      SUBROUTINE PUTGGB(GGPAK,ILG1,NLAT,KHEM,NPGG,KOUNT,
     1             NF,NAME,LEV,GLL,WRKS)
C
C     * NOV 24/94 - M.LAZARE. I/O NOW DONE WITHOUT IMPLIED DO-LIST IN
C     *                       ORDER TO OPTIMIZE I/O.
C     *                       ALSO COMMENT OUT FORMATTED WRITE TO CUT
C     *                       DOWN ON I/O TIME. 
C     * OCT 23/93 - M.LAZARE. INTEGER LABELS WRITTEN OUT USING ROUTINE
C     *                       FBUFOUT INSTEAD OF NATIVE WRITE, SO THAT
C     *                       TRANSPORTABLE TO 32-BIT MACHINES (PAKGCM
C     *                       USES GETFLD2 TO READ AND HENCE EXPECTS
C     *                       64-BIT INTEGER LABLELS).
C     * JUN 03/92 - M.LAZARE. FIELDS ARE SAVED WITH IBUF(8)=0 (I.E.
C     *                       MACHINE INTERNAL FORMAT).
C     * APR 02/92 - E.CHAN. (MODIFY I/O FOR 2-RECORD FORMAT)
C     * NOV 24/82 - R.LAPRISE.
C
C     * UNPACKS A GAUSSIAN GRID IN GGPAK ROW BY ROW FROM THE GCM. 
C     * THE UNPACKED GRID IS SAVED ON FILE NF.
C     * THE FIRST POINT IN EACH ROW IS COPIED INTO THE LAST POINT.
C 
C     * LEVEL 2,GGPAK,GLL 

      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)

      REAL GGPAK(1),GLL(ILG1*NLAT) 
      REAL WRKS(1)
      INTEGER IBUF(8)
C---------------------------------------------------------------------
      IGRID=NC4TO8("GRID")
C 
C     * STORE VALUES OF GGPAK INTO GLL, ADDING CYCLIC LONGITUDE.
C
      ILG=ILG1-1
      DO 210 J=1,NLAT 
        IJ=(J-1)*ILG1+1
        CALL UPGR(GLL(IJ),ILG,GGPAK,J,NPGG,WRKS) 
        GLL(IJ+ILG)=GLL(IJ)
  210 CONTINUE
C 
      KFLD=IGRID
      NPACK=0 
      CALL SETLAB(IBUF,KFLD,KOUNT,NAME,LEV,ILG1,NLAT,KHEM,NPACK)
      CALL FBUFOUT(NF,IBUF,-1,K)  
      WRITE(NF) GLL
C     WRITE(6,6010) KFLD,KOUNT,NAME,LEV,ILG1,NLAT,KHEM,NPACK,NF 
      RETURN
C---------------------------------------------------------------------
C6010 FORMAT(' ',71X,A4,I6,2X,A4,5I5,'  TO FILE',I3)
      END 
