+	SUBROUTINE XGINIT (MAXSUB,NCJ,KDIF,PROGNM)BC_TITLE  XGINIT Initialize common XXGCOM and arguments for XGDATA.CC_ARGUMENTSO      INTEGER MAXSUB  ![O]Number of sub-databases (orbiters) for this database.O      INTEGER NCJ    ![O]Number of output columns. 0 for this version of XGDATAG      INTEGER KDIF   ![O]Number of overlaping input and output columns.D      CHARACTER*16 PROGNM ![I] Name of the user application routine.C_VAR!	INCLUDE 'RAD$INC:XXCOM.INC/LIST'C					Uses: ILIST, IOUT.*C					Modifies: IIN, IOUT, ILIST, NOSPOT, C					DATIM.C"	INCLUDE 'RAD$INC:XXGCOM.INC/LIST'C					Uses: none.(C					Modifies:  MXNCOL, MXNFUN, MXNCON,+C					MXNARG, NCOLP, IFGSET, KSPOTS, TITLE.!	INCLUDE 'RAD$INC:XXTAE.INC/LIST'#C					Uses:  LOUT.  Modifies: none.CKC_DESCRIPTION  The subroutine XGINIT initializes the common XXGCOM, and theLC arguments for XGDATA; it also initializes the database specific variables.MC This is done here so that all other routines called from this point forward/C will have the database specifics initialized.OC This is called only once from XGDATA to initialize database specific database
c parameters.C_CALLS DATIME#C_HISTORY  85Feb12 Hugh_H_Kieffer  SC 87JUl16, Robert L. Gurule, USGS Flagstaff, AZ. NIMS/VIMS Documentation standards.C                    C_END	CHARACTER*6 PROGS	CHARACTER*13 FNPRNT        CHARACTER*16 TITLK(3)	INTEGER*4 KDB(3,4)-	DATA KDB / 		! values which depend upon IDDB     &  6,20,20			! NOSPOT     &, 83,20,20		! MAXCOL     &,  7, 1, 1		! NSPOTS     &,  2, 2, 1/		! MAXSUB;        DATA TITLK /'VIKING IRTM     ','VIKING MAWD      ',     &  'MARINER 9 IRR   '/ :C____Values not in common, and the same for all databases.	CALL DATIME(DATIM)	IPT = INDEX(PROGNM,':')
	IPT = IPT -1	IF (IPT.LT.0.OR.IPT.GT.6)IPT=6$        PROGS(1:IPT) = PROGNM(1:IPT)         FNPRNT = PROGS // '.PRT'
	ILIST = 8        IIN = 5        IOUT = 6	LOUT=ILIST<	NCJ = 0		!Number cols out, stored in the last part of ICOL.:	KDIF = 0	!Number of overlapping input and output columns.2!-------Open the print file, and write the header.:        OPEN(UNIT=ILIST,FILE=FNPRNT,STATUS='NEW',RECL=200)7        WRITE(ILIST,903) PROGNM(1:IPT),(DATIM(J),J=1,5)A903     FORMAT(1X,(A),5X,'A XX-GV PROGRAM: ',11X,'RUN_TIME=',5A4)5C____Items in common, and the same for all databases.?	MXNCOL = 30	!ICOL dimension: max number columns and functions.2	MXNFUN = 5	!IFUN dimension: max number functions.6	MXNCON = 10	!IDCON dimension: max number constraints.E	MXNARG = 10	!LFUN dimension in XXFVAL: max # arguments of a function7	KVDEF = 1	!Column for start of buffer for definitions.=	NCOLP = 0	!User may increase for preset principal variables.'	IFGSET = 1	!Default is to call XXGSET.5C____Items dependent on which database is to be used.910	NOSPOT = KDB(IDDB, 1)	!Last non-spot-dependent column.:	MAXCOL = KDB(IDDB, 2)	!Maximum column number in database.1	NSPOTS = KDB(IDDB, 3)	!Number spots in database.0	MAXSUB = KDB(IDDB, 4)	!Number of sub-databases.>	KSPOTS(1) = 1	        !Initialize in case XXGSET is not used.        C	ENCODE(16,13,TITLE)TITLK(IDDB)(1:16)	!Convert character title into; 13     FORMAT(A16)			        !integer form for output to  9        WRITE(IOUT,919) TITLK(IDDB)(1:16)	!XXGCOM common.*        WRITE(ILIST,919) TITLK(IDDB)(1:16)" 919    FORMAT('0DATABASE = ',A16)	RETURN	END