program read_ssh c c Peter M. Woiceshyn Feb 6, 1998 c c Sample program provides FORTRAN statements used to read in TOPEX/POSEIDON c sea surface height data in centimeters. c c The 1996 TOPEX/POSEIDON data are on a 540 X 540 element grid with the c origin at c c -89.8333 deg (S) latitude and 0.3333 degrees (E) longitude. c c lat grid interval, dlat = 1/3 c lon grid interval, dlon = 2/3 c c c GRID LIMITS c c lat limits: -89.8333 (S) to 89.8333 (N) c lon limits: 0.3333 (E) to 359.6667 (E) c c c DATA LIMITS c c lat limits: -65.8333 (S) to 65.8333 (N) c lon limits: 0.3333 (E) to 359.6667 (E) c c There are 12 monthly data files for 1996. c C----------------------------------------------------------------------C c c Declarations: REAL ssh(540,540) ! Topex data is in cm. c The values greater than or equal to 32767 c indicates no data c C----------------------------------------------------------------------C REAL del1, del2 REAL lon(540), lat(540) C INTEGER*2 lon2, lat2 c CHARACTER*3 c_mon(12) CHARACTER*2 yc CHARACTER*20 f_in CHARACTER*5 f_label CHARACTER*4 suff C----------------------------------------------------------------------C DATA c_mon/'Jan','Feb','Mar','Apr','May','Jun', & 'Jul','Aug','Sep','Oct','Nov','Dec'/ C----------------------------------------------------------------------C yc = '96' suff = '.dat' f_label = c_mon(1)//yc ! Jan96 f_in = 'TpxSSH'//f_label//suff C----------------------------------------------------------------------C lon2 = 540 lat2 = 540 del1 = 1.0/3.0 del2 = 2.0/3.0 PRINT *,' ' PRINT *,' longitude array dimension = ',lon2 PRINT *,' latitude array dimension = ',lat2 PRINT *,' delta latitude deg = ',del1 PRINT *,' delta longitude deg = ',del2 PRINT *,' ' C Construct lat & lon arrays DO jj = 0, lat2 - 1 lat(jj+1) = jj*del1 - 90.0 + del1/2.0 ENDdo DO ii = 0, lon2 - 1 lon(ii+1) = ii*del2 + del2/2.0 ENDdo c c c Lat range: -89.8333(S) to 89.8333(N) degrees c c Lon range: 0.3333(E) to 359.6667(E) degrees c c PRINT *,' ' PRINT *,' Reading file: ',f_in PRINT *,' ' OPEN(22,file=f_in,form='unformatted') read(22) ssh CLOSE(22) DO j = 270, 271 DO i = 1, 5 WRITE (6,'(A7,I5,2x,A7,I5,2x,A7,F8.2,2X,A7,F8.2,2X,A7,F10.2)') & ' i = ', i,' j = ', j, & ' lat = ', lat(j),' lon = ', lon(i), & ' ssh = ',ssh(i,j) ENDDO WRITE (6,'(A2)') ' ' ENDDO WRITE (6,'(A2)') ' ' C----------------------------------------------------------------------C STOP END C----------------------------------------------------------------------C C C Output from executing this program: C C host{wd21pw}432> read_ssh.x c c longitude array dimension = 540 c latitude array dimension = 540 c delta latitude deg = 0.333333 c delta longitude deg = 0.666667 c c c Reading file: TpxSSHJan96.dat c c i = 1 j = 270 lat = -0.17 lon = 0.33 ssh = -0.05 c i = 2 j = 270 lat = -0.17 lon = 1.00 ssh = -1.50 c i = 3 j = 270 lat = -0.17 lon = 1.67 ssh = 32767.00 c i = 4 j = 270 lat = -0.17 lon = 2.33 ssh = 3.35 c i = 5 j = 270 lat = -0.17 lon = 3.00 ssh = 32767.00 c c i = 1 j = 271 lat = 0.17 lon = 0.33 ssh = 32767.00 c i = 2 j = 271 lat = 0.17 lon = 1.00 ssh = -0.98 c i = 3 j = 271 lat = 0.17 lon = 1.67 ssh = 32767.00 c i = 4 j = 271 lat = 0.17 lon = 2.33 ssh = 2.45 c i = 5 j = 271 lat = 0.17 lon = 3.00 ssh = 32767.00 c c C host{wd21pw}433> C C----------------------------------------------------------------------C