      SUBROUTINE GETGBNRX(GGPAK,NAME,NF,NLON,NLAT,IDAY,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 GETGBNR.
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     * IDAY IS THE DAY OF THE YEAR.
C
C     * NOTE THAT THIS ROUTINE IS EXACTLY THE SAME AS ROUTINE "GETAGBX", 
C     * EXCEPT THAT THE INPUT FILE IS NOT REWOUND (TO BE USED TO SAVE 
C     * I/O ON OPERATIONS THAT WORK WITH SEQUENTIAL DATA). 
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"),IDAY,NAME,1,IBUF,MAXX,OK)
      IF(.NOT.OK) GO TO 900 
      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) IDAY,NAME,NLON,NLAT 
      CALL XIT('GETGBNRX',-1) 
C-----------------------------------------------------------------------
 6020 FORMAT('0GRID',I10,1X,A4,5X,'SIZE',2I6,5X,'NOT FOUND') 
 6025 FORMAT(' ',A4,I10,1X,A4,5I6)
 6030 FORMAT('+',55X,A4,' BIAS =',1PE12.4)
      END  
