NAG Library Routine Document
E05ZKF
1 Purpose
E05ZKF either initializes or resets the optional parameter arrays or sets a single optional parameter for supported problem solving routines in
Chapter E05.
The following routines are supported:
2 Specification
INTEGER 
IOPTS(LIOPTS), LIOPTS, LOPTS, IFAIL 
REAL (KIND=nag_wp) 
OPTS(LOPTS) 
CHARACTER(*) 
OPTSTR 

3 Description
E05ZKF 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 usersupplied value.
Optional parameters and their values are, in general, presented as a character string,
OPTSTR, of the form ‘
option $\text{}=\mathit{optval}$’; alphabetic characters can be supplied in either upper or lower case. Both
option and
$\mathit{optval}$ may consist of one or more tokens separated by white space. The tokens that comprise
$\mathit{optval}$ 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
$\mathit{optval}$ 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
E05ZLF. 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 optional parameter arrays to be passed to
E05SAF, E05ZKF is called as follows:
call E05ZKF('Initialize = e05saf', IOPTS, LIOPTS, OPTS, LOPTS, IFAIL)
Information relating to available option names and their corresponding valid values is given in Section 12 in
E05SAF,
E05SBF,
E05UCF and
E05USF.
4 References
None.
5 Arguments
 1: $\mathrm{OPTSTR}$ – CHARACTER(*)Input

On entry: a string identifying the option to be set.
 $\mathbf{Initialize}=\mathit{routine\; name}$
 Initialize the optional parameter arrays IOPTS and OPTS for use with routine $\mathit{routine\; name}$, where $\mathit{routine\; name}$ is the short name associated with the routine of interest.
 $\mathbf{Defaults}$
 Resets all options to their default values.
 $\mathit{option}=\mathit{optval}$
 See Section 12 in E05SAF, E05SBF, E05UCF and E05USF 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: $\mathrm{IOPTS}\left({\mathbf{LIOPTS}}\right)$ – INTEGER arrayCommunication Array

On entry: optional parameter array.
If
OPTSTR has the form
${\mathbf{Initialize}}=\mathit{routine\; name}$, the contents of
IOPTS need not be set.
Otherwise,
IOPTS must not have been altered since the last call to E05ZKF,
E05ZLF 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: $\mathrm{LIOPTS}$ – INTEGERInput

On entry: the length of the array
IOPTS.
Constraint:
unless otherwise stated in the documentation for a specific, supported, problem solving routine, ${\mathbf{LIOPTS}}\ge 100$.
 4: $\mathrm{OPTS}\left({\mathbf{LOPTS}}\right)$ – REAL (KIND=nag_wp) arrayCommunication Array

On entry: optional parameter array.
If
OPTSTR has the form
${\mathbf{Initialize}}=\mathit{routine\; name}$, the contents of
OPTS need not be set.
Otherwise,
OPTS must not have been altered since the last call to E05ZKF,
E05ZLF 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: $\mathrm{LOPTS}$ – INTEGERInput

On entry: the length of the array
OPTS.
Constraint:
unless otherwise stated in the documentation for a specific, supported, problem solving routine, ${\mathbf{LOPTS}}\ge 100$.
 6: $\mathrm{IFAIL}$ – INTEGERInput/Output

On entry:
IFAIL must be set to
$0$,
$1\text{ or}1$. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
$1\text{ or}1$ is recommended. If the output of error messages is undesirable, then the value
$1$ is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
$0$.
When the value $\mathbf{1}\text{ or}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit:
${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
${\mathbf{IFAIL}}=0$ or
$1$, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
 ${\mathbf{IFAIL}}=11$

On entry, the optional parameter in
OPTSTR was not recognized:
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=12$

On entry, the expected delimiter ‘
$=$’ was not found in
OPTSTR:
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=13$

On entry, could not convert the specified optval to an integer: ${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
On entry, could not convert the specified optval to a real: ${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
The
option in
OPTSTR is associated with a numerical value. However, the
optval,
$\u2329\mathit{\text{value}}\u232a$, present in
OPTSTR could not be fully interpreted.
 ${\mathbf{IFAIL}}=14$

On entry, the
option in
OPTSTR has been detected as
Initialize, however the
optval,
$\u2329\mathit{\text{value}}\u232a$, associated with
OPTSTR has not been recognized as a valid routine name.
 ${\mathbf{IFAIL}}=15$

On entry, the optval supplied for the integer optional parameter is not valid.
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=16$

On entry, the optval supplied for the real optional parameter is not valid.
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=17$

On entry, the optional parameter in
OPTSTR was not recognized:
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
On entry, the optval supplied for the character optional parameter is not valid.
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=21$

On entry, either the option arrays have not been initialized or they have been corrupted.
On entry, the optional parameter in
OPTSTR was not recognized:
${\mathbf{OPTSTR}}=\u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=31$

On entry, ${\mathbf{LIOPTS}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{LIOPTS}}\ge \u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=51$

On entry, ${\mathbf{LOPTS}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{LOPTS}}\ge \u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{IFAIL}}=99$
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
 ${\mathbf{IFAIL}}=399$
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
 ${\mathbf{IFAIL}}=999$
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7 Accuracy
Not applicable.
8 Parallelism and Performance
E05ZKF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementationspecific information.
Some options have default values which are problem dependent. For example the option
Maximum Iterations Completed for
E05SAF has the default value
$1000\times {\mathbf{NDIM}}$. If options such as this are set, they may only be set to constant values. If such an option is reset to its DEFAULT value its dependence on the specific problem will be restored.
10 Example
See the example programs associated with the problem solving routine you wish to use for a demonstration of how to use E05ZKF to initialize option arrays and set options.