      SUBROUTINE GETGGBX(GGPAK,NAME,NF,NLON,NLAT,ITIM,LVL,GG)
C
C     * JUN 20/03 - M.LAZARE. - CONVERT GRID TO ORDERED S-N PAIRS
C     *                         WITH CYCLIC LONGITUDE REMOVED, AS
C     *                         INPUT TO THE MODEL.
C     *                       - NPACK REMOVED FROM CALL.
C     * SEP 27/92 - M.LAZARE. PREVIOUS VERSION GETGGB.
C
C     * GETS GAUSSIAN GRID GG(NLON,NLAT) CALLED NAME FROM FILE NF.
C     * AND PACKS IT, IN ORDERED S-N PAIRS, INTO ARRAY GGPAK.

C     * THE LAST POINT IN EACH ROW IS OMITTED SINCE IT IS 
C     * JUST A COPY OF THE FIRST POINT IN THE ROW.
C     * ITIM IS THE VALUE IN IBUF(2). 
C     * LVL  IS THE VALUE IN IBUF(4). 
C 
C     * NOTE THAT THIS ROUTINE IS EXACTLY THE SAME AS ROUTINE "GETAGB", 
C     * EXCEPT THAT THE INPUT FILE IS NOT REWOUND (TO BE USED TO SAVE 
C     * I/O ON OPERATIONS THAT WORK WITH SEQUENTIAL DATA) AND A VALUE 
C     * MUST BE SPECIFIED FOR IBUF(4), I.E. THE LEVEL INDICATOR (RATHER 
C     * THAN ASSUMING IBUF(4)=1). 
C
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)                                         
C 
      REAL GGPAK(1),GG(NLON,NLAT)
      LOGICAL OK
C 
C     * ICOM IS A SHARED SCM I/O AREA. IT MUST BE LARGE ENOUGH
C     * FOR AN 8 WORD LABEL FOLLOWED BY A PACKED GAUSSIAN GRID. 
C 
      COMMON /ICOM/ IBUF(8),IDAT(1) 
      COMMON /MACHTYP/ MACHINE, INTSIZE
      COMMON /MPILAT/ ILAT
C-----------------------------------------------------------------------
C     * READ THE FIELD. 
C     * STOP IF NOT FOUND OR WRONG SIZE IS READ.
C 
      MAXX=( NLON*NLAT + 8 )*MACHINE
      CALL GETFLD2(NF,GG,NC4TO8("GRID"),ITIM,NAME,LVL,IBUF,MAXX,OK)
      IF(.NOT.OK) GO TO 900 
C     WRITE(6,6025) IBUF
      IF(IBUF(5).NE.NLON) GO TO 900 
      IF(IBUF(6).NE.NLAT) GO TO 900 
C
C     * CONVERT TO ORDERED S-N PAIRS.
C
      CALL RGTOCG2(GGPAK,GG,NLON-1,NLAT,ILAT)

      RETURN
C 
C     * ERROR EXIT - STOP IF GRID MISSING OR WRONG SIZE.
C 
  900 WRITE(6,6020) ITIM,NAME,LVL,NLON,NLAT 
      CALL XIT('GETGGBX',-1) 
C-----------------------------------------------------------------------
 6020 FORMAT('0GRID',I10,1X,A4,I10,5X,'SIZE',2I6,5X,'NOT FOUND') 
 6025 FORMAT(1H ,A4,I10,1X,A4,5I6)
      END 
