      PROGRAM read_taqa_daily

c----------------------------------------------------------------
c PROGRAM:  read_taqa_daily.f
c
c PURPOSE:  Reads Ta and Qa daily grid data
c
c LANGUAGE: Fortran-77
c
C NOTES:
C           xdata is 3-d array that is (longitude x latitude x time)
c           lon = 1 is 0.5E and indices progress eastward in 1 degree increments.
c           lat = 1 is 59.5S and indices progress northward in 1 degree increments.
c
c           xdata units are Celcius for Ta and g/kg for Qa
c
c           xdata = -99. is missing value
c
c CREATION HISTORY:  Darren Jackson  CIRES/ESRL June 2007
c-----------------------------------------------------------------

      IMPLICIT NONE
      
      INTEGER nlon,nlat
      PARAMETER (nlon=360,nlat=120)

c Declarations

      INTEGER*2 idata(nlon,nlat)
      INTEGER   i,j,k
      REAL      xdata(nlon,nlat)

c Open and read 3 hourly grid data

      OPEN(5,FILE='ta_ammi_99001_daily.dat',ACCESS='DIRECT',
     &     RECL=nlon*nlat*2)
      READ(5,rec=1) idata
      CLOSE(5)

c Make conversion

      DO i=1,nlon
         DO j=1,nlat
            xdata(i,j) = idata(i,j)/100.
         ENDDO
      ENDDO

      END
