hypoTD Ver.2 User Manual and Program Distribution
1. Introduction
HypoTD_ver2 is a hypocenter location software that registers arrival times with initial hypocenters for past earthquakes and conducts relative hypocenter locations. This second version has been updated to improve usability and make it more accessible to users. By executing the main program (auto_td/ateq_td) in version 2, the template earthquakes are registered and relative hypocenter locations with dozens of template earthquakes are carried out through a specified number of iterations. The estimation errors for latitude, longitude, and depth of the hypocenters are calculated using the method described in Horiuchi et al. (2025). Users can select the following three types of travel time computation:

(1) Two-layer inclined structure (2) Multi-layer structure (3) Japan Meteorological Agency travel-time table The required input files for using this software are:
(1) Arrival time data with initial hypocenter locations. (2) Velocity structure (3) Coordinates of observation stations (4) File specifying the names of files to be used (etc/wave_dir) (5) Decision parameter table for identifying earthquakes and noise (/etc/hypo_remove.dat). The output are the lists of hypocenters computed by hypoTD.
2. Directory Structure
(1) JMA_measure, win_measure, hypoDD_measure
    Software tools that convert arrival time data from the following formats into the format used by hypoTD.
1) Format of Japan Meteorological Agency observation data 2) Win format 3) hypoDD format
(2) auto_td: FORTRAN source code for hypoTD. (3) arriv: Arrival time data in hypoTD format. 1) arv_year.dat: Binary-format arrival time data by year 2) hypo_year.dat: Yearly hypocenter lists in formatted, direct-access style 3) event.dat: Comprehensive hypocenter list for all earthquakes in formatted, direct-access style. The formats of a) arriv/hypo_year.dat, b) arriv/event.dat, and c) arriv_dd/hypotd_dir_itr.dat are the same. The second-to-last digit of each number represents earthquake ID, which is used to link data across files. (4) etc: Files for 1)velocity structure, 2)station data, 3)a file specifying input filenames (wave_dir.dat), and 4) a decision parameter table to distinguish between earthquake signals and noise (../etc/hypo_remove.dat). (5) arriv_dd: Output files containing lists of hypocenters located by hypoTD.
3. Arrival time conversion Software
Arrival time data with following three kinds of format are converted into the hypoTD format. They are stored in the arriv directory. 

1) arriv/arv_year.dat: Binary-format arrival time data for each year. 
2) arriv/hypo_year.dat: Formatted, direct-access hypocenter list for each year.             
3) arriv/event.dat: Formatted, direct-access hypocenter list for all earthquakes.
Note: The file of event.dat will be replaced with the computed hypocenter list when ateq_td is executed. 
(1) JMA Unified Hypocenter Arrival Time Data
1) Compilation  
cd JMA_measure  
make  

2) Input Data  
Enter the filenames of the observation data into print.dat. If there are multiple files, list them all.  
Example of print.dat:  
measure_20240102_1.txt  

3) Execution  
./read_jma_arriv
(2) Win format
1) Compilation  
cd win_measure  
make  

2) Input data  
Enter the directory names containing the pick files into print.dat. If there are multiple directories, list them all.  
Example of print.dat:  
picks/1611  

3) Execution  
./read_win
(3) hypoDD format
1) Compilation  
cd hypoDD_measure  
make  

2) Input data  
Enter the filenames to be read into print.dat. If there are multiple files, list them all.  
Example of print.dat:  
test1.pha  

3) Execution  
./read_lv
4. Other input Data
In addition to arrival times, the required input data are:  
1) Station coordinates  
2) Velocity structure  
3) Data selection file  
4) Table for distinguishing earthquakes from noise
(1) Station data
Below are examples of station data:  

Example 1:  
etc/jma_stn.dat  
Code, number, latitude, longitude, elevation (km)  
EHTO 1 36.5354 140.5136 0.041  
ETKM 2 36.4386 140.5687 0.009  
EMTH 3 36.3396 140.5182 0.025  
EIBR 4 36.2575 140.4601 0.027  
ENGK 5 36.1456 140.4295 0.020  

