NAG Library Routine Document
D02ZAF calculates the weighted norm of the local error estimate from inside a MONITR
called from an integrator in sub-chapter D02M–N
(e.g., see D02NBF
|REAL (KIND=nag_wp) D02ZAF
D02ZAF is for use with the forward communication integrators D02NBF
and the reverse communication integrators D02NMF
. It must be used only inside MONITR
(if this option is selected) for the forward communication routines or on the equivalent return for the reverse communication routines. It may be used to evaluate the norm of the scaled local error estimate,
, where the weights used are contained in
and the norm used is as defined by an earlier call to the integrator setup routine (D02MVF
). Its use is described under the description of MONITR
in the specifications for the forward communication integrators mentioned above.
- 1: NEQ – INTEGERInput
On entry: the number of differential equations, as defined for the integrator being used.
- 2: V(NEQ) – REAL (KIND=nag_wp) arrayInput
: the vector, the weighted norm of which is to be evaluated by D02ZAF. V
is calculated internally by the integrator being used.
- 3: W(NEQ) – REAL (KIND=nag_wp) arrayInput
On entry: the weights, calculated internally by the integrator, to be used in the norm evaluation.
- 4: IFAIL – INTEGERInput/Output
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, because for this routine the values of the output parameters may be useful even if
on exit, the recommended value is
. When the value is used it is essential to test the value of IFAIL 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
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Note: D02ZAF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
The value of the norm would either overflow or is close to overflowing. A value close to the square root of the largest number on the computer is returned.
The result is calculated close to machine precision except in the case when the routine exits with .
D02ZAF should only be used within MONITR
associated with the integrators in sub-chapter D02M–N
(e.g., see D02NBF
). Its use and only valid calling sequence are fully documented in the description of MONITR
in the routine documents for the integrators.
This example solves the well-known stiff Robertson problem
over the range
with initial conditions
using scalar error control (
) and computation of the solution at
(e.g., see D02MVF
) set to
). A BDF integrator (setup routine D02NVF
) is used and a modified Newton method is selected. This example illustrates the use of D02ZAF within a monitor routine MONITR
to output intermediate results during the integration. The same problem is solved in the example program for D02NBF
where no monitoring was performed and so no intermediate solution information is output.
9.1 Program Text
Program Text (d02zafe.f90)
9.2 Program Data
Program Data (d02zafe.d)
9.3 Program Results
Program Results (d02zafe.r)