Local2UT $SSW_SMEI_UCSD/gen/for/lib/gen/local2ut.f
[Previous] [Next]
 NAME:
	Local2UT
 PURPOSE:
       Read system clock, including fraction of day, convert to day of year, 
       and calculate the day of year in Universal Time (Greenwich).
 CATEGORY:
	Time calculation
 CALLING SEQUENCE:
	subroutine Local2UT(off,yr,doy)
 INPUTS:
       off	integer		offset time (in hours) from Greenwich
				(i.e. UT-local time)
 OUTPUTS:
	yr	integer		year; the year xxxBC should be entered as -xxx+1
       doy	real		day of year + fraction + offset from Greenwich
 CALLS: ***
	Time2Day, Time2Local2UT, Time2YDoy
 RESTRICTIONS:
	Works only on a VAX
 PROCEDURE:
	The specified offset (in hours) is added to the obtain the doy of year
	in UT (with the time of day specified as a fraction).
 MODIFICATION HISTORY:
	Kari Winfield (UCSD)


LocateTag $SSW_SMEI_UCSD/gen/for/lib/str/locatetag.f
[Previous] [Next]
 NAME:
	LocateTag
 PURPOSE:
	Locate a tag (substring) from a list of tags (nternal use only)
 CATEGORY:
	Strings: tag manipulation
 CALLING SEQUENCE:
	function LocateTag(cSep,LS,cTags,LT,cTag)
 INPUTS:
	cSep		character	character used as separater (usually comma)
	LS		integer		only the part cTags(:LS) is searched
	cTags		character*(*)	list of tags, separated by the cSep character
	LT		integer		only the part cTag(:LT) is used
	cTag		character*(*)	tag (substring) to be removed
 OUTPUTS:
	LocateTag	integer		position of cTag in cTags
 CALLED BY:
	RemoveTag, ReplaceTag, SwitchTag
 SEE ALSO:
	RemoveTag, ReplaceTag, SwitchTag
 PROCEDURE:
       On the VMS Fortran compiler this is a no-brainer:
		LocateTag = index(cSep//cTags(:LS)//cSep,cSep//cTag(:LT)//cSep)
       This may not work on other compilers, since it involves the
       concatenation of variable length strings. A kludgy alternative is
	used here to accomplish the same.
 MODIFICATION HISTORY:
	NOV-1994, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	JUN-1995, Paul Hick (UCSD; pphick@ucsd.edu), added SwitchTag


LocFirst $SSW_SMEI_UCSD/gen/for/lib/str/locfirst.f
[Previous] [Next]
 NAME:
	LocFirst
 PURPOSE:
	Find the first occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocFirst(cFnd,cStr)
 INPUTS:
	cFnd	character*(*)	string to be searched for
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first occurrence, or
				0 if cFnd not found
 CALLED BY:
	Dbl2Str, FileSelection, Flt2Str, ForeignArgFind, ForeignArgSet, ForeignFile
	LocFirst0, LocFirstLen, ParseRepair, Peep, WR2DARR, bOSFind [1], bOSFind [2]
	bOSFindClose, iFileStructure, iGetDirectoryFragment, iGetFileSpec
	iGetParentDirectory, iGetTopDirectory, iSetFileSpec, mkenv, rice, smei_cal_group
	sprint
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocFirst will return 0 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LocFirst0 $SSW_SMEI_UCSD/gen/for/lib/str/locfirst0.f
[Previous] [Next]
 NAME:
	LocFirst0
 PURPOSE:
	Find the first occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocFirst0(L1,cFnd,L2,cStr)
 INPUTS:
	L1	integer		only cFnd(:L1) is searched for
	cFnd	character*(*)	string to be searched for
	L2	integer		only cStr(:L2) is searched
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first/last occurrence, or
				0 if cFnd not found
 CALLS: ***
	LocFirst
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocFirst0 will return 0 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LocFirstLen $SSW_SMEI_UCSD/gen/for/lib/str/locfirstlen.f
[Previous] [Next]
 NAME:
	LocFirstLen
 PURPOSE:
	Find the first occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocFirstLen(cFnd,cStr)
 INPUTS:
	cFnd	character*(*)	string to be searched for
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first/last occurrence, or
				len(cStr)+1 if cFnd not found
 CALLS: ***
	LocFirst
 CALLED BY:
	AskLimit, AskWhatEntry, AskWhatPrmpt, FileSelection, ForeignArg, ForeignArgs
	ForeignI2ArgN, ForeignI4ArgN, ForeignInput, ForeignR4ArgN, ForeignR8ArgN
	ForeignStrArg, Say, WR2DARR, iSearch [1], iSearch [2], iSearchTree, iTopFragment, rice
	smei_cal_group
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocFirstLen will return len(cStr)+1 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LocLast $SSW_SMEI_UCSD/gen/for/lib/str/loclast.f
[Previous] [Next]
 NAME:
	LocLast
 PURPOSE:
	Find the last occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocLast(cFnd,cStr)
 INPUTS:
	cFnd	character*(*)	string to be searched for
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first/last occurrence, or
				0 if cFnd not found
 CALLED BY:
	LocLast0, LocLastLen, bOSFind [1], bOSFind [2], bOSFindClose, bValidFragment [1]
	bValidFragment [2], bValidFragment [3], iFileStructure, iGetDirectoryFragment
	iGetFileSpec, iGetParentDirectory, iGetTopDirectory, iLastFragment
	iParentFragment, iSetFileSpec
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocLast will return 0 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LocLast0 $SSW_SMEI_UCSD/gen/for/lib/str/loclast0.f
[Previous] [Next]
 NAME:
	LocLast0
 PURPOSE:
	Find the last occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocLast0(L1,cFnd,L2,cStr)
 INPUTS:
	L1	integer		only cFnd(:L1) is searched for
	cFnd	character*(*)	string to be searched for
	L2	integer		only cStr(:L2) is searched
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first/last occurrence, or
				0 if cFnd(:L1)  not found
 CALLS: ***
	LocLast
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocLast0 will return 0 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LocLastLen $SSW_SMEI_UCSD/gen/for/lib/str/loclastlen.f
[Previous] [Next]
 NAME:
	LocLastLen
 PURPOSE:
	Find the first occurrence of string cFnd in string cStr
 CALLING SEQUENCE:
	function LocLastLen(cFnd,cStr)
 INPUTS:
	cFnd	character*(*)	string to be searched for
	cStr	character*(*)	string to be searched
 OUTPUTS:
	L	integer		position of first/last occurrence, or
				0 if cFnd not found
 CALLS: ***
	LocLast
 PROCEDURE:
 >	The index function has the quirky property that it returns 1 when
	searching for a zero-length string, i.e.
	I = index('abcd',str(:0))  will set I = 1.
	LocLastLen returns len(cStr)+1 instead.
 MODIFICATION HISTORY:
	JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


LogModFile $SSW_SMEI_UCSD/gen/for/os/logmod.f
[Previous] [Next]
 NAME:
	LogModFile
 CALLING SEQUENCE:
	function LogModFile(iAct,cType0,cNameIn,cDef0)
 INPUTS:
	iAct		integer		1: set logical/symbol
					2: get logical/symbol
					3: delete logical/symbol
	cType0		character*(*)	'LOG': manipulate logicals
					'SYM': manipulate symbols
	cNameIn		character*(*)	name of logical/symbol

	cDef0		character*(*)	(iAct=1 only) value of logical/symbol
 OUTPUTS:
	LogModFile	integer		0: failure
					1: success
	cDef0		character*(*)   (iAct=2 only) value of logical/symbol
 CALLED BY:
	iDeleteLogical [2], iDeleteSymbol [2], iGetLogical [2], iGetSymbol [2]
	iSetLogical [2], iSetSymbol [2]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 CALLS: ***
	TimeOut, bGetLun, iFreeLun, iListAllLun, iOSDeleteFile [1], iOSDeleteFile [2]
	iOSDeleteFile [3], iOSDeleteFile [4], iOSRenameFile [1], iOSRenameFile [2]
	iOSRenameFile [3], iOSRenameFile [4], itrim
 PROCEDURE:
 >	Should not be called directly (used internally only by functions for
	manipulating logicals and symbols).
 >	LogModFile should stay as simple as possible. In particular, do not use calls
	to Say or bOpenFile, since this would create recursion (since they
	in turn call LogModFile through calls to iSetSymbol etc.)

 >	On VMS there are system calls to manipulate logicals and symbols. This setup
	maintains a set of 'logicals' and 'symbols' in a plain ascii file in the user
	home directory. This addresses one of the main portability issues we ran into
	when moving programs to Windows, Unix and Linux.
 >	VMS logicals are functionally equivalent to environment variables in Windows
	and Linux (typically they refer to directories).
	VMS symbols are loosely equivalent to aliases in Linux.
 DEPENDENCY TREE:
	itrim
	LogModFile
		itrim
		bGetLun
			iGetLun
		iFreeLun
		iOSRenameFile *(system call)
		iOSDeleteFile *(system call)
 MODIFICATION HISTORY:
	???-????, Paul Hick (UCSD/CASS)
	SEP-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Now uses TimeOut to pause program for 1 second


lowercase $SSW_SMEI_UCSD/gen/for/lib/str/lowercase.f
[Previous] [Next]
 NAME:
	lowercase
 PURPOSE:
	Convert string to lowercase
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	subroutine lowercase(C)
 INPUTS:
	C		character*(*)	string to be processed
 OUTPUTS:
	C		character*(*)	modified string
 CALLED BY:
	ForeignFile, Peep, mkenv, rice, smei_foreign
 SEE ALSO:
	bCompareStr, icompress, itrim, iwhitespace, uppercase
 PROCEDURE:
	Each character in the string is converted separately.
	The intrinsic FORTRAN functions ICHAR is used to find the ASCII code
	for the character. For uppercase characters (ASCII code 65-90) 32 is added
	to the ASCII code. The FORTRAN function CHAR is used to convert the
	corrected code back to an character.
 MODIFICATION HISTORY:
	JAN-1992, Paul Hick (UCSD)