NAG Library Routine Document
D01ZKF
Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
1 Purpose
D01ZKF either initializes or resets the optional parameter arrays or sets a single optional parameter for supported problem solving routines in
Chapter D01.
2 Specification
INTEGER
IOPTS(LIOPTS), LIOPTS, LOPTS, IFAIL
REAL (KIND=nag_wp)
OPTS(LOPTS)
CHARACTER(*)
OPTSTR
3 Description
D01ZKF has three purposes: to initialize optional parameter arrays; to reset all optional parameters to their default values; or to set a single optional parameter to a user-supplied value.
Optional parameters and their values are, in general, presented as a character string,
OPTSTR, of the form ‘
option ’; alphabetic characters can be supplied in either upper or lower case. Both
option and
may consist of one or more tokens separated by white space. The tokens that comprise
will normally be either an integer, real or character value as defined in the description of the specific optional argument. In addition all optional parameters can take an
DEFAULT which resets the optional parameter to its default value.
It is imperative that optional parameter arrays are initialized before any options are set, before the relevant problem solving routine is called and before any options are queried using
D01ZLF. To initialize the optional parameter arrays
IOPTS and
OPTS for a specific problem solving routine, the option
Initialize is used with
optval identifying the problem solving routine to be called, via its short name. For example, to initialize the optional parameter arrays to be passed to
D01RAF, and its associated routines
D01RBF and
D01RCF, D01ZKF is called as follows:
call D01ZKF('Initialize = d01raf', IOPTS, LIOPTS, OPTS, LOPTS, IFAIL)
The available option names and their corresponding valid values are given in
Section 10 in D01RAF.
4 References
None.
5 Parameters
- 1: OPTSTR – CHARACTER(*)Input
On entry: a string identifying the option to be set.
- Initialize the optional parameter arrays IOPTS and OPTS for use with routine , where is the short name associated with the routine of interest. The associated long name may also be used, however only the short name will be returned if D01ZLF is called with .
- Resets all options to their default values.
- See Section 10 in D01RAF for details of valid values for option and optval. The equals sign () delimiter must be used to separate the option from its optval value.
OPTSTR is case insensitive. Each token in the
option and
optval component must be separated by at least one space.
- 2: IOPTS(LIOPTS) – INTEGER arrayCommunication Array
On entry: optional parameter array.
If
OPTSTR has the form
, the contents of
IOPTS need not be set.
Otherwise,
IOPTS must not have been altered since the last call to D01ZKF,
D01ZLF or the selected problem solving routine.
On exit: dependent on the contents of
OPTSTR, either an initialized, reset or updated version of the optional parameter array.
- 3: LIOPTS – INTEGERInput
On entry: the length of the array
IOPTS.
Constraint:
unless otherwise stated in the documentation for a specific, supported, problem solving routine, .
- 4: OPTS(LOPTS) – REAL (KIND=nag_wp) arrayCommunication Array
On entry: optional parameter array.
If
OPTSTR has the form
, the contents of
OPTS need not be set.
Otherwise,
OPTS must not have been altered since the last call to D01ZKF,
D01ZLF or the selected problem solving routine.
On exit: dependent on the contents of
OPTSTR, either an initialized, reset or updated version of the optional parameter array.
- 5: LOPTS – INTEGERInput
On entry: the length of the array
OPTS.
Constraint:
Unless otherwise stated in the documentation for a specific, supported, problem solving routine, .
- 6: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
On entry, the
option in
OPTSTR has not been recognized.
.
-
On entry,
OPTSTR did not contain the delimiter ‘
’.
-
On entry, could not convert the specified optval to an integer:
.
On entry, could not convert the specified optval to a real:
.
On entry, the
optval,
, associated with
OPTSTR was partially recognized as a numerical value. However, it could not be fully interpreted.
-
On entry, the
option in
OPTSTR has been detected as
Initialize, however the
optval,
, associated with
OPTSTR has not been recognized as a valid routine name.
On entry, the integer
optval associated with the optional parameter is not valid. One of the following may apply:
-
On entry, the absolute value of the integer present in OPTSTR is above the maximum allowable value.
, required.
-
On entry, the absolute value of the integer present in OPTSTR is below the minimum required value.
, required.
-
On entry, the integer value present in OPTSTR is above the maximum allowable value.
, required.
-
On entry, the integer value present in OPTSTR is below the minimum allowable value.
, required.
-
On entry, the integer value present in OPTSTR is outside of allowable bounds.
, required.
-
On entry, the integer value present in OPTSTR is outside the allowable set.
.
On entry, the real
optval associated with the optional parameter is not valid. One of the following may apply:
-
On entry, the magnitude of the real value present in OPTSTR is above the maximum allowable value.
, required.
-
On entry, the magnitude of the real value present in OPTSTR is below the minimum required.
, required.
-
On entry, the real value present in OPTSTR is above the maximum allowable value.
and required.
-
On entry, the real value present in OPTSTR is below the minimum required value.
, required.
-
On entry, the real value present in OPTSTR is outside allowable bounds.
, required.
-
On entry, the real value present in OPTSTR is outside the allowable set.
.
On entry, the character
optval associated with the optional parameter is not valid. One of the following may apply:
-
On entry, the value of optval in OPTSTR is not compatible with the option in OPTSTR. .
-
The pairing present in OPTSTR is not compatible with the routine for which the option arrays were initialized.
-
Either the option arrays have not been initialized, have been corrupted, or are not compatible with this option setting routine.
Either the option arrays have not been initialized, have been corrupted, or are not compatible with this option setting routine.
On entry, the optional parameter arrays
IOPTS and
OPTS have not been initialized, or have been corrupted.
-
LIOPTS is insufficient for the chosen routine name.
On entry,
.
Constraint:
.
-
LOPTS is insufficient for the chosen routine name.
On entry,
.
Constraint:
.
-
Dynamic memory allocation failed.
7 Accuracy
Not applicable.
For suites of routines that share the same option arrays, the option arrays must be initialized using the primary (driver) routine name.
9 Example
See the example programs associated with the problem solving routine you wish to use for a demonstration of how to use D01ZKF to initialize option arrays and set options.