## SIC Arguments Retrieving Routines

    Available subroutines:
              SIC_L4          SIC_I4          SIC_R4          SIC_R8
              SIC_CH          SIC_KE          SIC_NEXT

    Available functions:
              SIC_PRESENT     SIC_LEN         SIC_NARG        SIC_START

There are 5 retrieving routines following similar calling conventions

              Argument Data Type      Name of Subroutine
                    REAL(KIND=8)            SIC_R8
                    REAL(KIND=4)            SIC_R4
                    INTEGER(KIND=4)         SIC_I4
                    LOGICAL(KIND=4)         SIC_L4
                    CHARACTER(LEN=*)        SIC_CH, SIC_KE

    The calling syntax is the following
              CALL SIC_Name (LINE,IOPT,IARG,ARGUM,PRESENT,ERROR)
    Except for SIC_CH and SIC_KE
              CALL SIC_CH   (LINE,IOPT,IARG,ARGUM,LARG,PRESENT,ERROR)
              CALL SIC_KE   (LINE,IOPT,IARG,ARGUM,LARG,PRESENT,ERROR)

- LINE Character*(*)
  is the last command line processed from which arguments are to be retrieved.
- IOPT Integer
  is the number of the option. 0 means the command. Options are numbered in the order where they appear in the vocabulary array after the command name.
- IARG Integer
  is the number of the argument of the option/command to be retrieved. 0 means the option/command itself.
- ARGUM (Type depending on the subroutine called)
  is the argument to be returned
- LARG Integer
  is the returned number of characters for SIC_CH and SIC_KE
- PRESENT Logical
  is a logical indicating whether the argument must be present (.TRUE.) or not (.FALSE.).
- ERROR An logical error flag
  which is set if either i) PRESENT = .TRUE. and the argument is missing or ii) a decoding error occured.

SIC_KE is like SIC_CH, but expects a “keyword”, and thus returns the argument after upper case conversion.

In addition there are other functions related to the arguments:

INTEGER FUNCTION SIC_NARG(IOPT)

returns the number of arguments present for option IOPT.

LOGICAL FUNCTION SIC_PRESENT(IOPT,IARG)

returns a logical value indicating the presence of the IARG-th argument of the IOPT-th option.

SUBROUTINE SIC_AMBIGS(FACILITY,NAME,FULL,VOCAB,MVOC,IVOC,ERROR)

search for NAME in the vocabulary VOCAB, and returns the corresponding pointer IVOC in the vocabulary and corresponding keyword FULL = VOCAB(IVOC) if NAME is a non-ambiguous abbreviation of FULL.

- FACILITY Character*(*)
  A character string containing the name of the calling subroutine. This string is printed before any failure message (ambiguous or non existing keyword).
- NAME Character*(*)
  The input name to be searched for in the vocabulary
- FULL Character*(*)
  The complete keyword returned.
- IVOC Integer
  The keyword number in the vocabulary.
- MVOC Integer
  The number of keywords in the vocabulary.
- VOCAB Character*(*)(MVOC)
  The vocabulary.
- ERROR Logical
  An error flag set if the input name was ambiguous, invalid or not found in the vocabulary.

Typically, NAME will have been recovered by a call to SIC_KE

INTEGER FUNCTION SIC_LEN(IOPT,IARG)

returns the total length of the IARG-th argument of the IOPT-th option. Returns 0 if SIC_PRESENT(IOPT,IARG)=.FALSE.

INTEGER FUNCTION SIC_START(IOPT,IARG)

returns a pointer to the address of the argument in the character string. Returns 0 if SIC_PRESENT(IOPT,IARG)=.FALSE.. This routine can be used with SIC_LEN for special processing of arguments, such as sexagesimal decoding.

SUBROUTINE SIC_NEXT(LINE(NEXT:),ARGUM,LARG,NEXT)

This subroutine can be used for special processing of text with a syntax similar to command lines, i.e. text in which the delimiters are single spaces, strings being included between double quotes. Provided it is called with the text restricted to the current delimiter position LINE(NEXT:), it returns the position of the next delimiter NEXT (space, skipping strings), the character string included between these delimiters, ARGUM and its length LARG. This string may further be decoded as double precision value using routine SIC_MATH or SIC_SEXA, logical value using routine SIC_LOGICAL, or used as character constant.