iArrI4Total $SMEI/ucsd/gen/for/lib/array/iarri4total.f
[Previous] [Next]
 NAME:
	iArrI4Total
 PURPOSE:
	Get sum of all elements in integer*4 array
 CALLING SEQUENCE:
	function iArrI4Total(N,A,M)
 INPUTS:
	N	integer		# elements in array
				If N < 0 then array elements
				set to BadR4 are skipped
	A(*)	integer		array
 OUTPUTS:
	R	integer		sum
	M	integer		# elements contributing
				to sum (if N > 0 then M=N)
 CALLS: ***
	BadI4
 CALLED BY:
	HOSRead, LOSReach, PrintAll, iHOSInfo, ice_analyze, ipsd, ipsg2, ipsg2s, ipsg2t
 SEE ALSO:
	Array_Info


iArrI4ValuePresent $SMEI/ucsd/gen/for/lib/array/iarri4valuepresent.f
[Previous] [Next]
 NAME:
	iArrI4ValuePresent
 PURPOSE:
	Check occurrence of given value in integer*4 array
 CALLING SEQUENCE:
	function iArrI4ValuePresent(N,A,APresent)
 CALLED BY:
	HOSWrite, Pandora, PrintAll, WhatIsI4, dailyips [1], dailyips [2]
 SEE ALSO:
	Array_Info


iArrI8ValuePresent $SMEI/ucsd/gen/for/lib/array/iarri8valuepresent.f
[Previous] [Next]
 NAME:
	iArrI8ValuePresent
 PURPOSE:
	Check occurrence of given value in integer*8 array
 CALLING SEQUENCE:
	function iArrI8ValuePresent(N,A,APresent)
 CALLED BY:
	WhatIsI8
 SEE ALSO:
	Array_Info


iArrR4Compare $SMEI/ucsd/gen/for/lib/array/iarrr4compare.f
[Previous] [Next]
 NAME:
	iArrR4Compare
 PURPOSE:
	Compare two same-size real*4 arrays
 CALLING SEQUENCE:
	function iArrR4Compare(N,A,B)
 CALLED BY:
	Pandora
 SEE ALSO:
	Array_Info


iArrR4ValuePresent $SMEI/ucsd/gen/for/lib/array/iarrr4valuepresent.f
[Previous] [Next]
 NAME:
	iArrR4ValuePresent
 PURPOSE:
	Check real*4 array for presence of given value
 CALLING SEQUENCE:
	function iArrR4ValuePresent(N,A,APresent)
 CALLED BY:
	BuildSourceSurface, GridFill, GridSphere3D, GridSphereRange, GridSphereWeight
	HERDISK, MapReadTimes, RebinSphere, WR2DARR, WhatIsR4, smei_cal_build
	smei_frm_measle, smei_frm_saturated
 SEE ALSO:
	Array_Info


iAskChar $SMEI/ucsd/gen/for/lib/what/iaskchar.f
[Previous] [Next]
 NAME:
	iAskChar
 PURPOSE:
 CALLING SEQUENCE:
	function iAskChar(cQuery,M,bExit,bFile,bDir,bParse,bUpper,cExit,cVal,cOld)
 CALLED BY:
	AskChar
 INCLUDE:
	include		'filparts.h'
 CALLS: ***
	iCheckDirectory, iGetFileSpec, iSearch, itrim, uppercase


iAskWhatEntry $SMEI/ucsd/gen/for/lib/what/iaskwhatentry.f
[Previous] [Next]
 NAME:
	iAskWhatEntry
 CALLING SEQUENCE:
	function iAskWhatEntry(cWhat,cWhatIn,cPrmpt)
 CALLS: ***
	itrim, uppercase
 PURPOSE:
	Internal use only.
 CALLED BY:
	AskWhat
 MODIFICATION HISTORY:
	SEP-1994, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


