!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PROGRAM READ_FDA
! Use to read Fortran direct access (.Fda) files in
! ftp://ftp.cgd.ucar.edu/pub/CAS/NEWBUDGETS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! NOTE: Be sure to modify the character string `FdaFile' and the
! integer variable `nrec' to reflect the actual file you are reading.
IMPLICIT NONE
INTEGER, PARAMETER :: nlon = 128
INTEGER, PARAMETER :: nlat = 64
INTEGER, PARAMETER :: nbyt = 4
CHARACTER(LEN=200) :: FdaFile
INTEGER :: nrec
INTEGER :: rec
REAL, DIMENSION(nlon,nlat) :: mmGrid
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Modify the following:
FdaFile = "T42t_TEDIV_1979-2001_MM.Fda"
nrec = 276
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OPEN(UNIT=10,FILE=TRIM(FdaFile),ACCESS="DIRECT",RECL=nlon*nlat*nbyt)
DO rec = 1, nrec
READ(10,REC=rec) mmGrid(:,:)
! Perhaps further processing here, etc. Or make `nrec' an integer
! parameter, dimension `mmGrid' as (nlon,nlat,nrec), and use
! READ(10,REC=rec) mmGrid(:,:,rec)
END DO
CLOSE(10)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
END PROGRAM READ_FDA
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Back to `Accessing the Data'.