# NAG Library Routine Document

## 1Purpose

d03rzf is designed to be used in conjunction with d03rbf. It can be called from the monitr to obtain the number of grid points and their $\left(x,y\right)$ coordinates on a solution grid.

## 2Specification

Fortran Interface
 Subroutine d03rzf ( nlev, xmin, ymin, dxb, dyb, npts, x, y,
 Integer, Intent (In) :: level, nlev, lgrid(*), istruc(*), lenxy Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: npts Real (Kind=nag_wp), Intent (In) :: xmin, ymin, dxb, dyb Real (Kind=nag_wp), Intent (Out) :: x(lenxy), y(lenxy)
#include nagmk26.h
 void d03rzf_ (const Integer *level, const Integer *nlev, const double *xmin, const double *ymin, const double *dxb, const double *dyb, const Integer lgrid[], const Integer istruc[], Integer *npts, double x[], double y[], const Integer *lenxy, Integer *ifail)

## 3Description

d03rzf extracts the number of grid points and their $\left(x,y\right)$ coordinates on a specific solution grid produced by d03rbf. It must be called only from within the monitr. The arguments nlev, xmin, ymin, dxb, dyb, lgrid and istruc to monitr must be passed unchanged to d03rzf.

None.

## 5Arguments

1:     $\mathbf{level}$ – IntegerInput
On entry: the grid level at which the coordinates are required.
Constraint: $1\le {\mathbf{level}}\le {\mathbf{nlev}}$.
2:     $\mathbf{nlev}$ – IntegerInput
3:     $\mathbf{xmin}$ – Real (Kind=nag_wp)Input
4:     $\mathbf{ymin}$ – Real (Kind=nag_wp)Input
5:     $\mathbf{dxb}$ – Real (Kind=nag_wp)Input
6:     $\mathbf{dyb}$ – Real (Kind=nag_wp)Input
On entry: nlev, xmin, ymin, dxb and dyb as supplied to monitr must be passed unchanged to d03rzf.
7:     $\mathbf{lgrid}\left(*\right)$ – Integer arrayInput
Note: the dimension of the array lgrid must be at least ${\mathbf{nlev}}$.
On entry: lgrid as supplied to monitr must be passed unchanged to d03rzf.
8:     $\mathbf{istruc}\left(*\right)$ – Integer arrayInput
Note: the dimension of the array istruc must be at least ${\mathbf{lgrid}}\left({\mathbf{nlev}}\right)+2×\mathit{nrows}+{\mathbf{npts}}+1$ where $\mathit{nrows}$ is stored in ${\mathbf{istruc}}\left({\mathbf{lgrid}}\left({\mathbf{nlev}}\right)\right)$ and is the number of rows in the grid at level nlev.
On entry: istruc as supplied to monitr must be passed unchanged to d03rzf.
9:     $\mathbf{npts}$ – IntegerOutput
On exit: the number of grid points in the grid level level.
10:   $\mathbf{x}\left({\mathbf{lenxy}}\right)$ – Real (Kind=nag_wp) arrayOutput
11:   $\mathbf{y}\left({\mathbf{lenxy}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: ${\mathbf{x}}\left(\mathit{i}\right)$ and ${\mathbf{y}}\left(\mathit{i}\right)$ contain the $\left(x,y\right)$ coordinates respectively of the $\mathit{i}$th grid point, for $\mathit{i}=1,2,\dots ,{\mathbf{npts}}$.
12:   $\mathbf{lenxy}$ – IntegerInput
On entry: the dimension of the arrays x and y as declared in the (sub)program from which d03rzf is called.
Constraint: ${\mathbf{lenxy}}\ge {\mathbf{npts}}$.
13:   $\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$
 On entry, ${\mathbf{level}}<1$, or ${\mathbf{level}}>{\mathbf{nlev}}$.
${\mathbf{ifail}}=2$
The dimension of the arrays x and y is too small for the requested grid level, i.e., ${\mathbf{lenxy}}<{\mathbf{npts}}$.
${\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

d03rzf is not threaded in any implementation.