BadI1 $SSW_SMEI_UCSD/gen/for/lib/bytes/badi1.f
[Previous] [Next]
 NAME:
	BadI1
 PURPOSE:
	Provides a generic identifier for integer*1 'bad values'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	integer*1 function BadI1()
 INPUTS:
	(none)
 OUTPUTS:
	BadI1	integer*1	bad integer*1 identifier
 CALLS:
	(none)
 CALLED BY:
	ArrI1Copy
 SEE ALSO:
	BadR4, BadR8, TinyR4, pInfR4
 PROCEDURE:
	The BadI1 number is currently zero.
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadI4 $SSW_SMEI_UCSD/gen/for/lib/bytes/badi4.f
[Previous] [Next]
 NAME:
	BadI4
 PURPOSE:
	Provides a generic identifier for integer*4 'bad values'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	integer function BadI4()
 INPUTS:
	(none)
 OUTPUTS:
	I	integer		bad integer identifier
 CALLS:
	(none)
 CALLED BY:
	ArrI4AddConstant, ArrI4AddConstant2, ArrI4Bad, ArrI4Constant, ArrI4Copy
	ArrI4Copy2, ArrI4GetMinMax, ArrI4Index, ArrI4SetMinMax, ArrI4Zero
	ArrR4DivideByArrI4, FileInfo [1], FileInfo [2], WR2DARR, WhatIsI4, WriteI4GRD
	iArrI4Total, smei_base, smei_cal, smei_foreign, smei_orb, smei_skyd
 SEE ALSO:
	BadR4, BadR8, TinyR4, pInfR4
 INCLUDE:
	include		'math.h'
 PROCEDURE:
	The BadI4 number is pulled out of the include file.
	It is set to the largest negative integer*4 number
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadI8 $SSW_SMEI_UCSD/gen/for/lib/bytes/badi8.f
[Previous] [Next]
 NAME:
	BadI8
 PURPOSE:
	Provides a generic identifier for integer*8 'bad values'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	integer*8 function BadI8()
 INPUTS:
	(none)
 OUTPUTS:
	I	integer*8	bad integer identifier
 CALLS:
	(none)
 CALLED BY:
	ArrI8GetMinMax, ArrI8Zero, WhatIsI8
 SEE ALSO:
	BadR4, BadR8, TinyR4, pInfR4
 INCLUDE:
	include		'math.h'
 PROCEDURE:
	The BadI4 number is pulled out of the include file.
	It is set to the largest negative integer*8 number
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadR4 $SSW_SMEI_UCSD/gen/for/lib/bytes/badr4.f
[Previous] [Next]
 NAME:
	BadR4
 PURPOSE:
	Provides a generic identifier for real*4 'bad values'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	function BadR4()
 INPUTS:
	(none)
 OUTPUTS:
	X	real	bad value number
 CALLS:
	(none)
 CALLED BY:
	ArrR4AddConstant, ArrR4Bad, ArrR4Constant, ArrR4Copy, ArrR4Copy2
	ArrR4DivideByArrI4, ArrR4DivideByArrR4, ArrR4DivideByConstant, ArrR4Function
	ArrR4GetMinMax, ArrR4Index, ArrR4Interpolate, ArrR4Invert, ArrR4LinearArrR4
	ArrR4Mask, ArrR4Mean, ArrR4Median, ArrR4MinusArrR4, ArrR4Negate, ArrR4PlusArrR4
	ArrR4Scale, ArrR4Scale2, ArrR4SetMinMax, ArrR4Stdev, ArrR4Step, ArrR4TimesArrR4
	ArrR4TimesConstant, ArrR4Total, ArrR4Zero, BadR4Test, FLINT, GridFill, GridRan2Reg
	GridReg2Reg, GridSphere3D, GridSphereRange, GridSphereWeight, MapWarp
	POLYNOMIAL_EXP, PointPOnLOS, PointPOnLOS_Near, PointPOnLOS_Reset, RebinSphere
	SplineX, SplineY, ThomsonMidpoint, ThomsonMidpointFar, ThomsonPDistance
	ThomsonPDistanceFar, WR2DARR, WhatIsR4, WriteR4GRD, XMAP_SC_POS, iFltArr, nrBCUINT
	smei_base, smei_cal, smei_cal_add, smei_cal_build, smei_cal_write, smei_frm_base
	smei_frm_clean, smei_frm_dark, smei_frm_measle, smei_frm_ped, smei_frm_stats
	smei_orb_min, smei_orb_write, smei_skyd, smei_skyd_combine, smei_skyd_fill
	smei_skyd_flush, smei_skyd_fts, smei_skyd_init, smei_skyd_make, smei_skyd_sky
	smei_skyd_sort
 SEE ALSO:
	BadI4, BadR8, TinyR4, pInfR4
 INCLUDE:
	include		'math.h'
 PROCEDURE:
	The BadR4 number is pulled out of the include file.
	It is set to the largest negative real*4 number on VMS
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadR4Test $SSW_SMEI_UCSD/gen/for/lib/bytes/badr4test.f
[Previous] [Next]
 NAME:
	BadR4Test
 PURPOSE:
	Checks real*4 variable for 'bad value'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	logical function BadR4Test(X)
 INPUTS:
	X	real	any real variable
 OUTPUTS:
	BadR4Test	logical		.TRUE.  if X is bad
					.FALSE. if not
 CALLS: ***
	BadR4
 CALLED BY:
	smei_base
 PROCEDURE:
	The BadR4 number is pulled out of the include file.
	It is set to the largest negative real*4 number on VMS
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadR8 $SSW_SMEI_UCSD/gen/for/lib/bytes/badr8.f
[Previous] [Next]
 NAME:
	BadR8
 PURPOSE:
	Provides a generic identifier for real*8 'bad values'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	real*8 function BadR8()
 INPUTS:
	(none)
 OUTPUTS:
	X	real*8	bad value number
 CALLS:
	(none)
 CALLED BY:
	ArrR8Bad, ArrR8Copy, ArrR8Interpolate, ArrR8Zero, BadR8Test, FLINT8, smei_axis_cam
	smei_cam2ccd, smei_ccd2cam, smei_skyd_fill, smei_skyd_flush, smei_skyd_sort
 SEE ALSO:
	BadI4, BadR4, TinyR4, pInfR4
 INCLUDE:
	include		'math.h'
 PROCEDURE:
	The BadR8 number is pulled out of the include file.
	It is set to the largest negative real*8 number on VMS
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


