# NAG Library Routine Document

## 1Purpose

d02nzf is a setup routine which must be called, if optional inputs need resetting, prior to a continuation call to any of those integrators in Sub-chapter D02M–N that use methods set up by calls to d02mvf, d02nvf or d02nwf.

## 2Specification

Fortran Interface
 Subroutine d02nzf ( h, hmin, hmax,
 Integer, Intent (In) :: neqmax, maxstp, mxhnil Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: tcrit, h, hmin, hmax Real (Kind=nag_wp), Intent (Inout) :: rwork(50+4*neqmax)
#include nagmk26.h
 void d02nzf_ (const Integer *neqmax, const double *tcrit, const double *h, const double *hmin, const double *hmax, const Integer *maxstp, const Integer *mxhnil, double rwork[], Integer *ifail)

## 3Description

d02nzf is provided to permit you to reset many of the arguments which control the integration ‘on the fly’, that is in conjunction with the interrupt facility permitted through the argument itask of the integrator (e.g., see d02nbf). In addition to a number of arguments which you can set initially through one of the integrator setup routines, the step size to be attempted on the next step may be changed.

## 4References

See the D02M–N Sub-chapter Introduction.

## 5Arguments

1:     $\mathbf{neqmax}$ – IntegerInput
On entry: the value used for the argument neqmax when calling the integrator.
Constraint: ${\mathbf{neqmax}}\ge 1$.
2:     $\mathbf{tcrit}$ – Real (Kind=nag_wp)Input
On entry: a point beyond which integration must not be attempted. The use of tcrit is described under the argument itask in the specification for the integrator (e.g., see d02nbf). A value, $0.0$ say, must be specified even if itask subsequently specifies that tcrit will not be used.
3:     $\mathbf{h}$ – Real (Kind=nag_wp)Input
On entry: the next step size to be attempted. Set ${\mathbf{h}}=0.0$ if the current value of h is not to be changed.
4:     $\mathbf{hmin}$ – Real (Kind=nag_wp)Input
On entry: the minimum absolute step size to be allowed. Set ${\mathbf{hmin}}=0.0$ if this option is not required. Set ${\mathbf{hmin}}<0.0$ if the current value of hmin is not to be changed.
5:     $\mathbf{hmax}$ – Real (Kind=nag_wp)Input
On entry: the maximum absolute step size to be allowed. Set ${\mathbf{hmax}}=0.0$ if this option is not required. Set ${\mathbf{hmax}}<0.0$ if the current value of hmax is not to be changed.
6:     $\mathbf{maxstp}$ – IntegerInput
On entry: the maximum number of steps to be attempted during one call to the integrator after which it will return with ${\mathbf{ifail}}={\mathbf{2}}$ (see d02ncf). Set ${\mathbf{maxstp}}=0$ if this option is not required. Set ${\mathbf{maxstp}}<0$ if the current value of maxstp is not to be changed.
7:     $\mathbf{mxhnil}$ – IntegerInput
On entry: the maximum number of warnings printed (if ${\mathbf{itrace}}\ge 0$, e.g., see d02nbf) per problem when $t+h=t$ on a step ($h=\text{​ current step size}$). If ${\mathbf{mxhnil}}\le 0$, a default value of $10$ is assumed.
8:     $\mathbf{rwork}\left(50+4×{\mathbf{neqmax}}\right)$ – Real (Kind=nag_wp) arrayCommunication Array
This must be the same workspace array as the array rwork supplied to the integrator. It is used to pass information from the integrator to d02nzf and therefore its contents must not be changed before calling d02nzf.
9:     $\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$
${\mathbf{neqmax}}<1$.
${\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

d02nzf is not threaded in any implementation.