+       SUBROUTINE XXGDEF (IDEF, KDEF,KSCALE)   L C_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.8 C			  each column or function variable definition entry. C			  (8 integer*2 words).E C	   KDEF(1-3)  Title (6 ascii characters, leftmost generally blank). 7 C	       (4-6)  Units (6 ascii characters, e.g. h*100). C C		  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_Variables J       INCLUDE 'RAD$INC:XXGCOM.INC/LIST'    !Contains declarations for manyI C                                          database or program dependent  ) C					   variables. Uses: ICOL,NCOL,NCON. ; C                                          Modifies: IDCON. J C_Description  Set up variable definition information and scaling factors.M C XXGDEF unscales the constraints in array IDCON by multipling by the storage I C scale factor derived from KDEF.  Also computes the scaling factors for  G C the variables specified in array ICOL. The scaling of the constraints  C take place in this order:  C M C  1)  Input of constraints in STINPUT, there they are multiplied by physical / C      units.  e.g., Latitude print units = 10.   G C  2)  In this routine (XXGDEF) the constraints are turned into storage D C      units.  By multiplying by the ratio of scale_unit/print_unit.  J C  3)  In routine XXGCON all constraining on the limits of the constraintsM C      are performed, if they pass time constraint is kept positive otherwise  C      the are kept negative.   C C Database variables have column identifications greater than zero. 4 C Pre-defined functions are between -99 and zero 0).  O C Differences (a-b) (col = -aabb): from file record definition entry of minuend H C (a) with units overridden by title from subtrahend (b) entry (leftmost! C char of b title forced to "-").  C  C_Calls  XXFDEF,A2AN,MVBYTE 	 C_History  C	82dec12  RMehlman  UCLA.9 C	82jan01  RM  ICOL made  INT*2, ignore seq. constraints. I C	87JUN01  Robert_Gurule modified to NIMS/VIMS documentation and cleanup. C C	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 variables C         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 