Function: GDSINP
Purpose: GDSINP prompts the user to enter the name of a set and
the subsets, and returns the number of subsets entered.
Category: USER IO
Files: gdsinp.c
Author: K.G. Begeman
Use: INTEGER GDSINP( SET , I/O character*(*)
SUBSET , O integer array
MAXSUB , I integer
DEFAULT , I integer
KEYWORD , I character*(*)
MESSAGE , I character*(*)
SHOWDEV , I integer
AXPERM , O integer array
AXCOUNT , O integer array
MAXAXES , I integer
CLASS , I integer
CLASSDIM ) I/O integer
GDSINP Returns the number of subsets entered by user or
-1 in case of unrecoverable errors.
SET On input name of default set (and subsets) as the
user would have to type in and is appended in the
standard MESSAGE (not when an own message is used).
On output SET will contain the name only, even when
default subsets were specified.
If defaults are allowed and used by user, and SET is
on input blank, then GDSINP returns 0 for the number
of subsets.
SUBSET Array containing subsets coordinate words.
MAXSUB Maximum number of subsets in SUBSET.
DEFAULT Default code as in USERxxx. It determines whether
the user is prompted for a SET and/or a default
value of SET is accepted or not and whether an
exact number of subsets is required (specified in
MAXSUB).
If 100 is added to the default code, then the user is
not prompted and in case of errors GDSINP rejects
the keyword and returns -1 immediately.
KEYWORD Keyword prompts the user for set and subset(s).
Normally KEYWORD = 'SET='.
MESSAGE Message for the user. If MESSAGE is blank, standard
message 'give set information' will be used.
SHOWDEV Device number (as in ANYOUT) to which GDSINP sends
some info about the input set.
AXPERM Array of size MAXAXES containing the axes numbers.
The first elements (upto the dimension of the subset)
contain the axes numbers of the subset, the other ones
contain the axes numbers outside the subset ordered
according to the specification by the user.
AXCOUNT Array of size MAXAXES containing the number of grids
along an axes as specified by the user. The first
elements (upto the dimension of the subset) contain
the length of the subset axes, the other ones contain
the number of grids along an axes outside the subset.
MAXAXES Maximum number of axes the program can deal with.
This is the size of AXPERM and AXCOUNT.
CLASS What class of input is wanted. Class 1 is for
applications which repeat the operation for each
subset (MNMX), Class 2 is for applications for
which the operation requires an interaction between
the different subsets (MEAN). Class 2 programs need
always more than one subset (See GIPSY MEMO #1).
CLASSDIM Dimensionality of the subsets for class 1
applications, number of axes outside the subset
for class 2 programs. If on input CLASSDIM is zero
then the user is free to determine the number of
axes of the subsets for class 1 and the number of
axes outside the subset for class 2 applications.
Then on output CLASSDIM will contain the dimensions
of the subset (class 1) or the number of axes
outside the subset (class 2).
Description: GDSINP is a function which prompts the user to enter the name
of a set and (optionally) subset(s) and returns the number of
subsets entered. This routine checks whether the set and
subsets entered are present. If not present, it will inform
the user and prompts again for set and subsets.
Related Docs: gdsout.dc2, gdsasn.dc2, gdscss.dc2, gdscpa.dc2, gdscsa.dc2
Updates: Jan 22, 1990: KGB, Document created.
Dec 11, 1991: KGB, cancel replaced by reject.
Jul 14, 1994: VOG, Inserted new KGB '1.0+DBL_EPSILON' code
Nov 7, 1997: JPT, Implemented default code +100
Jul 12, 2000: JPT, Increased set name length to 256
Apr 09, 2009: VOG, Replaced NINT definition with one that
uses floor(). Several other routines
dealing with coordinates now use the
same definition. The routines now can deal
properly with CRPIX values that end on 0.5
(tested for both negative and positive CRPIX)