BadR8Test $SSW_SMEI_UCSD/gen/for/lib/bytes/badr8test.f
[Previous] [Next]
 NAME:
	BadR8Test
 PURPOSE:
	Checks double precision variable for 'bad value'
 CATEGORY:
	gen/for/lib
 CALLING SEQUENCE:
	logical function BadR8Test(X)
 INPUTS:
	X	real*8	any real variable
 OUTPUTS:
	BadR8Test	logical		.TRUE.  if X is bad
					.FALSE. if not
 CALLS: ***
	BadR8
 PROCEDURE:
	The BadR8 number is pulled out of the include file.
	It is set to the largest negative real*8 number on VMS
 MODIFICATION HISTORY:
	FEB-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bAskChar $SSW_SMEI_UCSD/gen/for/lib/what/baskchar.f
[Previous] [Next]
 NAME:
	bAskChar
 PURPOSE:
 CALLING SEQUENCE:
	logical function bAskChar(bExit,bFile,bDir,bParse,cExit,cOld,cNew,cVal)
 CALLED BY:
	AskChar
 INCLUDE:
	include		'filparts.h'
 CALLS: ***
	iCheckDirectory, iGetFileSpec, iSearch [1], iSearch [2], iSearch [3], iSearch [4]
	itrim, uppercase


bCompareStr $SSW_SMEI_UCSD/gen/for/lib/str/bcomparestr.f
[Previous] [Next]
 NAME:
	bCompareStr
 PURPOSE:
	Comparing strings, avoiding the traps of zero-length strings
 CATEGORY:
	String manipulation
 CALLING SEQUENCE:
	logical function bCompareStr(ID,C1,C2)
 INPUTS:
	C1		character*(*)	string to be processed
 OUTPUTS:
	CStr		character*(*)	modified string
	L		integer		length non-trivial part of output string
 CALLS: ***
	icompress, itrim
 SEE ALSO:
	icompress, itrim, iwhitespace, lowercase, uppercase
 PROCEDURE:
 MODIFICATION HISTORY:
	JAN-1992, Paul Hick (UCSD)


bCompressNic $SSW_SMEI_UCSD/gen/for/main/rice.f
[Previous] [Next]
 NAME:
	bCompressNic
 PURPOSE:
	Read *.nic file, compress the image array and write to *.ice file
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	logical function bCompressNic(iAct, cFile, cDir)
 INPUTS:
	iAct		integer		open specified (passed to bReadNic)
					If cFile is known to be a valid *.nic file use
					iAct = OPN__TRYINPUT
	cFile		character*(*)	file name (with .nic file type)
	cDir		character*(*)	output directory;
					if cDir = ' ' then the compressed file
					is put in the same directory as the input file
 OUTPUTS:
	bCompressNic	logical		.TRUE. : file compressed successfully
					.FALSE.: error compressing file
	(compressed file)
 CALLS: ***
	Int2Str, Str2Str, bReadNic, iGetFileSpec, iPutFileSpec, iSetFileSpec, ice_write, itrim
 CALLED BY:
	rice
 RESTRICTIONS:
	cDir must include a trailing backslash, i.e. C:\temp\ instead of just C:\temp
 INCLUDE:
	include		'openfile.h'
	include		'filparts.h'
 PROCEDURE:
 >	If cDir = ' ', then the compressed file is written into the same directory as
	the original image file.
 >	The compressed file is written only if the compression factor is less than 0.9.
 >	The file name of the compressed file is the same as the original file
	with the file type changed to .ice.
 >	The trailer information in the compressed file contains three items
	separated by a carriage return, line feed pair:
	- 2 integer*4 values containing the dimensions of the image file (e.g. '1280 600')
	  (the product nX*nY is also recorded in the header of the .ice file)
	- file name and type of the input file (e.g. tmo_001.nic)
	- the trailer of the original image file
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD; pphick@ucsd.edu)


bGetLun $SSW_SMEI_UCSD/gen/for/lib/str/bgetlun.f
[Previous] [Next]
 NAME:
	bGetLun
 PURPOSE:
	Handle pool of logical numbers for opening files to avoid problems
	with using the same logical number to open different files.
 CALLING SEQUENCE:
	logical function bGetLun(LU,cFile)
 INPUTS:
	(none)
 OUTPUTS:
	LU	integer		assigned logical unit number; FIL__NOUNIT is returned
				if no unit numbers are available
	bGetLun	logical		.TRUE. : logical unit number assigned
				.FALSE.: no more unit numbers available
 CALLED BY:
	HOSInquire, LogModFile, OSExitCmd [1], OSExitCmd [2], OSExitCmd [3], iOpenFile [1]
	iOpenFile [2], iOpenFile [3], iOpenFile [4]
 INCLUDE:
	include		'filparts.h'
 RESTRICTIONS:
	Only logical unit numbers in range [LUMin,LUMax]=[30,40] are processed.
 CALLS: ***
	iGetLun
 MODIFICATION HISTORY:
	?, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bHOSName $SSW_SMEI_UCSD/gen/for/lib/str/bhosname.f
[Previous] [Next]
 NAME:
	bHOSName
 PURPOSE:
	Check whether a file name has the standard Helios format
 CATEGORY:
	Data processing: auxilliary
 CALLING SEQUENCE:
	logical function bHOSName(cFile,iSc,iYr,IC,IFL)
 INPUTS:
	cFile		character*(*)	file name (READ ONLY)
 OUTPUTS:
	bHOSName	logical		.TRUE. if standard format, .FALSE. if not
	iSc		integer		1/2 for Helios A/B
	iYr		integer		year (in I4 format, e.g. 1980)
	IC		integer		color (1/2/3 for U/B/V)
	IFL		integer		filter (1/2/3/4/5) or 9 if 90 deg data file
 CALLS: ***
	iGetFileSpec, iSetFileSpec, itrim
 CALLED BY:
	bOpenFile
 INCLUDE:
	include		'filparts.h'
 PROCEDURE:
 >	The standard Helios format for a data file name is a 9 character
	string containing information about s/c, year, color, filter and start
	Doy, e.g. A76V4_103 contains Helios 1 (A) data for Doy 103 of year 1976
	for visual light (V) and the clear filter (4).
	- 1:1	tested for a,A or b,B
	- 2:3	tested for 1974-1985 for Helios A, 1976-1980 for Helios B
	- 4:4	tested for u,U or b,B or v,V
	- 5:5	tested for 1,2,3,4,5 or 9
	- 6:6	tested for underscore (_)
	- 7:9	tested for 1 <= Doy <= 366
 >	Optional:
	- 10:10	tested for underscore(_)
	- 11:14	tested for Carrington rotation number
 >	If bHOSName = .FALSE. then iSc=iYr=IC=IFL=0 is returned
 MODIFICATION HISTORY:
	NOV-1991, Paul Hick (UCSD)