Example 2:  
etc/stn_dd.dat  
Station latitude longitude  
NCAAR 39.275936 -121.026962  
NCAAS 38.430138 -121.109589  
NCABJ 39.165771 -121.192993  
NCABR 39.138126 -121.488167  

- The station number is optional.  
- If elevation is not specified, it defaults to 0.0 km.  
- If the station coordinate filename is incorrect, the program will output the station code and terminate the calculation.
(2) Velocity structure model
Put velocity model into etc/vel_model.dat.  
The following is a sample data.  

#;Comment line  
# Component Name  
UD NS EW AZ AX AYMZ MX MY SZ SX SY TZ TX TY   !Do not remove this line.  

# Select type of velocity model.  1;two layer,2; JMA table3:N Layer N<50  
1  

# 5.40 -59.0 7.75 -2.3 3.15 -59.0 4.35 -2.3  31.0  !Tohoku Univ.
# 5.50 -53.49 7.80 -2.13 3.25 -44.68  4.41 -1.57  32.0  !Ukawa
6.00 -30.0 8.0 -2.3 3.53 -30.0 4.50 -2.3  40.0

# Number of layers  
# depth Vp Vs(km)
6  
-2.00 4.800 2.844  
0.50 4.950 2.931  
1.00 6.000 3.521  
24.00 6.648 3.858  
40.01 8.10 4.50  
700.00 12.0 6.66  

Velocity Structure File (excluding comment lines)  
- Line 1: Unused but do not delete.  
- Line 2: Velocity model selection. Enter one of the following:  
    - 1: Two-layer spherical shell model with velocity gradient  
    - 2: JMA travel-time table  
    - 3: N-layer model with constant velocity in each layer  
- Line 3: Velocity model parameters used when Line 2 is set to 1.  
    Example: 6.00 -30.0 8.0 -2.3 3.53 -30.0 4.50 -2.3 40.0  
    This defines the velocity model as follows:  
    Layer 1 (0~40km)  
    Vp=6.0*{(R-dep)/R}-30.0  
    Vs=3.53*{(R-dep)/R}-30.0  
    Layer 2 (depth = 40 km~)  
    Vp=8.0*{(Rm-dep)/Rm}-2.3  
    Vs=4.5*{(Rm-dep)/Rm}-2.3  
    Where:  
    R = 6371.05 km (Earthfs radius)  
    Rm = 6371.05 - 40.0 km  
    Dep: Depth in km.  
- Line 4: Number of layers for the N-layer model (It is used when Line 2 is set to 3)  
- Line 5 and onward: Specify depth, P-wave velocity, and S-wave velocity for each layer.  
Note: In the N-layer model, a parallel-layer structure is assumed, and Earthfs curvature is not considered.
(3) Data Selection File
The following is an example of etc/wave_dir.dat  

#; Comment line  

# Input files of ateq_td.  
# Number of iterations  
3                                 !1 Number of iterations  
# station code file  
../etc/stn_dd.dat                 !2 Station for hypoDD sample data  
#../etc/stn_win.dat               !2 station for win format sample data  
#../etc/jma_stn.dat               !2 station for JMA format sample data  
# File name of Event list for re-location  
../arriv/event.dat                !3 Relocation list including template EQ  
# Latitude longitude and depth aranges of the relocation area.  
# 36.5  38.5 136.0  138.5   -2.0  100.0   !4  Relocation area  
# lat1,lat2,lon1,lon2,dep1,dep2  
  -90.0  90.0 -180.0  180.0   -2.0  700.0    !All Japan  
# Magnitude range for the selection of Template EQ  
1.0  6.0                            !5 Magnitude range for template EQ selection     
# Minimum numbers of P and S arrival times for the selection of Template EQ  
0  0                       !6  Minimum P and S readings for template EQ selection    
# Shallowest depth for templete EQ selection  
1.1 !7 Shallowest depth(km) for templete EQ selection.


