      SUBROUTINE DFO2F(GOFF,ILON,JLAT,GREG,JLAT1,WORK,LWORK,WSAVE,
     +                 LSAVEX,IOFF,IER)

      INTEGER ILON,JLAT,JLAT1,IOFF
      DOUBLE PRECISION GOFF(ILON,JLAT)
      INTEGER IER
      DOUBLE PRECISION GREG(ILON,JLAT1)


      DOUBLE PRECISION WORK(LWORK)
      DOUBLE PRECISION WSAVE(LSAVEX)
      INTEGER LWORK,LSAVEX
      INTEGER LSAVE

      IER = 0
      IF (ILON.LT.4 .OR. JLAT.LT.3) IER = 10
      IF ((JLAT1-JLAT).NE.1) IER = IER + 100
      IF (IER.NE.0) RETURN

      LSAVE = 2* (2*JLAT1+ILON+16)
      LSAVE = (10*LSAVE)/9
      CALL DSSHIFTI(IOFF,ILON,JLAT,LSAVE,WSAVE,IER)
      CALL DSSHIFTE(IOFF,ILON,JLAT,GOFF,GREG,WSAVE,LSAVE,WORK,LWORK,IER)

      RETURN
      END
