program read_sst 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 the Pathfinder c sea surface temperature (degrees Centigrade) data for 2001. c c The SST data are on a 1440 X 720 element grid with the origin at c -89.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 -89.875 (S) to 89.875 (N) in latitude & from 0.125to 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 a value C of 0 or 1 for each SST value. A 'num' value equal to 0 (zero) C indicates that there were NO temperature values for that grid c point (over the ocean -- and obviously not over land). The 'num' c array values of 1.0 can therefore be used to identify legitimate c values of SST for each grid point. c c There are 12 months of data for the year 2001. c c Declarations: REAL lon(1440), lat(720) C REAL del_deg, sst(1440,720), num(1440,720) C INTEGER*2 lon2, lat2 C CHARACTER*1 c_sub CHARACTER*2 mon(12) CHARACTER*3 c_mon(12) CHARACTER*4 yc, suff CHARACTER*5 f_label CHARACTER*7 f_lab CHARACTER*35 f_in C----------------------------------------------------------------------C DATA c_mon/'Jan','Feb','Mar','Apr','May','Jun', & 'Jul','Aug','Sep','Oct','Nov','Dec'/ DATA mon/'01','02','03','04','05','06', & '07','08','09','10','11','12'/ C----------------------------------------------------------------------C yc = '2001' suff = '.dat' C_sub = '_' f_label = c_mon(1)//yc ! Jan01 f_lab = yc//c_sub//mon(1) f_in = 'sstPathfinder'//f_lab//suff C----------------------------------------------------------------------C lon2 = 1440 lat2 = 720 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 - 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.875(S) to 89.875(N) degrees c c Lon range: 0.125(E) to 359.875(E) degrees c c 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 = 360, 361 DO i = 1, 5 WRITE (6,'(2x,A4,I1,2x,A3,I4,2x,A6,F6.2,2X,A6,F5.2,2X, & A6,F6.2,2x,A6,F4.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 program: C C host{pw}2> read_sst.x C C longitude array dimension = 1440 C latitude array dimension = 720 C delta lat/lon deg = 0.25 C C Reading file: sstPathfinder2001_01.dat C C Read array sst C Read array num C C i = 1 j = 360 lat = -0.12 lon = 0.12 sst = 26.25 num = 1.0 C i = 2 j = 360 lat = -0.12 lon = 0.38 sst = 25.88 num = 1.0 C i = 3 j = 360 lat = -0.12 lon = 0.62 sst = 25.95 num = 1.0 C i = 4 j = 360 lat = -0.12 lon = 0.88 sst = 26.04 num = 1.0 C i = 5 j = 360 lat = -0.12 lon = 1.12 sst = 26.10 num = 1.0 C C i = 1 j = 361 lat = 0.12 lon = 0.12 sst = 26.27 num = 1.0 C i = 2 j = 361 lat = 0.12 lon = 0.38 sst = 26.33 num = 1.0 C i = 3 j = 361 lat = 0.12 lon = 0.62 sst = 26.22 num = 1.0 C i = 4 j = 361 lat = 0.12 lon = 0.88 sst = 26.15 num = 1.0 C i = 5 j = 361 lat = 0.12 lon = 1.12 sst = 26.25 num = 1.0 C C C host{wd21pw}433> C C----------------------------------------------------------------------C