Line numbers refer to non-comment lines.  
- Line 1: Number of iterations.  
- Line 2: File name of the station coordinate data.  
- Line 3: Filename of the hypocenter list for all earthquakes. (arriv/event.dat)  
- Line 4: Latitude, longitude, and depth range for selecting earthquakes to be relocated.  
- Line 5: Magnitude range for registering template earthquakes.  
- Line 6: Minimum number of P-wave and S-wave picks required to register an earthquake as a template.  
    If values of 20 and 10 are set, only earthquakes with P and S wave arrival times more than 20 and 10 and with specified magnitude range will be registered as template earthquakes.  
- Line 7: Upper limit (Shallowest limit) of depth (in km) for the selection of template earthquakes. If the value is 0.1, earthquakes determined to be at the surface will not be selected as templates.
(4) Decision parameter table for identifying earthquakes and noise
../etc/hypo_remove.dat  

Example: 
0.1         !1 err_min      Minimum sd_cross  
2.0         !2 rat_stn_sd2  remove error picks sd2=2.0*sd  
0.4         !3 sd_remove remove hypo when large sd (sec)  
10.0        !4 dl_remove remove hypo when large location error (km)  
0.2         !5 rat_err_eq remove hypo if 80% of large sd eq.  
70.0        !6 del_lim_sd_change km  
5.0         !7magnitude to remove S arrival  
See Table 2 of Horiuchi et al.(2025) for the detailed explanation. They used the same table for the location in areas of all Japanese Islands with length more than 3000km long.  

- Line 1: Minimum travel-time residual (RMS) for relative hypocenter determination.  
    When RMS is 0.05 and set 0.1 sec, then 0.1 sec is used to compute 2 ƒŠ in !2.  
- Line 2: Threshold value for discarding pick data. 2.0 -> 2 ƒŠ  
- Line 3: If the RMS of travel-time residuals for 50 earthquakes exceeds this value, the event is considered to be false detection.  
- Line 4: If the spatial scatter of hypocenter locations from 50 relative determinations exceeds this value, the event is considered to be false detection.  
- Line 5: If the proportion of successfully determined hypocenters among 50 relative determinations is below this value, the event is considered to be false detection.  
- Line 6: Threshold for normalizing Line 3 and 5 by average epicentral distance (e.g., 70 km).  
- Line 7: If the magnitude of an earthquake exceeds this value, S-wave arrival times will not be used.
5. The method of hypocenter location by hypoTD
(1) Compilation  
cd auto_td  
make  

(2) Set all input data  

(3) Execution  
cd auto_td  
./ateq_td  