ice_analyze $SMEI/ucsd/gen/for/lib/bytes/ice_analyze.f
[Previous] [Next]
 NAME:
	ice_analyze
 PURPOSE:
	Finds the optimum parameters for compressing the specified integer array with ice_pack
 CATEGORY:
	Bits and bytes
 CALLING SEQUENCE:
	function ice_analyze(kmax, kshift, klenbit, ksign, kperm, nOrig, Orig)
 INPUTS:
	nOrig		integer		# elements in Orig
	Orig(nOrig)	integer		array to be analyzed
 OUTPUTS:
	ice_analyze	integer		# bits needed to hold compressed data for the optimum parameters

	kmax		integer		cutoff for applying compression
	kshift		integer		minimum # bits copied for each difference

	klenbit		integer		# bits encoded  when the full value instead
					of a difference is used
	ksign		integer		-1: all values in Orig are <  zero
					+1: all values in Orig are >= zero
					 0: both positive and negative values are present
	kperm(0:nbit-1)	integer		permutation table
					nbit = 32 (# bits in integer*4)
					Only elements 0...kmax of the returned array should be used.
 CALLS: ***
	ArrI4Copy, ArrI4GetMinMax, ArrI4Reverse, ArrI4Zero, IndexI4, iArrI4Total
 CALLED BY:
	ice_write
 SEE ALSO:
	ice_pack, ice_read, ice_unpack, ice_write
 PROCEDURE:
	kmax, kshift, klenbit, ksign, kperm are ready to be passed to ice_pack for compression
	of Orig. The compression factor is ibit/(nOrig*nbit). (use nbit=16 instead of nbit=32
	if the original data were actually integer*2 stored in integer*4 form).
	See ice_pack for more information.
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


ice_pack $SMEI/ucsd/gen/for/lib/bytes/ice_pack.f
[Previous] [Next]
 NAME:
	ice_pack
 PURPOSE:
	Compresses an integer array using a modified Rice algorithm
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	function ice_pack(kmax, kshift, nlenbit, nsign, nperm, nOrig, Orig, nPack, Pack, iPack)
 INPUTS:
	kmax		integer		cutoff for applying compression (see PROCEDURE)
					(kmax > 0)
	kshift		integer		minimum # bits copied for each difference
					(kshift <kmax)
	nlenbit		integer		# bits encoded  when the full value instead
					of a difference is used (see PROCEDURE)
	nsign		integer		-1: all values in Orig are <  zero
					+1: all values in Orig are >= zero
					 0: both positive and negative values are present
	nperm(0:kmax-kshift)
			integer		permutation table (see PROCEDURE)
					(if not available use nperm(i) = i [i=0,kmax])
	nOrig		integer		# elements in Orig
	Orig(nOrig)	integer		array to be compressed
	nPack		integer		# of elements in Pack available for storing compressed data
 OUTPUTS:
	ice_pack	integer		# bits in Pack used to hold the compressed data.

					On failure ibit = 0 is returned (happens only if the array
					Pack is not big enough to hold the compressed data). Since Pack
					is an integer*4 array nPack*nbit (nbit=32) bits are available.

					Bits 0..ibit-1 are filled. The first 1+(ibit-1)/nbit elements
					of Pack are used. Only ib = 1+mod(ibit-1,nbit) bits (0..ib-1)
					of the last element are  used.
	Pack(nPack)	integer		compressed data; array elements 1..iPack are used.
	iPack		integer		# elements in Pack used (= 1+(ibit-1)/nbit)
 CALLED BY:
	ice_write
 SEE ALSO:
	ice_analyze, ice_read, ice_unpack, ice_write
 PROCEDURE:
 >	The subroutine ice_analyze provides optimum values for kmax, kshift,
	nlenbit, nsign and nperm.
 >	The compression factor is ibit/(nOrig*nbit). Use nbit=16 instead of nbit=32
	if the original data were actually integer*2 stored in integer*4 form.
 >	The technique is based on the algorithm described by Michael W. Richmond
	and Nancy E. Ellman, in March 1996? paper which we have in preprint form. 
	Reference?

	COMPRESSION ALGORITHM
	---------------------

	The Rice algorithm stores an integer in the following bit pattern:
		0......0 1 x..........x
		|______|   |__________|
		  ipad       itop+1
	i.e. a string of ipad 0-bits, followed by a terminating 1-bit, followed by a
	string of itop+1 bits encoding the integer value.

	The actual number encoded is either the full value from the input array, or the
	difference with the previous element in the array (For the first
	element in the array the 'previous element' is assumed to be zero).

	The two cases are distinguished using the kmax value: if the absolute difference
	is less than 2^(kmax-1) then the difference is encoded; if not then the full value
	is encoded.

	CASE A: Non-zero absolute difference less than 2^(kmax-1)
	---------------------------------------------------------
	2^(kmax-1) has only bit kmax-1 set. I.e. for absolute differences less than
	2^(kmax-1) this bit, and all higher bits, are NOT set, i.e. only the first
	kmax-1 bits 0...kmax-2 might be set.

	Let itop be the highest 1-bit of the absolute difference. For a non-zero difference
	0 <= itop <= kmax-2. Since bit itop is by definition set, the absolute difference
	is fully described by the first itop bits 0...itop-1. An additional bit is needed
	to encode the sign of the difference. So itop+1 bits are needed to store the difference:
	first ipad=itop+1 0-bits, followed by a terminator 1-bit, indicate how many bits are
	used. The terminator bit is then followed by the first itop bits of the absolute difference
	followed by a sign bit. The total number of bits used is 2*itop+3.

		0..........0 1 x..........x
		|__________|   |__________|
		ipad=itop+1       itop+1
	
	CASE B: Zero difference
	-----------------------
	No bit at all is needed to store a zero, except for a terminator bit. Note that this 
	is CASE A with ipad = 0, itop = -1.

	CASE C:  Absolute difference greater/equal 2^(kmax-1)
	-----------------------------------------------------
	In this case the full value instead of the difference is encoded.
	For case A the maximum number of leading 0-bits is kmax-1. A string of kmax 0-bits
	is used to indicate that a full value is encoded. After the terminator bit follow
	the first nlenbit bits. The total number of bits used is kmax+1+nlenbit

		0..........0 1 x..........x
		|__________|   |__________|
		ipad=kmax         nlenbit

	MINIMUM NUMBER OF BITS
	----------------------

	The above describes the the compression algorithm for the case kshift=0.
	Setting kshift to non-zero value modifies the way differences are stored: for each
	difference the kshift lowest bits are always stored. The differences are now encoded
	as follows:

	Zero difference (ipad = 0)
		1 0
	The 1-bit is the terminating bit (i.e. no leading 0-bits), followed by a 0-bit to
	indicate the presence of a zero difference.

	Difference needing 1..kshift bits (1 <= ipad <= kshift)
		1 1 s x.....x
		      |_____|
		       kshift
	The leading 1-bit is the terminating bit (i.e. no leading 0-bits). It is followed by
	a 1-bit to be able to distinguish it from a zero difference. Then a bit follows
	storing the sign of the difference (s-bit). Then follow the lowest kshift bits.

	Differences needing kshift+1...kmax-1 bits (kmax-1 <= ipad <= kmax-1 above)
		0.......0 1 x........x
	        |_______|   |________|
	       ipad-kshift     ipad

	Full value (ipad=kmax)
		0.......0 1 x........x
	        |_______|   |________|
	       kmax-kshift    nlenbit

	For kshift > 0 a smaller number of leading zeroes is needed to store a value. A small
	penalty is paid for zero differences (1 extra bit); for differences needing
	1 <= ipad <= kshift bits the penalty is: 2+kshift-2*ipad. This is positive for
	ipad < 1+kshift/2. The penalty is largest for ipad = 1 (kshift bits).

	PERMUTATION TABLE
	-----------------

	The number of leading 0-bits varies from izero=0 to izero=kmax-kshift. These differences
	serve merely as identifiers for the type of information stored after the terminating
	1-bit. Rather than using them directly as described above, it is more efficient to
	use a permutation table based on the histogram of the number of bits needed for to store
	the differences. E.g. if for some sky image 3-bit difference occur most, followed by 2-bit,
	then 1-bit, then 0-bit, then 4-bit, 5-bit, etc. then the permutation table would be
		nperm = 3,2,1,0,4,5...kmax-kshift
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Rewrite of Andy Buffington's ricearc.for.
		Main modifications:
		- large intermediate byte array for storing individual bits is removed
		- # leading zeroes used to store full values was reduced from kmax+1 to kmax
		- use of kshift allows for slightly better compression


ice_read $SMEI/ucsd/gen/for/lib/bytes/ice_read.f
[Previous] [Next]
 NAME:
	ice_read
 PURPOSE:
	Reads a compressed file written by ice_write into an integer array
 CATEGORY:
	Bits and bytes
 CALLING SEQUENCE:
	function ice_read(iAct0, cFile, nOrig, Orig, nPack, Pack, cExtra, cVersion)
 INPUTS:
	cFile		character*(*)	file name of compressed file
	nOrig		integer		# elements in Orig

	nPack		integer		# elements in Pack
	Pack		integer		scratch array (needed to store the compressed data)
 OUTPUTS:
	ice_read	integer		0: failure (an error message is displayed)
					1: success
	nOrig		integer		# elements in Orig filled with decompressed data
	Orig(nOrig)	integer		decompressed integer array
					Only the first nOrig elements contain useful information.
	cExtra		character*(*)	optional string extracted from end of file
					cExtra=' ' if no trailer was found.
	cVersion	character*8	Version string in form 'ice 000n'
					(currently n=2)
 CALLS: ***
	ArrI4Copy, Int2Str, Say, Str2Str, bOpenFile, iFreeLun, ice_unpack
 CALLED BY:
	Peep, bUncompressNic
 INCLUDE:
	include		'openfile.h'
 SEE ALSO:
	ice_write
 PROCEDURE:
	See ice_pack for information on the compression algorithm.
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


ice_unpack $SMEI/ucsd/gen/for/lib/bytes/ice_unpack.f
[Previous] [Next]
 NAME:
	ice_unpack
 PURPOSE:
	Deompresses an integer array compressed using ice_pack
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	function ice_unpack(ibit, kmax, kshift, nlenbit, nsign, nperm, nOrig, Orig, nPack, Pack, iOrig)
 INPUTS:
	ibit		integer		# bits in Pack containing compressed data.

	kmax		integer		cutoff for applying compression
	kshift		integer		minimum # bits copied for each difference

	nlenbit		integer		# bits encoded  when the full value instead
					of a difference is used
	nsign		integer		-1: all values in Orig are <  zero
					+1: all values in Orig are >= zero
					 0: both positive and negative values are present
	nperm(0:kmax)	integer		permutation table
					(if not available use nperm(i) = i [i=0,kmax])
	nPack		integer		# of elements in Pack containing compressed data
	Pack(nPack)	integer		compressed data
 OUTPUTS:
	ice_unpack	integer		# bits in Pack used to hold the compressed data
					as determined during the decompression. This value
					msut match the input value ibit.

					On failure jbit = 0 is returned (happens only if the array
					Orig is not big enough to hold the decompressed data).
	nOrig		integer		# elements in Orig
	Orig(nOrig)	integer		array to receive decompressed data
					This array is updated only up to element iOrig.
	iOrig		integer		# elements in Orig filled with decompressed data.
 CALLED BY:
	ice_read
 SEE ALSO:
	ice_analyze, ice_pack, ice_read, ice_write
 PROCEDURE:
 >	Inverts the compression of ice_pack.
 >	The input values for ibit, kmax, nlenbit, nsign, nperm must be the same as for
	the ice_pack call that created the compressed array Pack.
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


ice_write $SMEI/ucsd/gen/for/lib/bytes/ice_write.f
[Previous] [Next]
 NAME:
	ice_write
 PURPOSE:
	Writes an integer array to a compressed file
 CATEGORY:
	Bits and bytes
 CALLING SEQUENCE:
	function ice_write(iAct0, cFile, ibytes, packfraction, nOrig, Orig, nPack, Pack, cExtra)
 INPUTS:
	ibytes		integer		effective # bytes in Orig
					e.g. if the original data were integer*2
					set ibytes=2 (ibytes is used only to
					calculate the compression ratio)
	packfraction	real		threshold for compression (fraction of
					original size). The compressed file is
					written only if the compression is
					better than packfraction.
	nOrig		integer		# elements in Orig
	Orig(nOrig)	integer		array to be compressed
	cFile		character*(*)	file name

	nPack		integer		# elements in Pack
	Pack		integer		scratch array (needed to store the compressed data)
	cExtra		character*(*)	optional string to be appended to compressed file.
 OUTPUTS:
	ice_write	integer		0: failure (an error message is displayed)
					1: success
 CALLS: ***
	ArrI4Copy, ArrI4Zero, Flt2Str, Int2Str, Say, Str2Str, bOpenFile, iFreeLun, iGetFileSpec
	iPutFileSpec, iSetFileSpec, ice_analyze, ice_pack, itrim
 CALLED BY:
	bCompressNic
 INCLUDE:
	include		'openfile.h'
	include		'filparts.h'
 SEE ALSO:
	ice_read
 PROCEDURE:
 >	If the compression ratio is larger than one then no file is written
	(irrespective of the packfraction input value).
 >	See ice_pack for information on the compression algorithm.
	The output file is organized in 512 byte (128 longword) records:
	The first record contains the compression parameters:
		Longword 1 and 2: 8 byte string containing version information.
		Longword 3: length of original array (# elements)
		Longword 4: ibit; # bits in compressed data
		Longword 5: kmax
		Longword 6: kshift
		Longword 7: klenbit
		Longword 8: ksign
		Longword 9: nextra; # characters in trailer
		Longwords 10...9+kmax-kshift: permutation table
		The record is padded with zeros to 128 longwords.
	Next follows the compressed data array (ibit bits), written in blocks
	of 512 bytes; the last data record is again padded with zeros to 128
	longwords.
	At the end follows the trailer (nextrac bytes), again written in
	blocks of 512 bytes with the last record padded with zeroes to 128
	longwords.
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS)
		Version 1
	AUG-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Version 2. No changes to ice_write and ice_read, but
		the program rice now also can deal with integer*4
		data. This information is stored in a trailer.
		The new version number is needed to reconstruct the original
		trailer info. 


iCheckDirectory $SMEI/ucsd/gen/for/lib/str/icheckdirectory.f
[Previous] [Next]
 NAME:
	iCheckDirectory
 PURPOSE:
	Check whether a directory exists or not
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iCheckDirectory(cDir)
 INPUTS:
	cDir	character*(*)	Directory to be checked
 OUTPUTS:
	I	integer		0: directory does not exist, or parse error
				1: directory exists
 CALLS: ***
	iDir2File, iFile2Dir, iGetFileSpec, iSearch
 CALLED BY:
	FileSelection, HERDISK, SD, SD_TREE, bAskChar, dailyips [1], dailyips [2], iAskChar
	iGetDefaultDir, iSetDefaultDir, mkenv, rice, smei_cal_build, smei_foreign
	smei_frm_write
 INCLUDE:
	include		'filparts.h'
 SIDE EFFECTS:
	iFile2Dir is called to convert the input from file format to directory format.
	On VMS this converts DEVICE:[DIR]NAME.DIR to DEVICE:[DIR.NAME]
	On DOS and Unix it adds the trailing (back)slash.

	If the directory exists it is stored using iSetFileSpec.
	The calling procedure can retrieve the fully qualified directory name
	(including (back)slash on DOS and Unix) using:
		I = iGetFileSpec(0,FIL__DIRECTORY,cDir)
	(the include file 'filparts.h' sets the value FIL__DIRECTORY)
 DEPENDENCY TREE:
	iCheckDirectory
		iSetFileSpec
		iGetFileSpec
		iDir2File
		iSearch *system call (on VMS)
			*depends on various system calls on DOS:
				iOSRenameFile *(system call)
				iOSDeleteFile *(system call)
				iOSGetDirectory *(system call)
				iOSCheckDirectory *(system call)
				iOSSpawnCmd *(system call)
				ExitCmd	*(system call)
 PROCEDURE:
	iSearch is used to check whether the directory exists.
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	   Added more documentation


iClean0 $SMEI/ucsd/gen/for/lib/bytes/iclean0.f
[Previous] [Next]
 NAME:
	iClean0
 PURPOSE:
	Cleans 'dirty' or 'NaN' REAL*4 zeros
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	function iClean0 (idirty)
 INPUTS:
	X	real	value to be checked
 OUTPUTS:
	X	real	set to zero if it was a dirty zero
	I	integer		0: if the was not modified
				1: if the input was set to zero
 CALLS:
	(none)
 CALLED BY:
	iFltArr
 SEE ALSO:
	Clean0, RClean, iCleanNaN
 RESTRICTIONS:
	Should be called with REAL*4 argument!
 PROCEDURE:
	A dirty zero is tested by the condition
		iand(idirty,Z'0000FF80') .eq. 0

	The NaN value is tested by
		iand(idirty,Z'0000FF80') .eq. 0
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iCleanNaN $SMEI/ucsd/gen/for/lib/bytes/icleannan.f
[Previous] [Next]
 NAME:
	iCleanNaN
 PURPOSE:
	Cleans 'dirty' or 'NaN' REAL*4 zeros
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	function iCleanNaN(iNaN)
 INPUTS:
	iNaN		integer
 OUTPUTS:
	iCleanNaN	integer		0: if the input was not modified
					1: if the input was set to zero
 CALLS:
	(none)
 CALLED BY:
	iFltArr
 SEE ALSO:
	Clean0, RClean, iClean0
 RESTRICTIONS:
	Should be called with REAL*4 argument!
 PROCEDURE:
	The test
		if (iNaN .eq. Z'00008000'
	is used. Don't remember why.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


icompress $SMEI/ucsd/gen/for/lib/str/icompress.f
[Previous] [Next]
 NAME:
	icompress
 PURPOSE:
	Remove spaces,tabs,nulls; returns length of remaining string
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	function icompress(cStr,cOut)
 INPUTS:
	cStr		character*(*)	string to be processed
 OUTPUTS:
	cOut		character*(*)	modified string
	icompress	integer		length non-trivial part of output string
 CALLED BY:
	Dbl2Str, Flt2Str, Int2Str, Int2StrSet, Pandora, bCompareStr, mkenv
 SEE ALSO:
	bCompareStr, itrim, iwhitespace, lowercase, uppercase
 RESTRICTIONS:
	The string is only tested for space, tab and null
 PROCEDURE:
	Each character in the string is converted separately.
 MODIFICATION HISTORY:
	JAN-1992, Paul Hick (UCSD); check for NULL added (some system procedures
		pad strings with NULs instead of blanks)


iDeleteLogical [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iDeleteLogical
 PURPOSE:
	Portable way of deleting 'logical' values
 CALLING SEQUENCE:
	function iDeleteLogical(cName)
 INPUTS:
	cName		character*(*)		name of symbol
 OUTPUTS:
	iDeleteLogical	integer			0: failed to delete logical
						1: succesful deleting logical
 CALLED BY:
	SetGipsy, SetLog2Dir, mkenv
 SEE ALSO:
	iDeleteSymbol [1], iDeleteSymbol [2], iGetLogical [1], iGetLogical [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iDeleteLogical [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iDeleteLogical
 PURPOSE:
	Portable way of deleting 'logical' values
 CALLING SEQUENCE:
	function iDeleteLogical(cName)
 INPUTS:
	cName		character*(*)		name of symbol
 OUTPUTS:
	iDeleteLogical	integer			0: failed to delete logical
						1: succesful deleting logical
 CALLS: ***
	LogModFile, itrim
 CALLED BY:
	SetGipsy, SetLog2Dir, mkenv
 SEE ALSO:
	iDeleteSymbol [1], iDeleteSymbol [2], iGetLogical [1], iGetLogical [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iDeleteSymbol [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iDeleteSymbol
 PURPOSE:
	Portable way of deleting 'symbol' values
 CALLING SEQUENCE:
	function iDeleteSymbol(cName,iTable)
 INPUTS:
	cName		character*(*)		name of symbol
	iTable		integer			not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iDeleteSymbol	integer			0: failed to delete symbol
						1: succesful deleting symbol
 CALLED BY:
	NODAT, ipsdt, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iGetLogical [1], iGetLogical [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iDeleteSymbol [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iDeleteSymbol
 PURPOSE:
	Portable way of deleting 'symbol' values
 CALLING SEQUENCE:
	function iDeleteSymbol(cName,iTable)
 INPUTS:
	cName		character*(*)		name of symbol
	iTable		integer			not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iDeleteSymbol	integer			0: failed to delete symbol
						1: succesful deleting symbol
 CALLS: ***
	LogModFile, itrim
 CALLED BY:
	NODAT, ipsdt, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iGetLogical [1], iGetLogical [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iDir2File $SMEI/ucsd/gen/for/lib/str/idir2file.f
[Previous] [Next]
 NAME:
	iDir2File
 PURPOSE:
	Convert a directory name to a file name
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iDir2File(cDir,cFile)
 INPUTS:
	cDir		character*(*)	Directory name to be converted
 OUTPUTS:
	cFile		character*(*)	File name after conversion
	iDir2File	integer		# useful characters in cFile
 CALLS: ***
	Str2Str, Str2StrSet, iGetDirectoryFragment, iGetFileSpec, iGetParentDirectory
	iSetFileSpec
 CALLED BY:
	iCheckDirectory
 SEE ALSO:
	iFile2Dir
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
	include		'str2str_inc.h'
 PROCEDURE:
	On VMS convert from
		UD1:[PHICK.SOFT.EXE]    to UD1:[PHICK.SOFT]EXE.DIR to 
	On Unix convert from
		/home/phick/soft/exe/   to /home/phick/soft/exe
	On DOS convert from
		C:\home\phick\soft\exe\ to C:\home\phick\soft\exe

	Failure occurs:
	If either file name or file type have non-zero length (except for . in file type)
	If there is no parent directory ??????
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD; pphick@ucsd.edu)


iFile2Dir $SMEI/ucsd/gen/for/lib/str/ifile2dir.f
[Previous] [Next]
 NAME:
	iFile2Dir
 PURPOSE:
	Convert from file name format to directory format
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iFile2Dir(cFile,cDir)
 INPUTS:
	cFile		character*(*)	File name to be converted
 OUTPUTS:
	cDir		character*(*)	Directory name after conversion
	iFile2Dir	integer		Length of directory name
					If the conversion fails then I=0 and cDir=' '
 CALLS: ***
	Str2Str, Str2StrSet, iFullFragment, iGetFileSpec, iSetFileSpec
 CALLED BY:
	SD, iCheckDirectory
 SEE ALSO:
	iDir2File
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
	include		'str2str_inc.h'
 PROCEDURE:
	On VMS convert from
		UD1:[PHICK.SOFT]EXE.DIR to UD1:[PHICK.SOFT.EXE]
	On Unix convert from
		/home/phick/soft/exe    to /home/phick/soft/exe/
	On DOS convert from
		C:\home\phick\soft\exe  to C:\home\phick\soft\exe\

	Failure occurs:
	On VMS when the file name has a zero zero length or the file type is not .DIR
	On DOS and Unix when both file name and and file type have zero length
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD; pphick@ucsd.edu)
	    Added check for hidden directories for Unix
	    Set return value to ' ' on failure


iFilePath $SMEI/ucsd/gen/for/lib/str/ifilepath.f
[Previous] [Next]
 NAME:
	iFilePath
 PURPOSE:
	Platform-independent construction of file name
 CATEGORY:
	Portability
 CALLING SEQUENCE:
	function iFilePath(cRootDir,nSub,cSub,cFile,cPathOut)
 INPUTS:
	cRootDir 	character*(*)	The 'root' or 'device' part of the file name
					If the string starts with cEnvi='$' then cRoot is interpreted
					as a logical, e.g. cRoot=cEnvi//'dat'. If the logical does not
					exist then the full cRoot (including cEnvi) is used. If cRoot
					is set to the cHome and cTemp strings defined in dirspec.h,
					then these also will be translated (even if they do not start
					with cEnvi, as on VMS). To generate a machine independent file
					name this almost always will be logical.
	nSub		integer		# entries in cSub to be processed (can be zero)
	cSub		character(*)*(*)list of subdirectories to be appended to cRoot
					usually this will list of string to copied literally. If an
					entry in the cSub array starts with the cEnvi character then a
					logical translation is attempted. If this is not succesfull
					then the cEnvi is stripped off, and the remainder is used.
	cFile		character*(*)	filename to be appended after the cSub entries.
 OUTPUTS:
	iFilePath	integer		# useful chars returned in cPath (=itrim(cPath))
	cPathOut 	character*(*)	the (hopefully) machine-independent file name
 CALLED BY:
	BList_NSO_NOAA, BList_WSO_NOAA, Connect, FileSelection, GIPSCAST, HERDISK
	OGetRecord, OSExitCmd, OpenTest, ReadG, SD_TREE, Say, SetGipsy, SetRotations
	Time2smei_eph, bTempFile, cFilePath, dailyips [1], dailyips [2], iHideLogical
	iOSgunzip, iReadG, iReadProxyMap, iReadProxyMapN, iWriteProxyMapN, jpl_close
	jpl_init, jpl_state, jpl_test, smei_base, smei_cal, smei_cal_build, smei_cal_c3mask
	smei_cal_get, smei_cal_init, smei_cal_write, smei_foreign, smei_frm_getfirst
	smei_frm_getlist, smei_frm_getnext, smei_frm_path, smei_get_glare, smei_get_lsff
	smei_get_starmask, smei_orb_get, smei_orb_write, smei_orbit_info2, smei_skyd_fts
	smei_skyd_init, smei_skyd_make, smei_skyd_sky
 EXAMPLE:
	cSub(1) = 'sub1'
	cSub(2) = 'sub2'
	I = iFilePath(cEnvi//'dat',2,cSub,'file.txt',cFileSpec)
	On VMS:
		$DAT logical defined as UD1:[PHICK.SOFT.DAT]
		cFileSpec = 'UD1:[PHICK.SOFT.DAT.SUB1.SUB2]FILE.TXT'
	On NT:
		$DAT logical defined as E:\DAT\
		cFileSpec = 'E:\DAT\SUB1\SUB2\FILE.TXT'
	on Unix/Linux:
		$dat logical defined as /mnt/dat/
		cFileSpec = '/mnt/dat/sub1/sub2/file.txt'
 CALLS: ***
	Str2Str, Str2StrSet, iGetLogical [1], iGetLogical [2], itrim, uppercase
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
	include		'str2str_inc.h'
 PROCEDURE:
 >	The concept of a logical comes from VMS. Logical translation is done using a few
	system calls. On NT, Unix and Linux the concept of a 'logical' does not really exist.
	Instead the 'logical' definitions are maintained in the file LOGFIL.TXT in the users home
	directory (in principle this would work on VMS also).
 >	The NT/Unix/Linux-style environment variable is the functional equivalent of
	a logical, but I have had problems tracking down the appropriate system calls for setting,
	deleting and translating environment variables. The approach with LOGFIL.TXT is the
	workaround. It is ugly, but it works.
 >	For a non-casesensitive OS (as identified by the setting of
	bOS__NotCaseSensitive in include file dirspec.h, the output is always
	converted to uppercase (e.g. NT, VMS).
 >	On NT and Unix/Linux the logical does not have to be defined with a trailing
	(back)slash, but for consistency it is better to add it:
	a directory string ending with a (back)slash is always treated as a 'directory'.
	If the (back)slash is not present it may be treated as a 'file'.
 MODIFICATION HISTORY:
	SEP-1998, Paul Hick (UCSD/CASS)
	AUG-1999, Paul Hick (UCSD/CASS)
		added option for cSub entries to be treated as logical if
		preceeded by cEnvi character ($); added documentation.
	AUG-1999, Paul Hick (UCSD; pphick@ucsd.edu)
		modified to allow input arg cFile to be the same as output arg cPathOut
 DEPENDENCY TREE:

 Str2Flt:
	itrim
	uppercase
	Int2Str
	Int2StrSet
	Say
		(see below)

 Say:	(FORSTR.F LOGMODFILE.F OSCALLS.F)
	uppercase
	itrim
	LocFirstLen
		LocFirst
	iGetLun
	iFilePath
		(see below)
	iGetSymbol
		itrim
		LogModFile
			itrim
			bGetLun
				iGetLun
			iFreeLun
			iOSRenameFile *(system call)
			iOSDeleteFile *(system call)
	OSExitCmd *(system call)

 iFilePath:	(FORSTR.F LOGMODFILE.F OSCALLS.F)
	Str2Str
		itrim
	Str2StrSet
	iGetLogical
		itrim
		LogModFile
			itrim
			bGetLun
				iGetLun
			iFreeLun
			iOSRenameFile *(system call)
			iOSDeleteFile *(system call)
	


iFileStructure $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iFileStructure
 PURPOSE:
	(Internal use only) Deconstruct file names into components
 CALLING SEQUENCE:
	entry iFileStructure(iD,FileSpec)
 INPUTS:
	integer		iD
 OUTPUTS:
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	iPutFileSpec
 SEE ALSO:
	iGetFileSpec, iSetFileSpec
 PROCEDURE:
	Entry point in iSetFileSpec
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iFltArr $SMEI/ucsd/gen/for/lib/io/ifltarr.f
[Previous] [Next]
 NAME:
	iFltArr
 PURPOSE:
	Read 2D-array ('map') from ASCII of BINARY file
 CALLING SEQUENCE:
	function iFltArr(cFile,nAct,W1,W2,fncW,ZFlag,N,nX,nY,nPad,Z)
 INPUTS:
	cFile		character*(*)	file to be read
	nAct		integer		each decimal digit is used to set some
					action. Least-significant digit is 0, etc.:
		Digit 0 : 0=read ASCII file,1=Byte,2=Int2,3=Int4,4=Real4
		Digit 1 : determines the orientation of the array (see PROCEDURE)
		Digit 2 : 0/1=treat values ZFlag in file as valid/invalid fnc-value (see PROCEDURE)
		Digit 3 : 1=the file is pre-read to determine # records
		Digit 4 : 1=swap bytes if nType > 0
		Digit 5 : 1=forces use of MVBITS for nType > 0
	W1,W2		real		`weighting factors'. Output array Z
					is a `weighted mean' of input array
					Z and the array ZR read from the file:
					Z(out) = W1*Z(in)+W2*ZR
					(e.g. if W1=0 and W2=1 then Z(out)=ZR)
	fncW		real		external function
					if W1=W2=0 then the external function
					fncW is used to evaluate Z(out)
					fncW is a real function of two real 
					arguments: Z(out) = fncW(Z(in),ZR)
	ZFlag		real		value used to indicate 'no fnc-value
					available' (see PROCEDURE)
	N		integer		maximum permitted array size
	nX, nY		integer		requested array dimension of output
					array. If set to 0, values are 
					determined from the file (see PROCEDURE)
	nPad(4)		integer		info on padding of rows and columns 
					using BadR4(): 0=Left,1=Right,2=Bottom,3=Top
 OUTPUTS:
	iFltArr		integer		0=Failure, or length of file name
	cFile		character*(*)	if iFltArr .ne. 0: full file name
	nX, nY		integer		array dimensions
	Z(nX,nY)	real		array read from file
 CALLED BY:
	ExpandSW, MKVTRACE, READ_HOS, iReadProxyMap, iReadProxyMapN
 INCLUDE:
	include		'filparts.h'
	include		'openfile.h'
	include		'str2str_inc.h'
 CALLS: ***
	ArrI4Zero, ArrR4Constant, ArrR4GetMinMax, ArrR4Mask, BadR4, FlipFlop, Flt2Str, Int2Str
	Int2StrSet, Say, Str2Flt, Str2Flt_Exp, Str2Flt_Format, Str2Str, Str2StrSet, bOpenFile
	iClean0, iCleanNaN, iFreeLun, itrim
 PROCEDURE:
 >	The specified file is opened using the bOpenFile procedure.
	Digit0 = 0: open as a sequential, formatted file (ascii file)
	Digit0 > 0: open as a sequential, unformatted file (binary file)
 >	Digit1 = 0,..,7: determines how the records in the file are
	mapped to the array. For Digit1<4 records are associated with rows
	in the output array. For Digit1>=4 records are associated with columns.
	In addition the value mod(Digit1,4) is used to flip the array upside
	down, or produce a mirror image, or both.
	If z(j,i) (j=1..nx,i=1..ny) is the j-th number in the i-th record
	(i.e. the file contains ny records with nx numbers each) and 
	if Z(j,i) (j=1..NX,i=1..NY) is the number in the J-th column and
	the I-th row of the output array.
	Digit1	= 0:	nx=NX, ny=NY;	z(j,i) -> Z(j,i)
		= 1:			z(j,i) -> Z(j,i) -> Z(NX+1-j,i)
		= 2:			z(j,i) -> Z(j,i) -> Z(j     ,NY+1-i)
		= 3:			Z(j,i) -> Z(j,i) -> Z(NX+1-j,NY+1-i)
	Digit1	= 4:	nx=NY, ny=NX;	z(j,i) -> Z(i,j)
		= 5:			z(j,i) -> Z(i,j) -> Z(NX+1-i,j)
		= 6:			z(j,i) -> Z(i,j) -> Z(i     ,NY+1-j)
		= 7:			z(j,i) -> Z(i,j) -> Z(NX+1-i,NY+1-j)
 >	Digit2 = 0: ZFlag is not used
	!! Special case: if Digit2=0, ZFlag=BadR4(), W1=0 and W2 nonzero,
	!! then the minimum in the file is determined and all values equal to this
	!!  minimum are set to BadR4().
	Digit2 = 1: values read from the file are checked for the value ZFlag.
	If the input Z is NOT BadR4() and the value from file is NOT ZFlag will
	the weighting W1,W2 or the function fncW be applied. Otherwise the ouput Z is
	set to BadR4().
 >	Digit 3 = 1: the file structure (nH by nV) is determined by pre-reading
	the file. nH is determined from the record length (binary files) or from
	a call to Str2Flt using the 1st record (ascii files). nV is set to
	the number of records in the file.
	Digit 3 = 0: no pre-read, nV=0 (IMPORTANT: if nX=0 or nY=0, or if nPad(i)=-1
	(i=1,2,3 or 4), then the file always be a pre-read to determine.
	nX,nY and nPad will be set using nH and nV.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS)
	OCT-1997, Paul Hick (UCSD/CASS; pphick@ucsd.edu), complete overhaul
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Changed declarations of iRec1, iTmp1 and bTmp from (unsigned)
	    'byte' to (signed) 'integer*1'.


iFourDigitYear [1] $SMEI/for/main/dailyips.f
[Previous] [Next]
 NAME:
	iFourDigitYear
 CALLING SEQUENCE:
	function iFourDigitYear(cYr)
 CALLS: ***
	Str2Flt
 CALLED BY:
	dailyips [1], dailyips [2]


iFourDigitYear [2] $SMEI/for/main/dailyips_new.f
[Previous] [Next]
 NAME:
	iFourDigitYear
 CALLING SEQUENCE:
	function iFourDigitYear(cYr)
 CALLS: ***
	Str2Flt
 CALLED BY:
	dailyips [1], dailyips [2]


iFreeAllLun $SMEI/ucsd/gen/for/lib/str/igetlun.f
[Previous] [Next]
 NAME:
	iFreeAllLun
 PURPOSE:
	Releases all logical units.
 CALLING SEQUENCE:
	entry iFreeAllLun()
 INPUTS:
	(none)
 OUTPUTS:
	(none)
 CALLS: ***
	itrim
 CALLED BY:
	Say
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are
	processed.
 PROCEDURE:
	See iGetLun
 MODIFICATION HISTORY:
	?, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iFreeLun $SMEI/ucsd/gen/for/lib/str/igetlun.f
[Previous] [Next]
 NAME:
	iFreeLun	
 PURPOSE:
	Release specified logical unit number
 CALLING SEQUENCE:
	entry iFreeLun(LU)
 INPUTS:
	LU	integer		(read-only) logical unit number to be processed
				a negative LU will attempt to close
				and delete the file (close(LU,status='DELETE')
				For positive LU the file is closed: close(LU)
 OUTPUTS:
	LU	integer		always returns FIL__NOUNIT
 CALLS: ***
	itrim
 CALLED BY:
	Average, BList_NSO_NOAA, BList_WSO_NOAA, BRead_WSO, Connect, DailyIPS_UCSD [1]
	DailyIPS_UCSD [2], ExpandSW, ExtractInsitu, Extractd, Extractd3d, GIPSCAST, GIPSIMP
	HERDISK, HOSInquire, HOSRead, HOSUpdate, HOSWrite, LogModFile, NODAT, OGetRecord
	OSExitCmd, OpenTest, Pandora, Pandora_Records, ReadG, ReadVIPS, ReadVIPSLOSCheck
	ReadVIPSLOSCheckn, ReadVIPSn, SD_TREE, Say, SortIPS, TheFit, Time2smei_eph, WR2DARR
	WriteI4GRD, WriteLOSD, WriteLOSY, WriteR4GRD, bOSFind, bOSFindClose, bReadNic
	bWriteNic, dailyips [1], dailyips [2], iFltArr, iGetLogical [1], iHOSInfo, iOpenFile
	iReadG, ice_read, ice_write, jpl_close, jpl_init, jpl_state, smei_base, smei_cal
	smei_cal_c3mask, smei_cal_get, smei_cal_group, smei_cal_init, smei_cal_read
	smei_cal_write, smei_frm_fts, smei_frm_getlist, smei_frm_path, smei_frm_read
	smei_frm_read_get_sdark, smei_frm_write, smei_get_glare, smei_get_lsff
	smei_get_starmask, smei_orb, smei_orb_cal_name, smei_orb_camera
	smei_orb_min_name, smei_orb_min_number, smei_orb_name, smei_orb_number
	smei_orb_read, smei_orb_time, smei_orb_version, smei_orb_write, smei_orbit_info2
	smei_sky_iread, smei_sky_read, smei_skyd, smei_skyd_fts, smei_skyd_go
	smei_skyd_init, smei_skyd_make, smei_skyd_sky, sprint
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are processed.
 PROCEDURE:
	See iGetLun
 MODIFICATION HISTORY:
	?, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iFullFragment $SMEI/ucsd/gen/for/lib/str/ifullfragment.f
[Previous] [Next]
 NAME:
	iFullFragment
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iFullFragment(cDir,cOut)		! cDir = [......]
 INPUTS:
	iSetFileSpec:

	cFile	character*(*)	file specification

	iGetFileSpec:

	nFirst	integer		first component to be extracted
	nLast	integer		last component to be extracted
 OUTPUTS:
 CALLS: ***
	itrim
 CALLED BY:
	iFile2Dir, iFileStructure, iGetDirectoryFragment, iGetFileSpec
	iGetParentDirectory, iGetTopDirectory, iSetFileSpec
 INCLUDE:
	include		'dirspec.h'
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetDefaultDir $SMEI/ucsd/gen/for/lib/str/igetdefaultdir.f
[Previous] [Next]
 NAME:
	iGetDefaultDir
 PURPOSE:
	Get current working directory
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iGetDefaultDir(cDir)
 INPUTS:
	(none)
 OUTPUTS:
	cDir	character*(*)		Fully qualified directory name current directory
 CALLS: ***
	iCheckDirectory, iGetFileSpec
 CALLED BY:
	HERDISK, SD, SetLog2Dir, iSetDefaultDir
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
 RESTRICTIONS:
 DEPENDENCY TREE:
	iGetDefaultDir
		iGetFilespec
		iCheckDirectory
 SIDE EFFECTS:
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	   Added more documentation


iGetDirectoryFragment $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iGetDirectoryFragment
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	entry iGetDirectoryFragment(iGet,cInOut)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	SD, SD_SCAN, SD_TREE, iDir2File
 INCLUDE:
 PROCEDURE:
	Entry point in iSetFileSpec

	0 = full
	1 = first fragment (top)
	2 = parent fragment
	3 = last fragment
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetFileSpec $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iGetFileSpec
 PURPOSE:
	Reconstruct file names into components
 CALLING SEQUENCE:
	entry iGetFileSpec(nFrst,nLast,cInOut)
 INPUTS:
	nFirst		integer		first component to be extracted
	nLast		integer		last component to be extracted
 OUTPUTS:
	iGetFileSpec	integer		Length of string returned in cFile
	cFile		character*(*)	File name components requested
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	Average, BList_NSO_NOAA, BList_WSO, BList_WSO_NOAA, BRead_WSO, Connect, Dust
	FileSelection, HERDISK, HOSRunningMean, NODAT, Peep, ReadVIPS, ReadVIPSLOSCheck
	ReadVIPSLOSCheckn, ReadVIPSn, SD, SD_TREE, SetGipsy, SetLog2Dir, SetRotations, SortIPS
	T3D_marker, T3D_marker_num, TheFit, bAskChar, bCompressNic, bHOSName, bOpenFile
	bTempFile, bWriteNic, dailyips [1], dailyips [2], iAskChar, iCheckDirectory
	iDir2File, iFile2Dir, iGetDefaultDir, iOSgunzip, iSetDefaultDir, iUniqueName
	ice_write, mkenv, rice, smei_Time2Split, smei_base, smei_cal, smei_cal_build
	smei_cal_get, smei_cal_group, smei_cal_init, smei_cal_read, smei_cal_write
	smei_foreign, smei_frm_base, smei_frm_fts, smei_frm_fts_base, smei_frm_getfirst
	smei_frm_getlist, smei_frm_getnext, smei_frm_ped_guess, smei_frm_read
	smei_frm_read_get_sdark, smei_frm_write, smei_orb, smei_orb_get, smei_skyd
	smei_skyd_fts, smei_skyd_init, smei_skyd_make, smei_skyd_sky, sprint
 SEE ALSO:
	iPutFileSpec, iSetFileSpec
 PROCEDURE:
 >	Entry point in iSetFileSpec
 >	Arguments 'nFrst' and 'nLast' should be set to one of the following
	constants defined in include file 'filparts.h':
		FIL__NODE		pick up from/upto node name (VMS only)
		FIL__DEVICE		pick up from/upto device name
		FIL__DIRECTORY		pick up from/upto directory
		FIL__NAME		pick up from/upto file name
		FIL__TYPE		pick up from/upto file type
		FIL__VERSION		pick up from/upto version number (VMS only)
 >	Setting nFrst=0 is the same as setting nFrst=FIL__NODE
 >	Setting nLast=0 is the same as setting nLast=FIL__VERSION
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetLogical [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iGetLogical
 PURPOSE:
	Portable way of retrieving 'logical' values
 CALLING SEQUENCE:
	function iGetLogical(cName,cValue)
 INPUTS:
	cName		character*(*)		name of logical
 OUTPUTS:
	iGetLogical	integer			0: failed to get value of logical
						1: succesful getting value of logical
	cValue		character*(*)		value of logical
 CALLED BY:
	FileSelection, HERDISK, READ_HOS, SD, SetGipsy, SetLog2Dir, bTempFile, iFilePath
	iHideLogical, iSearch, mkenv, smei_cal, smei_foreign, smei_frm_path, sprint
 INCLUDE:
	include		'filparts.h'
	include   	'dirspec.h'
 CALLS: ***
	iFreeLun, iGetLun, iOSSpawnCmd, iUniqueName, itrim
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetLogical [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iGetLogical
 PURPOSE:
	Portable way of retrieving 'logical' values
 CALLING SEQUENCE:
	function iGetLogical(cName,cValue)
 INPUTS:
	cName		character*(*)		name of logical
 OUTPUTS:
	iGetLogical	integer			0: failed to get value of logical
						1: succesful getting value of logical
	cValue		character*(*)		value of logical
 CALLED BY:
	FileSelection, HERDISK, READ_HOS, SD, SetGipsy, SetLog2Dir, bTempFile, iFilePath
	iHideLogical, iSearch, mkenv, smei_cal, smei_foreign, smei_frm_path, sprint
 INCLUDE:
	include   	'dirspec.h'
 CALLS: ***
	LogModFile, itrim
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetSymbol [1], iGetSymbol [2], iSetLogical [1], iSetLogical [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetLun $SMEI/ucsd/gen/for/lib/str/igetlun.f
[Previous] [Next]
 NAME:
	iGetLun	
 PURPOSE:
	Handle pool of logical numbers for opening files to avoid problems
	with using the same logical number to open different files.
 CALLING SEQUENCE:
	function iGetLun(cFile)
 INPUTS:
	cFile		character*(*)	file name
 OUTPUTS:
	iGetLun:	integer		assigned logical unit number; FIL__NOUNIT is returned
					if no unit numbers are available
 CALLS: ***
	itrim
 CALLED BY:
	BList_NSO_NOAA, BList_WSO_NOAA, BRead_WSO, Say, bGetLun, bOSFind, bOSFindClose
	iGetLogical [1], jpl_test, smei_cal_get, smei_cal_init, smei_cal_read
	smei_cal_write, smei_frm_fts, smei_frm_read, smei_frm_read_get_sdark
	smei_frm_write, smei_get_glare, smei_get_lsff, smei_get_starmask, smei_orb
	smei_orb_cal_name, smei_orb_camera, smei_orb_min_name, smei_orb_min_number
	smei_orb_name, smei_orb_number, smei_orb_read, smei_orb_time, smei_orb_version
	smei_orb_write, smei_sky_iread, smei_sky_read, smei_skyd_fts, smei_skyd_go
	smei_skyd_init, smei_skyd_make, smei_skyd_sky
 INCLUDE:
	include		'filparts.h'
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are processed.
 PROCEDURE:
 >	In general files should be opened using <A HREF="#BOPENFILE">bOpenFile</A>,
	which automatically assigns a unit number.
 >	A convenient way to release a unit number iU is by
		iU = iFreeLun(iU)
	This sets iU to FIL__NOUNIT, i.e. an 'invalid' unit number.
 >	An internal array LUStatus is maintained with elements set to
	0 (LU available) or 1 (LU in use).
 MODIFICATION HISTORY:
	?, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetParentDirectory $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iGetParentDirectory
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	entry iGetParentDirectory(cInOut)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	SD_SCAN, iDir2File
 PROCEDURE:
	Entry point in iSetFileSpec
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetSymbol [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iGetSymbol
 PURPOSE:
	Portable way of retrieving 'symbol' values
 CALLING SEQUENCE:
	function iGetSymbol(cName,cValue)
 INPUTS:
	cName		character*(*)		name of symbol
 OUTPUTS:
	iGetSymbol	integer			0: failed to get value of symbol
						1: succesful getting value of symbol
	cValue		character*(*)		value of symbol
 CALLED BY:
	HERDISK, NODAT, Pandora, SD, SD_SCAN, Say, bOpenFile, iHOSRead, iHOSWrite, libarg, mkenv
	sprint
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iSetLogical [1], iSetLogical [2]
	iSetSymbol [1], iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetSymbol [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iGetSymbol
 PURPOSE:
	Portable way of retrieving 'symbol' values
 CALLING SEQUENCE:
	function iGetSymbol(cName,cValue)
 INPUTS:
	cName		character*(*)		name of symbol
 OUTPUTS:
	iGetSymbol	integer			0: failed to get value of symbol
						1: succesful getting value of symbol
	cValue		character*(*)		value of symbol
 CALLS: ***
	LogModFile, itrim
 CALLED BY:
	HERDISK, NODAT, Pandora, SD, SD_SCAN, Say, bOpenFile, iHOSRead, iHOSWrite, libarg, mkenv
	sprint
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iSetLogical [1], iSetLogical [2]
	iSetSymbol [1], iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGetTopDirectory $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iGetTopDirectory
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	entry iGetTopDirectory(cInOut)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	SD
 INCLUDE:
 PROCEDURE:
	Entry point in iSetFileSpec
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iGridScan $SMEI/ucsd/gen/for/lib/grid/igridscan.f
[Previous] [Next]
 NAME:
	iGridScan
 PURPOSE:
	Counts the number of neighbours with valid function values
 CALLING SEQUENCE:
	function iGridScan(nX,nY,Z,rBad,NSIDE)
 INPUTS:
	nX,nY		integer		dimensions of input grid
	Z(nX,nY)	real		array of function values
					bad bins identified by BadR4()
	rBad		real		value indicating 'bad' bin
 OUTPUTS:
	iGridScan	integer		max # valid neighbours for empty bins
					If nMax= 0 then the whole array is empty
					If nMax=-1 then the whole array is valid
	NSIDE(nX,nY,-1:1,-1:1)
			integer*1
		NSIDE(I,J,0,0)	= -1	if function value available
				>= 0	# valid neighbours (if no function value available)
		NSIDE(I,J,IX,JX) (IX,IY=-1 or 1)
				= 0,1	if neigbour does not/does contain a  valid fnc value
					(only filled for empty bins)
 CALLED BY:
	GridFill, READ_HOS
 MODIFICATION HISTORY:
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu), extracted from GridFill
	JUL-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Changed type NSIDE from (unsigned) byte to (signed) integer*1.


iHideLogical $SMEI/ucsd/gen/for/lib/str/ihidelogical.f
[Previous] [Next]
 NAME:
	iHideLogical
 PURPOSE:
	Hides the value of a logical from a fully qualified file specification
 CATEGORY:
	String handling
 CALLING SEQUENCE:
	integer function iHideLogical(cStr,cStrHide)
 INPUTS:
	cStr		character*(*)	Fully-qualified file name
 OUTPUTS:
	cStrHide	character*(*)	File name with leading part replaced
					by the name of a logical.
	iHideLogical	integer		value of itrim(cStrHide)
 CALLS: ***
	iFilePath, iGetLogical [1], iGetLogical [2], itrim
 CALLED BY:
	Say, cHideLogical, smei_cal, smei_frm_base, smei_skyd, sprint
 INCLUDE:
	include			'dirspec.h'
	include			'filparts.h'
 RESTRICTIONS:
	Probably does not work on VMS
 PROCEDURE:
	If the input file is /home/soft/smei/test.txt, and
	logical $smei is defined as /home/soft/smei then the output
	string will be $smei/test.txt.
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iHOSArch $SMEI/for/lib/hos/ihosarch.f
[Previous] [Next]
 NAME:
	iHOSArch
 PURPOSE:
	For a given set of orbital Helios coordinates, try to determine
	on which architecture the numbers originated
 CATEGORY:
	I/O: HOS
 CALLING SEQUENCE:
	function iHOSArch(T,R,L)
 INPUTS: (read only)
	T	real	day of year (with time of day as fraction)
	R	real	heliocentric distance (AU)
	L	real	geocentric ecliptic longitude of the Sun
 OUTPUTS:
	iD	integer if the architecture was determined then the appropriate
			architecture bit is set (HOS__OS_VMS, HOS__OS_DOS
			or HOS__OS_UNIX) is set, and the other two are cleared.
			(Linux numbers are the same as DOS numbers so we don't need a Linux bit).
			In addition one of the spacecraft bits (HOS__AA or HOS__BB) is set.
			if the architecture could not be determined then all
			architecture and spacecraft bits are cleared (and iD=0 is returned).
 CALLS: ***
	BadR4, CvR4, HOSOrbID, Say, pInfR4
 CALLED BY:
	iHOSRead, iHOSWrite
 INCLUDE:
	include		'dirspec.h'
	include		'hos_e9.h'
 RESTRICTIONS:
	I don't think this is bullet proof, but it's pretty good.
 PROCEDURE:
	Most (but not all) of the Helios photometer files were written on VMS.
	When files are read on a different architecture then they where written on then
	the numbers need to be converted to native format.
	This function is applied to a set of orbital numbers just read from a file
	to decide what the architecture of origin is.
	Currently VMS, DOS, and Unix are potential candidates. Linux is implicitly
	supported (recognized as DOS).

	The current test consist of converting to each of the candidate architecture
	and checking the results.

	- first check whether the converted number are valid real*4 numbers by
	  comparing with BadR4() and pInfR4().

	If the numbers are valid, check for 'reasonable' values:
	- check the range of R: the Helios spacecraft moved between 0.3 and 1.0 AU
	  so we test whether R is in the range [0.25,1.05] AU. 
	- check the range of L: presumably the ecliptic longitude is between 0 and
	  360 degrees. Check for the range [-360,720].
	- check the range of T: presumably the day of year is between 0 and 366.
	  Check for the range [-400,800]

	If it passes both tests, call HOSOrbid to find the year and spacecraft
	that best fits the coordinates. This gives a minimum distance between actual
	and calculated orbital location.
 MODIFICATION HISTORY:
	MAY-2000, Paul Hick (UCSD; pphick@ucsd.edu)


iHOSInfo $SMEI/for/lib/hos/ihosinfo.f
[Previous] [Next]
 NAME:
	iHOSInfo
 PURPOSE:
	Get info about content of Helios file
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	function iHOSInfo(iOpen,cFile,iRecl,iSc,iYr,TMin,TMax,iD,Lst)
 INPUTS:
	iOpen	integer		passed to bOpenFile
	cFile	character*(*)	file name
 OUTPUTS:
	iHOSInfo
		integer		# records; if iR=0 there was an open error or the file was empty
	iRecl	integer		record length (4-byte longwords)
	iSc	integer		spacecraft ID (1=Helios A, 2=Helios B)
	iYr	integer		year
	TMin	real		start time (Doy)
	TMax	real		end time (Doy)
	iD	integer		describes the file content by setting/clearing bits
				according to the definitions in include file hos_e9.h
				Bits set/cleared are:
					HOS__P_*: set if photometer present
					HOS__C_*: set if color present
					HOS__F_*: set if filter present
					HOS__AA or HOS__BB: identified spacecraft (based on 1st record)
					HOS__NONORM: set if file unnormalized (based on 1st record)
					HOS__OS_*: identifies architecture where file was written
	Lst(3,11)		file contents;
		integer		 3 = 1+1+1 = colors U,B,V
				11 = 5+5+1 = (5 filters for phot 1) +
					     (5 filters for phot 2) +
					     (photometer 3)
 CALLED BY:
	Average, Connect, Dust, HERDISK, HOSPlot, HOSRunningMean, NODAT, Pandora, Peep, PrintAll
	TheFit
 INCLUDE:
	include		'filparts.h'
	include		'openfile.h'
	include		'hos_e9.h'
	include		'dirspec.h'
 CALLS: ***
	ArrI4Zero, HOSOrbID, Say, bOpenFile, cInt2Str, iArrI4Total, iFreeLun, iHOSRead, itrim
 RESTRICTIONS:
 >	iSc,iYr,Lst(1,12) are based on the first record of the file
 MODIFICATION HISTORY:
	JUN-1993, Paul Hick (UCSD)


iHOSRead $SMEI/for/lib/hos/ihosread.f
[Previous] [Next]
 NAME:
	iHOSRead
 PURPOSE:
	Read single record from Helios data file
 CATEGORY:
	I/O: Helios
 CALLING SEQUENCE:
	function iHOSRead(iD,iU,iRecl,iR,TT,PP,CC,FF,RR,LL,NN,ZZ)
 INPUTS:
	iD	integer		identifies data properties
				each bit identifies a property defined in include file hos_e9.h
				Bits are set by summing parameters defined in the include file.

				Bits set for input are for:
				- HOS__P_*: photometer selection
				- HOS__C_*: color selection
				- HOS__F_*: filter selection
				If any one of these bits is set then the first record following record
				iR matching the selection criteria is returned.
				If none of these bits is set then record iR is returned.

				- HOS__NOT: negates the photometer/color/filter selection

				- HOS__OS_*: only one of the architecture bits should be set to identify
				  the OS used to write the file. If none is set then iHOSArch is called
				  to try to identify the architecture.

	iU	integer		logical unit number for data file
	iRecl	integer		record length in (4-byte) long words
				The calling program usually sets these by a call to bOpenFile

	iR	integer		Selection criteria set: starting point for search for next record is iR+1
				No selection criteria: record number to be read
	NN	integer		# sectors to be returned in Z
				MUST BE EVEN. UNEVEN VALUES WILL BE ROUNDED DOWN TO AN EVEN VALUE
				Sectors 1..N/2     will be put in Z(1)..Z(N/2)
				Sectors 33-N/2..32 will be put in Z(N/2+1)..Z(N)
				SPECIAL CASE: N=1
				Can be used to pull out the intensity only for photometer 3
				(in this case ONLY the photometer 3 bit in iD should be set)
 OUTPUTS:
	iD	integer		HOS__OS_*: if no architecture bit was set on input, then iHOSArch will
				try to find the appropriate architecture bit If it fails all architecture
				bits are cleared.
				HOS__AA or HOS__BB: iHOSArch also sets or clears the spacecraft bit
				HOS__NONORM: is cleared or set if the color value is smaller or larger
				than 100, respectively

	iR	integer		Selection criteria set: On read error (or EOF), iR will be the record
				number of the last successfully read record. If read was OK, then iR
				will be the number of the record read successfully.
				No selection criteria: Same as the input value.

	TT	real		time (doy)
	PP	integer		photometer (1/2/3)
	CC	integer		color (1/2/3)
	FF	integer		filter (1..5) (if P=3 then F=4)(4=Clear,5=pB)
	RR	real		heliocentric distance (AU)
	LL	real		topocentric ecliptic longitude (deg) of the Sun
	ZZ(NN)	real		intensities
				IP=3: ZZ(1) = intensity, ZZ(2) = pB
 CALLS: ***
	ArrR4Bad, ArrR4Copy, ArrR4Mask, BadR4, CvI2, CvR4, CvSwap, Say, cInt2Str, iGetSymbol [1]
	iGetSymbol [2], iHOSArch, itrim, iwhitespace
 CALLED BY:
	Average, Connect, HOSRead, HOSUpdate, NODAT, Pandora, Pandora_Records, iHOSInfo
 INCLUDE:
	include		'hos_e9.h'
	include		'dirspec.h'
 RESTRICTIONS:
 >	Sectors are stored in Z in the same order as they are found in the file
	(consisten with normal sector numbers). Swapping sector ordering to modified
	sector numbers is done in HOSRead.
 >	iHOSRead always returns a color value of 1,2, or 3. If the record is read from
	an unnormalized file (as indicated by a color value > 100) then the no-normaliation
	bit in iD is set and the color value is adjusted.
 PROCEDURE:
	Records for the 90 degree photometers store data as follows:
		Day of year	real*4
		Photometer	integer*2
		Color		integer*2
		Distance	real*4
		Longitude Sun	real*4
		Intensities	real*4 array (2: intensity and pB)
	A 90 deg record is always 6 words long.

	Records for the 16 and 31 degree photometers store data as follows:
		Day of year	real*4
		Photometer	integer*2
		Color		integer*2
		Filter		integer*2
		Distance	real*4
		Longitude Sun	real*4
		Intensities	real*4 array (2,4,6,..,32)
	In the old days these data were stored in a structure, which was then written to file.
	Depending on how the program was compiled the structure may or may not be aligned on
	longword boundaries. If it is then a 2-byte word is inserted after the color entry.
	The default for the Helios data has always been to work with unaligned structures.
	Should a file be encountered containing aligned structures then the file can still be
	read by setting the symbol HOS_ALIGN.

	The first time iHOSRead or iHOSWrite is called, it checks for the existence of
	the symbol HOS_ALIGN. If found and HOS_ALIGN='1', then the records for the 16 and 31
	degree photometer are assumed to be aligned, i.e. a 2-byte dummy variable is inserted
	after the filter entry.
 MODIFICATION HISTORY:
	SEP-1998, Paul Hick (UCSD/CASS)
	MAY-2000, Paul Hick (UCSD/CASS), improved check for architecture
	DEC-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Fixed minor problem with checking error status of read statements
		The error check is now immediately after the read statement, rather
		than following the architecture check using the photometer value.


iHOSWrite $SMEI/for/lib/hos/ihosread.f
[Previous] [Next]
 NAME:
	iHOSWrite
 PURPOSE:
	Write a single record from Helios data file (entry point in iHOSRead)
 CATEGORY:
	I/O: Helios
 CALLING SEQUENCE:
	entry iHOSWrite(iD,iU,iRecl,iR,TT,PP,CC,FF,RR,LL,NN,ZZ)
 INPUTS:
	iD	integer		identifies data properties
				each bit identifies a property defined in include file hos_e9.h
				Bits are set by summing parameters defined in the include file.

				Bits used are for:
				- HOS__P_*: photometer selection (ignored if nS=1)
				- HOS__C_*: color selection
				- HOS__F_*: filter selection (ignored if nS=1)
				If any one of these bits is set then the record iR+1 is written.
				If none of these bits is set then record iR is written.
				- HOS__NONORM: 100 is added to the color if this bit is set 

	iU	integer		logical unit number for data file
	iRecl	integer		record length in (4-byte) long words (iRecl MUST be >=6)
				The record length determines how many sectors are written to file for
				the 16 and 31 deg photometers: if iRecl >= 7 then M = iRecl-5 sectors
				(sectors 1..,M/2 and sectors 33-M/2..32) are written.
				I.e. if iRecl = 37 then all 32 sectors are written.
				For the 90 deg photometer 2 'sectors' (intensity and pB) are written.
				If iRecl = 6 then a 90 deg photometer record should be specified (i.e.
				P = 3, since 16 and 31 deg photometer records won't fit.

	iR	integer		Selection criterion set: record number iR+1 is written
				No selection criterion: record number iR is written

	N	integer		# sectors in Z to be written to file
				MUST BE EVEN. UNEVEN VALUES WILL BE ROUNDED DOWN TO AN EVEN VALUE
				The first N entries in Z are written to file.
				Entries 1..N/2 correspond to sectors 1..N/2
				Entries N/2..N correspond to sectors 33-N/2..32
				These are fitted into the record consisten with the record length
				specified in iRecl (missing sectors will be padded with BadR4() values).
 OUTPUTS:
	iHOSWrite   integer	= 0: write was succesfull
				Otherwise, the write error code is returned (unequal 0)

	iR	integer		Selection criteria set: On write error, iR will be the same as the
				input value. If write was OK, then iR will be incremented by 1.
				No selection criteria: Same as the input value.
 CALLS: ***
	ArrR4Bad, ArrR4Copy, ArrR4Mask, BadR4, CvI2, CvR4, CvSwap, Say, cInt2Str, iGetSymbol [1]
	iGetSymbol [2], iHOSArch, itrim, iwhitespace
 CALLED BY:
	Average, Connect, HERDISK, HOSUpdate, HOSWrite, NODAT, Pandora, Pandora_Records
 SEE ALSO:
	iHOSRead
 RESTRICTIONS:
 >	Records are always written in the native format.
 >	Sectors are written in the same order as found in the Z-array. This ordering
	should be consistent with regular sector numbers. Swapping sectors from modified
	sector numbering to regular sector numbering is done in HOSWrite.
 >	If the no-normalization bit is set then the color value is set to 101,102 or 103.
	If not the value 1,2, or 3 is written into the file.
 PROCEDURE:
	The first time iHOSRead  or iHOSWrite is called, it checks for the existence
	of the symbol HOS_ALIGN. If found and HOS_ALIGN='1', then the records for the 16 and
	31 degree photometer are assumed to be aligned, i.e. a 2-byte dummy variable is
	inserted after the filter entry.
 MODIFICATION HISTORY:
	SEP-1998, Paul Hick (UCSD/CASS)
	MAY-2000, Paul Hick (UCSD/CASS), update
	DEC-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Modified the write statements so that bytes on each record not containing
		data are explicitly set to zero. This should elimate potential differences
		between files created on different operating systems. Especially Linux
		is inclined to write garbage if not explicitly told otherwise. This would
		not compromise the data, but is confusing when differencing files.


iLastFragment $SMEI/ucsd/gen/for/lib/str/ilastfragment.f
[Previous] [Next]
 NAME:
	iLastFragment
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iLastFragment(cDir,cOut)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocLast, itrim
 CALLED BY:
	iFileStructure, iGetDirectoryFragment, iGetFileSpec, iGetParentDirectory
	iGetTopDirectory, iSetFileSpec
 INCLUDE:
	include		'dirspec.h'
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iListAllLun $SMEI/ucsd/gen/for/lib/str/igetlun.f
[Previous] [Next]
 NAME:
	iListAllLun
 PURPOSE:
	List the status of logical unit (mainly used for debugging).
 CALLING SEQUENCE:
	entry iListAllLun()
 INPUTS:
	(none)
 OUTPUTS:
	(none)
 CALLS: ***
	itrim
 CALLED BY:
	LogModFile
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are processed.
 PROCEDURE:
	See iGetLun
 MODIFICATION HISTORY:
	?, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexChar $SMEI/ucsd/gen/for/lib/math/indexchar.f
[Previous] [Next]
 NAME:
	IndexChar
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexChar(N1,N2,M1,M2,cArr,INDX)
 INPUTS:
	N1,N2		integer		logical dimensions of arrays ARRIN and INDX
	M1,M2		integer		physical dimensions of arrays ARRIN and INDX
					(only the logical part of the array is indexed).
	cArr(M1:M2)*(*)	character	 array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer		index table
 CALLED BY:
	dailyips [1], dailyips [2]
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	Rank
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	1990, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexI2 $SMEI/ucsd/gen/for/lib/math/indexi2.f
[Previous] [Next]
 NAME:
	IndexI2
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexI2(N1,N2,M1,M2,ARRIN,INDX)
 INPUTS:
	N1,N2		integer		logical dimensions of arrays ARRIN and INDX
	M1,M2		integer		physical dimensions of arrays ARRIN and INDX
					(only the logical part of the array is indexed).
	ARRIN(M1:M2)	integer*2	array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer		index table
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	IndexI4, IndexR4, IndexR8, Rank, Sort2I2, SortI2
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	1990, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexI4 $SMEI/ucsd/gen/for/lib/math/indexi4.f
[Previous] [Next]
 NAME:
	IndexI4
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexI4(N1,N2,M1,M2,ARRIN,INDX)
 INPUTS:
	N1,N2		integer		logical dimensions of arrays ARRIN and INDX
	M1,M2		integer		physical dimensions of arrays ARRIN and INDX
					(only the logical part of the array is indexed).
	ARRIN(M1:M2)	integer		array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer		index table
 CALLED BY:
	ice_analyze, smei_skyd_fill, smei_skyd_flush, smei_skyd_sort
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	IndexI2, IndexR4, IndexR8, Rank, Sort2I4, SortI4
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	1990, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexI8 $SMEI/ucsd/gen/for/lib/math/indexi8.f
[Previous] [Next]
 NAME:
	IndexI8
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexI8(N1,N2,M1,M2,ARRIN,INDX)
 INPUTS:
	N1,N2		integer		logical dimensions of arrays ARRIN and INDX
	M1,M2		integer		physical dimensions of arrays ARRIN and INDX
					(only the logical part of the array is indexed).
	ARRIN(M1:M2)	integer*8	array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer		index table
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	IndexI2, IndexR4, IndexR8, Rank, Sort2I4, SortI4
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	FEB-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexR4 $SMEI/ucsd/gen/for/lib/math/indexr4.f
[Previous] [Next]
 NAME:
	IndexR4
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexR4(N1,N2,M1,M2,ARRIN,INDX)
 INPUTS:
	N1,N2		integer		logical dimensions of arrays ARRIN and INDX
	M1,M2		integer		physical dimensions of arrays ARRIN and INDX
					(only the logical part of the array is indexed).
	ARRIN(M1:M2)	real		array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer		index table
 CALLED BY:
	BListAll, Connect, HOSPlot, MKVTRACE, Pandora, SortIPS, SplineX, SplineY
	smei_frm_measle, smei_skyd_combine
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	IndexI2, IndexI4, IndexR8, Rank, Sort2R4, SortR4
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	1990, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IndexR8 $SMEI/ucsd/gen/for/lib/math/indexr8.f
[Previous] [Next]
 NAME:
	IndexR8
 PURPOSE:
	Return index table for given one-dimensional array
 CATEGORY:
	Math: sorting
 CALLING SEQUENCE:
	subroutine IndexR8(N1,N2,M1,M2,ARRIN,INDX)
 INPUTS:
	N1,N2		integer			logical dimensions of arrays ARRIN and INDX
	M1,M2		integer			physical dimensions of arrays ARRIN and INDX
						(only the logical part of the array is indexed).
	ARRIN(M1:M2)	double precision	array to be indexed
 OUTPUTS:
	INDX(M1:M2)	integer			index table
 CALLED BY:
	TheFit
 SIDE EFFECTS:
	The part of the index array INDX outside the logical range (i.e.
	[M1:N1-1] and [N2+1,M2]) remains untouched
 RESTRICTIONS:
	The index range [N1,N2] must be a subset of [M1,M2]
 SEE ALSO:
	IndexI2, IndexI4, IndexR4, Rank, Sort2R8, SortR8
 PROCEDURE:
	Only the part ARRIN(N1:N2) is indexed. The array index values [N1,N2]
	are arranged in INDX(N1:N2) in such a way that after indexing INDX(N1)
	contains the array index of the smallest element of ARRIN(N1:N2) and
	INDX(N2) the array index of the largest element of ARRIN(N1:N2).
	Generalization of the heapsort indexing subroutine in Press et al.,
	"Numerical Recipes", Cambridge UP (1989), Chapter 8, p. 233.
 MODIFICATION HISTORY:
	1990, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


inside_area $SMEI/ucsd/gen/for/lib/gen/inside_area.f
[Previous] [Next]
 NAME:
	inside_area
 PURPOSE:
	Check whether point is inside area bound by straight lines
 CATEGORY:
	gen/for/lib/forgen.f
 CALLING SEQUENCE:
	logical function inside_area(x,y,x0,y0,n,xx,yy)
 INPUTS:
	x	double precision	x-coordinate of test point
	y	double precision	y-coordinate of test point
	x0	double precision	x-coordinate of point inside area
	y0	double precision	y-coordinate of point inside area
	n	double precision	number of straigh bounday segments
	xx(*)	double precision	x-coordinates of intersections
	yy(*)	double precision	y-coordinates of intersections
					(i.e. xx,yy are the corner points)
					The corners must be specified in clockwise
					or counter-clockwise order.
 OUTPUTS:
	inside_area	logical		.TRUE. if inside; .FALSE if outside
 CALLED BY:
	smei_skyd_pixel
 RESTRICTIONS:
	The angle where the straight lines intersect must all be
	less than 180 degrees.
 PROCEDURE:
	The most common application probably is to a square are. (x0,y0) is
	the center of the square; (xx,yy) are the four corners.
	For each of the straight boundary segments it is determined whether
	(x,y) is on the same side of the line as the point (x0,y0) known
	to lie inside the square. If this is true for all segments than
	the point lies inside the bounded area.
	The algorithm breaks down when the angle between line segments
	at the corner points are larger than 180 degree.
 MODIFICATION HISTORY:
	MAR-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


Int2Str $SMEI/ucsd/gen/for/lib/str/int2str.f
[Previous] [Next]
 NAME:
	Int2Str
 PURPOSE:
       Write integer to string using constraints set by Int2StrSet
 CATEGORY:
       Strings: write integer into string
 CALLING SEQUENCE:
	function Int2Str(I,cInt)
 INPUTS:
	I		integer		integer to be processed
 OUTPUTS:
	Int2Str		integer		length non-trivial part of output string
	cInt		character*(*)	output string
 CALLS: ***
	icompress
 CALLED BY:
	BuildSourceSurface, Connect, Dbl2Str, Flt2Str, GridFill, HERDISK, HOSPlot_bCommand
	LOSClean, MAP_TZERO, Peep, ReadGIPS, ReadVIPS, ReadVIPSLOSCheck, ReadVIPSLOSCheckn
	ReadVIPSn, SD_SCAN, SetRotations, SortIPS, Str2Dbl, Str2Flt, Str2Flt_Crumbs
	Str2Flt_Exp, Str2Flt_FforI, Str2Flt_FmtCrumbs, Str2Flt_FmtNumbers
	Str2Flt_Format, Str2Flt_Int, Str2Flt_Mask, Str2Flt_XforA, Str2Int, T3D_fill_global
	T3D_fill_time, T3D_get, T3D_get_all, T3D_get_grid, T3D_get_mode, T3D_header
	T3D_iget, T3D_iset, T3D_marker, T3D_marker_num, T3D_set, T3D_set_mode, TheFit
	WriteI4GRD, WriteLOSY, WriteR4GRD, XCvarFormat, bCompressNic, bUncompressNic
	cInt2Str, dailyips [1], dailyips [2], iFltArr, iReadG, ice_read, ice_write, ipsd, ipsdt
	ipsg2, ipsg2s, ipsg2t, rice, smei_base, smei_cal, smei_cal_add, smei_cal_build
	smei_cal_c3mask, smei_cal_get, smei_cal_init, smei_cal_read, smei_cal_write
	smei_frm_base, smei_frm_getlist, smei_frm_ok, smei_get_glare, smei_orb, smei_skyd
	smei_skyd_combine, smei_skyd_fill, smei_skyd_flush, smei_skyd_fts
	smei_skyd_init, smei_skyd_make, smei_skyd_scan, smei_skyd_size, smei_skyd_sky
	smei_skyd_sort
 INCLUDE:
	include		'str2str_inc.h'
 PROCEDURE:
	Four constraints can be set with Int2Str:
	STR__TRIM:	  no leading or trailing blanks
	STR__LEFTADJUST:  no leading blanks
	STR__RIGHTADJUST: no trailing blanks
	STR__ZERORIGHTADJUST: no trailing blanks, zeroes instead of leading blanks
	The parameters are declared in include file str2str_inc.h)	
	The input integer is put in the output string subject to the
	constraints set by Int2StrSet.

	A sequence of Str2Str, Int2Str and Flt2Str calls can be used to build
	a string without explicitly referring to locations in the destination
	string:
	I = 0
	I = I+Str2Str(cStr1, cStrO(I+1:))
	I = I+Int2Str(iNum , cStrO(I+1:))
	I = I+Str2Str(cStr2, cStrO(I+1:))
 MODIFICATION HISTORY:
	JAN-1995, Paul Hick (UCSD)


Int2StrSet $SMEI/ucsd/gen/for/lib/str/int2str.f
[Previous] [Next]
 NAME:
	Int2StrSet
 PURPOSE:
	Set constraints to be used with Int2Str
 CATEGORY:
	Strings: write integer to string
 CALLING SEQUENCE:
	entry Int2StrSet(I)
 INPUTS:
	I		integer		mode: STR__TRIM, STR__LEFTADJUST, STR__RIGHTADJUST, STR__ZERORIGHTADJUST
 OUTPUTS:
	Int2StrSet	integer		previous setting of mode
 CALLS: ***
	icompress
 CALLED BY:
	Dbl2Str, Flt2Str, SetRotations, Str2Dbl, Str2Flt, Str2Flt_Exp, Str2Flt_FforI
	Str2Flt_Int, Str2Flt_Mask, Str2Flt_XforA, Str2Int, T3D_fill_global, T3D_fill_time
	T3D_get, T3D_get_all, T3D_get_grid, T3D_get_mode, T3D_header, T3D_iget, T3D_iset
	T3D_marker, T3D_marker_num, T3D_set, T3D_set_mode, XCvarFormat, iFltArr
 SEE ALSO:
	Str2StrSet
 PROCEDURE:
	Int2StrSet is an entry point in function Int2Str.
	Typically it is used before and after one or more Int2Str calls to
	restore a previously set insertion mode:

	iSet = Int2StrSet(STR__NOTRIM)		Set new insertion mode, save old one
	( calls to Int2Str )
	iSet = Int2StrSet(iSet)			Restore old insertion mode
 MODIFICATION HISTORY:
	JAN-1995, Paul Hick (UCSD)


iOpenFile $SMEI/ucsd/gen/for/os/linux/iopen_linux.f
[Previous] [Next]
 NAME:
	iOpenFile
 PURPOSE:
	(internal use only; called by bOpenFile)
	Open statemenst for direct/sequential, formatted/unformatted files
 CALLING SEQUENCE:
	function iOpenFile(iAct,cFile,nRecl)
 INPUTS: (passed from bOpenFile)
	iAct		integer		code passed from bOpenFile
	cFile		character*(*)	fully qualified file name
	nRecl		integer		record length in 4-byte longwords
					(not always used; see PROCEDURE)
 OUTPUTS:
	iOpenFile	integer		logical unit number assigned by iGetLun
					(=FIL__NOUNIT is open was unsuccessful)
	nRecl		integer		on success, record length in longwords
					on failure, input value is retained
 CALLED BY:
	bOpenFile
 INCLUDE:
	include		'dirspec.h'
	include		'openfile.h'
 CALLS: ***
	HOSInquire, Say, bGetLun, cInt2Str, iFreeLun
 PROCEDURE:
	Isolates the Fortran open statements needed by bOpenFile.

	For HELIOS files the record length is determined by HOSInquire

	Binary files are best opened as direct access, unformatted files. If the
	record length is not known or not fixed, then open with record length of
	1 byte (iRecl=1 and set the OPN__RECLBYTE bit). Then read each byte
	separately with 'read(iU,rec=iR) ibyte'.

	In principle, a binary file can be opened as a sequential, unformatted
	file, but apparently only if the file was written in a special way (at least
	for g77; see http://gcc.gnu.org/onlinedocs/g77/index.html
	Look under: Known causes of trouble with GNU Fortran/Missing Features/
	Portable unformatted files.)

	The open statements for sequential, formatted files (usually used to open
	plain ascii files) cannot include the RECL= keyword. Absoft for Linux
	will stop with error code 10025 (= RECL= only valid for direct acces files);
	g77 just quietly ignores the keyword, I think.

 WARNING:
	Do not add a call to iSearch to this function to check for the existence
	of cFile. This may interfere with a wildcard search using iSearch in progress
	in the calling procedure.
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS)
	DEC-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Removed 'recl=irecl' from open statements for sequential, formatted
		files (Absoft chokes on it).


iOSCheckDirectory $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSCheckDirectory
 PURPOSE:
	Check whether a directory exists
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSCheckDirectory(cDir)
 INPUTS:
	cDir	character*(*)	(incomplete) directory name
 OUTPUTS:
	cDir	character*(*)	if the directory exists, a (back)slash is added
				if it is not there already; if it does not exist
				the input value is returned unmodified
	iOSCheckDirectory
		integer		0: directory does not exist
				1: directory exists
 CALLS: ***
	CHDIR, GETCWD, itrim
 CALLED BY:
	iSearch
 INCLUDE:
	include		'filparts.h'
	include		'dirspec.h'
 RESTRICTIONS:
	Do NOT call this function directly. Instead use iSearch.
 PROCEDURE:
	Existence of the directory is tested by changing directory
	using CHDIR and checking its exit status. The current directory
	is saved using GETCWD and is restored before returning.
	There is an alternative way to check wheter a directory exists:
	    iDir = itrim(cDir)
	    bStatus = bOSFind(1,cDir(:iDir-1),1,cNamTmp)
	This involves spawning a subprocess.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSCopyFile $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSCopyFile
 PURPOSE:
	Copies a file
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSCopyFile(cFile1,cFile2)
 INPUTS:
	cFile1		character*(*)	file to be copied
	cFile2		character*(*)	new file name
 OUTPUTS:
	iOSCopyFile	integer		0: copy failed
					1: copy successful
 CALLS: ***
	Str2Str, iSearch, itrim
 INCLUDE:
	include		'filparts.h'
	include		'dirspec.h'
 PROCEDURE:
	Roundabout way of copying a file by passing a
	a cp command to the SYSTEM procedure.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSDeleteFile $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSDeleteFile
 PURPOSE:
	Delete a file
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSDeleteFile(cFile)
 INPUTS:
	cFile		character*(*)	file to be deleted
 OUTPUTS:
	iOSDeleteFile	integer		0: delete failed
					1: delete successful
 CALLS: ***
	UNLINK
 CALLED BY:
	BRead_WSO, LogModFile, bOSFind, bOSFindClose, smei_base, smei_cal, smei_frm_fts
	smei_frm_write, smei_orb_write, smei_skyd, smei_skyd_fts, smei_skyd_init
	smei_skyd_make, smei_skyd_sky, sprint
 PROCEDURE:
	Input is passed unmodified to UNLINK. Return status is determined
	from UNLINK exit status.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS); Added documentation
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Changed call to UNLINK from subroutine call to function call.
		The Absoft f. Linux compiler insists on function call; g77
		accepts both.


iOSGetDirectory $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSGetDirectory
 PURPOSE:
	Get a fully-qualified directory name, incl. drive and directory
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSGetDirectory(cDir)
 INPUTS:
	cDir		character*(*)	(incomplete) directory name
 OUTPUTS:
	cDir		character*(*)	complete directory name,
					incl. trailing backslash
	iOSGetDirectory	integer		0: if GETCWD failed
					1: if GETCWD succesful
 CALLS: ***
	GETCWD, itrim
 INCLUDE:
	include		'dirspec.h'
 RESTRICTIONS:
	Do NOT call this function directly. Instead use iSearch.
 PROCEDURE:
	Input is passed to GETCWD. Then a trailing (back)slash is
	appended if necessary.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSGetForeign $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSGetForeign
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 PURPOSE:
	Get command line arguments as single string
 CALLING SEQUENCE:
	function iOSGetForeign(L,cStr)
 INPUTS:
	(none)
 OUTPUTS:
	cStr		character*(*)	command line string
	L		integer		useful length of cStr (=itrim(cStr))
	iOSGetForeign	integer		0: no command line string (--> L=0)
					1: command line string present (L > 0)
 CALLS: ***
	itrim
 CALLED BY:
	ForeignArg, ForeignInput
 PROCEDURE:
	NARGC returns the number of command line arguments.
	These are picked up with GETARG and strung together in cStr
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSgunzip $SMEI/ucsd/gen/for/os/fnc/iosgunzip.f
[Previous] [Next]
 NAME:
	iOSgunzip
 PURPOSE:
	Unzip zip file
 CATEGORY:
	gen/for/os
 CALLING SEQUENCE:
	function iOSgunzip(cZipFile, cUnzippedFile)
 INPUTS:
	cZipFile	character*(*)	name of zipped file (with extension .gz)
 OUTPUTS:
	iOK		integer		0: unzip not succesfull
					1: unzip succesfull
	cUnzippedFile	character*(*)	name of unzipped file
					the file is created in $temp with the same filename
					as cZipFile with the prefix _tmp_ added.
 CALLS: ***
	Str2Str, iFilePath, iGetFileSpec, iOSSpawnCmd, iSetFileSpec
 CALLED BY:
	BRead_WSO, bOpenFile
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
 RESTRICTIONS:
	Input file name must have extension .gz
	The gzip executable should be located in $smei/gen/exe/linux
	Currently Linux and Windows is available.
	The environment variable smei must be defined in $HOME/LOGFIL.TXT
 PROCEDURE:
	cUnzippedFile is modified only if the unzip is successfull, i.e. the call
		iOK = iOSgunzip(cFile,cFile)
	is legal, and modifies cFile only after gzip has been executed.
 MODIFICATION HISTORY:
	APR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iOSProtect $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSProtect
 PURPOSE:
	Modify protection of a file
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSProtect(cFile,iProt,iCode)
 INPUTS:
	cFile		character*(*)	file to be protected
	iProt		integer		not used
	iCode		integer		not used
 OUTPUTS:
	iOSProtect	integer		always 1
 PROCEDURE:
	NOT IMPLEMENTED
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSRenameFile $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSRenameFile
 PURPOSE:
	Rename a file
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSRenameFile(cFile1,cFile2)
 INPUTS:
	cFile1		character*(*)	file to be renamed
	cFile2		character*(*)	new file name
 OUTPUTS:
	iOSRenameFile	integer		0: rename failed
					1: rename successful
 CALLS: ***
	RENAME
 CALLED BY:
	LogModFile, Pandora, bTempFile, sprint
 PROCEDURE:
	Input is passed unmodified to RENAME. Return status is determined
	from RENAME exit status.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS); Added documentation
	SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Changed call to RENAME from subroutine call to function call.
		The Absoft f. Linux compiler insists on a function call; g77
		accepts both.


iOSSetDirectory $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSSetDirectory
 PURPOSE:
	Change to a new working directory
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSSetDirectory(cDir)
 INPUTS:
	cDir	character*(*)	(incomplete) directory name
 OUTPUTS:
	iOSSetDirectory
		integer		0: change of directory failed
				1: change of directory successful
 CALLS: ***
	CHDIR
 CALLED BY:
	iSetDefaultDir
 RESTRICTIONS:
	Do NOT call this function directly. Use iSetDefaultDir..
 PROCEDURE:
	Input is passed unmodified to CHDIR. Return status is
	determined from CHDIR exit status.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iOSSpawnCmd $SMEI/ucsd/gen/for/os/linux/os_linux.f
[Previous] [Next]
 NAME:
	iOSSpawnCmd
 PURPOSE:
	Execute a single shell command
 CATEGORY:
	Machine-dependent functions: Linux, Unix
 CALLING SEQUENCE:
	function iOSSpawnCmd(Cmd,iNoWait)
 INPUTS:
	Cmd		character*(*)	shell command
	iNoWait		integer		(not used; kept for compatibility with VMS)
 OUTPUTS:
	iOSSpawnCmd	integer		0: error executing command
					1: command executed succesully
 CALLS: ***
	itrim
 CALLED BY:
	bOSFind, bOSFindClose, iGetLogical [1], iOSgunzip, smei_cal_write, smei_frm_write
	smei_orb, sprint
 PROCEDURE:
	The error status is determined from the return value of the SYSTEM call.
	Under NT the command string should include the prefix 'cmd /c'.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation


iParentFragment $SMEI/ucsd/gen/for/lib/str/iparentfragment.f
[Previous] [Next]
 NAME:
	iParentFragment
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iParentFragment(cDir,cOut)	! cDir = [........]
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocLast, itrim
 CALLED BY:
	iFileStructure, iGetDirectoryFragment, iGetFileSpec, iGetParentDirectory
	iGetTopDirectory, iSetFileSpec
 INCLUDE:
	include		'dirspec.h'
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iProcessNagoya $SMEI/for/lib/ireadnagoya.f
[Previous] [Next]
 NAME:
	iProcessNagoya
 PURPOSE:
	Used as external function in 1st argument of ReadVIPS
 CALLING SEQUENCE:
	entry iProcessNagoya(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
 INPUTS:
	See documentation for ReadVIPS.
 OUTPUTS:
	See documentation for ReadVIPS.
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, POINT_ON_LOS, ReadVIPSCheckData
	SunNewcomb, XMAP_SC_POS
 CALLED BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 SEE ALSO:
	iReadNagoya
 EXTERNAL BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 PROCEDURE:
	Entry point in iReadNagoya.
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iProcessNagoyan $SMEI/for/ipsdt/ireadnagoyan.f
[Previous] [Next]
 NAME:
	iProcessNagoyan
 PURPOSE:
	Used as external function in 1st argument of ReadVIPS
 CALLING SEQUENCE:
	entry iProcessNagoyan(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		cSrc,nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
 INPUTS:
	See documentation for ReadVIPS.
 OUTPUTS:
	See documentation for ReadVIPS.
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, POINT_ON_LOS, SunNewcomb, XMAP_SC_POS
 CALLED BY:
	ipsdt
 SEE ALSO:
	iReadNagoya
 PROCEDURE:
	Entry point in iReadNagoya.
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iProcessOoty $SMEI/for/lib/ireadooty.f
[Previous] [Next]
 NAME:
	iProcessOoty
 PURPOSE:
	Used as external function in 1st argument of ReadVIPS
 CALLING SEQUENCE:
	entry iProcessOoty(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
 INPUTS:
	See documentation for ReadVIPS.
 OUTPUTS:
	See documentation for ReadVIPS.
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS
	SunNewcomb, XMAP_OBS_POS, XMAP_SC_POS, cosd
 CALLED BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 SEE ALSO:
	iReadOoty
 EXTERNAL BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 PROCEDURE:
	Entry point in iReadOoty
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iProcessOotyn $SMEI/for/ipsdt/ireadootyn.f
[Previous] [Next]
 NAME:
	iProcessOotyn
 PURPOSE:
	Used as external function in 1st argument of ReadVIPS
 CALLING SEQUENCE:
	entry iProcessOotyn(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		cSrc,nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
 INPUTS:
	See documentation for ReadVIPS.
 OUTPUTS:
	See documentation for ReadVIPS.
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS
	SunNewcomb, XMAP_OBS_POS, XMAP_SC_POS, cosd
 CALLED BY:
	ipsdt
 SEE ALSO:
	iReadOoty
 PROCEDURE:
	Entry point in iReadOoty
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iProcessUCSD $SMEI/for/lib/ireaducsd.f
[Previous] [Next]
 NAME:
	iProcessUCSD
 PURPOSE:
	Used as external function in 1st argument of ReadVIPS
 CALLING SEQUENCE:
	entry iProcessUCSD(iR,nCar,JDCar,NCoff,XCend,Radius,
     &		nYr,Doy,XCsc,XCobs,xLat,xVV,xGG,dRA,
     &		rLngSun,rDisSun,rLngP,rLatP,rEloP)
 INPUTS:
	See documentation for ReadVIPS.
 OUTPUTS:
	See documentation for ReadVIPS.
 CALLS: ***
	BadR4, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS, SunNewcomb
	XMAP_SC_POS, cosd
 SEE ALSO:
	iReadUCSD
 PROCEDURE:
	Entry point in iReadUCSD
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IPSBase $SMEI/ucsd/gen/for/lib/gen/ipsbase.f
[Previous] [Next]
 NAME:
	IPSBase
 PURPOSE:
	Calculate line of sight weight for IPS
 CATEGORY:
	gen/for/lib/gen
 CALLING SEQUENCE:
	real function IPSBase(freq,theta,zdist)
 INPUTS:
	freq		real	observing frequency (MHz)
	theta		real	source size (arcsec)
	zdist		real	distance along line of sight (AU)
 OUTPUTS:
	IPSBase		real	ISP weight
 CALLS: ***
	IPSFuncQ, Simpson
 CALLED BY:
	LOSWeights
 INCLUDE:
	include		'sun.h'
	include		'phys.h'
	include		'math.h'
 EXTERNAL TYPE:
	real		IPSFuncQ
 EXTERNAL:
	external	IPSFuncQ	! Spectral function
 COMMON BLOCKS:
	common	/FQIPS/	hachodz,thetadz
 PROCEDURE:
	Arguments freq and theta are best set by subroutine IPSConst
	The common block is shared between IPSBase and IPSFuncQ
	The code for the spectral function IPSFuncQ is included
 MODIFICATION HISTORY:
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Modification of STELab AIPS_WTF function


IPSConst $SMEI/ucsd/gen/for/lib/gen/ipsconst.f
[Previous] [Next]
 NAME:
	IPSConst
 PURPOSE:
	Return IPS-related constant for several observatories
 CATEGORY:
 CALLING SEQUENCE:
	subroutine IPSConst(ID,freq,theta)
 INPUTS:
	ID	integer		1=STELab IPS; 2=Cambridge IPS; 3=UCSD IPS
 OUTPUTS:
	freq	real		observing frequency (MHz)
	theta	real		source size (arcsec)
 CALLED BY:
	LOSWeights
 PROCEDURE:
   	1 = 327.0MHz : STELab, Nagoya Univ
	2 =  81.5MHZ : Cambridge Univ.
	3 =  73.8MHZ : UCSD
 MODIFICATION HISTORY:
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


IPSConstraints $SMEI/for/lib/ipsconstraints.f
[Previous] [Next]
 NAME:
	IPSConstraints
 PURPOSE:
	Set up data processing constraints for IPS tomography program
 CATEGORY:
	Tomography
 CALLING SEQUENCE:
	subroutine IPSConstraints(bForecast,I__VD,NitTotal,bBound,BINXmin,NitBad,iEorW,XElow,XEhigh,XRlim)
 INPUTS:
	bForeCast	logical		Forecast mode or regular mode (set by IPSProcessing)
	I__VD		integer		TOM__V: set constraints for V data
					TOM__G: set constraints for G data
	NitTotal	integer		# iterations (set by IPSProcessing)
 OUTPUTS:
	bBound		logical		? (never used this)
	BINXmin		real		minimum # of line-of-segments in a bin at the source surface
					needed to make a valid update
	NitBad		integer		iteration at which to throw away 'bad' sources
	iEorW		integer		use all data (0), east data only (1) or west data only (2)
	XElow		real		minimum elongation to be used
	XEhigh		real		maximum elongation to be used
	XRlim		real		maximum difference for RA with solar direction
 CALLS: ***
	AskI4, AskR4, AskWhat, AskYN, Flt2Str, Say
 CALLED BY:
	ipsg2, ipsg2s, ipsg2t
 INCLUDE:
	include		't3d_param.h'
 PROCEDURE:
	Lots of user prompts
 MODIFICATION HISTORY:
	NOV-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


ipsd $SMEI/for/main/ipsd.f
[Previous] [Next]
 NAME:
	ipsd
 PURPOSE:
	Tomographic reconstruction based on IPS velocity and g-level
	observations. The reconstruction is time-independent, but does
	not assume that a mod 360 degree heliosphere exists.
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
	program ipsd
 INPUTS:
	IPS data files
 OUTPUTS:
	ASCII files
 CALLS: ***
	AdjustJDCar, ArrI4Constant, ArrI4Zero, ArrR4Bad, ArrR4Constant, ArrR4Copy
	ArrR4SetMinMax, ArrR4TimesConstant, ArrR4Zero, AskI4, AskR4, AskR8, AskWhat, AskYN
	BField_Choose, BadR4, ConvertG2D, DATE_DOY, EARTH, ECLIPTIC_HELIOGRAPHIC
	ExtractInsitu, ExtractMap, FLINT8, FillMap, FixModel, Flt2Str, ForeignArg, ForeignFile
	Get3Dval, GridFill, GridSphere2D, Int2Str, Julian, Local2UT, MAP_TZERO, MapGrid, MkDMap
	MkGModel, MkLOSWeights, MkPos, MkShift, MkVMap, MkVModel, Mk_D2V, Mk_V2D, N_CARRINGTON
	ReadGIPS, ReadVIPS, ReadVIPSValidData, Say, SetGipsy, Str2Str, SunNewcomb, T3D_iset
	T3D_marker, T3D_set, T3D_set_mode, WR2DARR, Write3D_bb, Write3D_nv, WriteLOSD
	WriteLOSY, XMAP_SC_POS, iArrI4Total, iProcessNagoya, iProcessOoty, iReadNagoya
	iReadOoty, iReadProxyMap
 INCLUDE:
	include		'dirspec.h'
	include		'sun.h'
	include		't3d_array.h'
	include		't3d_index.h'
 EXTERNAL:
	external	iReadNagoya
	external	iProcessNagoya
	external	iReadOoty
	external	iProcessOoty
 	external 	EARTH
 PROCEDURE:
 >	The input IPS data are organized in either yearly files (Nagoya and Oooty
	data) or daily (Cambridge g-level data). Additional input are magnetic
	field data at the source surface (radial magnetic field only.)
 >	The Cambridge data are located using the logical $CAM. This is set
	interactively during the first run of the program. The definition is stored
	in the file LOGFIL.TXT in the user home directory (Linux) or the root of the
	C-drive (Windows). Once define, the only way to force the program to look in
	another directory is remove or modify the definition from LOGFIL.TXT.

 >	All other data (Nagoya, Ooty, UCSD and magnetic field data) are accessed
	by specifying their location as a command line argument:

	IPS data:
		nagoya=nagoya,/home/bjackson/dat/nagoya/yearly
		ooty=ooty,/home/bjackson/dat/nagoya/yearly
	Magnetic data (only one of these should be selected:
		wso=wso(4)_(3)_(1).dat,$DAT,map,xmdi
		wso_noaa=wso(4)_(3)_(1).dat,$DAT,map,xmdi

 >	Compile using g77 as:

	f77 -w -fdollar-ok -ffixed-line-length-none -I$for/h -I$for/h/linux
		ipsd.f -L$for -lgen -o$exe/ipsd

	The main features of this compilation are:
	- the environment variable $for and $exe need to be defined
	- generic include files are expected in $for/h
	- platform dependent include files are expected in $for/h/linux (for linux)
		or $for/h/win (for Win NT).
	- object libraries are expected in $for
	- the principal object library is libgen.a (Linux) or forgen.lib (Win NT)
	- the executable is created in $exe

   >	The modified Julian day MJD used for the IPS data is related to the
	regular Julian day (as used in subroutine Julian) by
		MJD = JD-2400000.5
	(i.e. the modified Julian day starts at midnight).
 MODIFICATION HISTORY:
	JUN-1992, Paul Hick (UCSD/CASS)
	NOV-1995, Bernie Jackson (STEL)
	MAR-1999, Bernie Jackson (UCSD)
	NOV-2001, Tamsen Dunn (UCSD)
		Added magnetic field and prepped for win/linux
	MAY-2002, Paul Hick (UCSD/CASS)
		Modified tail of program writing the 3D data files
		and the timeseries extraction. Main change involves reading
		of source surface magnetic maps, and subsequent writing
		of 3D magnetic field.
	AUG-2002, Paul Hick (UCSD/CASS)
		Added check for type of magnetic source maps.
	APR-2003, Paul Hick (UCSD/CASS)
		If no V (or G) deconvolution is requested and no V (or G) data are available
		then the requested deconvolution is now switched off, and deconvolution
		continues using only G (or V) data (instead of aborting the program).
	SEP-2003, Paul Hick (UCSD/CASS)
		Bug fix. For G-deconvolution only, with momentum conservation set. The
		source surface velocity map passed to the magnetic field was a constant
		velocity map, instead of the map derived from momentum conservation.
       MAY-2011, John Clover (UCSD/CASS)
               Changed density at 1AU to 1.5


ipsdt $SMEI/for/ipsdt/ipsdt.f
[Previous] [Next]
 NAME:
	ipsdt
 PURPOSE:
	Construct deconvolved synoptic maps for the IPS observations using
	a "time-dependent" technique that projects all observations to a
	single lower reference surface.  Note - uneven time cadences are
	allowed for velocity and density data sets.
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
	program ipsdt
 INPUTS:
	Data file $CAM:G*.
 OUTPUTS:
	Rectangular grid of data points
 CALLS: ***
	AdjustJDCar, ArrI4Constant, ArrR4Constant, ArrR4Copy, ArrR4GetMinMax, ArrR4Mask
	ArrR4SetMinMax, ArrR4TimesConstant, ArrR4Zero, AskI4, AskR4, AskR8, AskWhat, AskYN
	BField_Choose, BadR4, ConvertG2D, CopyDtoDVN, CopyVtoVDN, DATE_DOY, Deneq3, EARTH
	ECLIPTIC_HELIOGRAPHIC, Extractd, Extractd3d, FillMapL, FillMapOLS, FillMaptN
	FillWholeT, FixModeltdn, Flt2Str, ForeignArg, ForeignFile, Get4Dval, GridFill
	GridSphere2D, Int2Str, Julian, Local2UT, MAP_TZERO, MapGrid, MkDMaptdn, MkGModeltdn
	MkLOSWeights, MkPostd, MkShiftdn, MkTimes, MkVMaptdN, MkVModeltd, Mk_D2VN, Mk_V2DN
	N_CARRINGTON, ReadGIPS, ReadVIPSn, Say, SetGipsy, SunNewcomb, T3D_iset, T3D_set
	T3D_set_mode, TimeSmooth, Veleq3, Write3D_bbtt, XMAP_SC_POS, iDeleteSymbol [1]
	iDeleteSymbol [2], iProcessNagoyan, iProcessOotyn, iReadNagoyan, iReadOotyn
	iReadProxyMapN, write3D_infotd3D, writelosmap, writem_scomp
 INCLUDE:
	include		'sun.h'
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
	Latest 9/15/00 work - tried a copydtodv here and this filled
	the density matrix a lot better when it was placed just before write3dinfo - 
	There was no apparent change in extractd from the ea_file but maybe something 
	was different with ulysses.  At this stage, this program does not give exactly
	the same thing as the current version on the vax, but it is close.  Prior I tried
	using. Found an error 10/15/00 (A gridsphere2d was placed outside a do loop after 
	the first MKshiftd. This version should now have no seam in each temporal value.
	 
   >	The modified Julian day MJD used for the IPS data is related to the
	regular Julian day (as used in subroutine Julian) by
		MJD = JD-2400000.5
	(i.e. the modified Julian day starts at midnight).
   >	Once the logical $CAM is set (during the first run of IPSD2020), the
	only way to force IPSD2020 to look in another directory is to delete the
	logical $CAM.
 MODIFICATION HISTORY:
	JUN-1992, Paul Hick (UCSD)
       NOV-1995, Bernie Jackson (STEL)
	March-1999 Bernie Jackson (UCSD)
	June -1999 Bernie Jackson (UCSD)
	August -1999 Bernie Jackson (UCSD)
	Jan/Feb 2001 Bernie Jackson (UCSD)
	Mar 2001 Bernie Jackson (UCSD)


IPSFuncQ $SMEI/ucsd/gen/for/lib/gen/ipsfuncq.f
[Previous] [Next]
 NAME:
	IPSFuncQ
 CALLING SEQUENCE:
	real function IPSFuncQ(q)
 CALLED BY:
	AIPS_WTF, IPSBase
 EXTERNAL BY:
	AIPS_WTF, IPSBase
 COMMON BLOCKS:
	common	/FQIPS/	hachodz,thetadz
!$omp threadprivate(/FQIPS/)
 INCLUDE:
	include		'math.h'
 MODIFICATION HISTORY:


ipsg2 $SMEI/for/main/ipsg2.f
[Previous] [Next]
 NAME:
	ipsg2
 PURPOSE:
	Deconvolve IPS observations
 CATEGORY:
	program ipsg2
 CALLING SEQUENCE:
	run $exe:ipsg2
 INPUTS:
	IPS data files
 OUTPUTS:
	t3d* files in current directory
 CALLS: ***
	ArrR4Constant, ArrR4Copy, ArrR4Function, ArrR4Mask, ArrR4TimesArrR4, AskR4, BadR4
	BuildSourceSurface, CvD2G, CvG2D, Flt2Str, ForeignArg, ForeignFile, GridFill
	GridSphere2D, IPSConstraints, IPSProcessing, Int2Str, LOSClean, LOSIntegralG
	LOSIntegralV, LOSPosition, LOSProjection, LOSReach, LOSSanityCheck, LOSTweak
	LOSWeights, LocFirst, MapGrid, MkD2V, MkV2D, ReadGIPS, ReadVIPS, ReadVIPSValidData
	SW_Model_Kinematic, Say, SetGrid, StopWatch, Str2Str, T3D_get_grid, T3D_iget, T3D_iset
	T3D_marker, T3D_set, T3D_show, Write3D_nv_UT, Write3D_nv_XC, WriteLOSD, WriteLOSY
	iArrI4Total, iProcessNagoya, iProcessOoty, iReadNagoya, iReadOoty, itrim
 INCLUDE:
	include		'dirspec.h'
	include		't3d_param.h'
	include		't3d_array.h'
	include		't3d_index.h'
 EXTERNAL:
	external	iReadNagoya
	external	iProcessNagoya	! Passed to ReadVIPS
	external	iReadOoty
	external	iProcessOoty
 PROCEDURE:
 > !!!	Normalized densities are used throughout.
	These are defined as n*r^2 with n the density in cm^-3 and r the heliocentric
	distance in AU. Typical values would be in the range 1-10.
 > !!!	Velocities are in km/s

 >	The modified Julian day MJD used for the IPS data is related to the
	regular Julian day (as used in subroutine Julian) by
		MJD = JD-2400000.5
	(i.e. the modified Julian day starts at midnight).
 >	Once the logical $CAM is set (during the first run of IPSD), the
	only way to force IPSD to look in another directory is to delete it.

	II = iand(I__MODE,TOM__MOD):

	LOSReach:
	uses I__MODE to stop execution when LOS segments fall outside
	the range [XCbegMAT,XCendMAT] (only if II = 0).

	SW_Model_Kinematic:
	uses I__MODE three times to deal with mod(XCendMAT-XCbegMAT) issues (if II != 0)
	and twice to avoid array index errors (if II = 0).
	The 2nd of these latter is the only place in the NOMOD scheme where a
	rather ugly kludge is needed.

	LOSIntegralG, LOSIntegralV
	passes I__MODE to Get3DValue

	LOSProjection
	passes I__MODE to Get3DValue

	BuildSourceSurface
	uses I__MODE to map XC values into the range [XCbegMAT,XCendMAT] (II != 0 only).

	POTENTIAL MODIFICATIONS/IMPROVEMENTS:

	The first and last grid point in longitude and latitude now are located
	on the edges of the interval covered. It makes more sense to put the grid
	at bin centers instead. E.g. at a 10 degree resolution the latitude grid
	now is located at -90,-80,...,80,90. It should be located at -85,-75,75,85.
	This is probably fairly easy to fix in the Fortran tomography program.
	It may be more difficult to adapt the IDL visualization programs.

	Switch all Carrington variables (time and longitude) to double precision
 MODIFICATION HISTORY:
	JUN-1992, Paul Hick (UCSD)
		point-P synoptic map program
	NOV-1995, Bernie Jackson (STEL)
		conversion to tomography program
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		subtantial rewrite. Program now uses g^2 rather than density.


ipsg2s $SMEI/user/pphick/for/main/ipsg2s.f
[Previous] [Next]
 NAME:
	ipsg2s
 PURPOSE:
	Deconvolve IPS observations; (quasi-) time-independent.
 CATEGORY:
	program ipsg2s
 CALLING SEQUENCE:
	run $exe:ipsg2s
 INPUTS:
	IPS data files
 OUTPUTS:
	t3d* files in current directory
 CALLS: ***
	ArrR4Constant, ArrR4Copy, ArrR4Function, ArrR4Mask, ArrR4TimesArrR4, AskR4, BadR4
	BuildSourceSurface, CvD2G, CvG2D, Flt2Str, ForeignArg, ForeignFile, GridFill
	GridSphere2D, IPSConstraints, IPSProcessing, Int2Str, LOSClean, LOSIntegralG
	LOSIntegralV, LOSPosition, LOSProjection, LOSReach, LOSSanityCheck, LOSTweak
	LOSWeights, LocFirst, MapGrid, MkD2V, MkV2D, ReadGIPS, ReadVIPS, ReadVIPSValidData
	SW_Model_Kinematic, Say, SetGrid, StopWatch, Str2Str, T3D_get_grid, T3D_iget, T3D_iset
	T3D_marker, T3D_set, T3D_show, Write3D_bb, Write3D_bb_UT, Write3D_nv, Write3D_nv_UT
	WriteLOSD, WriteLOSY, iArrI4Total, iProcessNagoya, iProcessOoty, iReadNagoya
	iReadOoty, itrim
 INCLUDE:
	include		'dirspec.h'
	include		't3d_param.h'
	include		't3d_array.h'
	include		't3d_index.h'
 EXTERNAL:
	external	iReadNagoya
	external	iProcessNagoya		! Passed to ReadVIPS
	external	iReadOoty
	external	iProcessOoty
 PROCEDURE:
 > !!!	Normalized densities are used throughout.
	These are defined as n*r^2 with n the density in cm^-3 and r the heliocentric
	distance in AU. Typical values would be in the range 1-10.
 > !!!	Velocities are in km/s

 >	The modified Julian day MJD used for the IPS data is related to the
	regular Julian day (as used in subroutine Julian) by
		MJD = JD-2400000.5
	(i.e. the modified Julian day starts at midnight).
 >	Once the logical $CAM is set (during the first run of IPSD), the
	only way to force IPSD to look in another directory is to delete it.

	II = iand(I__MODE,TOM__MOD):

	LOSReach:
	uses I__MODE to stop execution when LOS segments fall outside
	the range [XCbegMAT,XCendMAT] (only if II = 0).

	SW_Model_Kinematic:
	uses I__MODE three times to deal with mod(XCendMAT-XCbegMAT) issues (if II != 0)
	and twice to avoid array index errors (if II = 0).
	The 2nd of these latter is the only place in the NOMOD scheme where a
	rather ugly kludge is needed.

	LOSIntegralG, LOSIntegralV
	passes I__MODE to Get3DValue

	LOSProjection
	passes I__MODE to Get3DValue

	BuildSourceSurface
	uses I__MODE to map XC values into the range [XCbegMAT,XCendMAT] (II != 0 only).

	POTENTIAL MODIFICATIONS/IMPROVEMENTS:

	The first and last grid point in longitude and latitude now are located
	on the edges of the interval covered. It makes more sense to put the grid
	at bin centers instead. E.g. at a 10 degree resolution the latitude grid
	now is located at -90,-80,...,80,90. It should be located at -85,-75,75,85.
	This is probably fairly easy to fix in the Fortran tomography program.
	It may be more difficult to adapt the IDL visualization programs.

	Switch all Carrington variables (time and longitude) to double precision
 MODIFICATION HISTORY:
	JUN-1992, Paul Hick (UCSD)
		point-P synoptic map program
	NOV-1995, Bernie Jackson (STEL)
		conversion to tomography program
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		subtantial rewrite. Program now uses g^2 rather than density.


ipsg2t $SMEI/user/pphick/for/main/ipsg2t.f
[Previous] [Next]
 NAME:
	ipsg2t
 PURPOSE:
	Deconvolve IPS observations
 CATEGORY:
	program ipsg2t
 CALLING SEQUENCE:
	run $exe:ipsgt
 INPUTS:
	IPS data files
 OUTPUTS:
	t3d* files in current directory
 CALLS: ***
	ArrR4Constant, ArrR4Copy, ArrR4Function, ArrR4Mask, ArrR4TimesArrR4, AskR4, BadR4
	BuildSourceSurface, CvD2G, CvG2D, Flt2Str, ForeignArg, ForeignFile, GridFill
	GridSphere2D, IPSConstraints, IPSProcessing, Int2Str, LOSClean, LOSIntegralG
	LOSIntegralV, LOSPosition, LOSProjection, LOSReach, LOSSanityCheck, LOSTweak
	LOSWeights, LocFirst, MapGrid, MkD2V, MkV2D, ReadGIPS, ReadVIPS, ReadVIPSValidData
	SW_Model_Kinematic, Say, SetGrid, StopWatch, Str2Str, T3D_get_grid, T3D_iget, T3D_iset
	T3D_marker, T3D_set, T3D_show, Write3D_bb, Write3D_bb_UT, Write3D_nv, Write3D_nv_UT
	WriteLOSD, WriteLOSY, iArrI4Total, iProcessNagoya, iProcessOoty, iReadNagoya
	iReadOoty, itrim
 INCLUDE:
	include		'dirspec.h'
	include		't3d_param.h'
	include		't3d_array.h'
	include		't3d_index.h'
 EXTERNAL:
	external	iReadNagoya
	external	iProcessNagoya		! Passed to ReadVIPS
	external	iReadOoty
	external	iProcessOoty
 PROCEDURE:
 > !!!	Normalized densities are used throughout.
	These are defined as n*r^2 with n the density in cm^-3 and r the heliocentric
	distance in AU. Typical values would be in the range 1-10.
 > !!!	Velocities are in km/s

 >	The modified Julian day MJD used for the IPS data is related to the
	regular Julian day (as used in subroutine Julian) by
		MJD = JD-2400000.5
	(i.e. the modified Julian day starts at midnight).
 >	Once the logical $CAM is set (during the first run of IPSD), the
	only way to force IPSD to look in another directory is to delete it.

	II = iand(I__MODE,TOM__MOD):

	LOSReach:
	uses I__MODE to stop execution when LOS segments fall outside
	the range [XCbegMAT,XCendMAT] (only if II = 0).

	SW_Model_Kinematic:
	uses I__MODE three times to deal with mod(XCendMAT-XCbegMAT) issues (if II != 0)
	and twice to avoid array index errors (if II = 0).
	The 2nd of these latter is the only place in the NOMOD scheme where a
	rather ugly kludge is needed.

	LOSIntegralG, LOSIntegralV
	passes I__MODE to Get3DValue

	LOSProjection
	passes I__MODE to Get3DValue

	BuildSourceSurface
	uses I__MODE to map XC values into the range [XCbegMAT,XCendMAT] (II != 0 only).

	POTENTIAL MODIFICATIONS/IMPROVEMENTS:

	The first and last grid point in longitude and latitude now are located
	on the edges of the interval covered. It makes more sense to put the grid
	at bin centers instead. E.g. at a 10 degree resolution the latitude grid
	now is located at -90,-80,...,80,90. It should be located at -85,-75,75,85.
	This is probably fairly easy to fix in the Fortran tomography program.
	It may be more difficult to adapt the IDL visualization programs.

	Switch all Carrington variables (time and longitude) to double precision
 MODIFICATION HISTORY:
	JUN-1992, Paul Hick (UCSD)
		point-P synoptic map program
	NOV-1995, Bernie Jackson (STEL)
		conversion to tomography program
	APR-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		subtantial rewrite. Program now uses g^2 rather than density.


IPSProcessing $SMEI/for/lib/ipsprocessing.f
[Previous] [Next]
 NAME:
	IPSProcessing
 PURPOSE:
	Set up data processing constraints for IPS tomography program
 CATEGORY:
	Tomography
 CALLING SEQUENCE:
	subroutine IPSProcessing(bForecast,NitTotal,bVcon,bVNago,bVOoty,bGcon,bGNago,bGCamb,bGOoty,bMV2)
 INPUTS:
	(none)
 OUTPUTS:
	bForecast	logical		Forecast mode or regular mode
	NitTotal	integer		# iterations
	bVcon		logical		.TRUE. if IPS V data are deconvolved; .FALSE. if not
	bVNago		logical		.TRUE.: use Nagoya V data		
	bVOoty		logical		.TRUE.: used Ooty V data
					If bVcon=.TRUE. either bVNago or bVOoty is set .TRUE.
					If bVcon=.FALSE., then bVNago and bVOoty are set .FALSE.
	bGcon		logical		.TRUE. if G-level data are deconvolved; .FALSE. if not
	bGNago		logical		.TRUE.: use Nagoya G data
	bGCamb		logical		.TRUE.: use Cambridge G data
	bGOoty		logical		.TRUE.: use Ooty G data
					If bGcon=.TRUE. either bGNago, bGCamb or bGOoty is set .TRUE.
					If bGcon=.FALSE., then also bGNagoy, bGCamb and bGOoty are set .FALSE.

	bMV2		logical		.TRUE.: use mv^2 is constant
					If bGcon=.FALSE. and bMV2=.TRUE. then the density at the source surface
					is calculated using mv^2=constant
					If bVcon=.FALSE. and bMV2=.TRUE. then the velocity at the source surface
					is calculated using mv^2=constant
					If both bGcon=.TRUE. and bVcon=.TRUE. then bMV2=.FALSE.
 CALLS: ***
	AskI4, AskWhat, AskYN
 CALLED BY:
	ipsg2, ipsg2s, ipsg2t
 INCLUDE:
 PROCEDURE:
	Lots of user prompts
 MODIFICATION HISTORY:
	NOV-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iPutFileSpec $SMEI/ucsd/gen/for/lib/str/iputfilespec.f
[Previous] [Next]
 NAME:
	iPutFileSpec
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iPutFileSpec(nFrst,nLast,cSpec)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	iFileStructure, iSetFileSpec
 CALLED BY:
	Average, Connect, FileSelection, HERDISK, NODAT, T3D_marker_num, TheFit, bCompressNic
	bOpenFile, bWriteNic, iUniqueName, ice_write
 INCLUDE:
	include		'filparts.h'	
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iReadG $SMEI/for/lib/ireadg.f
[Previous] [Next]
 NAME:
	iReadG
 PURPOSE:
	Read G values from unedited G*. files containing Cambridge IPS data
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
	function iReadG(cDat,iEdt,MJD,XG)
 INPUTS:
	cDat		character*(*)	logical name for data directory
	iEdt		integer		0 : read unedited files g*.
					1 : read edited files e*.dat
	MJD		integer		(read-only)
					modified Julian day (JD-2400000.5) for
					the requested file
 OUTPUTS: (NTIME=72,NDEC=14)
	iReadG		integer		= 0 if file was not opened succesfully
					= 1 if file was opened
					= 3 if file contained no valid points
	XG(NTIME,NDEC)	real		G-factors
	Each observation XG refers to a line of sight extending from Earth.
 CALLS: ***
	Int2Str, ReadGHD, bOpenFile, iFilePath, iFreeLun
 CALLED BY:
	WriteLOSD
 INCLUDE:
	include		'dirspec.h'
	include		'openfile.h'
 RESTRICTIONS:
 >	Input files are searched for in the directory assigned to logical $CAM
 >	Make sure to test iOK before using the output arrays (the arrays are
	not always cleared before returning; you may end up using the values
	from a previous call to iReadG)
 PROCEDURE:
	See ReadG
 MODIFICATION HISTORY:
	SEPT-1992, Paul Hick (UCSD), stripped version of ReadG.


iReadNagoya $SMEI/for/lib/ireadnagoya.f
[Previous] [Next]
 NAME:
	iReadNagoya
 CALLING SEQUENCE:
	function iReadNagoya(iU,iFirst)
 INPUTS:
	iU	integer		logical unit number of open IPS data file
	iFirst	integer		0 or 1. The value 1 resets the record counter
				back to one. The value 0 increments the counter by 1.
 OUTPUTS:
	(none)
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, POINT_ON_LOS, ReadVIPSCheckData
	SunNewcomb, XMAP_SC_POS
 CALLED BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 EXTERNAL BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 INCLUDE:
	include		'sun.h'
 EXTERNAL:
	external	EARTH
 PROCEDURE:
 >	Structure of Nagoya files:
	cSrce		string		descriptor for radio source
	iY,iM,iD	integer 	year, month and day of observation
	UT		real		universal time of day
	DP		real		heliocentric distance point P (AU)
	iTHR		integer		?? (only from 1990 - 1993)
	iHLA		integer		heliocentric ecliptic latitude point P
	iHLO		integer 	heliocentric longitude point P relative to
					Sun-Earth direction (i.e. a difference of
					ecliptic longitudes)
	iGLA,iGLO	integer		heliographic location point P (degrees)
	iROT		integer		Carrington rotation number
	iVEL		integer		IPS velocity (km/s)
	iDVEL		integer		error in velocity (km/s)
	SCINDX/G-VALUE	real		scintillation index (arbitrary units);
					present from 1990 to 1996) or G-value (after 1997)

	Record length of original Nagoya files:

	1990-1993: 73 chars
	1994-1996: 68 chars (no THR column)
	1997-1998: 66 chars (no THR, g-value instead of source index

	In the processed files, iTHR has been omitted, and the source
	index has been replaced by zero (i.e. results in a zero g-value)
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iReadNagoyan $SMEI/for/ipsdt/ireadnagoyan.f
[Previous] [Next]
 NAME:
	iReadNagoyan
 CALLING SEQUENCE:
	function iReadNagoyan(iU,iFirst)
 INPUTS:
	iU	integer		logical unit number of open IPS data file
	iFirst	integer		0 or 1. The value 1 resets the record counter
				back to one. The value 0 increments the counter by 1.
 OUTPUTS:
	(none)
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, POINT_ON_LOS, SunNewcomb, XMAP_SC_POS
 CALLED BY:
	ipsdt
 INCLUDE:
	include		'sun.h'
 EXTERNAL:
	external	EARTH
 PROCEDURE:
 >	Structure of Nagoya files:
	cSrce		string		descriptor for radio source
	iY,iM,iD	integer 	year, month and day of observation
	UT		real		universal time of day
	DP		real		heliocentric distance point P (AU)
	iTHR		integer		?? (only from 1990 - 1993)
	iHLA		integer		heliocentric ecliptic latitude point P
	iHLO		integer 	heliocentric longitude point P relative to
					Sun-Earth direction (i.e. a difference of
					ecliptic longitudes)
	iGLA,iGLO	integer		heliographic location point P (degrees)
	iROT		integer		Carrington rotation number
	iVEL		integer		IPS velocity (km/s)
	iDVEL		integer		error in velocity (km/s)
	SCINDX/G-VALUE	real		scintillation index (arbitrary units);
					present from 1990 to 1996) or G-value (after 1997)

	Record length of original Nagoya files:

	1990-1993: 73 chars
	1994-1996: 68 chars (no THR column)
	1997-1998: 66 chars (no THR, g-value instead of source index

	In the processed files, iTHR has been omitted, and the source
	index has been replaced by zero (i.e. results in a zero g-value)
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iReadOoty $SMEI/for/lib/ireadooty.f
[Previous] [Next]
 NAME:
	iReadOoty
 CALLING SEQUENCE:
	function iReadOoty(iU,iFirst)
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS
	SunNewcomb, XMAP_OBS_POS, XMAP_SC_POS, cosd
 CALLED BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 EXTERNAL BY:
	ipsd, ipsg2, ipsg2s, ipsg2t
 INCLUDE:
	include		'sun.h'
 EXTERNAL:
	external	EARTH
 PROCEDURE:
 >	Structure of Ooty files:
	iY,iM,iD	integer 	year, month and day of observation
	IST		integer		time of observation in IST - hr and min
					(the longitude difference between
					Greenwich and the IST longitude is 82.5
					deg corresponding to 5.5 hrs time difference. 
	UT		real		universal time (should be IST-5.5)
	cSrce		string		descriptor for radio source
	iRA50(3)	integer		1950 Right Ascension (h,m,s)
	iDEC50(3)	integer		1950 declination (deg,m,s)
	iRA(3)		integer		Right Ascension at equinox of date
	iDEC(3)		integer		declination at equinox of date
	ELO		real		source elongation (deg)
	SIZE		real		angular size of the compact component
					of the source (seconds of arc)
	iVEL		integer		IPS velocity (km/s)
	AR		real		axial ratio of the solar wind density
					irregularities
	SN		real		signal to noise ratio of the spectrum
	SCINDX		real		scintillation index
	GVAL		real		disturbance factor

	From an email by Janardhan Padmanabhan:

	I have selected only those sources in this list with elongations
	greater than or equal to 10 deg (the turnover in the m vs epsilon
	curve at 327 MHz is around 10 deg) and signal to noise greater than or
	equal to 10db. However, please note that source sizes derived for
	sources with S/N less than 15 db will have larger errors. Therefore
	if source sizes are an important input in your program, then use
	only data with S/N greater than or equal to 15 db.

	For 8 observations in the file I was unable to extract the scintillation
	indices. 7 of these are the august observations. I marked these in the
	list with a "N/A" (not available) in the last column.


iReadOotyn $SMEI/for/ipsdt/ireadootyn.f
[Previous] [Next]
 NAME:
	iReadOotyn
 CALLING SEQUENCE:
	function iReadOotyn(iU,iFirst)
 CALLS: ***
	BadR4, DATE_DOY, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS
	SunNewcomb, XMAP_OBS_POS, XMAP_SC_POS, cosd
 CALLED BY:
	ipsdt
 INCLUDE:
	include		'sun.h'
 EXTERNAL:
	external	EARTH
 PROCEDURE:
 >	Structure of Ooty files:
	iY,iM,iD	integer 	year, month and day of observation
	IST		integer		time of observation in IST - hr and min
					(the longitude difference between
					Greenwich and the IST longitude is 82.5
					deg corresponding to 5.5 hrs time difference. 
	UT		real		universal time (should be IST-5.5)
	cSrce		string		descriptor for radio source
	iRA50(3)	integer		1950 Right Ascension (h,m,s)
	iDEC50(3)	integer		1950 declination (deg,m,s)
	iRA(3)		integer		Right Ascension at equinox of date
	iDEC(3)		integer		declination at equinox of date
	ELO		real		source elongation (deg)
	SIZE		real		angular size of the compact component
					of the source (seconds of arc)
	iVEL		integer		IPS velocity (km/s)
	AR		real		axial ratio of the solar wind density
					irregularities
	SN		real		signal to noise ratio of the spectrum
	SCINDX		real		scintillation index
	GVAL		real		disturbance factor

	From an email by Janardhan Padmanabhan:

	I have selected only those sources in this list with elongations
	greater than or equal to 10 deg (the turnover in the m vs epsilon
	curve at 327 MHz is around 10 deg) and signal to noise greater than or
	equal to 10db. However, please note that source sizes derived for
	sources with S/N less than 15 db will have larger errors. Therefore
	if source sizes are an important input in your program, then use
	only data with S/N greater than or equal to 15 db.

	For 8 observations in the file I was unable to extract the scintillation
	indices. 7 of these are the august observations. I marked these in the
	list with a "N/A" (not available) in the last column.


iReadProxyMap $SMEI/for/lib/ireadproxymap.f
[Previous] [Next]
 NAME:
	iReadProxyMap
 PURPOSE:
	Read a proxy map for velocity, density or g-level.
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
 	function iReadProxyMap(iq,Rot,nLng,nLat,Z)
 INPUTS:
	iq	integer		Type of map
			iq = 1 velocity map (vmap.dat)
			iq = 2 density map (dmap.dat)
			iq = 3 g-level map (gmap.dat)
	nLng	integer		# longitudes points in GMAP
	nLat	integer		# latitude points in GMAP
	ROT	real		Modified Carrington variable
 OUTPUTS:
	AMAP(nLng,nLat)	real	Proxy map read from file
 CALLED BY:
	ipsd
 INCLUDE:
	include		'dirspec.h'
 CALLS: ***
	BadR4, fncWZ, iFilePath, iFltArr
 PROCEDURE:
 MODIFICATION HISTORY:
	NOV, 1995 B. Jackson (STEL,UCSD)


iReadProxyMapN $SMEI/for/tdlib/ireadproxymapn.f
[Previous] [Next]
 NAME:
	iReadProxyMapN
 PURPOSE:
	Read a proxy map for velocity, density or g-level.
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
	I = iReadProxyMapN(iq,nLng,nLat,ROT,AMAP)
 INPUTS:
	iq	integer		Type of map
			iq = 1 velocity map (vmap.dat)
			iq = 2 density map (dmap.dat)
			iq = 3 g-level map (gmap.dat)
	nLng	integer		# longitudes points in GMAP
	nLat	integer		# latitude points in GMAP
	ROT	real		Modified Carrington variable
 OUTPUTS:
	AMAP(nLng,nLat)	real	Proxy map read from file
 CALLS: ***
	ArrR4Mask, BadR4, fncWZ, iFilePath, iFltArr
 CALLED BY:
	ipsdt
 PROCEDURE:
 MODIFICATION HISTORY:
	NOV, 1995 B. Jackson (STEL,UCSD)


iReadUCSD $SMEI/for/lib/ireaducsd.f
[Previous] [Next]
 NAME:
	iReadUCSD
 CALLING SEQUENCE:
	function iReadUCSD(iU,iFirst)
 CALLS: ***
	BadR4, EARTH, ECLIPTIC_EQUATOR, ECLIPTIC_HELIOGRAPHIC, POINT_ON_LOS, SunNewcomb
	XMAP_SC_POS, cosd
 INCLUDE:
	include		'sun.h'
 EXTERNAL:
	external	EARTH
 PURPOSE:
 >	Structure of UCSD files:
	iY		integer		year-1900
	IDOY		integer		day of year
	IH,IM		integer		time of day
	cSrce		string		descriptor for radio source
	IQUAL		integer		quality indicator
	VEL		real		IPS velocity (km/s)
	DVEL		real		error in velocity (km/s)
	VELpeak		real		IPS peak velocity (km/s)
	DVELpeak	real		error in peak velocity (km/s)
	SCALE		real		spatial scale of IPS pattern (km)
	ISITE		integer		site parameter
	ELO		real		Sun-Source angle (elongation; deg)
	ILONG		integer		Carrington longitude point P (mapped to Sun)
	XC		real		modified Carrington variable point P (x100) (mapped to Sun)
	HLAT		real		heliographic latitude point P (deg)
	ILONGe		real		Carrington longitude sub-Earth point
	XCe		real		modified Carrington variable sub-Earth point (x100)

 NOTES:
	ILONG = (1-(XC-int(XC)))*360.0
	XCe = XMAP_SC_POS(EARTH,nYr,Doy,nCar,JDCar)
	Both appear to be true to within 2 degree in longitude, or so.

	For large elongation the point P was probably taken at a fixed distance
	from the Earth. In principle, the distance can be reconstructed from
	ILONG and HLAT by reversing the traceback to the solar surface.
	I tried to do this for a number of elongations above 90 degrees and
	found point-P distances close to 0.3 AU:
	Elongation    Dist (AU)			Elongation    Dist (AU)
	91.00000      0.3017747			115.0000      0.3055834
	92.00000      0.3120534			116.0000      0.2949757
	93.00000      0.3077490			117.0000      0.2932528
	94.00000      0.3076252			121.0000      0.2888033
	95.00000      0.2509942			122.0000      0.2779170
	96.00000      0.2847953			123.0000      0.2820099
	97.00000      0.2842951			124.0000      0.2752993
	98.00000      0.2923858			125.0000      0.2946435
	99.00000      0.3047100			126.0000      0.2908247
	100.0000      0.2982190			127.0000      0.2950612
	101.0000      0.2989129			128.0000      0.2925285
	102.0000      0.3032739			129.0000      0.2909675
	103.0000      0.2805566			130.0000      0.2826101
	104.0000      0.2944881			131.0000      0.2786521
	105.0000      0.2971804			132.0000      0.3057403
	106.0000      0.2883710			133.0000      0.2940556
	107.0000      0.3060628			134.0000      0.2966698
	108.0000      0.2852099			135.0000      0.2718044
	110.0000      0.2984203			136.0000      0.272730
	111.0000      0.2984303			137.0000      0.2766779
	112.0000      0.2980161			140.0000      0.2886397
	113.0000      0.2884684
	114.0000      0.2940932


iScratchLun $SMEI/ucsd/gen/for/lib/str/igetlun.f
[Previous] [Next]
 NAME:
	iScratchLun	
 PURPOSE:
	Mark unit number as 'scratch file'
 CALLING SEQUENCE:
	entry iScratchLun(LU)
 INPUTS:
	LU	integer		(read-only) logical unit number to be processed
 OUTPUTS:
	LU	integer		LU
 CALLS: ***
	itrim
 CALLED BY:
	bOSFind, bOSFindClose, bOpenFile, smei_base, smei_skyd
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are processed.
 PROCEDURE:
	See iGetLun
	Marking the unit number as 'scratch file' will result in deleting the
	file when the logical unit number is released using iFreeLun (even if
	argument iU is positive). Note that scratch files can be cleaned up
	by calling iFreeAllLun before aborting.
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSearch $SMEI/ucsd/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	iSearch
 PURPOSE:
	Search for file based on file name specification
 CALLING SEQUENCE:
	function iSearch(jFirst,cSearchIn,cFound)
 INPUTS:
	jFirst	integer		=1 on 1st call (set up for subsequent searches)
				=0 on subsequent calls
				Add 10 to iFirst to suppress the error message 
				when no file is found
				Add 100 if you want to test for parsing errors only
				A positive value searches for files;
				a negative value searches for directories (see SIDE EFFECTS)
	cSearch	character*(*)	File specification to search for
 OUTPUTS:
	cFound	character*(*)	File specification of located file
				= ' ' if no file is found
	iSearch	integer		0 : file not found
				1 : file found
				2 : error parsing cSearch (probably typo)
 CALLS: ***
	LocFirstLen, Say, bOSFind, bValidPath, cHideLogical, iGetLogical [1]
	iGetLogical [2], iOSCheckDirectory, iSetFileSpec, itrim
 CALLED BY:
	BListAll, FileInfo, HERDISK, MKVTRACE, Pandora, READ_HOS, ReadVIPS, ReadVIPSLOSCheck
	ReadVIPSLOSCheckn, ReadVIPSn, SD, SD_TREE, SetLog2Dir, SetRotations, T3D_marker
	bAskChar, bOpenFile, dailyips [1], dailyips [2], iAskChar, iCheckDirectory
	iOSCopyFile, jpl_close, jpl_init, jpl_state, rice, smei_cal, smei_cal_get
	smei_cal_init, smei_foreign, smei_frm_getfirst, smei_frm_getnext, smei_orb_get
	smei_skyd_fts, smei_skyd_go, smei_skyd_init, smei_skyd_make, smei_skyd_sky, sprint
 INCLUDE:
	include		'filparts.h'
	include		'dirspec.h'
 SIDE EFFECTS:
 >	iSetFileSpec is used to store the file for retrieval with iGetFileSpec
	by the caller.
 >	In general iFirst must be set to a negative value when searching for
	directories on DOS or Unix. However, when searching for a single directory
	the sign of iFirst is not used if the trailing (back)slash is included.
 PROCEDURE:
	Scans a directory for files based on a specified search string
	(wild cards permitted) and returns successive matching file
	specifications. When no match is found, the returned specification is blank.
	If the input is to be checked for parsing, a valid cFound is returned
	even if it does not exist.

	When searching for directories using a wild card specification
	(no trailing slash will be present) then the names of directories
	are returned without a trailing slash.

	When searching for a single directory with no wildcard present
	(i.e. checking whether a directory exists) then trailing slash
	is only present if was included also in the input search string.
 DEPENDENCY TREE:
	itrim
	iGetLogical
		itrim
		LogModFile
			itrim
			bGetLun
				iGetLun
			iFreeLun
			iOSRenameFile *(system call)
			iOSDeleteFile *(system call)
	iSetFileSpec
		itrim
		uppercase
		LocFirst
		LocLast
		ParseRepair
			LocFirst
			Str2Str
			Str2StrSet
	iGetFileSpec
		Str2Str
		Str2StrSet
	bValidPath
		uppercase
		itrim
		iSetFileSpec
		iGetFileSpec
		iOSGetDirectory *(system call)
		bValidFileName
			uppercase
		bValidFragment
			LocLast
			bValidFileName
				uppercase
	iOSCheckDirectory *(system call)
	bOSFind
		itrim
		Str2Str
		Str2StrSet
		iGetLun
		iFreeLun
		iGetLogical
			itrim
			LogModFile
				itrim
				bGetLun
					iGetLun
				iFreeLun
				iOSRenameFile *(system call)
				iOSDeleteFile *(system call)
		iOSSpawnCmd *(system call)
	Say
		uppercase
		itrim
		LocFirstLen
			LocFirst
		iGetLun
		iFilePath
			Str2Str
				itrim
			Str2StrSet
			iGetLogical
				itrim
				LogModFile
					itrim
					bGetLun
						iGetLun
					iFreeLun
					iOSRenameFile *(system call)
					iOSDeleteFile *(system call)
		iGetSymbol
			itrim
			LogModFile
				itrim
				bGetLun
					iGetLun
				iFreeLun
				iOSRenameFile *(system call)
				iOSDeleteFile *(system call)
		ExitCmd	*(system call)
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSetDefaultDir $SMEI/ucsd/gen/for/lib/str/isetdefaultdir.f
[Previous] [Next]
 NAME:
	iSetDefaultDir
 PURPOSE:
	Set new default diirectory (equivalent of 'cd' command)
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iSetDefaultDir(cNewDef)
 INPUTS:
	cNewDef		character*(*)	name of new directory
 OUTPUTS:
	(none)
 CALLS: ***
	Say, iCheckDirectory, iGetDefaultDir, iGetFileSpec, iOSSetDirectory
 CALLED BY:
	iShowDefaultDir
 EXTERNAL:
 INCLUDE:
	include		'filparts.h'
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 DEPENDENCY TREE:
	iSetDefaultDir
		Say
		iGetFileSpec
		iGetDefaultDir
			iGetFilespec
			iCheckDirectory
		iCheckDirectory
			iSetFileSpec
			iGetFileSpec
			iDir2File
			iSearch
		iOSSetDirectory *(system call)
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	   More documentation


iSetFileSpec $SMEI/ucsd/gen/for/lib/str/isetfilespec.f
[Previous] [Next]
 NAME:
	iSetFileSpec
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iSetFileSpec(cInOut)
 INPUTS:
	cInOut		character*(*)	file specification
 OUTPUTS:
	iSetFileSpec	integer		Always 1
 CALLS: ***
	LocFirst, LocLast, ParseRepair, Str2Str, Str2StrSet, iFullFragment, iLastFragment
	iParentFragment, iTopFragment, itrim, uppercase
 CALLED BY:
	BList_NSO_NOAA, BList_WSO, BList_WSO_NOAA, BRead_WSO, Connect, Dust, FileSelection
	HERDISK, Peep, ReadVIPS, ReadVIPSLOSCheck, ReadVIPSLOSCheckn, ReadVIPSn, SD, SD_SCAN
	SD_TREE, SetGipsy, SetLog2Dir, SetRotations, T3D_marker, T3D_marker_num, TheFit
	bCompressNic, bHOSName, bOpenFile, bTempFile, bWriteNic, dailyips [1], dailyips [2]
	iDir2File, iFile2Dir, iOSgunzip, iPutFileSpec, iSearch, iUniqueName, ice_write, rice
	smei_Time2Split, smei_base, smei_cal, smei_cal_build, smei_cal_get, smei_cal_group
	smei_cal_init, smei_cal_read, smei_cal_write, smei_foreign, smei_frm_base
	smei_frm_fts, smei_frm_fts_base, smei_frm_getfirst, smei_frm_getlist
	smei_frm_getnext, smei_frm_ped_guess, smei_frm_read, smei_frm_read_get_sdark
	smei_frm_write, smei_orb, smei_orb_get, smei_skyd, smei_skyd_fts, smei_skyd_init
	smei_skyd_make, smei_skyd_sky, sprint
 SEE ALSO:
	iGetFileSpec, iPutFileSpec
 INCLUDE:
	include		'dirspec.h'
	include		'filparts.h'
	include		'str2str_inc.h'
 PROCEDURE:
	Deconstructs the input file name cFile into its constituents
	and stores them internally in a character array.
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSetLogical [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iSetLogical
 PURPOSE:
	Portable way of setting 'logical' values
 CALLING SEQUENCE:
	function iSetLogical(cName,cValue,cTable)
 INPUTS:
	cName		character*(*)		name of logical
	cValue		character*(*)		value to be assigned to logical
	cTable		character*(*)		not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iSetLogical	integer			0: failed to set logical
						1: succesful setting logical
 CALLED BY:
	SetGipsy, SetLog2Dir, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iGetSymbol [1], iGetSymbol [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSetLogical [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iSetLogical
 PURPOSE:
	Portable way of setting 'logical' values
 CALLING SEQUENCE:
	function iSetLogical(cName,cValue,cTable)
 INPUTS:
	cName		character*(*)		name of logical
	cValue		character*(*)		value to be assigned to logical
	cTable		character*(*)		not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iSetLogical	integer			0: failed to set logical
						1: succesful setting logical
 CALLS: ***
	LogModFile, itrim
 CALLED BY:
	SetGipsy, SetLog2Dir, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iGetSymbol [1], iGetSymbol [2], iSetSymbol [1]
	iSetSymbol [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSetSymbol [1] $SMEI/ucsd/gen/for/os/linux/logmod_linux.f
[Previous] [Next]
 NAME:
	iSetSymbol
 PURPOSE:
	Portable way of setting 'symbol' values
 CALLING SEQUENCE:
	function iSetSymbol(cName,cValue,iTable)
 INPUTS:
	cName		character*(*)		name of symbol
	cValue		character*(*)		value to be assigned to symbol
	iTable		integer			not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iSetSymbol	integer			0: failed to set symbol
						1: succesful setting symbol
 CALLED BY:
	NODAT, SD_SCAN, bOpenFile, libarg, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iGetSymbol [1], iGetSymbol [2]
	iSetLogical [1], iSetLogical [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iSetSymbol [2] $SMEI/ucsd/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	iSetSymbol
 PURPOSE:
	Portable way of setting 'symbol' values
 CALLING SEQUENCE:
	function iSetSymbol(cName,cValue,iTable)
 INPUTS:
	cName		character*(*)		name of symbol
	cValue		character*(*)		value to be assigned to symbol
	iTable		integer			not used (maintained for backward
						compatibility with VMS version)
 OUTPUTS:
	iSetSymbol	integer			0: failed to set symbol
						1: succesful setting symbol
 CALLS: ***
	LogModFile, itrim
 CALLED BY:
	NODAT, SD_SCAN, bOpenFile, libarg, mkenv
 SEE ALSO:
	iDeleteLogical [1], iDeleteLogical [2], iDeleteSymbol [1], iDeleteSymbol [2]
	iGetLogical [1], iGetLogical [2], iGetSymbol [1], iGetSymbol [2]
	iSetLogical [1], iSetLogical [2]
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


iShowDefaultDir $SMEI/ucsd/gen/for/lib/str/ishowdefaultdir.f
[Previous] [Next]
 NAME:
	iShowDefaultDir
 PURPOSE:
 CATEGORY:
	Environment
 CALLING SEQUENCE:
	function iShowDefaultDir()
 OUTPUTS:
 CALLS: ***
	iSetDefaultDir
 EXTERNAL:
 INCLUDE:
	include		'dirspec.h'
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 DEPENDENCY TREE:
	iShowDefaultDir
		iSetDefaultDir
 PROCEDURE:
 MODIFICATION HISTORY:
	JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		More documentation


iSTRGTODEN $SMEI/for/lib/istrgtoden.f
[Previous] [Next]
 NAME:
	iSTRGTODEN
 PURPOSE:
	Used by EGIPSY to create density maps
 CALLING SEQUENCE:
	function iSTRGTODEN(IDFNC,cStr)
 INPUTS:
	IDFNC		integer		ID for indentifying conversion formulae
					if < 0 in GTODEN the inverse is applied
	G		real		G-value to be converted
 OUTPUTS:
	iSTRGTODEN	integer		length of cStr
	cStr		character*(*)	String descriptor for formula
					corresponding to IDFNC
 CALLS: ***
	itrim
 PROCEDURE:
	See GTODEN
 MODIFICATION HISTORY:
	MAY-1994, Paul Hick (UCSD)


iTopFragment $SMEI/ucsd/gen/for/lib/str/itopfragment.f
[Previous] [Next]
 NAME:
	iTopFragment
 PURPOSE:
	Deconstruct file names into components
 CALLING SEQUENCE:
	function iTopFragment(cDir,cOut)
 INPUTS:
 OUTPUTS:
 CALLS: ***
	LocFirstLen, itrim
 CALLED BY:
	iFileStructure, iGetDirectoryFragment, iGetFileSpec, iGetParentDirectory
	iGetTopDirectory, iSetFileSpec
 INCLUDE:
	include		'dirspec.h'
 PROCEDURE:
 MODIFICATION HISTORY:
	JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


itrim $SMEI/ucsd/gen/for/lib/str/itrim.f
[Previous] [Next]
 NAME:
	itrim
 PURPOSE:
 	Returns the index of the last non-blank character in a string
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	function itrim(cStr)
 INPUTS:
	cStr		character*(*)	string to be processed
 OUTPUTS:
	itrim		integer		length non-trivial part of output string
 CALLED BY:
	AskChar, AskLimit, AskLog, AskR4, AskR8, AskWhatPrmpt, AskYN, BField_Choose, BField_Get
	BList_NSO_NOAA, BList_WSO_NOAA, BRead_WSO, DailyIPS_UCSD [1], DailyIPS_UCSD [2]
	ExtractInsitu, Extractd, Extractd3d, FileInfo, FileSelection, FixModel, FixModeltdn
	ForeignArg, ForeignArgFind, ForeignArgSet, ForeignArgs, ForeignFile, ForeignI2ArgN
	ForeignI4ArgN, ForeignR4ArgN, ForeignR8ArgN, ForeignStrArg, HERDISK, HOSPlot
	LogModFile, MkDMap, MkDMaptdn, MkVMap, MkVMaptdN, OSExitCmd, OpenTest, Pandora, Peep
	READ_HOS, ReadG, ReadGHD, ReadGIPS, RemoveTag, ReplaceTag, SD, SD_SCAN, SD_TREE, Say
	SetLog2Dir, SetRotations, SortIPS, Str2Dbl, Str2Flt, Str2Flt_Crumbs, Str2Flt_Exp
	Str2Flt_FforI, Str2Flt_FmtCrumbs, Str2Flt_FmtNumbers, Str2Flt_Format
	Str2Flt_Int, Str2Flt_Mask, Str2Flt_XforA, Str2Int, Str2Str, Str2StrSet, SwitchTag
	T3D_marker, T3D_show, T3D_write_bb, T3D_write_nv, TheFit, Time2Line, Time2Split
	Time2Str, Time2Template, Time2Time, Time2smei_eph, WR2DARR, WhatIsI4, WhatIsI8
	WhatIsR4, WriteI4GRD, WriteLOSY, WriteR4GRD, XCvarFormat, bAskChar, bCompareStr
	bCompressNic, bHOSName, bOSFind, bOSFindClose, bOpenFile, bUncompressNic, bValidPath
	bWriteNic, dailyips [1], dailyips [2], iAskChar, iAskWhatEntry, iDeleteLogical [2]
	iDeleteSymbol [2], iFilePath, iFileStructure, iFltArr, iFreeAllLun, iFreeLun
	iFullFragment, iGetDirectoryFragment, iGetFileSpec, iGetLogical [1]
	iGetLogical [2], iGetLun, iGetParentDirectory, iGetSymbol [2], iGetTopDirectory
	iHOSInfo, iHOSRead, iHOSWrite, iHideLogical, iLastFragment, iListAllLun
	iOSCheckDirectory, iOSCopyFile, iOSGetDirectory, iOSGetForeign, iOSSpawnCmd
	iParentFragment, iSTRGTODEN, iScratchLun, iSearch, iSetFileSpec, iSetLogical [2]
	iSetSymbol [2], iTopFragment, iUniqueName, ice_write, ipsg2, ipsg2s, ipsg2t, libarg
	mkenv, say_fts, smei_base, smei_cal, smei_cal_build, smei_cal_get, smei_cal_group
	smei_cal_init, smei_cal_write, smei_foreign, smei_frm_getlist, smei_frm_ok
	smei_frm_path, smei_frm_write, smei_orb, smei_orb_write, smei_skyd_fts
	smei_skyd_init, smei_skyd_make, smei_skyd_sky, sprint
 SEE ALSO:
	bCompareStr, icompress, iwhitespace, lowercase, uppercase
 RESTRICTIONS:
	The string is only tested for space, tab and null
 PROCEDURE:
	Each character in the string is converted separately.
 MODIFICATION HISTORY:
	JAN-1992, Paul Hick (UCSD); check for NULL added (some system procedures
		pad strings with NULs instead of blanks)


iUniqueName $SMEI/ucsd/gen/for/lib/str/iuniquename.f
[Previous] [Next]
 NAME:
	iUniqueName
 PURPOSE:
	Construct unique file name
 CATEGORY:
	String handling
 CALLING SEQUENCE:
	function iUniqueName(cPattern,cFile)
 INPUTS:
	cPattern	character*(*)	Should contain a single or two question marks
 OUTPUTS:
	cFile		character*(*)	Unique file name
	iUniqueName	integer		value of itrim(cFile)
 CALLS: ***
	GETPID, cTime2System, iGetFileSpec, iPutFileSpec, iSetFileSpec, itrim
 CALLED BY:
	Connect, Pandora, bOSFind, bOSFindClose, bTempFile, iGetLogical [1], sprint
 INCLUDE:
	include		'filparts.h'
 SIDE EFFECTS:
	If no question marks are present then cPattern is interpreted as
	a fully qualified file name, and the number is inserted after the
	file name part.
 PROCEDURE:
 >	The file name is constructed by replacing the question mark in the
	string cPattern by an eight or ten digit number. The number is
	constructed from the system time (6 or 8 digits) and a counter
	(2 digits).
 >	If the pattern contains '??', then the '??' will be replaced by a
	10 digit number.
 >	If the pattern contains '?', then the '?' will be replaced by an
	8 digit number. If the pattern specified is of the form '?.DAT', then
	the resulting file name will be a valid DOS file name.
 MODIFICATION HISTORY:
	1991, Paul Hick (ARC, UCSD/CASS; pphick@ucsd.edu)


iwhitespace $SMEI/ucsd/gen/for/lib/str/iwhitespace.f
[Previous] [Next]
 NAME:
	iwhitespace
 PURPOSE:
	Converts tabs and multiple spaces to single spaces
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	function  iwhitespace(cStr)
 INPUTS:
	cStr		character*(*)	string to be processed
 OUTPUTS:
	cStr		character*(*)	modified string
	iwhitespace	integer		length non-trivial part of output string
 CALLED BY:
	Connect, HOSOrbID, HOSPlot, HOSUpdate, LOSReach, Pandora, iHOSRead, iHOSWrite
 SEE ALSO:
	bCompareStr, icompress, itrim, lowercase, uppercase
 RESTRICTIONS:
	The string is only tested for space, tab and null
 PROCEDURE:
	Each character in the string is converted separately.
 MODIFICATION HISTORY:
	JAN-1992, Paul Hick (UCSD); check for NULL added (some system procedures
	    pad strings with NULs instead of blanks)


iWriteProxyMapN $SMEI/for/tdlib/iwriteproxymapn.f
[Previous] [Next]
 NAME:
	iWriteProxyMapN
 PURPOSE:
	Write a proxy map for velocity, density or g-level.
 CATEGORY:
	Data processing
 CALLING SEQUENCE:
	I = iWriteProxyMapN(iq,nLng,nLat,ROT,AMAP)
 INPUTS:
	iq	integer		Type of map
				iq = 1 velocity map (vmap.dat)
				iq = 2 density map (dmap.dat)
				iq = 3 g-level map (gmap.dat)
	nLng	integer		# longitudes points in GMAP
	nLat	integer		# latitude points in GMAP
	ROT	real		Modified Carrington variable
 OUTPUTS:
	AMAP(nLng,nLat)	real	Proxy map read from file
 CALLS: ***
	ArrR4Mask, BadR4, WR2DARR, iFilePath
 PROCEDURE:
 MODIFICATION HISTORY:
	NOV, 1995 B. Jackson (STEL,UCSD)