c reads idl output files c the C commented statments depend on type of file c ssh and speed use: parameter(icol=540,irow=1080) c sst use: C parameter(icol=512,irow=1024) c character ifile*40 integer*4 x(irow,icol) real examp(12) c c all arrays start at 0 longitude and 90 N latitude c the latitude and longitude of a given array element x(ir,ic), c given as the NW corner, for arrays(1:irow,1:icol), can be figured by: c 2 Aug 2002 e.armstrong c Scaling equations for extracted data array 'x' and no data values c SST = x / 100. (degC) c no data: -999900 real latitude,longitude c c print*,'latitudes:' c do ic=1,icol c latitude = 90.-((ic-1)*(180./float(icol))) c write(6,4) ic,latitude c 4 format('ic = ',i5,':',f7.2) c enddo c print*,'longitudes:' c do ir=1,irow c longitude = (ir-1)*(360./float(irow)) c write(6,5) ir,longitude c 5 format('ir = ',i5,':',f7.2) c enddo c c or to figure ir or ic from longitude or latitude: c c latitude range 90. to, but not including, -90. c ic = 1+((90.-latitude)*(float(icol)/180.)) c longitude range 0. to, but not including, 360. c ir = 1+(longitude*(float(irow)/360.)) c print*,'running rdira.x' nfil = 0 c set input file ifile = '/hal/jcn/Maps/Wrt/spd01.d' C ifile = '/hal/jcn/Maps/Wrt/ssh01.d' C ifile = '/hal/jcn/Maps/Wrt/sst01.d' nfil = nfil+1 print*,'file: ',ifile print*,' row(longitudes):',irow,' col(latitudes):',icol nbytes = icol*irow*4 open(21,file=ifile,status='old',form='unformatted', + access='direct',recl=nbytes) read(21,rec=1) x c print out same data as printed when files where written as check print*,' ' latp = (icol/4)*2.5 print*,'data(1:12,',latp,') of array(1:',irow,',1:',icol,'):' write(6,*) (x(i,latp),i=1,12) c print out latitude and longitudes of these points latitude = 90.-((latp-1)*(180./float(icol))) do i=1,12 examp(i) = (i-1)*(360./float(irow)) enddo write(6,1) latp,latitude 1 format('latitude for ic=',i4,' is ', + f5.1,', longitudes at ir=(1:12):') write(6,2) (examp(i),i=1,12) 2 format(12f6.2) print*,' ' c print out first and last latitude and longitude of array ir = 1 ic = 1 latitude = 90.-((ic-1)*(180./float(icol))) longitude = (ir-1)*(360./float(irow)) write(6,3) ir,ic,latitude,longitude latitude = 90.-((icol-1)*(180./float(icol))) longitude = (irow-1)*(360./float(irow)) write(6,3) irow,icol,latitude,longitude 3 format('latitude and longitude of array element x(ir=',i4, + ',ic=',i3,') =',f7.2,' and',f7.2) close(21) print*,' file processed, END' stop end