bIsXEvent $SSW_SMEI_UCSD/gen/for/lib/obsolete/bisxevent.f
[Previous] [Next]
 NAME:
	bIsXEvent
 PURPOSE:
	Duummy function for Windows and Linux
	for functions containing calls to GRPACK functions
 PROCEDURE:
	Needed by: MapReadSrf
 MODIFICATION HISTORY:
	JAN-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


Bit16 $SSW_SMEI_UCSD/gen/for/lib/bytes/bit16.f
[Previous] [Next]
 NAME:
	Bit16
 PURPOSE:
	Put the binary representation for a integer*2 into a 16 element
	integer*1 array, or v.v.
 CALLING SEQUENCE:
	subroutine Bit16(ID,IN,OBIT)
 INPUTS:
	ID		integer		0 : integer ---> binary
					1 : binary  ---> integer
 INPUTS/OUTPUTS:
	IN		integer*2	integer to be converted to/from binary
	OBIT(16)	integer*1	binary representation for IN
 CALLS:
	(none)
 RESTRICTIONS:
	If IN is negative, two's complement convention is assumed, i.e.
	bit 16 is set to one; the other 15 bits are those of the positive
	number IN+32768.
 PROCEDURE:
	The least significant bit of IN is put into OBIT(16), the most 
	significant in OBIT(1), i.e. if OBIT is printed with format 16I1
	the value of IN in binary results.
 MODIFICATION HISTORY:
	MAR-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu) : Rewrite of JBIT16


Bit2to4 $SSW_SMEI_UCSD/gen/for/lib/bytes/bit2to4.f
[Previous] [Next]
 NAME:
	Bit2to4
 PURPOSE:
	Copy an integer in the range [-32768,32767] stored in an integer*2
	variable into an integer*4 variable, preserving the bit pattern of
	the least significant 16 bits.
 CALLING SEQUENCE:
	subroutine Bit2to4(I2,I4)
 INPUTS:
	I2	integer*2	integer in range [-32768,32767]
 OUTPUTS:
	I4	integer*4	result in range [0,65535]
 CALLS:
	(none)
 PROCEDURE:
	The output integer*4 value is in the range [0,65535], i.e. the 
	most significant 16 bits are all zero.
 MODIFICATION HISTORY:
	MAR-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


Bit32 $SSW_SMEI_UCSD/gen/for/lib/bytes/bit32.f
[Previous] [Next]
 NAME:
	Bit32
 PURPOSE:
	Put the binary representation for a integer*4 into a 32 element
	integer*1 array or v.v.
 CALLING SEQUENCE:
	subroutine Bit32(ID,IN,OBIT)
 INPUTS:
	ID		integer		0 : integer ---> binary
					1 : binary  ---> integer
 INPUTS/OUTPUTS:
	IN		integer		integer to be converted to binary
	OBIT(32)	integer*1	binary representation for IN
 CALLED BY:
	cBit32
 RESTRICTIONS:
	If IN is negative, two's complement convention is assumed, i.e.
	bit 32 is set to one; the other 31 bits are those of the positive
	number IN+2147483648.
 PROCEDURE:
	The least significant bit of IN is put into OBIT(32), the most 
	significant in OBIT(1), i.e. if OBIT is printed with format 32I1
	the value of IN in binary results.
 MODIFICATION HISTORY:
	MAR-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu) : Rewrite of JBIT16


Bit4to2 $SSW_SMEI_UCSD/gen/for/lib/bytes/bit4to2.f
[Previous] [Next]
 NAME:
	Bit4to2
 PURPOSE:
       Copy the two least signficant bytes of an integer*4 into
       an integer*2 variable.
 CALLING SEQUENCE:
	subroutine Bit4to2(I4,I2)
 INPUTS:
	I4	integer*4	any integer*4
 OUTPUTS:
	I2	integer*2	result in range [-32768,32767]
 CALLS:
	(none)
 PROCEDURE:
	iand(I4,Z'7FFF')        copies the least significant 15 bits
	iand(I4,Z'FFFF')/Z'8000'=0/1 is the 16 bit
	iand(I4,Z'FFFF')/Z'8000')*Z'8000' sets the sign bit of the integer*2
 MODIFICATION HISTORY:
	SEP-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bOpenFile $SSW_SMEI_UCSD/gen/for/lib/io/bopenfile.f
