+      SUBROUTINE XXGDEF (IDEF, KDEF,KSCALE)LC_Title  XXGDEF  Set up variable definition information and scaling factors.C_ArgsE      INTEGER*2 IDEF(8,*) ![I] Array of record definition information%	                  !from file header.L      INTEGER*2 KDEF(8,*) ![O] Array of variable definition information for.8C			  each column or function variable definition entry.C			  (8 integer*2 words).EC	   KDEF(1-3)  Title (6 ascii characters, leftmost generally blank).7C	       (4-6)  Units (6 ascii characters, e.g. h*100).CC		  7   Storage scale (integer*2 storage units per physical unit).?C		  8   Print scale (integer*2 print units per physical unit).H      INTEGER*2 KSCALE(*) ![O] Array of scaling factors for each column.C_VariablesJ      INCLUDE 'RAD$INC:XXGCOM.INC/LIST'    !Contains declarations for manyIC                                          database or program dependent )C					   variables. Uses: ICOL,NCOL,NCON.;C                                          Modifies: IDCON.JC_Description  Set up variable definition information and scaling factors.MC XXGDEF unscales the constraints in array IDCON by multipling by the storageIC scale factor derived from KDEF.  Also computes the scaling factors for GC the variables specified in array ICOL. The scaling of the constraintsC take place in this order:CMC  1)  Input of constraints in STINPUT, there they are multiplied by physical/C      units.  e.g., Latitude print units = 10.GC  2)  In this routine (XXGDEF) the constraints are turned into storageDC      units.  By multiplying by the ratio of scale_unit/print_unit.JC  3)  In routine XXGCON all constraining on the limits of the constraintsMC      are performed, if they pass time constraint is kept positive otherwiseC      the are kept negative.CC Database variables have column identifications greater than zero.4C Pre-defined functions are between -99 and zero 0).OC Differences (a-b) (col = -aabb): from file record definition entry of minuendHC (a) with units overridden by title from subtrahend (b) entry (leftmost!C char of b title forced to "-").CC_Calls  XXFDEF,A2AN,MVBYTE	C_HistoryC	82dec12  RMehlman  UCLA.9C	82jan01  RM  ICOL made  INT*2, ignore seq. constraints.IC	87JUN01  Robert_Gurule modified to NIMS/VIMS documentation and cleanup.CC	87oct16  Hugh_H_Kieffer  USGS_Flagstaff convert to using  XXVDEF.C_End      CHARACTER*7 FMT      CHARACTER*5 SYM.      INTEGER*4 DESC(8)	 !32-byte description.C!-----loop on variables to get variable definition information and !     compute scaling factors.'      DO K=1,NCOL		!Loop over variablesC        KCOL=ICOL(K)		!Variable _id, as constructed from user input. 	CALL XGVDEF (2,SYM,KCOL,KDEF(7,K),KDEF(8,K) $     &,KDEF(1,K),KDEF(4,K),DESC,FMT)0	KSCALE(K) = KDEF(7,K)/KDEF(8,K)  !Print/Storage      ENDDO>!  Unscale min/max constraint values, looping over constraintsG!  IDCON (4,I) = pointer to the location of the requested variable in  5!  the IA array.  Scale min and max to storage units.      IF (NCON.GT.0) THEN 	DO I=1,NCON			   *          K=IDCON(4,I)	                   )          IF (K.LE.1000) THEN	                       DO J=2,3&	      IDCON(J,I)=IDCON(J,I)*KSCALE(K)            ENDDO	  ENDIF	ENDDO      ENDIF      RETURN	      END