program read_TMIsst c c Peter M. Woiceshyn Aug 26, 2002 c 818-354-1450 c Peter.M.Woiceshyn@jpl.nasa.gov c c Sample program provides read statements to read in TMI sea c surface temperature (degrees Centigrade) data. c c The TMI sst data are on a 1440 X 320 element grid with the origin at c -39.875 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 -39.875 (S) to 39.875 (N) in latitude & from 0.125 to 359.875 C in East longitude). c c Two arrays exist in the file. The first array, 'sst', contains the c the temperature values. The second array, 'num', contains the c number of data values that were used to compute the mean c temperature value at a particular grid point. A 'num' value C equal to 0 (zero) indicates that there were NO temperature values C for that grid point (over the ocean -- and obviously not over land). C The 'num' array values greater than zero can therefore be used to C identify legitimate values of SST for each grid point. c c There are 12 months of data for year 2001. c c Declarations: REAL lon(1440), lat(320) C REAL del_deg, sst(1440,320), num(1440,320) C INTEGER*2 lon2, lat2 C CHARACTER*3 c_mon(12) CHARACTER*2 yc, mc(12) CHARACTER*15 f_in CHARACTER*5 f_label CHARACTER*4 suff, f_ycmc 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 = '01' suff = '.dat' f_label = c_mon(1)//yc ! Jan 2001 f_ycmc = yc//mc(1) f_in = 'SstNite'//f_ycmc//suff PRINT *,' ' PRINT *,' '//f_in//' '//f_label C----------------------------------------------------------------------C lon2 = 1440 lat2 = 320 del_deg = 0.25 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 - 40.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: -39.875(S) to 39.875(N) degrees c c Lon range: 0.125(E) to 359.875(E) degrees c c PRINT *,' ' PRINT *,' Reading file: ',f_in PRINT *,' ' OPEN(22,file=f_in,form='unformatted') print *, ' Read array sst' read(22) sst print *, ' Read array num' print *, ' ' read(22) num CLOSE(22) DO j = 160, 161 DO i = 1, 5 WRITE (6,'(2x,A4,I3,2x,A4,I4,2x,A6,F7.3,2X,A6,F7.3,2X, & A6,F8.2,2x,A6,F6.1)') & 'i = ', i,'j = ', j, & ' lat = ', lat(j),' lon = ', lon(i), & ' sst = ',sst(i,j), ' num = ',num(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{pw}432> read_TMIsst.x C C SstNite0001.dat Jan01 C C longitude array dimension = 1440 C latitude array dimension = 320 C delta lat/lon deg = 0.250000 C C C Reading file: SstNite0101.dat C C Read array sst C Read array num C C i = 1 j = 160 lat = -0.125 lon = 0.125 sst = 27.77 num = 16.0 C i = 2 j = 160 lat = -0.125 lon = 0.375 sst = 27.55 num = 17.0 C i = 3 j = 160 lat = -0.125 lon = 0.625 sst = 27.44 num = 16.0 C i = 4 j = 160 lat = -0.125 lon = 0.875 sst = 27.34 num = 16.0 C i = 5 j = 160 lat = -0.125 lon = 1.125 sst = 27.44 num = 16.0 C C i = 1 j = 161 lat = 0.125 lon = 0.125 sst = 27.87 num = 17.0 C i = 2 j = 161 lat = 0.125 lon = 0.375 sst = 28.04 num = 17.0 C i = 3 j = 161 lat = 0.125 lon = 0.625 sst = 27.66 num = 15.0 C i = 4 j = 161 lat = 0.125 lon = 0.875 sst = 27.69 num = 16.0 C i = 5 j = 161 lat = 0.125 lon = 1.125 sst = 27.80 num = 15.0 C C C host{99pw}433> C C----------------------------------------------------------------------C