[Previous] [Next]
 NAME:
	bOpenFile
 PURPOSE:
	Opens a file or checks for its existence.
	By default, the user will be prompted to enter a filename until a file is
	successfully opened. This behaviour can be modified in several ways using
	options listed under the input argument 'Act' below.
 CATEGORY:
	I/O: opening files
 CALLING SEQUENCE:
	logical function bOpenFile(Act,iU,cFile,iRecl)
 INPUTS:
	More information may be available in the include openfile.h

	Act	integer			sum of parameters defined in include file openfile.h
					(the safest way to combine options is to use the .or. operator
					e.g. OPN__NOMESSAGE .or. OPN__TRYINPUT)

		OPN__NOMESSAGE		suppress informational messages to screen
					(error messages are always displayed)

		OPN__TRYINPUT		Skip first prompt and try input file name instead
					Default: prompt for file name

		OPN__SEARCHONLY		Search only (i.e. check for existence)
					Default: open file

		OPN__ONEPASS		Do not activate prompt loop on failure
					Default: keep prompting until success

		Used only if OPN__ONEPASS is set:

		OPN__STOP		On failure, STOP execution
					Default: RETURN with .FALSE. return value


		The following are only useful for opening files (OPN__SEARCHONLY not set)

		OPN__NOPARSE		Used only in combination with OPN__TRYINPUT:
					Useful for bypassing a call to iSearch which may intervene
					with a wildcard search. The iSearch call is responsible for
					returning a fully qualified filename in cFile. OPN__NOPARSE
					should be used only if the input value already is fully qualified
					(e.g. output from another iSearch call).

		OPN__SEQUENTIAL		Open for sequential access
					Default: direct access

		OPN__FORMATTED		Open for formatted read
					Default: unformatted read

		OPN__TRYALL		Try all seq/direct, form/unform
					Default: use OPN__SEQUENTIAL and OPN__FORMATTED

		OPN__READONLY		Open for read only
					Default: open for read/write
					(g77 does not support read-only files, so this
					value is ignored on Linux)

		OPN__RECLBYTE		Is set to indicate that the record length iRecl is specified
					in bytes, rather than 4-byte longwords.

		By default bOpenFile tries to open an existing file and aborts if the file
		does not exist. Modify this by one of the following three values:

		OPN__APPEND		Opens an existing file for append and aborts if the
					file does not exist
		OPN__NEW		Opens a new file and aborts if it already exists
		OPN__UNKNOWN		Opens a file whether it exists or not.

 Special definitions:
		OPN__REOPEN		= OPN__TRYINPUT+OPN__ONEPASS+OPN__NOPARSE
					Useful for reopening a file known to exist:
					the input value cFile is tried only once without parsing.

		OPN__BINARY		Same as OPN__SEQUENTIAL:
					opens a sequential access, unformatted file, i.e.
					a generic binary file.

		OPN__TEXT		Same as OPN__SEQUENTIAL+OPN__FORMATTED
					opens a generic ascii file.

		OPN__HOS		Open Helios file.
					Some trickery is required to determine the record length
					of a Helios file on DOS/WIN or Unix. Use this parameter to
					to identify an existing file as a Helios data file.
					Helios files are always opened for direct, unformatted access.

	cFile	character*(*)	File to be opened
				(used only if OPN__TRYINPUT is set)
	iRecl			Record length in 4-byte longwords (unless option OPN__RECLBYTE is used).
				On Linux and WIN record length only need to specified when opening
				a file for direct access.
 OUTPUTS:
	bOpenFile
		logical		= .FALSE : if open/check failed or was aborted by user
				= .TRUE. : if open/check succesful
	Act	integer		(only if OPN__TRYALL was set)
				mode used to open file, i.e. bits for OPN__SEQUENTIAL and/or
				OPN__FORMATTED are set
	iU	integer		On Failure: set to FIL__NOUNIT
				On Success: Logical unit number of open file (open)
				or FIL__NOUNIT+1 (check only)
	cFile	character*(*)	On Failure: input value is retained
				On Success: Fully qualified file name of opened/existing file
				If the input file was a gzipped (.gz) file and the file was
	`			unzipped successfully, then the file of the unzipped file created
				by iOSgunzip is returned. To get rid of the temporary file
				closed the logical unit with iFreeLun.
	iRecl			On Failure: input value is retained
				On Success: record length in 4-byte longwords
 CALLED BY:
	Time2smei_eph, WR2DARR, WriteI4GRD, WriteR4GRD, bReadNic, bWriteNic, iFltArr, ice_read
	ice_write, jpl_close, jpl_init, jpl_state, smei_base, smei_cal, smei_cal_c3mask
	smei_cal_group, smei_cal_write, smei_frm_getlist, smei_frm_path
	smei_orbit_info2, smei_skyd, sprint
 INCLUDE:
	include		'filparts.h'
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'openfile.h'
 CALLS: ***
	AskChar, Say, bHOSName, iGetFileSpec, iGetSymbol [1], iGetSymbol [2], iGetSymbol [3]
	iOSgunzip, iOpenFile [1], iOpenFile [2], iOpenFile [3], iOpenFile [4]
	iPutFileSpec, iScratchLun, iSearch [1], iSearch [2], iSearch [3], iSearch [4]
	iSetFileSpec, iSetSymbol [1], iSetSymbol [2], iSetSymbol [3], itrim, uppercase
 RESTRICTIONS:
	iOpenFile is a system dependent function. Currently versions are available for
	VMS, NT, Unix and Linux
 SIDE EFFECT:
	On success the output filename cFile is parsed using iSetFileSpec
 PROCEDURE:
 >	The function iOpenFile [1] called by this subroutine contains the actual open statements.
	Separate versions of this function exists for every operating system.
 >	iOpenFile tries to determine the record length of the file. If unsuccessful,
	the input value of iRecl is used.
	On DOS and UNIX iOpenFile can only determine the record length for HELIOS data files.
 >	Act is a read-only variable, UNLESS all access methods are to be tried
	(OPN__TRYALL used). In this case the OPN__TRYALL bit is cleared and the
	the OPN__SEQUENTIAL and OPN__FORMATTED bits are set to the values used to open the file
	The other bits are unchanged
 >	The existence check is performed by iSearch [1].
 >	A default for the file prompt is read from the symbol DEF_FILE (on VMS a global symbol).
 >	The file prompt allows for changing file name components separately, e.g
	typing '.dat' will only change the extension of the default file name while keeping
	all the other components.
 >	For HELIOS data file with standard file names (e.g. A76V4_007.DAT), the following
	additional abbreviated responses are possible:
	.ZLD		results in cFile = 'A76V4_007.ZLD'
	_111		results in cFile = 'A76V4_111.DAT'
	_111.ZLD	results in cFile = 'A76V4_111.ZLD'
	9		results in cFile = 'A76V9_007.DAT'
 MODIFICATION HISTORY:
	NOV-1990, Paul Hick (UCSD/CASS)
	SEP-1998, Paul Hick (UCSD/CASS)
		Complete overhaul and merged with bOpenHOS
	JUL-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Changed exit error code (set by Say) on open error from 'S'
		(=1) to 'E' (=2)
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Introduced use of cHideLogical (implicit through '#' prefix in Say call).


bOSFind [1] $SSW_SMEI_UCSD/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	bOSFind
 PURPOSE:
 CALLING SEQUENCE:
	logical function bOSFind(iNewSearch,cBufIn,iType,cName)
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
	include		'str2str_inc.h'
 CALLS: ***
	LocFirst, LocLast, Str2StrSet, iFreeLun, iGetLun, iOSDeleteFile [1]
	iOSDeleteFile [2], iOSDeleteFile [3], iOSDeleteFile [4], iOSSpawnCmd [1]
	iOSSpawnCmd [2], iOSSpawnCmd [3], iOSSpawnCmd [4], iScratchLun, iUniqueName, itrim
 PROCEDURE:
	Specify full path including directory and file name.
	Wildcards only permitted in the file name part. (use output of bValidPath)
	In DOS to test for the root directory set e.g. cBufIn=A: (no trailing \).
	??? What really happens when cBufIn=A: ??.
	The file name is returned in cName.

	Note that the scratch file used to as a destination for the ouput of the
	dir command remains open, and hence that the associated logical unit
	remains assigned.

	Somewhere there is a version of bOSFind for DOS which uses the DOS
	interrupt function instead of the SYSTEM function. This version was written to
	for use with Windows programs.
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS)
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added imperfect patch to allow iSearch to work partially with
	    directories with lots of files in.


bOSFind [2] $SSW_SMEI_UCSD/gen/for/os/unix/isearch_unix.f
[Previous] [Next]
 NAME:
	bOSFind
 PURPOSE:
 CALLING SEQUENCE:
	logical function bOSFind(iNewSearch,cBufIn,iType,cName)
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
	include		'str2str_inc.h'
 CALLS: ***
	LocFirst, LocLast, Str2StrSet, iFreeLun, iGetLun, iOSDeleteFile [1]
	iOSDeleteFile [2], iOSDeleteFile [3], iOSDeleteFile [4], iOSSpawnCmd [1]
	iOSSpawnCmd [2], iOSSpawnCmd [3], iOSSpawnCmd [4], iScratchLun, iUniqueName, itrim
 PROCEDURE:
	Specify full path including directory and file name.
	Wildcards only permitted in the file name part. (use output of bValidPath)
	In DOS to test for the root directory set e.g. cBufIn=A: (no trailing \).
	??? What really happens when cBufIn=A: ??.
	The file name is returned in cName.

	Note that the scratch file used to as a destination for the ouput of the
	dir command remains open, and hence that the associated logical unit
	remains assigned.

	Somewhere there is a version of bOSFind for DOS which uses the DOS
	interrupt function instead of the SYSTEM function. This version was written to
	for use with Windows programs.
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bOSFind [3] $SSW_SMEI_UCSD/gen/for/os/win/isearch_win.f
[Previous] [Next]
 NAME:
	bOSFind
 PURPOSE:
	(For internal use by iSearch only)
	Search for specified file(s) by making a 'dir' or 'ls' call
 CALLING SEQUENCE:
	logical function bOSFind(iNewSearch,cBufIn,iType,cName)
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
	include		'fattrib.h'
	include		'str2str_inc.h'
 CALLS: ***
	Str2Str, Str2StrSet, iFreeLun, iGetLogical [1], iGetLogical [2], iGetLogical [3]
	iGetLun, iOSDeleteFile [1], iOSDeleteFile [2], iOSDeleteFile [3]
	iOSDeleteFile [4], iOSSpawnCmd [1], iOSSpawnCmd [2], iOSSpawnCmd [3]
	iOSSpawnCmd [4], iScratchLun, itrim
 PROCEDURE:
	Specify full path including drive,directory and file name.
	Wildcards only permitted in the file name part. (use output of bValidPath)
	In DOS to test for the root directory set e.g. cBufIn=A: (no trailing \).
	??? What really happens when cBufIn=A: ??.
	The file name is returned in cName.

	Note that the scratch file used to as a destination for the ouput of the
	dir command remains open, and hence that the associated logical unit
	remains assigned.

	Somewhere there is a version of bOSFind for DOS which uses the DOS
	interrupt function instead of the SYSTEM function. This version was written to
	for use with Windows programs.
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bOSFindClose $SSW_SMEI_UCSD/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	bOSFindClose
 CALLS: ***
	LocFirst, LocLast, Str2StrSet, iFreeLun, iGetLun, iOSDeleteFile [1]
	iOSDeleteFile [2], iOSDeleteFile [3], iOSDeleteFile [4], iOSSpawnCmd [1]
	iOSSpawnCmd [2], iOSSpawnCmd [3], iOSSpawnCmd [4], iScratchLun, iUniqueName, itrim
 CALLED BY:
	jpl_close, jpl_init, jpl_state, smei_foreign, smei_frm_getfirst, smei_frm_getnext


bReadNic $SSW_SMEI_UCSD/gen/for/lib/io/breadnic.f
[Previous] [Next]
 NAME:
	bReadNic
 PURPOSE:
	Read image from prototype SMEI camera
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	logical function bReadNic(iAct0, cFile, N, nX, nY, nB, Img, cTrailer)
 INPUTS:
	iAct0		integer		open code passed to bOpenFile
					Usually set to zero. If cFile is known
					to exist (e.g. a return value from
					iSearch [1]) then file access can be
					made more efficient by using the value 
					OPN__REOPEN (defined in openfile.h).
	cFile		character*(*)	file name
	N		integer		size of Img
 OUTPUTS:
	bReadNic	logical		.TRUE. : success
					.FALSE.: failure
	nX		integer		horizontal size of image
	nY		integer		vertical size of image
	nB		integer		# bytes per number on input file
					2 for integer*2
					4 for integer*4
					-4 for real*4
	Img(nX*nY)	real		image data
	cTrailer	character*(*)	trailer info from image file
 CALLS: ***
	Say, bOpenFile, iFreeLun
 CALLED BY:
	Peep, bCompressNic, smei_frm_read, smei_frm_read_get_sdark
 SEE ALSO:
	bWriteNic
 RESTRICTIONS:
	Reading of *.nic.gz files depends on availability of gzip
	(windows) or gunzip (Linux).
 SIDE EFFECTS:
	Linux   : bOpenFile is passed OPN__RECLBYTE+OPN__READONLY
	Other OS: bOpenFile is passed OPN__BINARY  +OPN__READONLY
 INCLUDE:
	include		'openfile.h'
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 PROCEDURE:
	On Linux the file is opened as a direct, unformatted file with
	a record length of 2 bytes. The file is read in packets of 2 byte.
	This also works on Windows, but a much faster method opens
	the file as a sequential, unformatted file and, after reading the
	the array dimensions from the header reads the entire image with
	a single read (this does not work on Linux).
 MODIFICATION HISTORY:
	AUG-2000, Paul Hick (UCSD/CASS)
	MAR-2003, Paul Hick (UCSD/CASS)
		Added capability to process *.nic.gz files (the file is
		decompressed into a temporary file in $temp; the temporary
		file is read and deleted).
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Added argument nB.
		Modified to enable reading of integer*4 and real*4 data.
		The output now is real*4 instead of integer*4.


bStr2Dbl $SSW_SMEI_UCSD/gen/for/lib/str/bstr2dbl.f
[Previous] [Next]
 NAME:
	bStr2Dbl
 CALLING SEQUENCE:
	logical function bStr2Dbl(cStr,N,R)
 CALLED BY:
	AskR8
 PROCEDURE:
 	bStr2Dbl is a special case of a Str2Dbl call.
 CALLS: ***
	Str2Dbl, Str2Flt_Crumbs, Str2Flt_Exp
 SEE ALSO:
	Str2Dbl
 MODIFICATION HISTORY:
	DEC-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bStr2Flt $SSW_SMEI_UCSD/gen/for/lib/str/bstr2flt.f
[Previous] [Next]
 NAME:
	bStr2Flt
 CALLING SEQUENCE:
	logical function bStr2Flt(CStr,N,R)
 CALLED BY:
	AskR4
 PROCEDURE:
 	bStr2Flt is a special case of a Str2Flt call.
 CALLS: ***
	Str2Flt, Str2Flt_Crumbs, Str2Flt_Exp
 SEE ALSO:
	Str2Flt
 MODIFICATION HISTORY:
	DEC-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bTempFile $SSW_SMEI_UCSD/gen/for/lib/str/btempfile.f
[Previous] [Next]
 NAME:
	bTempFile
 PURPOSE:
	Rename an existing file giving it a unique file name
 CATEGORY:
	File system
 CALLING SEQUENCE:
	logical function bTempFile(cFile,cTmpFile)
 INPUTS:
	cFile		character*(*)	file to be renamed
 OUTPUTS:
	cTmpFile	character*(*)	fully-qualified, new, unique file name
 CALLS: ***
	Say, iFilePath, iGetFileSpec, iGetLogical [1], iGetLogical [2], iGetLogical [3]
	iOSRenameFile [1], iOSRenameFile [2], iOSRenameFile [3], iOSRenameFile [4]
	iSetFileSpec, iUniqueName
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
 PROCEDURE:
 >	The specified file is moved to directory $temp and is given a unique name
 DEPENDENCY TREE:
 	(FORSTR.F LOGMODFILE.F OSCALLS.F)

	iSetFileSpec
	iGetFileSpec
	iPutFileSpec
	iFilePath
		(see above)
	iUniqueName
		(see above)
	iGetLogical
		itrim
		LogModFile
			itrim
			bGetLun
				iGetLun
			iFreeLun
			iOSRenameFile *(system call)
			iOSDeleteFile *(system call)
	iOSRenameFile *(system call)
	iGetDefaultDir				?
 MODIFICATION HISTORY:
	SEP-1999, Paul Hick (UCSD; pphick@ucsd.edu)


bUncompressNic $SSW_SMEI_UCSD/gen/for/main/rice.f
[Previous] [Next]
 NAME:
	bUncompressNic
 PURPOSE:
	Read compressed *.nic file, and decompress it to *.nic file
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	logical function bUncompressNic(iAct, cFile, cDir)
 INPUTS:
	iAct		integer		open specified (passed to bOpenFile)
					If cFile is known to be a valid *.ice file use
					iAct = OPN__TRYINPUT
	cFile		character*(*)	file name (with .ice file type)
	cDir		character*(*)	output directory;
					if cDir = ' ' then the decompressed file
					is put in the same directory as the input file
 OUTPUTS:
	bUncompressNic	logical		.TRUE. : file decompressed successfully
					.FALSE.: error decompressing file
	(decompressed file)
 CALLS: ***
	Int2Str, bWriteNic, ice_read, itrim
 CALLED BY:
	rice
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include 	'openfile.h'
	include		'filparts.h'
 RESTRICTIONS:
	Writing the decompressed file will currently only work on Windows.
 PROCEDURE:
 >	If cDir = ' ', then the decompressed file is written into the same directory
	as the original image file.
 >	The file name of the compressed file is the same as the original file
	with the file type changed to .nic.
 >	The decompressed file should be byte for byte identical to the original file (i.e. the
	DOS 'fc /b' command or the Unix 'diff' command should not detect any differences.
 MODIFICATION HISTORY:
	DEC-2000, Kevin Nguyen, Paul Hick (UCSD; pphick@ucsd.edu)


bValidDriveName $SSW_SMEI_UCSD/gen/for/os/win/isearch_win.f
[Previous] [Next]
 NAME:
	bValidDriveName
 PURPOSE:
	(For internal use by iSearch only)
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidDriveName(cDrive)
 INPUTS:
	(none)
 OUTPUTS:
	cDrive	character*(*)	2-char drive spec ('C:') (DOS-only)
 CALLS: ***
	iOSCheckDirectory [1], iOSCheckDirectory [2], iOSCheckDirectory [3]
 CALLED BY:
	bValidPath [3]
 SEE ALSO:
	bValidFileName [1], bValidFileName [2], bValidFileName [3], bValidFragment [1]
	bValidFragment [2], bValidFragment [3], bValidPath [1], bValidPath [2]
	bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 PROCEDURE:
	bValidDriveName:
	A:,..,Z:,a:,..,z: are valid drive names
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFileName [1] $SSW_SMEI_UCSD/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	bValidFileName
 PURPOSE:
 CALLING SEQUENCE:
	logical function bValidFileName(iType,cFile)
 CALLS: ***
	uppercase
 CALLED BY:
	bValidFragment [1], bValidFragment [2], bValidFragment [3], bValidPath [1]
	bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 PROCEDURE:
	Based on DOS5.0 User's Guide and Reference.
	For file names: Chapter 4, p. 69
	For directory names : Chapter 5, p. 102

	The difference in testing for file and directory names are:
	1.) The 3 characters @ ' ` are not permitted in directories
	2.) Directory names are at least 1 char long; file names
	    can have zero length.
	3.) File name and extension can't have zero-length at the same time
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFileName [2] $SSW_SMEI_UCSD/gen/for/os/unix/isearch_unix.f
[Previous] [Next]
 NAME:
	bValidFileName
 PURPOSE:
 CALLING SEQUENCE:
	logical function bValidFileName(iType,cFile)
 CALLS: ***
	uppercase
 CALLED BY:
	bValidFragment [1], bValidFragment [2], bValidFragment [3], bValidPath [1]
	bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 PROCEDURE:
	Based on DOS5.0 User's Guide and Reference.
	For file names: Chapter 4, p. 69
	For directory names : Chapter 5, p. 102

	The difference in testing for file and directory names are:
	1.) The 3 characters @ ' ` are not permitted in directories
	2.) Directory names are at least 1 char long; file names
	    can have zero length.
	3.) File name and extension can't have zero-length at the same time
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFileName [3] $SSW_SMEI_UCSD/gen/for/os/win/isearch_win.f
[Previous] [Next]
 NAME:
	bValidFileName
 PURPOSE:
	(For internal use by iSearch only)
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidFileName(iType,cFile)
 INPUTS:
	iType	integer		0 = test for file name
				1 = test for directory name
	cFile	character*(*)	string to be tested for validity
 OUTPUTS:
	Result	logical		.FALSE. = invalid file/directory name
				.TRUE.  = valid file/directory name
 CALLS: ***
	uppercase
 CALLED BY:
	bValidFragment [1], bValidFragment [2], bValidFragment [3], bValidPath [1]
	bValidPath [2], bValidPath [3]
 SEE ALSO:
	bValidDriveName, bValidFragment [1], bValidFragment [2], bValidFragment [3]
	bValidPath [1], bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 RESTRICTIONS:
	DOS: Extended chars are permitted in principle. This is not implemented here.
 PROCEDURE:
	Based on DOS5.0 User's Guide and Reference.
	For file names: Chapter 4, p. 69
	For directory names : Chapter 5, p. 102

	The difference in testing for file and directory names are:
	1.) The 3 characters @ ' ` are not permitted in directories
	2.) Directory names are at least 1 char long; file names
	    can have zero length.
	3.) File name and extension can't have zero-length at the same time
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFragment [1] $SSW_SMEI_UCSD/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	bValidFragment
 PURPOSE:
 CALLING SEQUENCE:
	logical function bValidFragment(iType,isub,cFileSub,iBuf,cBuf)
 CALLS: ***
	LocLast, bValidFileName [1], bValidFileName [2], bValidFileName [3]
 CALLED BY:
	bValidPath [1], bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFragment [2] $SSW_SMEI_UCSD/gen/for/os/unix/isearch_unix.f
