      SUBROUTINE DGFILTR(DT,TAUSS,TAUCC)

      include 'slgcm.slgprm'
      include 'slgcm.slgprg'
      include 'slgcm.slgcon'

      DIMENSION UOR(IJM0M0), VOR(IJM0M0), GTPOR(IJM0M0)
      DIMENSION HF(0:1000)

      INTEGER DT
      LOGICAL FIRST

      TAUS = TAUSS*3600.0
      TAUC = TAUCC*3600.0

      RDT = DT
      NIN = TAUS/(2.0*RDT)
      THETAC = PI*TAUS/(NIN*TAUC)


      HF(0) = THETAC/PI
      TEMH = HF(0)

      DO I=1,NIN
         TEM1 = FLOAT(I)*PI/FLOAT(NIN+1)
         HF(I) = (SIN(TEM1)/TEM1)
     #          *(SIN(FLOAT(I)*THETAC)/(FLOAT(I)*PI))
         TEMH = TEMH + 2.0*HF(I)
      ENDDO

      DO I = 0, NIN
         HF(I) = HF(I)/TEMH
      ENDDO

      print*, ' NIN =', NIN, ' TEMH =',TEMH, '  THETAC=', THETAC

      DO I=0, NIN
         PRINT*, 'I=', I, '   HF(I)=', HF(I)
      ENDDO

      DO J1X = 1, IJM0M0
         UOR(J1X) = HF(0)*UN0(J1X)
         VOR(J1X) = HF(0)*VN0(J1X)
         GTPOR(J1X) = HF(0)*GTP(J1X)
      END DO

      CALL CONDT(DT)
      FIRST = .TRUE.
      DO N = 1, NIN
         CALL SLGCST(RDT,FIRST)
      DO J1X = 1, IJM0M0
         UOR(J1X) = HF(N)*UN0(J1X) + UOR(J1X)
         VOR(J1X) = HF(N)*VN0(J1X) + VOR(J1X)
         GTPOR(J1X) = HF(N)*GTP(J1X) + GTPOR(J1X)
      END DO
      ENDDO

      MDT = DT
      DT = -MDT
      RDT = DT

      CALL CONDT(DT)
      FIRST = .TRUE.
      DO N = 1, NIN
         CALL SLGCST(RDT,FIRST)
      DO J1X = 1, IJM0M0
         UOR(J1X) = HF(N)*UN0(J1X) + UOR(J1X)
         VOR(J1X) = HF(N)*VN0(J1X) + VOR(J1X)
         GTPOR(J1X) = HF(N)*GTP(J1X) + GTPOR(J1X)
      END DO
      ENDDO
      
      FIRST = .TRUE.
      DT = MDT

      DO J1X = 1, 13377
         UN0(J1X) = UOR(J1X)
         VN0(J1X) = VOR(J1X)
         GTP(J1X) = GTPOR(J1X)
      END DO

      RETURN
      END


