      SUBROUTINE UPGG (IXROW,LON,IXPAK,J,NPACK,WRKS,VALMIN)
C
C     * JUN 01/92 - M.LAZARE. REVISED FOR NEW PACKER.
C     * NOV 14/85 - B.DUGAS, R.LAPRISE.  (SCALING INFO IS ALSO CODED).
C 
C     * UNPACK ONE GRID SLICE AT LATITUDE J INTO IXROW FROM GLOBAL
C     * PACKED ARRAY IXPAK, AT DENSITY NPACK.
C     * WRKS IS NOT USED. 
C     * VALMIN IS LOWER BOUND IMPOSED ON IXROW.
C 
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)

      DIMENSION IXPAK(1),IXROW(LON)
C
C     * WORK SPACE TO PERFORM LOWER BOUND OPERATION.
C
      REAL TEMP
      INTEGER ITEMP(2)
      EQUIVALENCE (TEMP,ITEMP)    
C
C     * THE FOLLOWING COMMON BLOCK HOLDS INFORMATION ON THE MACHINE
C     * TYPE (32 OR 64 BIT INTEGERS) AND THE RATIO OF FLOATING POINT
C     * SIZE TO INTEGER SIZE.
C
      COMMON /MACHTYP/ MACHINE,INTSIZE
C 
      DATA NBW/64/
C---------------------------------------------------------------------
C     * SECTIONS FOR DIFFERENT PACKING DENSITITES.
C     * "N" HOLD THE LOCATION IN NATIVE MACHINE WORD LENGTH OF
C     * THE LAST ELEMENT OF THE PREVIOUS ROW.
C
      IF (NPACK .NE. 0 .AND. NPACK .NE. 1) GO TO 200
C
      N = (J-1)*LON*INTSIZE
C
C     * NPACK=0: DATA IS STORED IN NATIVE FORMAT.  THIS IS HIGHLY NON-
C     * PORTABLE DATA AND IS USED ONLY FOR TESTING PURPOSES.
C
      IF (NPACK .EQ. 0) THEN
          DO 100 I=1,LON*INTSIZE 
  100     IXROW(I) = IXPAK(N+I)
      ENDIF
C
C     * NPACK=1: DATA IS STORED IN IEEE 64-BIT FLOATING POINT.
C
      IF (NPACK .EQ. 1) THEN
          CALL IEEEUP(LON,IXROW,IXPAK(N+1))
      ENDIF
      GO TO 250
C---------------------------------------------------------------------
C     * UNPACK IXROW FROM IXPAK AT PROPER PLACE FOR THIS LATITUDE.
C     * FIRST 2 WORDS OF PACKED ROWS CONTAIN MINIMUM AND MAXIMUM VALUES
C     * FOR THE ROW IN QUESTION.
C 
  200 N    = LENPAK(LON,J-1,NPACK)
      NBITS= NBW/ABS(NPACK)
      IND=2*MACHINE+1
      CALL DECODR2(IXPAK(N+1),XMIN)
      CALL DECODR2(IXPAK(N+MACHINE+1),XMAX)
      CALL PACCRN (IXROW,IXROW,IXPAK(N+IND),LON,NBITS,XMIN,XMAX,-1)
C
C     * PACKING ROUND-OFF MAY RENDER FIELDS UNPHYSICAL.
C     * IMPOSE LOWER BOUND VALMIN ON IXROW.
C     * CARE MUST BE TAKEN AS IXROW IS DEFINED AS INTEGER IN THIS 
C     * ROUTINE (DUE TO BEING INTERFACE TO PACKING ROUTINES) WHILE
C     * VALMIN IS REAL. THE VALUE OF INTSIZE IS USED TO DETERMINE
C     * THE NECESSARY CODE. SINCE THIS ADDS OVERHEAD, AVOID USE OF
C     * THIS ROUTINE UNLESS ABSOLUTELY NECESSARY (I.E. IF VALMIN=0
C     * AND "ROW" VALUES ARE ALL GE.0, PACKER SHOULD NOT PUT NEGATIVE
C     * VALUES AND UPGR CAN BE USED INSTEAD.
C
  250 IF(INTSIZE.EQ.2)                                   THEN
         DO 300 I=1,2*LON,2
            ITEMP(1)=IXROW(I)
            ITEMP(2)=IXROW(I+1)
            TEMP=MAX(TEMP,VALMIN)
            IXROW(I)=ITEMP(1)
            IXROW(I+1)=ITEMP(2)
  300    CONTINUE
      ELSE
         DO 350 I=1,LON
            ITEMP(1)=IXROW(I)
            TEMP=MAX(TEMP,VALMIN)
            IXROW(I)=ITEMP(1)
  350    CONTINUE
      ENDIF
C       
      RETURN
C-----------------------------------------------------------------------
      END 
