program example_ampr_read_program c c Example program to read AMPR data from a text file into arrays. Data file c must exist in same directory as the program executable. Just a reader c program that prints out the time and GPS altitude to the screen. c c Date and Time are in UTC. Longitudes are negative-west convention. c TB's and noise are in Kelvin. All other applicable units are metric. c c TB arrays are 4-channel X 50 sample in the order: 10.7, 19.35, 37.1, 85.5 GHz. c Full V-pol on LHS on scan, full H-pol on RHS of scan. c c nrec: record number, 1 to N c nday, nhr, nmt, nsc: day and time in UTC c nqc: zero if okay c glat, glon, galt: GPS nadir latitude, longitude, and altitude(m) c pitch: aircraft pitch (+ up) c roll: aircraft roll (+ right) c yaw: aircraft yaw (track angle) c head: aircraft true heading 0,360 north c aspd, gspd: air and ground speed in m/s c noise: RMS noise in K; 10, 19, 37, and 85 c tb: brightness temps in K c elat, elon: MSL pixel latitude and longitude c elev: surface elevation at above c flnd: fraction of land in 2.5 km radius (approximate) c c Linux compile (optional) c g77 -c -I. $1.f c g77 $1.o -o $1 c rm -f $1.o c c F. LaFontaine Sep 2002 Release 1.0, Fortran-77, tested on Dell/LINUX. c Please report bugs or errors. c c F. LaFontaine Dec 2006 Release 2.0, slightly modify for a new c all experiment format. c c F. LaFontaine May 2007 Release 3.0, 1 error fixed, added example c compile option (reported by S. Giraund, FSU). c c character cin_file*256 logical done integer i, j, k, NR c AMPR data parameter (NS=15000) integer*2 nrec(NS), nday(NS), nhr(NS), nmt(NS), nsc(NS) integer*2 nqc(NS), ngps(NS), elev(50,NS) real*8 galt(NS), glat(NS), glon(NS), head(NS), pitch(NS), > roll(NS), yaw(NS), aspd(NS), gspd(NS), track(NS) real*8 elat(50,NS), elon(50,NS), flnd(50,NS) real*8 noise(4,NS), tbs(4,50,NS) if (iargc() .eq. 1) then call getarg (1, cin_file) else print* print*,' Usage: example_ampr_read_program input_file ' stop endif open (11, file=cin_file, form='formatted') i = 1 done = .false. do while (.not. done) read (11, 1101, end=101) > nrec(i), nday(i), nhr(i), nmt(i), nsc(i), nqc(i), > glat(i), glon(i), galt(i), pitch(i), roll(i), yaw(i), > head(i), aspd(i), gspd(i), (noise(j,i), j=1,4), > ((tbs(k,j,i), j=1,50), k=1,4), > (elat(j,i), j=1,50), (elon(j,i), j=1,50), > (elev(j,i), j=1,50), (flnd(j,i), j=1,50) 1101 format ( 6(1x,i6), 2(1x,f12.5), 7(1x,f11.4), 4(1x,f11.4), > 200(1x,f9.2), 100(1x,f12.5), 50(1x,i6), 50(1x,f12.5) ) c print time of scan and aircraft altitude. write (6, 6000) nhr(i), nmt(i), nsc(i), galt(i) 6000 format (' Time: ',i2,':',i2,':',i2,' Altitude: ',f9.2) i = i + 1 enddo 101 close (11) print* print*,' --- All data read --- ' stop end c[EOP]