      SUBROUTINE EXTRACT(GG,ILG1,ILAT,DLAT,GLL,NLG1,NLAT,DEGLAT)
  
C     * JULY 11/85 - M.LAZARE.
  
C     * EXTRACTS A GLOBAL GRID GG(ILG1,ILAT) FROM ANOTHER OF DIFFERENT
C     * DIMENSION (NLG1,NLAT), REGARDLESS OF WHETHER THEY ARE GAUSSIAN OR 
C     * LAT-LONG. 
C     * EACH GG POINT TAKES THE VALUE OF THE CLOSEST POINT IN GLL.
  
C     * GG HAS ILG EQUALLY SPACED LONGITUDES. 
C     * DLAT(ILAT) CONTAINS GG LATITUDES IN DEGREES S. TO N.
  
C     * GLL HAS NLG EQUALLY SPACED LONGITUDES.
C     * DEGLAT(NLAT) CONTAINS GLL LATITUDES IN DEGREES S. TO N. 
  
C     * FOR BOTH GRIDS THE LEFT SIDE IS REPEATED ON THE RIGHT SIDE. 
  
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      REAL GG(ILG1,ILAT),GLL(NLG1,NLAT) 
      REAL DLAT(ILAT),DEGLAT(NLAT)
C-----------------------------------------------------------------------
      ILG=ILG1-1
      NLG=NLG1-1
      DEGX=360.E0/FLOAT(NLG)
  
C     * THE ROWS ARE DONE FROM SOUTH TO NORTH.
  
      DO 400 J=1,ILAT 
         DYOLD=180.E0 
         DO 100 KKK=1,NLAT
            DY=ABS(DLAT(J)-DEGLAT(KKK)) 
            IF(DY.LT.DYOLD) THEN
               DYOLD=DY 
               JJ=KKK 
            ELSE
               GOTO 200 
            ENDIF 
  100    CONTINUE 
  
C     * EXTRACT THE POINTS FROM LEFT TO RIGHT IN EACH ROW.
C     * DLON = DEGREES OF POINT I EASTWARD FROM GREENWICH.
  
  200    DO 300 I=1,ILG 
            DLON=FLOAT(I-1)/FLOAT(ILG)*360.E0 
            X=DLON/DEGX+1.E0
            II=INT(X) 
            DX=X-FLOAT(II)
C***        II=CVMGT(II,II+1,DX.LE.0.5) 
            IF(DX.GT.0.5E0) II=II+1  
            GG(I,J)=GLL(II,JJ)
  300    CONTINUE 
  
         GG(ILG1,J)=GG(1,J) 
  400 CONTINUE
  
      RETURN
      END 
