# NAG Library Routine Document

## 1Purpose

e02zkf either initializes or resets the optional parameter arrays or sets a single optional parameter for supported problem solving routines in Chapter E02. Currently, only e02jdf is supported.

## 2Specification

Fortran Interface
 Subroutine e02zkf ( opts,
 Integer, Intent (In) :: liopts, lopts Integer, Intent (Inout) :: iopts(liopts), ifail Real (Kind=nag_wp), Intent (Inout) :: opts(lopts) Character (*), Intent (In) :: optstr
#include nagmk26.h
 void e02zkf_ (const char *optstr, Integer iopts[], const Integer *liopts, double opts[], const Integer *lopts, Integer *ifail, const Charlen length_optstr)

## 3Description

e02zkf 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 $\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}$ $\mathrm{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 e02zlf. To initialize the optional parameter arrays iopts and opts for a specific problem solving routine, the option Initialize is used with $\mathit{optval}$ identifying the problem solving routine to be called. For example, to initialize optional parameter arrays to be passed to e02jdf, e02zkf is called as follows:
```Call e02zkf('Initialize = e02jdf', iopts, liopts, opts, lopts, ifail)
```
Note that the routine name may be abbreviated to just the first five letters of the ‘short’ name, or by omitting the nagf_ or fit_ prefixes of the ‘long’ name. So the above may be equivalently specified as 'Initialize = e02jd' or 'Initialize = dim2_spline_ts_sctr'.
Information relating to available option names and their corresponding valid values is given in Section 11 in e02jdf.

None.

## 5Arguments

1:     $\mathbf{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 of the problem solving routine you wish to use.
$\mathbf{Defaults}$
Resets all options to their default values.
$\mathit{option}=\mathit{optval}$
See Section 11 in e02jdf for details of valid values for option and optval. The equals sign ($=$) delimiter must be used to separate the option from its optval.
The processing of optstr does not depend on its case. Each token in the option and optval component must be separated by at least one space.
2:     $\mathbf{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 e02zkf, e02zlf or the selected problem solving routine or suite of routines.
On exit: dependent on the contents of optstr, either an initialized, reset or updated version of the optional parameter array.
3:     $\mathbf{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:     $\mathbf{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 e02zkf, e02zlf or the selected problem solving routine or suite of routines.
On exit: dependent on the contents of optstr, either an initialized, reset or updated version of the optional parameter array.
5:     $\mathbf{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:     $\mathbf{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).

## 6Error 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}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=12$
On entry, the expected delimiter ‘$=$’ was not found in optstr: ${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=13$
On entry, could not convert the specified optval to an integer: ${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
On entry, could not convert the specified optval to a real: ${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=14$
On entry, attempting to initialize the optional parameter arrays but specified routine name was not valid: $\text{name}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=15$
On entry, the optval supplied for the integer optional parameter is not valid.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=16$
On entry, the optval supplied for the real optional parameter is not valid.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=17$
On entry, the optval supplied for the character optional parameter is not valid.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=21$
On entry, either the option arrays have not been initialized or they have been corrupted.
${\mathbf{ifail}}=31$
On entry, ${\mathbf{liopts}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{liopts}}\ge 〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=51$
On entry, ${\mathbf{lopts}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{lopts}}\ge 〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=-99$
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.

Not applicable.

## 8Parallelism and Performance

e02zkf 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 implementation-specific information.