program read_header parameter(max=40000) character nin*100 real*4 x(max) nin='/home/sgao/demo/04_sac/st04.sac' call rsac1(nin, x, npts, beg, dt, max, nerr) call getfhv('EVLA', evlat, nerr) call getfhv('EVLO', evlon, nerr) call getfhv('EVDP', evdep, nerr) call getfhv('GCARC', gcarc, nerr) call getfhv('BAZ', baz, nerr) call getfhv('STLA', stlat, nerr) * In the subroutine above, nin, x, and max are input, and * the rest are output. write(6,61) dt 61 format('The sampling interval is ', f6.3, ' seconds') print*,'The number of points in the file is ', npts print*,'The 10th data point is ', x(10) print*,'The event latitude is ', evlat print*,'The event longitude is ', evlon print*,'The event depth is ', evdep print*,'The epicentral distance in degree is ',gcarc print*,'The back-azimuth is ', baz print*,'The station latitude is ', stlat ** Get the time of the first point in the file call getnhv('NZYEAR', nzyear, nerr) call getnhv('NZJDAY', nzjday, nerr) call getnhv('NZHOUR', nzhour, nerr) call getnhv('NZMIN', nzmin, nerr) call getnhv('NZSEC', nzsec, nerr) call getnhv('NZMSEC', nzmsec, nerr) print*,'The time of the first point in the SAC file is ' print*,nzyear,':', nzjday,':',nzhour, & ':',nzmin,':',nzsec,':',nzmsec stop end *********************************************** ** To compile the program, copy and paste the *following 3 lines into a file called Makefile and type make *read_header.exe:read_header.f * gfortran -g -m64 read_header.f -o read_header.exe \ */home/sgao/lib/sacio.a