[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:
ice_analyze
SEE ALSO:
Array_Info
[Previous]
[Next]
NAME:
iArrI4ValuePresent
PURPOSE:
Check occurrence of given value in integer*4 array
CALLING SEQUENCE:
function iArrI4ValuePresent(N,A,APresent)
CALLED BY:
WhatIsI4
SEE ALSO:
Array_Info
[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
[Previous]
[Next]
NAME:
iArrR4Compare
PURPOSE:
Compare two same-size real*4 arrays
CALLING SEQUENCE:
function iArrR4Compare(N,A,B)
SEE ALSO:
Array_Info
[Previous]
[Next]
NAME:
iArrR4ValuePresent
PURPOSE:
Check real*4 array for presence of given value
CALLING SEQUENCE:
function iArrR4ValuePresent(N,A,APresent)
CALLED BY:
GridFill, GridSphere3D, GridSphereRange, GridSphereWeight, RebinSphere, WR2DARR
WhatIsR4, smei_cal_build, smei_frm_measle, smei_frm_saturated
SEE ALSO:
Array_Info
[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 [1], iSearch [2], iSearch [3], iSearch [4]
itrim, uppercase
[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)
[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)
[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
[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)
[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)
[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.
[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 [1], iSearch [2], iSearch [3]
iSearch [4]
CALLED BY:
FileSelection, bAskChar, iAskChar, iGetDefaultDir, iSearchTree, 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
[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)
[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)
[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, 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)
[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:
SetLog2Dir, mkenv
SEE ALSO:
iDeleteSymbol [1], iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1]
iGetLogical [2], iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3]
iSetLogical [1], iSetLogical [2], iSetLogical [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
SetLog2Dir, mkenv
SEE ALSO:
iDeleteSymbol [1], iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1]
iGetLogical [2], iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3]
iSetLogical [1], iSetLogical [2], iSetLogical [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iGetLogical [1]
iGetLogical [2], iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3]
iSetLogical [1], iSetLogical [2], iSetLogical [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iGetLogical [1]
iGetLogical [2], iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3]
iSetLogical [1], iSetLogical [2], iSetLogical [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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:
iCheckDirectory
SEE ALSO:
iDir2File
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[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:
FileSelection, OSExitCmd [1], OSExitCmd [2], OSExitCmd [3], Say, SetRotations
Time2smei_eph, bTempFile, cFilePath, iHideLogical, iOSgunzip, 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], iGetLogical [3], itrim
uppercase
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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)
[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
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'.
[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)
[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:
HOSInquire, LogModFile, OSExitCmd [1], OSExitCmd [2], OSExitCmd [3], Say
Time2smei_eph, WR2DARR, WriteI4GRD, WriteR4GRD, bOSFind [1], bOSFind [2]
bOSFind [3], bOSFindClose, bReadNic, bWriteNic, iFltArr, iGetLogical [1]
iOpenFile [1], iOpenFile [2], iOpenFile [3], iOpenFile [4], 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)
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
SetLog2Dir, iSetDefaultDir
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[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:
iDir2File, iSearchTree
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)
[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:
FileSelection, Peep, SetLog2Dir, SetRotations, bAskChar, bCompressNic, bHOSName
bOpenFile, bTempFile, bValidPath [3], bWriteNic, iAskChar, iCheckDirectory
iDir2File, iFile2Dir, iGetDefaultDir, iOSSetDirectory [4], iOSgunzip, iSearch [3]
iSearchTree, 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)
[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, SetLog2Dir, bOSFind [3], bTempFile, iDeleteLogical [3], iFilePath
iHideLogical, iOSSpawnCmd [3], iSearch [1], iSearch [2], iSearch [3], mkenv
smei_cal, smei_foreign, smei_frm_path, sprint
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
CALLS: ***
iFreeLun, iGetLun, iOSSpawnCmd [1], iOSSpawnCmd [2], iOSSpawnCmd [3]
iOSSpawnCmd [4], iUniqueName, itrim
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetSymbol [1], iGetSymbol [2]
iGetSymbol [3], iSetLogical [1], iSetLogical [2], iSetLogical [3]
iSetSymbol [1], iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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, SetLog2Dir, bOSFind [3], bTempFile, iDeleteLogical [3], iFilePath
iHideLogical, iOSSpawnCmd [3], iSearch [1], iSearch [2], iSearch [3], mkenv
smei_cal, smei_foreign, smei_frm_path, sprint
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
CALLS: ***
LogModFile, itrim
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetSymbol [1], iGetSymbol [2]
iGetSymbol [3], iSetLogical [1], iSetLogical [2], iSetLogical [3]
iSetSymbol [1], iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
Say, bGetLun, bOSFind [1], bOSFind [2], bOSFind [3], 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)
[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:
iDir2File
PROCEDURE:
Entry point in iSetFileSpec
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
Say, bOpenFile, mkenv, sprint
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iSetLogical [1], iSetLogical [2], iSetLogical [3]
iSetSymbol [1], iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
Say, bOpenFile, mkenv, sprint
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iSetLogical [1], iSetLogical [2], iSetLogical [3]
iSetSymbol [1], iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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
INCLUDE:
PROCEDURE:
Entry point in iSetFileSpec
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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
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.
[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], iGetLogical [3], itrim
CALLED BY:
Say, cHideLogical, smei_cal, smei_frm_base, smei_skyd, sprint
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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)
[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
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)
[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)
[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)
[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)
[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:
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)
[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
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)
[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)
[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:
Dbl2Str, Flt2Str, GridFill, MAP_TZERO, Peep, SetRotations, Str2Dbl, Str2Flt
Str2Flt_Crumbs, Str2Flt_Exp, Str2Flt_FforI, Str2Flt_FmtCrumbs
Str2Flt_FmtNumbers, Str2Flt_Format, Str2Flt_Int, Str2Flt_Mask, Str2Flt_XforA
Str2Int, WriteI4GRD, WriteR4GRD, bCompressNic, bUncompressNic, cInt2Str, iFltArr
ice_read, ice_write, 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)
[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, 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)
[Previous]
[Next]
NAME:
iOpenFile
PURPOSE:
Open statemenst for direct/sequential, formatted/unformatted files
(internal use only; called by bOpenFile)
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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
include 'openfile.h'
CALLS: ***
HOSInquire, Say, bGetLun, cInt2Str, iFreeLun
PROCEDURE:
Isolates the Fortran open statements needed by bOpenFile.
If a file is opened for direct access on an Intel PC, then the record length
must be explicitly added to the open statement. This is not needed on a VMS
computer. If an 'inquire by filename' is done on VMS then the record length
is returned in bytes. On Intel either 0 (MS-Fortran) is returned, or the
record length is not filled at all (i.e. the input value is retained; Absoft
Fortran).
For the HELIOS files it is possible to determine the record length from the
file content (done by HOSInquire).
On VMS the record length is determined by an 'inquire by file name'
For HELIOS files the record length is determined by HOSInquire
VMS:
In the open command the record length should be specified in bytes for
formatted access and in words for unformatted access.
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)
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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).
[Previous]
[Next]
NAME:
iOpenFile
PURPOSE:
Open statemenst for direct/sequential, formatted/unformatted files
(internal use only; called by bOpenFile)
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
CALLS: ***
HOSInquire, Say, bGetLun, cInt2Str, iFreeLun
CALLED BY:
bOpenFile
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
include 'openfile.h'
PROCEDURE:
Isolates the Fortran open statements needed by bOpenFile.
If a file is opened for direct access on an Intel PC, then the record length
must be explicitly added to the open statement. This is not needed on a VMS
computer. If an 'inquire by filename' is done on VMS then the record length
is returned in bytes. On Intel either 0 (MS-Fortran) is returned, or the
record length is not filled at all (i.e. the input value is retained; Absoft
Fortran).
For the HELIOS files it is possible to determine the record length from the
file content (done by HOSInquire).
On VMS the record length is determined by an 'inquire by file name'
For HELIOS files the record length is determined by HOSInquire
VMS:
In the open command the record length should be specified in bytes for
formatted access and in words for unformatted access.
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)
[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:
bValidDriveName, iSearch [1], iSearch [2], iSearch [3]
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[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's 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:
bValidDriveName, iSearch [1], iSearch [2], iSearch [3]
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[Previous]
[Next]
NAME:
iOSCheckDirectory
PURPOSE:
Check whether a directory exists
CATEGORY:
Machine-dependent functions: WIN-NT
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
value is returned unmodified
iOSCheckDirectory
integer 0: directory does not exist
1: directory exists
CALLS: ***
CHDIR, GETCWD, itrim
CALLED BY:
bValidDriveName, iSearch [1], iSearch [2], iSearch [3]
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation
[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 [1], iSearch [2], iSearch [3], iSearch [4], itrim
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[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
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
CALLS: ***
Str2Str, iSearch [1], iSearch [2], iSearch [3], iSearch [4], itrim
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
[Previous]
[Next]
NAME:
iOSCopyFile
PURPOSE:
Copies a file
CATEGORY:
Machine-dependent functions: WIN-NT
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 [1], iSearch [2], iSearch [3], iSearch [4], itrim
INCLUDE:
include 'filparts.h'
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
RESTRICTIONS:
PROCEDURE:
Roundabout way of copying a file by passing a
a copy command to the SYSTEM procedure.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation
[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:
LogModFile, bOSFind [1], bOSFind [2], bOSFind [3], 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.
[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:
LogModFile, bOSFind [1], bOSFind [2], bOSFind [3], 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; pphick@ucsd.edu); Added documentation
[Previous]
[Next]
NAME:
iOSDeleteFile
PURPOSE:
Delete a file
CATEGORY:
Machine-dependent functions: WIN-NT
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:
LogModFile, bOSFind [1], bOSFind [2], bOSFind [3], 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; pphick@ucsd.edu); Added documentation
[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
CALLED BY:
bValidPath [3]
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[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
CALLED BY:
bValidPath [3]
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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
[Previous]
[Next]
NAME:
iOSGetDirectory
PURPOSE:
Get a fully-qualified directory name, incl. drive and directory
CATEGORY:
Machine-dependent functions: WIN-NT, 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
CALLED BY:
bValidPath [3]
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
RESTRICTIONS:
Do NOT call this function directly. Instead use iSearch.
PROCEDURE:
Uses system function GETCWD
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation
[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
[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)
CALLED BY:
ForeignArg, ForeignInput
INCLUDE:
include 'filparts.h'
CALLS: ***
itrim
PROCEDURE:
> For some reason this is implemented slightly different then the
NT and Linux version. Does not really seem necessary.
> 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
[Previous]
[Next]
NAME:
iOSGetForeign
CATEGORY:
Machine-dependent functions: WIN-NT
PURPOSE:
Get command line arguments as single string
CALLING SEQUENCE:
function iOSGetForeign(L,cStr)
INPUTS:
(none)
OUTPUTS:
L integer useful length of cStr (=itrim(cStr))
cStr character*(*) command line string
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
[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 [1], iOSSpawnCmd [2]
iOSSpawnCmd [3], iOSSpawnCmd [4], iSetFileSpec
CALLED BY:
bOpenFile
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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
[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
[Previous]
[Next]
NAME:
iOSProtect
PURPOSE:
Modify protection of a file
CATEGORY:
Machine-dependent functions: WIN-NT
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
[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, 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.
[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, 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; pphick@ucsd.edu); Added documentation
[Previous]
[Next]
NAME:
iOSRenameFile
PURPOSE:
Rename a file
CATEGORY:
Machine-dependent functions: WIN-NT
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, 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; pphick@ucsd.edu); Added documentation
[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
[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
[Previous]
[Next]
NAME:
iOSSetDirectory
PURPOSE:
Change to a new working directory
CATEGORY:
Machine-dependent functions: WIN-NT
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
[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 [1], bOSFind [2], bOSFind [3], 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
[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 [1], bOSFind [2], bOSFind [3], 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
[Previous]
[Next]
NAME:
iOSSpawnCmd
PURPOSE:
Execute a single shell command
CATEGORY:
Machine-dependent functions: WIN-NT
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
CALLED BY:
bOSFind [1], bOSFind [2], bOSFind [3], bOSFindClose, iGetLogical [1], iOSgunzip
smei_cal_write, smei_frm_write, smei_orb, sprint
RESTRICTIONS:
CALLS: ***
iGetLogical [1], iGetLogical [2], iGetLogical [3], itrim
PROCEDURE:
The error status is determined from the return value of the SYSTEM call.
By default the NT command shell cmd.exe is prefixed to the input shell command.
Override this by setting the logical 'win_cmd' in $home/LOGFIL.TXT
(e.g. on Windows 98 add the line 'LOG=win_cmd=command.com /c')
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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
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
[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)
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)
[Previous]
[Next]
NAME:
IPSFuncQ
CALLING SEQUENCE:
real function IPSFuncQ(q)
CALLED BY:
IPSBase
EXTERNAL BY:
IPSBase
COMMON BLOCKS:
common /FQIPS/ hachodz,thetadz
!$omp threadprivate(/FQIPS/)
INCLUDE:
include 'math.h'
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
iPutFileSpec
PURPOSE:
Deconstruct file names into components
CALLING SEQUENCE:
function iPutFileSpec(nFrst,nLast,cSpec)
INPUTS:
OUTPUTS:
CALLS: ***
iFileStructure, iSetFileSpec
CALLED BY:
FileSelection, bCompressNic, bOpenFile, bWriteNic, iUniqueName, ice_write
INCLUDE:
include 'filparts.h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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 [1], bOSFind [2], bOSFind [3], 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)
[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 [1], bOSFind [2], bOSFind [3], bValidPath [1]
bValidPath [2], bValidPath [3], cHideLogical, iGetLogical [1], iGetLogical [2]
iGetLogical [3], iOSCheckDirectory [1], iOSCheckDirectory [2]
iOSCheckDirectory [3], iSetFileSpec, itrim
CALLED BY:
FileInfo [1], FileInfo [2], SetLog2Dir, SetRotations, bAskChar, bOpenFile, iAskChar
iCheckDirectory, iOSCopyFile [1], iOSCopyFile [2], iOSCopyFile [3], iSearchTree
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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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 [1], bOSFind [2], bOSFind [3], bValidPath [1]
bValidPath [2], bValidPath [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iOSCheckDirectory [1], iOSCheckDirectory [2]
iOSCheckDirectory [3], iSetFileSpec, itrim
CALLED BY:
FileInfo [1], FileInfo [2], SetLog2Dir, SetRotations, bAskChar, bOpenFile, iAskChar
iCheckDirectory, iOSCopyFile [1], iOSCopyFile [2], iOSCopyFile [3], iSearchTree
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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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: ***
Say, bOSFind [1], bOSFind [2], bOSFind [3], bValidPath [1], bValidPath [2]
bValidPath [3], iGetFileSpec, iGetLogical [1], iGetLogical [2], iGetLogical [3]
iOSCheckDirectory [1], iOSCheckDirectory [2], iOSCheckDirectory [3]
iSetFileSpec, itrim
CALLED BY:
FileInfo [1], FileInfo [2], SetLog2Dir, SetRotations, bAskChar, bOpenFile, iAskChar
iCheckDirectory, iOSCopyFile [1], iOSCopyFile [2], iOSCopyFile [3], iSearchTree
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 'fattrib.h'
include 'filparts.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)
bValidDriveName
iOSCheckDirectory *(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)
[Previous]
[Next]
NAME:
iSearchTree
PURPOSE:
Displays a rudimentary directory tree from the top directory downwards
CALLING SEQUENCE:
subroutine iSearchTree(cSearch, nFound, cFound)
INPUTS:
cTopDir character top directory and file name wild card
nFound integer max # files returned
OUTPUTS:
nFound integer # files found
cFound character(*)*(*) fully-qualified file names
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
include 'filparts.h'
!include 'openfile.h'
CALLS: ***
LocFirstLen, Say, Str2Str, iCheckDirectory, iGetDirectoryFragment, iGetFileSpec
iSearch [1], iSearch [2], iSearch [3], iSearch [4], iSetFileSpec
MODIFICATION HISTORY:
MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Extracted from program libsd.f (subroutine SD_TREE)
[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 [1]
iOSSetDirectory [2], iOSSetDirectory [3], iOSSetDirectory [4]
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
[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:
FileSelection, Peep, SetLog2Dir, SetRotations, bCompressNic, bHOSName, bOpenFile
bTempFile, bValidPath [3], bWriteNic, iDir2File, iFile2Dir, iOSSetDirectory [4]
iOSgunzip, iPutFileSpec, iSearch [1], iSearch [2], iSearch [3], iSearch [4]
iSearchTree, 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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].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)
[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:
SetLog2Dir, iOSSetDirectory [4], mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
SetLog2Dir, iOSSetDirectory [4], mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3], iSetSymbol [1]
iSetSymbol [2], iSetSymbol [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
bOpenFile, mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3], iSetLogical [1]
iSetLogical [2], iSetLogical [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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:
bOpenFile, mkenv
SEE ALSO:
iDeleteLogical [1], iDeleteLogical [2], iDeleteLogical [3], iDeleteSymbol [1]
iDeleteSymbol [2], iDeleteSymbol [3], iGetLogical [1], iGetLogical [2]
iGetLogical [3], iGetSymbol [1], iGetSymbol [2], iGetSymbol [3], iSetLogical [1]
iSetLogical [2], iSetLogical [3]
MODIFICATION HISTORY:
???-????, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
iShowDefaultDir
PURPOSE:
CATEGORY:
Environment
CALLING SEQUENCE:
function iShowDefaultDir()
OUTPUTS:
CALLS: ***
iSetDefaultDir
EXTERNAL:
INCLUDE:
include 'dirspec [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
DEPENDENCY TREE:
iShowDefaultDir
iSetDefaultDir
PROCEDURE:
MODIFICATION HISTORY:
JUL-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
More documentation
[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 [1].h'
include 'dirspec [2].h'
include 'dirspec [3].h'
include 'dirspec [4].h'
PROCEDURE:
MODIFICATION HISTORY:
JUN-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[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, FileInfo [1], FileInfo [2]
FileSelection, ForeignArg, ForeignArgFind, ForeignArgSet, ForeignArgs, ForeignFile
ForeignI2ArgN, ForeignI4ArgN, ForeignR4ArgN, ForeignR8ArgN, ForeignStrArg
LogModFile, OSExitCmd [1], OSExitCmd [2], OSExitCmd [3], Peep, RemoveTag, ReplaceTag
Say, SetLog2Dir, SetRotations, Str2Dbl, Str2Flt, Str2Flt_Crumbs, Str2Flt_Exp
Str2Flt_FforI, Str2Flt_FmtCrumbs, Str2Flt_FmtNumbers, Str2Flt_Format
Str2Flt_Int, Str2Flt_Mask, Str2Flt_XforA, Str2Int, Str2Str, Str2StrSet, SwitchTag
Time2Line, Time2Split, Time2Str, Time2Template, Time2smei_eph, WR2DARR, WhatIsI4
WhatIsI8, WhatIsR4, WriteI4GRD, WriteR4GRD, bAskChar, bCompareStr, bCompressNic
bHOSName, bOSFind [1], bOSFind [2], bOSFind [3], bOSFindClose, bOpenFile
bUncompressNic, bValidPath [1], bValidPath [2], bValidPath [3], bWriteNic
iAskChar, iAskWhatEntry, iDeleteLogical [2], iDeleteLogical [3]
iDeleteSymbol [2], iDeleteSymbol [3], iFilePath, iFileStructure, iFltArr
iFreeAllLun, iFreeLun, iFullFragment, iGetDirectoryFragment, iGetFileSpec
iGetLogical [1], iGetLogical [2], iGetLogical [3], iGetLun, iGetParentDirectory
iGetSymbol [2], iGetSymbol [3], iGetTopDirectory, iHideLogical, iLastFragment
iListAllLun, iOSCheckDirectory [1], iOSCheckDirectory [2]
iOSCheckDirectory [3], iOSCopyFile [1], iOSCopyFile [2], iOSCopyFile [3]
iOSGetDirectory [1], iOSGetDirectory [2], iOSGetDirectory [3]
iOSGetForeign [1], iOSGetForeign [2], iOSGetForeign [3], iOSSpawnCmd [1]
iOSSpawnCmd [2], iOSSpawnCmd [3], iOSSpawnCmd [4], iParentFragment, iScratchLun
iSearch [1], iSearch [2], iSearch [3], iSetFileSpec, iSetLogical [2]
iSetLogical [3], iSetSymbol [2], iSetSymbol [3], iTopFragment, iUniqueName
ice_write, 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)
[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:
bOSFind [1], bOSFind [2], 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)
[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
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)