      SUBROUTINE INTXFX(XSFXPAM,XSFXPAK,XSFXPAL,XSFXROW,XSFXROL,
     1                  NPPS,NPGG,LON,LAT,MDAY1,IDAY,MDAY,GG) 
C 
C     * NOV 05/97 - M.HOLZER. INTERPOLATES SURFACE TRACER FLUX TO GET
C     *                       THE FLUX AT THE FIRST TIME STEP.     
C     *                       BASED ON ROUTINE INTGT. 
C
C     * INTERPOLATE XSFX FOR DAY=IDAY (INTO XSFXPAM), BETWEEN 
C     * MDAY1 (INTO XSFXPAK) AND MDAY (INTO XSFXPAL).
C 
      IMPLICIT NONE
      REAL XSFXPAK(1),XSFXPAL(1),XSFXROW(1),XSFXROL(1)
      REAL XSFXPAM(1),GG(1) 
      INTEGER NPPS,NPGG,LON,LAT,MDAY1,IDAY,MDAY

      REAL DAY1, DAY2, DAY3
      REAL W1, W2
      REAL FLOAT
      INTEGER I, J
C---------------------------------------------------------------------
      DAY1=FLOAT(MDAY1) 
      DAY2=FLOAT(IDAY)
      DAY3=FLOAT(MDAY)
      IF(DAY2.LT.DAY1) DAY2=DAY2+365. 
      IF(DAY3.LT.DAY2) DAY3=DAY3+365. 
      W1=(DAY2-DAY1)/(DAY3-DAY1)
      W2=(DAY3-DAY2)/(DAY3-DAY1)
      WRITE(6,6000) IDAY,MDAY1,MDAY,W1,W2 
C 
C 
      DO 200 J=1,LAT
        CALL UPGR(XSFXROW,LON,XSFXPAK,J,NPPS,GG)
        CALL UPGR(XSFXROL,LON,XSFXPAL,J,NPPS,GG)
C 
        DO 100 I=1,LON
          XSFXROW(I)=W1*XSFXROL(I) + W2*XSFXROW(I)
  100   CONTINUE
C 
        CALL PKGR(XSFXPAM,J,XSFXROW,LON,NPPS,GG)
  200 CONTINUE
      RETURN
C---------------------------------------------------------------------- 
 6000 FORMAT(' INTERPOLATING FOR', I5, ' BETWEEN', I5, ' AND',
     1       I5, ' WITH WEIGHTS=', 2F7.3)
      END 
