program read_ssh c c Peter M. Woiceshyn Auguust 26, 2002 c 818-354-1450 c Peter.M.Woiceshyn@jpl.nasa.gov c c Sample program provides FORTRAN statements used to read in TOPEX/POSEIDON c sea surface height data in centimeters. c c The 2001 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 year 2001. 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*2 c_mo(12) CHARACTER*2 yc CHARACTER*20 f_in CHARACTER*4 f_label CHARACTER*4 suff C----------------------------------------------------------------------C DATA c_mo/'01','02','03','04','05','06', & '07','08','09','10','11','12'/ C----------------------------------------------------------------------C yc = '01' suff = '.dat' f_label = yc//c_mo(1) ! 0001 Jan 2001 f_in = 'ssh'//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: ssh0101.dat c c i = 1 j = 270 lat = -0.17 lon = 0.33 ssh = 6.10 c i = 2 j = 270 lat = -0.17 lon = 1.00 ssh = 5.76 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 = 1.38 c i = 5 j = 270 lat = -0.17 lon = 3.00 ssh = 32767.00 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 = 5.29 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 = 1.26 c i = 5 j = 271 lat = 0.17 lon = 3.00 ssh = 32767.00 c c C host{wd21pw}433> C C----------------------------------------------------------------------C