[Previous] [Next]
 NAME:
	bValidFragment
 PURPOSE:
 CALLING SEQUENCE:
	logical function bValidFragment(iType,isub,cFileSub,iBuf,cBuf)
 CALLS: ***
	LocLast, bValidFileName [1], bValidFileName [2], bValidFileName [3]
 CALLED BY:
	bValidPath [1], bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidFragment [3] $SSW_SMEI_UCSD/gen/for/os/win/isearch_win.f
[Previous] [Next]
 NAME:
	bValidFragment
 PURPOSE:
	(For internal use by iSearch only)
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidFragment(iType,isub,cFileSub,iBuf,cBuf)
 INPUTS:
	iType	integer		0 = test for file name
				1 = test for directory name
 OUTPUTS:
	Result	logical		.FALSE. = invalid file/directory name
				.TRUE.  = valid file/directory name
	cBuf	character*(*)   parsed version of input spec (including
				drive, directory and file name)
 CALLS: ***
	LocLast, bValidFileName [1], bValidFileName [2], bValidFileName [3]
 CALLED BY:
	bValidPath [1], bValidPath [2], bValidPath [3]
 SEE ALSO:
	bValidDriveName, bValidPath [1], bValidPath [2], bValidPath [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidPath [1] $SSW_SMEI_UCSD/gen/for/os/linux/isearch_linux.f
[Previous] [Next]
 NAME:
	bValidPath
 PURPOSE:
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidPath(cFile,cDir,cName)
 INPUTS:
	iType	integer		0 = test for file name
				1 = test for directory name
	cFile	character*(*)	string to be tested for validity
 OUTPUTS:
	Result	logical		.FALSE. = invalid file/directory name
				.TRUE.  = valid file/directory name
	cDrive	character*(*)	2-char drive spec ('C:') (DOS-only)
	cBuf	character*(*)	parsed version of input spec (including
				drive, directory and file name)
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 CALLS: ***
	GETCWD, bValidFileName [1], bValidFileName [2], bValidFileName [3]
	bValidFragment [1], bValidFragment [2], bValidFragment [3], itrim
 RESTRICTIONS:
	DOS:
	Extended chars are permitted in principle. This is not implemented here.
 PROCEDURE:
	Tests a full spec consisting of drive, directory and filename.

	Valid full directory names are e.g. (the C: is optional):
		C:		???? excluded
		C:\
		C:\sub1
		C:\sub1\	???? excluded
	i.e. any string that, after terminating it with \ if necessary,
	can be combined with a file name to produce a valid path to the file
	name.
	Note that this definition makes the interpretation of C: ambiguous:
	C:file.ext is a file in the current directory on the C: drive.
	But if first the terminating backslash is appended the meaning changes:
	C:\file.ext is a file in the root directory on the C: drive.

	A valid full filename is tested by validating the part preceding the last
	backslash as a valid directory name, and validating the remaining part
	as a file name. Valid full filenames are: (the C: is optional)
		C:file.ext
		C:\file.ext
		C:\sub\file.ext
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidPath [2] $SSW_SMEI_UCSD/gen/for/os/unix/isearch_unix.f
[Previous] [Next]
 NAME:
	bValidPath
 PURPOSE:
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidPath(cFile,cDir,cName)
 INPUTS:
	iType	integer		0 = test for file name
				1 = test for directory name
	cFile	character*(*)	string to be tested for validity
 OUTPUTS:
	Result	logical		.FALSE. = invalid file/directory name
				.TRUE.  = valid file/directory name
	cDrive	character*(*)	2-char drive spec ('C:') (DOS-only)
	cBuf	character*(*)	parsed version of input spec (including
				drive, directory and file name)
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
 CALLS: ***
	GETCWD, bValidFileName [1], bValidFileName [2], bValidFileName [3]
	bValidFragment [1], bValidFragment [2], bValidFragment [3], itrim
 RESTRICTIONS:
	DOS:
	Extended chars are permitted in principle. This is not implemented here.
 PROCEDURE:
	Tests a full spec consisting of drive, directory and filename.

	Valid full directory names are e.g. (the C: is optional):
		C:		???? excluded
		C:\
		C:\sub1
		C:\sub1\	???? excluded
	i.e. any string that, after terminating it with \ if necessary,
	can be combined with a file name to produce a valid path to the file
	name.
	Note that this definition makes the interpretation of C: ambiguous:
	C:file.ext is a file in the current directory on the C: drive.
	But if first the terminating backslash is appended the meaning changes:
	C:\file.ext is a file in the root directory on the C: drive.

	A valid full filename is tested by validating the part preceding the last
	backslash as a valid directory name, and validating the remaining part
	as a file name. Valid full filenames are: (the C: is optional)
		C:file.ext
		C:\file.ext
		C:\sub\file.ext
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bValidPath [3] $SSW_SMEI_UCSD/gen/for/os/win/isearch_win.f
[Previous] [Next]
 NAME:
	bValidPath
 PURPOSE:
	(For internal use by iSearch only)
	Build a valid fully-qualified file name for Unix or DOS
 CALLING SEQUENCE:
	logical function bValidPath(cFile,cDir,cName)
 INPUTS:
	cFile	character*(*)	string to be tested for validity
 OUTPUTS:
 CALLS: ***
	bValidDriveName, bValidFileName [1], bValidFileName [2], bValidFileName [3]
	bValidFragment [1], bValidFragment [2], bValidFragment [3], iGetFileSpec
	iOSGetDirectory [1], iOSGetDirectory [2], iOSGetDirectory [3], iSetFileSpec
	itrim, uppercase
 CALLED BY:
	iSearch [1], iSearch [2], iSearch [3]
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
 RESTRICTIONS:
	DOS: Extended chars are permitted in principle. This is not implemented here.
 PROCEDURE:
	Tests a full spec consisting of drive, directory and filename.

	Valid full directory names are e.g. (the C: is optional):
		C:		???? excluded
		C:\
		C:\sub1
		C:\sub1\	???? excluded
	i.e. any string that, after terminating it with \ if necessary,
	can be combined with a file name to produce a valid path to the file
	name.
	Note that this definition makes the interpretation of C: ambiguous:
	C:file.ext is a file in the current directory on the C: drive.
	But if first the terminating backslash is appended the meaning changes:
	C:\file.ext is a file in the root directory on the C: drive.

	A valid full filename is tested by validating the part preceding the last
	backslash as a valid directory name, and validating the remaining part
	as a file name. Valid full filenames are: (the C: is optional)
		C:file.ext
		C:\file.ext
		C:\sub\file.ext
 MODIFICATION HISTORY:
	DEC-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bWriteFrm $SSW_SMEI_UCSD/gen/for/lib/frm/bwritefrm.f
[Previous] [Next]
 NAME:
	bWriteFrm
 PURPOSE:
	Writes a binary .nic file in the exact format the SMEI camera
	software produces.
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	logical function bWriteFrm(cFile, cDir, nX, nY, nB, Orig, hdr)
 INPUTS:
	cFile		character*(*)	file name
					(the file type will be replaced by .nic)
	cDir		character*(*)	output directory
					if not left blank this directory overrides
					the directory specification in cFile
	nX		integer		row length
	nY		integer		column height
	nB		integer		# bytes per number in output file
					2 for integer*2
					4 for integer*4
					-4 for real*4
	Orig(nX*nY)	integer		image data
	hdr(*)		double precision
					frame header entries
 OUTPUTS:
	(output to .nic file)
 CALLS: ***
	NicHdr, bWriteNic
 CALLED BY:
	smei_cal
 SEE ALSO:
	bReadNic
 PROCEDURE:
	See bWriteNic
 MODIFICATION HISTORY:
	JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)


