2. Communication between operators and the Supervisor#

Operators make requests to the Supervisor about the content of user commands.

To do this, they have a set of routines allowing them to access keyword arguments:

  • Request for access to keyword values:

    A set of sub-programs specific to each type known to the supervisor is available:

getvis

Retrieving integer values

getvr8

Retrieving real values

getvc8

Retrieving complex values

getvid

Retrieving a concept name

getvtx

Retrieving text values (character string)

getltx

Retrieving text value lengths

  • Request for access to the result:

    The getres subprogram allows you to obtain the user name of the result as well as the name of the associated type known by the supervisor.

  • Query concerning the composition of the commands in the command file:

getfac

Retrieving the number of occurrences of a factor keyword

gettco

Retrieving the type of a concept.

gcucon

Presence of a concept in the command set

2.1. Description of user routines#

2.1.1. Arguments for getvxx routines#

The getvxx routines allow you to retrieve the values provided in a simple keyword located under a keyword factor, in the current command.

The signature of the routines is therefore (only the type of values returned changes):

call getvxx (keyword, keyword, iocc, iocc, iocc, nbval, vect, scal, nbret, isdefault)

  • motfac is the name of the factor keyword, “” if the simple keyword is not under a factor keyword.

  • keyword is the name of the simple keyword.

The following arguments are optional.

  • iocc is the occurrence number of the keyword factor.

  • nbval is the maximum number of values to write to vect.

  • vect is the vector in which the values read will be written.

  • scal is the receptacle variable when you only want to read one value.

  • nbret is the number of values actually read if nbret is positive or zero. If nbret is negative, there were more values than nbval (example: the user enters 3 values, if nbval=2, we will have nbret=-3 and the first 2 values are assigned in the vector vect).

  • isdefault is 1 if the value was entered by the user, 0 if it is the catalog default.

Warning

isdefault*is not relevant if the simple keyword (or the factor keyword that contains it) is under a block.*

To find out how many values have been entered and thus to correctly size the vector vect, we usually make a call of this type with nbval=0:

call getvxx (keyword, keyword, iocc, iocc, nbval=0, nbret=nbv)

allocating an array of size -nbv, then:

call getvxx (keyword, keyword, iocc, iocc, nbval=-nbv, vect=array)

2.1.2. Handling detected errors#

The main errors detectable during supervision are:

  1. the command file does not contain the simple keyword you are looking for:

    • first case: the order catalog proposes a value by default for the keyword: this value is returned by the routine,

    • second case: there is no default value but the status of the parameter is « optional » (“f”): the routine returns nbret=0,

    • third case: the parameter is mandatory; the processing is interrupted in phase 1 of the analysis of the command file (see Summary Operation of the Supervisor, page 1).

  2. An invalid value for iocc: the routine returns nbret=0

  3. A query is made on a factor keyword or a simple keyword that does not exist in the order catalog (typing error).

2.1.3. List of getvxx routines#

getvc8: reading a “C” parameter, complex numbers. vect and scal are declared complex (kind=8).

getvis: reading an “I” parameter, integer numbers. vect and scal are declared integer.

getvr8: reading an “R” parameter, real numbers. vect and scal are declared real (kind=8).

getvtx: reading a parameter of type “TXM”, character strings. vect and scal are declared character (len=*).

getvid: reading a “CO” parameter, concepts. vect and scal are declared character (len=*).

2.1.4. getltx to get the lengths of the strings of a character string parameter#

Purpose

From the current command, from the name of a simple keyword located under a keyword factor - from the current command - whose name is provided or located directly under the current command, the GETLTX routine returns in an integer array the exact length of each character string attached to the simple keyword in the command file.

The exact length of a character string is the exact number of significant characters (not blanks) that make up the value attached to the simple keyword.

Usage

In a Fortran routine, GETLTX requires the following arguments:

MOTFAC

Name of the keyword factor, of the current command, in which we are looking for the simple keyword. White space if the simple keyword MOTCLEest is located directly under the current command.

MOTCLE

The name of the simple keyword in which to search for values. The simple keyword can be located under a factor keyword of the current command, in a block of the current command, under a keyword factor of a block of the current command, or directly under the current command. In the first case, MOTFACne should not be white.

IOCC

In the case where the keyword factor appears multiple times, in the current command, IOCCindique is the occurrence number for which the user is looking for the simple keyword; if there is only one occurrence, IOCCdoit be equal to 1. The number of occurrences of the keyword factor can be obtained using the routine GETFAC (see page 1). In the case where the keyword factor is blank, argument IOCCest ignored.

IARG

Value 0 if the value was entered by the user, 1 if it is the default value defined in the catalog.

MXVAL

Maximum number of values returned, in other words size of the ISVAL array (this number can be determined dynamically see p. 1)

ISVAL

An array containing the NBVALlongueur of the returned strings; if the simple keyword is not found in the command set, the Fortran array ISALn is not changed.

NBVAL

Effective number of values returned (=0, if values were not found in the command set), if the number of values in the command file is greater than MXVAL, the list of returned values is truncated to MXVALvaleurs and NBVALest returned with the negative value - MXVAL.

2.1.5. GETRES for information on the result of an order#

Purpose

The routine GETRES returns the information concerning the current command in character strings:

  • the username of the concept returned (if there is one),

  • the type of concept returned (if there is one),

  • the name of the order.

For example from the command:

mail= LIRE_MAILLAGE ()

The call to GETRES

CALL GETRES (numbers, concept, nomcmd)

returns:

NOMRES with the value “mail”

CONCEP with value “MAILLAGE”

NOMCMD with value “LIRE_MAILLAGE”

Usage

In a Fortran routine, GETRES requires the following arguments:

NOMRES

Name given by the user to the result produced by the current command. The case of this name (lower case or upper case) is retained. If the result name in the file is too long for the capacity of the NOMRES variable, the supervisor truncates the returned string to fit the size of the variable. If the current command is a procedure - that is, an operation with no result - NOMRESest blanked out.

CONCEP

Result type NOMRES; this information is defined by the command developer in the command catalog (sd_prod keyword) If the current command is a procedure - that is, an operation with no result - CONCEPest blanked out.

NOMCMD

Name of the current command (its text without its arguments).

2.1.6. GETFAC to get the number of occurrences of a factor keyword#

Purpose

Routine GETFAC returns the number of times this factor keyword appears in the current command.

Usage

In a Fortran routine, GETFAC requires the following arguments:

MOTFAC

Name of the keyword factor, of the current command.

IOCC

Number of occurrences of the factor keyword.

2.1.7. GETTCO to get the type attached to a concept#

Purpose

From the name of a concept, the result produced by a command, GETTCO returns the name of its type. We can of course consult GETTCO on concepts retrieved as simple keyword arguments, not necessarily produced by the current command.

Usage

In a Fortran routine, GETTCO requires the following arguments:

NOMCO

Concept name

TYPECO

Type name attached to concept name

2.1.8. GCUCON to test the existence of a concept in the command set#

Purpose

Verification of the existence of the couple (resul, concept) in the results produced by the previous steps.

Usage

In a Fortran routine, GCUCON requires the following arguments:

RESUL

Concept name

CONCEP

Type name attached to concept name

IRET

Return code: >0 if present, 0 if absent