C---+----1----+----2----+----3----+----4----+----5----+----6----+----7--
      SUBROUTINE TABLE3(AMP,PHI,TOZ)

C Subroutine: Reads in TABLE#3 monthly mean zonal waves 0-7 amplitude
C and phase data as shown in Reference Publication RP-1360 by
C Stanford et al. [1995].  Current months extend from Nov78 through
C Jan92.  Note that equatorial data are also included.  This subroutine 
C also "reconstructs" monthly mean latitude vs longitude fields from 
C zonal waves 0-3.
C Arrays (all are output arrays):
C     AMP(MON,LAT,K) = Harmonic amplitude (units DU) of zonal waves
C                      0(zonal mean), 1, 2, 3, and combined waves 4-7
C     PHI(MON,LAT,K) = Corresponding harmonic phase (units radians)
C                      for zonal waves 1, 2, and 3.
C     TOZ(LON,LAT,MON) = Reconstructed TOMS total column ozone derived
C                        from AMP and PHI for zonal waves 0-3
C Array elements:
C     LON=1,2,...,18 <==> 180,-160,-140,...,160 degrees longitude
C     LAT=1,2,...,19 <==> 85S,75S,..,15S,5S,EQU,5N,15N,25N,..,75N,85N
C                         degrees latitude (NOTE: equatorial data also
C                         included)
C     MON=1,2,...,159 <==> NOV78,DEC78,JAN79,FEB79,...,DEC91,JAN92
C     K=1,2,3,4,5 <==> Zonal wave 0(zonal mean), 1, 2, 3, and
C                      combined waves 4-7
C EXTRA NOTE(S):
C     Values of TOZ in polar night are missing data and are flagged with
C     the value ZERO

      PARAMETER(NMON=159,NLON=18,NLAT=19)
      PARAMETER(PI=3.141592653589793,RAD=0.0174533)
      REAL AMP(NMON,NLAT,5),PHI(NMON,NLAT,5),TOZ(NLON,NLAT,NMON)
      INTEGER NUMMON(15),A(NLAT)
      CHARACTER*98 STUFF
      CHARACTER*10 FNAME
      CHARACTER*2 CMONTH
      DATA NUMMON /2,12,12,12,12,12,12,12,12,12,12,12,12,12,1/
      DATA FNAME /'table3.n7t'/

      OPEN(12,FORM='FORMATTED',FILE=FNAME,STATUS='OLD')
      DO IWN=0,4
        IF (IWN.GT.0) THEN
          DO I=1,3
            READ(12,'(A98)') STUFF
          ENDDO
        ENDIF
        DO I=1,5
          READ(12,'(A98)') STUFF
        ENDDO
        MONTH=0
        !Amplitudes:
        DO IYEAR=1,15
          READ(12,'(A98)') STUFF
          DO MON=1,NUMMON(IYEAR)
            MONTH=MONTH+1
            READ(12,'(1X,A2,19I5)') CMONTH,A
            DO LAT=1,19
              AMP(MONTH,LAT,IWN+1)=A(NLAT+1-LAT)
            ENDDO
          ENDDO
        ENDDO
        IF ((IWN.GE.1).AND.(IWN.LE.3)) THEN
          !Phases:
          DO I=1,8
            READ(12,'(A98)') STUFF
          ENDDO
          MONTH=0
          DO IYEAR=1,15
            READ(12,'(A98)') STUFF
            DO MON=1,NUMMON(IYEAR)
              MONTH=MONTH+1
              READ(12,'(1X,A2,19I5)') CMONTH,A
              DO LAT=1,NLAT
                PHI(MONTH,LAT,IWN+1)=A(NLAT+1-LAT)*RAD
              ENDDO
            ENDDO
          ENDDO
        ENDIF
      ENDDO
      CLOSE(12)
      DO MON=1,NMON
        DO LAT=1,NLAT
          DO LON=1,NLON
            TOZ(LON,LAT,MON)=0.
          ENDDO
        ENDDO
      ENDDO
      DO IWN=0,3
        DO LAT=1,NLAT
          DO LON=1,NLON
            LONG=1+(360/NLON/5)*(LON-1)
            ARG=2.*(PI*IWN)*(LONG-1)/72.
            DO MON=1,NMON
              M=MOD(MON-3,12)+1
              IF (MON.EQ.1) M=11
              IF (MON.EQ.2) M=12
              IF (((M.EQ.1).AND.(LAT.LE.17)).OR.
     &            ((M.EQ.2).AND.(LAT.LE.17)).OR.
     &            ((M.EQ.3).AND.(LAT.LE.18)).OR.
     &            ((M.EQ.4).AND.(LAT.GE.2)).OR.
     &            ((M.EQ.5).AND.(LAT.GE.3)).OR.
     &            ((M.EQ.6).AND.(LAT.GE.3)).OR.
     &            ((M.EQ.7).AND.(LAT.GE.3)).OR.
     &            ((M.EQ.8).AND.(LAT.GE.3)).OR.
     &            ((M.EQ.9).AND.(LAT.GE.2)).OR.
     &            ((M.EQ.10).AND.(LAT.LE.18)).OR.
     &            ((M.EQ.11).AND.(LAT.LE.17)).OR.
     &            ((M.EQ.12).AND.(LAT.LE.17))) THEN
                TOZ(LON,LAT,MON)=TOZ(LON,LAT,MON)+
     &            AMP(MON,LAT,IWN+1)*COS(ARG-PHI(MON,LAT,IWN+1))
              ENDIF
            ENDDO
          ENDDO
        ENDDO
      ENDDO

      RETURN
      END
