program read_sst c c Peter M. Woiceshyn Oct 9, 1998 c c Sample program provides read statements to read in MCSST sea c surface temperature (degrees Centigrade) data. c c The MCSST data are on a 1024 X 512 element grid with the origin at c -89.8242 South latitude and 0.17578 degrees East longitude (i.e., C a 0.351562 by 0.351562 degree lat/lon grid resolution ranging from C -89.8242 (S) to 89.8240 (N) in latitude & from 0.17578 to 359.824 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 1997. c c Note that the data for each month does not entirely correspond c to a calender month. The days over which the data was collected c are indicated in the atlas. c c Declarations: REAL lon(1024), lat(512) C REAL del_deg, sst(1024,512) C INTEGER*2 lon2, lat2, num(1024,512) C CHARACTER*3 c_mon(12) CHARACTER*2 yc CHARACTER*12 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 = '97' suff = '.dat' f_label = c_mon(1)//yc ! Jan97 f_in = 'SST'//f_label//suff C----------------------------------------------------------------------C lon2 = 1024 lat2 = 512 del_deg = 0.351562 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.824(S) to 89.824(N) degrees c c Lon range: 0.17578(E) to 359.824(E) degrees c c PRINT *,' ' PRINT *,' Reading file: ',f_in PRINT *,' ' OPEN(22,file=f_in,form='unformatted') read(22) sst print *, ' Read array sst' read(22) num print *, ' Read array num' print *, ' ' CLOSE(22) DO j = 256, 257 DO i = 1, 5 WRITE (6,'(2x,A4,I3,2x,A4,I4,2x,A6,F7.2,2X,A6,F7.2,2X, & A6,F8.2,2x,A6,I3)') & '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 program: C C host{wd21pw}432> read_sst.x C C longitude array dimension = 1024 C latitude array dimension = 512 C delta lat/lon deg = 0.351562 C C C Reading file: SSTJan97.dat C C Read array sst C Read array num C C i = 1 j = 256 lat = -0.18 lon = 0.18 sst = 26.84 num = 5 C i = 2 j = 256 lat = -0.18 lon = 0.53 sst = 26.25 num = 3 C i = 3 j = 256 lat = -0.18 lon = 0.88 sst = 26.81 num = 4 C i = 4 j = 256 lat = -0.18 lon = 1.23 sst = 26.80 num = 6 C i = 5 j = 256 lat = -0.18 lon = 1.58 sst = 27.10 num = 4 C C i = 1 j = 257 lat = 0.18 lon = 0.18 sst = 26.90 num = 4 C i = 2 j = 257 lat = 0.18 lon = 0.53 sst = 27.02 num = 5 C i = 3 j = 257 lat = 0.18 lon = 0.88 sst = 26.94 num = 7 C i = 4 j = 257 lat = 0.18 lon = 1.23 sst = 26.85 num = 6 C i = 5 j = 257 lat = 0.18 lon = 1.58 sst = 27.00 num = 6 C C C host{wd21pw}433> C C----------------------------------------------------------------------C