program read_SWHtpx c c Peter M. Woiceshyn June 30, 2000 c 818-354-1450 c wd21pw@pacific.jpl.nasa.gov c c Sample program provides read statements to read in the c TOPEX/POSEIDON Significant Wave Height data (SWH) in meters. c c The SWH data are on a 360 X 180 element grid with the origin at c -89.5 South latitude and 0.125 degrees East longitude (i.e., C a 0.25 by 0.25 degree lat/lon grid resolution ranging from C -89.5 (S) to 89.5 (N) in latitude & from 0.5 to 359.5 C in East longitude). c c One array exist in the file. The array, 'swh', contains the c the TOPEX/POSEIDON Significant Wave Height values. c c A 'swh' value equal to 32767.0 indicates that there were NO swh values c for that grid point (over the ocean -- and obviously not over land). c c There are 12 months of data for 1998. c c Declarations: REAL lon(360), lat(180) C REAL del_deg, swh(360,180) C INTEGER*2 lon2, lat2 C CHARACTER*3 c_mon(12) CHARACTER*2 yc, mc(12) CHARACTER*18 f_in CHARACTER*5 f_label CHARACTER*4 f_ycmc CHARACTER*7 suff C----------------------------------------------------------------------C DATA c_mon/'Jan','Feb','Mar','Apr','May','Jun', & 'Jul','Aug','Sep','Oct','Nov','Dec'/ DATA mc/'01','02','03','04','05','06', & '07','08','09','10','11','12'/ C----------------------------------------------------------------------C yc = '98' suff = 'TPX.dat' f_label = c_mon(1)//yc ! Jan98 f_ycmc = yc//mc(1) f_in = 'SWHakh'//f_label//suff PRINT *,' ' PRINT *,' '//f_in C----------------------------------------------------------------------C lon2 = 360 lat2 = 180 del_deg = 1.0 PRINT *,' ' PRINT *,' longitude array dimension = ',lon2 PRINT *,' latitude array dimension = ',lat2 PRINT *,' delta lat/lon deg = ',del_deg PRINT *,' ' C Construct lat & lon arrays DO jj = 0, lat2 - 1 lat(jj+1) = jj*del_deg - 90.0 + del_deg/2.0 ENDdo DO ii = 0, lon2 - 1 lon(ii+1) = ii*del_deg + del_deg/2.0 ENDdo c c c Lat range: -89.5(S) to 89.5(N) degrees c c Lon range: 0.5(E) to 359.5(E) degrees c c PRINT *,' ' PRINT *,' Reading file: ',f_in PRINT *,' ' OPEN(22,file=f_in,form='unformatted') print *, ' Read array swh' PRINT *,' ' read(22) swh CLOSE(22) DO j = 90, 91 DO i = 1, 5 WRITE (6,'(2x,A4,I3,2x,A4,I4,2x,A6,F7.3,2X,A6,F7.3,2X, & A6,F10.2)') & 'i = ', i,'j = ', j, & ' lat = ', lat(j),' lon = ', lon(i), & ' swh = ',swh(i,j) ENDDO WRITE (6,'(A2)') ' ' ENDDO WRITE (6,'(A2)') ' ' C----------------------------------------------------------------------C STOP END C----------------------------------------------------------------------C C C Output from executing this FORTRAN 77 program: C C host{wd21pw}432> read_SWHtpx.x C C SWHakhJan98TPX.dat C C longitude array dimension = 360 C latitude array dimension = 180 C delta lat/lon deg = 1.00000 C C C Reading file: SWHakhJan98TPX.dat C C Read array swh C C i = 1 j = 90 lat = -0.500 lon = 0.500 swh = 1.37 C i = 2 j = 90 lat = -0.500 lon = 1.500 swh = 32767.00 C i = 3 j = 90 lat = -0.500 lon = 2.500 swh = 1.34 C i = 4 j = 90 lat = -0.500 lon = 3.500 swh = 1.17 C i = 5 j = 90 lat = -0.500 lon = 4.500 swh = 1.45 C C i = 1 j = 91 lat = 0.500 lon = 0.500 swh = 1.29 C i = 2 j = 91 lat = 0.500 lon = 1.500 swh = 1.31 C i = 3 j = 91 lat = 0.500 lon = 2.500 swh = 1.26 C i = 4 j = 91 lat = 0.500 lon = 3.500 swh = 1.09 C i = 5 j = 91 lat = 0.500 lon = 4.500 swh = 1.28 C C C host{wd21pw}433> C C----------------------------------------------------------------------C