(4) Testing by shipped data  
rm arriv/* rm arriv_dd/* 
cd hypodd_measure  
./lead_lv  
cd ../auto_td  
./ateq_td
6. Output of hypoTD
The following hypocenter lists are created in arriv_dd directory.  

(1) File name: arriv_dd/hypotd_asc_ita.dat  
    ita: Number of iteration  
    File Format: ASCII Format  
    Example of hypotd_asc_001.dat  

   write(38,1302) iyear,im,id,ih,imin,t,  
     1 phi,dphi,ram,dram,dep,ddep,fmag,nobsp,nobss,sd_all_cross  
1302  format(i4,4i2,f7.2,f8.4,f7.4,f10.4,f7.4,2f7.2,f5.2,2i4,f6.2)  

Date    orgin  Lat     err  Long     err   Depth  err Mag  Np Ns  RMS  
1984 1 31931   5.80 36.8646 0.0104 -121.4131 0.0155   3.91   1.52 2.52  93   0  0.16  
1984 1 32058  34.57 36.8755 0.0007 -121.6182 0.0015   3.37   0.29 2.39  62   0  0.14  
1984 1 51756  17.10 36.7045 0.0008 -121.3740 0.0008   1.25   0.23 1.44  19   0  0.13  

Events for which the hypocenter could not be determined retain their initial hypocenter information, and sd_all_cross is set to 9.9.
(2) File name: arriv_dd/hypotd_dir_ita.dat  
    ita: Number of iteration  
    File Format: Formatted Direct Access, Record Length 120 bytes  

    Example: hypotd_dir_001.dat  

      322                                                                     
                                       
 84 1 31931  0.00    5.80  0.00 36.8646 0.0104-121.4131 0.0155   3.91  
1.52 2.52  93   0  93           3  0.16        
 84 1 32058  0.00   34.57  0.00 36.8755 0.0007-121.6182 0.0015   3.37  
0.29 2.39  62   0  62           4  0.14        
 84 1 51756  0.00   17.10  0.00 36.7045 0.0008-121.3740 0.0008   1.25  
0.23 1.44  19   0  20           5  0.13          

Line 1: Number of earthquakes  
From Line 2 onward:  
Each line contains the following fields:  
- (Year-1900, or Year-2000), Month, Day, Hour, Minute, Second  
- Origin time uncertainty  
- Latitude, uncertainty  
- Longitude, uncertainty  
- Depth, Depth uncertainty  
- Magnitude  
- Number of P-wave picks  
- Number of S-wave picks  
- Number of stations  
- Event ID  
- Standard deviation of travel-time residuals from relative hypocenter determination.  
character*1 cret, c_temp,c_hypo_flag  
      open(7,file=file_hypo,access='direct',form='formatted',  
     1 recl=120,status='unknown')  
       read(7,1303,rec=irece) cret,iy,im,id,ih,imin,sec,t,dt,  
     1 phi,dphi,ram,dram,dep,ddep,fmag,nobsp,nobss,nobsall,  
     1 c_temp,c_hypo_flag,irec_arv,sd_all_cross  
1303  format(a1,1x,5i2,f6.2,f8.2,f6.2,f8.4,f7.4,f9.4,f7.4,  
     1 2f7.2,f5.2,3i4,1x,2a1,i9,f6.2)  
Cret; return  
iy,im,id,ih,imin,sec; date  
t,dt; Origin time and its error  
phi,dphi,ram,dram,dep,ddep; Latitude, Longitude, depth and their standard error.  
Fmag; Magnitude  
nobsp,nobss,nobsall; Number of P, S readings and number of stations.  
c_temp,c_hypo_flag; JMA flag  
irec_arv; Earthquake number  
sd_all_cross; travel time residuals  

Events for which the hypocenter could not be determined contain the JMA (Japan Meteorological Agency) hypocenter information, and sd_all_cross is set to 9.9.
7. How to Modify the JMA Travel-Time Table
1) To modify the travel-time table, set the velocity structure model type to 2 in etc/vel_model.dat  

2) Edit the file ../etc/jma_trav_del_dep.dat  

3) If the number of grid points in the depth and distance directions exceeds 236 and 106 respectively, increase the arguments in common /c_trav_jma/  

Below is the source code of travel-time table reading included at the end of sub_trv.f.  

      subroutine read_jma_trv  
      common /c_trav_jma/idelg(236),idepg(106),travp(106,236),  
     1 travs(106,236)   
       open(7,file='../etc/jma_trav_del_dep.dat')  
      ndel=236  
      ndep=106  
      do kdep=1,ndep  
      do kdel=1,ndel  
         read(7,100) travp(kdep,kdel),travs(kdep,kdel),  
     1 idepg(kdep),idelg(kdel)  
 100    format(1x,f9.3,2x,f9.3,i4,i7)  
c       if(kdel.eq.1) write(*,100) travp(kdep,kdel),travs(kdep,kdel),  
c    1 idepg(kdep),kdep  
         enddo  
         enddo  
         close(7)  
c        write(*,'(10i5)') (idelg(j),j=1,ndel)  
c        write(*,'(10i7)') (idepg(j),j=1,ndep)  
         return  
         end
8. The method to change ateq_td.f so as to conduct real-time operation
1) Change etc/wave_dir.dat  

2) Comment out the following system call in ateq_td.f.  
text='cp ../arriv_dd/hypotd_dir.dat '//event_list  
ccc   call system(text)   !cp calculated hypo for the next iteration  

3) ateq_td.f 179 line subroutine read_new_event_test(iflag)  
Change this subroutine so as to read arrival time data at a time of a new earthquake occurrence.  

9. Download
Click the link below to download hypoTD Ver.2.

		Download hypoTD Ver.2 Source Files (1.08 MB)

If you have questions or have difficulty to change the software, we welcome your contact, e-mail info@homeseismo.com