# NAG Library Routine Document

## 1Purpose

e04zpf is an option setting routine for all solvers from the NAG optimization modelling suite. It can set one or more optional parameters from an external file.

## 2Specification

Fortran Interface
 Subroutine e04zpf (
 Integer, Intent (In) :: infile Integer, Intent (Inout) :: ifail Type (c_ptr), Intent (In) :: handle
#include nagmk26.h
 void e04zpf_ ( void **handle, const Integer *infile, Integer *ifail)

## 3Description

e04zpf may be used to supply values for optional parameters to the solver from an external file. It can only be called on handles which have been initialized by e04raf and before the call to the solver. e04zpf looks in the file for a specific section containing the optional parameters. The section must start with a line Begin and must finish with a line End. Anything outside the section is ignored. If there is more than one section like this, only the first one is processed. Any line within the section is either blank or a comment which is ignored or defines a single optional parameter as if it had been set by e04zmf. The implied data type (character, integer or real) of each value to be set must match that expected by the corresponding optional parameter. It is only necessary to supply values for those arguments whose values are to be different from their default values. A comment begins with an asterisk (*) and all subsequent characters to the end of the line are ignored. Comments can also be placed after the optional parameter. The file is case insensitive.
Note that the optional parameters printed by the solver or by e04ryf are in the compatible format. An example of a valid options file is:
```Begin * Example options file
Print Level = 3
Monitoring Level = 5 * output all details
Monitoring File = 42 * to this file
End```

None.

## 5Arguments

1:     $\mathbf{handle}$ – Type (c_ptr)Input
On entry: the handle to the problem. It needs to be initialized by e04raf and must not be changed.
2:     $\mathbf{infile}$ – IntegerInput
On entry: the file identifier associated with the argument data file. Note:  that the file needs to be opened in read mode by x04acf with ${\mathbf{mode}}=0$.
Constraint: ${\mathbf{infile}}\ge 0$.
3:     $\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}}=1$
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by e04raf or it has been corrupted.
${\mathbf{ifail}}=2$
The options cannot be modified in this phase.
${\mathbf{ifail}}=3$
On entry, ${\mathbf{infile}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{infile}}\ge 0$.
${\mathbf{ifail}}=4$
BEGIN found, but end-of-file found before END. All optional parameters that were set from the file before this error was encountered will remain set on exit.
End-of-file or read error detected before BEGIN was found.
${\mathbf{ifail}}=11$
The option provided on line $〈\mathit{\text{value}}〉$ was not recognized.
${\mathbf{ifail}}=12$
The expected delimiter ‘$=$’ was not found on line $〈\mathit{\text{value}}〉$.
${\mathbf{ifail}}=13$
The optval provided on line $〈\mathit{\text{value}}〉$ could not be converted to the expected numerical type.
${\mathbf{ifail}}=15$
The optval provided on line $〈\mathit{\text{value}}〉$ for the integer optional parameter is out of bounds.
${\mathbf{ifail}}=16$
The optval provided on line $〈\mathit{\text{value}}〉$ for the real optional parameter is out of bounds.
${\mathbf{ifail}}=17$
The optval provided on line $〈\mathit{\text{value}}〉$ for the character optional parameter is not valid.
${\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

e04zpf is not threaded in any implementation.