bWriteNic $SSW_SMEI_UCSD/gen/for/lib/io/bwritenic.f
[Previous] [Next]
 NAME:
	bWriteNic
 PURPOSE:
	Writes a binary .nic file in the exact format the SMEI camera
	software produces.
 CATEGORY:
	I/O
 CALLING SEQUENCE:
	logical function bWriteNic(cFile, cDir, nX, nY, nB, Orig, cTrailer)
 INPUTS:
	cFile		character*(*)	file name
					(the file type will be replaced by .nic)
	cDir		character*(*)	output directory
					if not left blank this directory overrides
					the directory specification in cFile
	nX		integer		row length
	nY		integer		column height
	nB		integer		# bytes per number in output file
					2 for integer*2
					4 for integer*4
					-4 for real*4
	Orig(nX*nY)	integer		image data
	cTrailer	character*512	trailer
 OUTPUTS:
	(output to .nic file)
 CALLS: ***
	bOpenFile, iFreeLun, iGetFileSpec, iPutFileSpec, iSetFileSpec, itrim
 CALLED BY:
	bUncompressNic, bWriteFrm
 SEE ALSO:
	bReadNic
 INCLUDE:
	include		'dirspec [1].h'
	include		'dirspec [2].h'
	include		'dirspec [3].h'
	include		'dirspec [4].h'
	include		'filparts.h'
	include		'openfile.h'
 RESTRICTIONS:
	Has only been tested on NT and Linux
 PROCEDURE:
	WIN: Output file is opened as a sequential access file
	    (iAct = OPN__REOPEN+OPN__NEW+OPN__BINARY in bOpenFile call)
	    The file is written with a single write:
		read (iU) ....

	Linux: The WIN method produces a file in Linux which has 8 bytes
	    attached to the end. To avoid this we open a direct access file
	    (iAct = OPN__REOPEN+OPN__NEW+OPN__RECLBYTE in bOpenFile call)
	    with a record length in bytes equal to the total size of the file
	    The file is written with a single write:
		read (iU,rec=1) ....

	The second method (for Linux) will also work for WIN.
 MODIFICATION HISTORY:
	FEB-2001, Paul Hick (UCSD/CASS)
	JUL-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
		Modified to enable reading of integer*4 and real*4 data.
		The input array is now real*4 instead of integer*4.