# NAG Library Routine Document

## 1Purpose

The dimension of the arrays that must be passed as actual arguments to d01raf are dependent upon a number of factors. d01rcf returns the correct size of these arrays enabling d01raf to be called successfully.

## 2Specification

Fortran Interface
 Subroutine d01rcf ( ni, opts,
 Integer, Intent (In) :: ni, iopts(*) Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: lenxrq, ldfmrq, sdfmrq, licmin, licmax, lcmin, lcmax Real (Kind=nag_wp), Intent (In) :: opts(*)
#include <nagmk26.h>
 void d01rcf_ (const Integer *ni, Integer *lenxrq, Integer *ldfmrq, Integer *sdfmrq, Integer *licmin, Integer *licmax, Integer *lcmin, Integer *lcmax, const Integer iopts[], const double opts[], Integer *ifail)

## 3Description

d01rcf returns the minimum dimension of the arrays x ($\mathit{lenxrq}$), fm ($\mathit{ldfmrq}×\mathit{sdfmrq}$), icom ($\mathit{licmin}$) and com ($\mathit{lcmin}$) that must be passed to d01raf to enable the integration to commence given options currently set for the ni integrands. d01rcf also returns the upper bounds $\mathit{licmax}$ and $\mathit{lcmax}$ for the dimension of the arrays icom and com, that could possibly be required with the chosen options.
All the minimum values $\mathit{lenxrq}$, $\mathit{ldfmrq}$, $\mathit{sdfmrq}$, $\mathit{licmin}$ and $\mathit{lcmin}$, and subsequently all the maximum values $\mathit{licmax}$ and $\mathit{lcmax}$ may be affected if different options are set, and hence d01rcf should be called after any options are set, and before the first call to d01raf.
A segment is here defined as a (possibly maximal) subset of the domain of integration. During subdivision, a segment is bisected into two new segments.

None.

## 5Arguments

1:     $\mathbf{ni}$ – IntegerInput
On entry: ${n}_{i}$, the number of integrals which will be approximated in the subsequent call to d01raf.
Constraint: ${\mathbf{ni}}>0$.
2:     $\mathbf{lenxrq}$ – IntegerOutput
On exit: $\mathit{lenxrq}$, the minimum dimension of the array x that can be used in a subsequent call to d01raf.
3:     $\mathbf{ldfmrq}$ – IntegerOutput
On exit: $\mathit{ldfmrq}$, the minimum leading dimension of the array fm that can be used in a subsequent call to d01raf.
4:     $\mathbf{sdfmrq}$ – IntegerOutput
On exit: $\mathit{sdfmrq}$, the minimum second dimension of the array fm that can be used in a subsequent call to d01raf.
Note: the minimum dimension of the array fm is $\mathit{ldfmrq}×\mathit{sdfmrq}$.
5:     $\mathbf{licmin}$ – IntegerOutput
On exit: $\mathit{licmin}$, the minimum dimension of the array icom that must be passed to d01raf to enable it to calculate a single approximation to all the ${n}_{i}$ integrals over the interval $\left[a,b\right]$ with ${s}_{\mathit{pri}}$ initial segments.
6:     $\mathbf{licmax}$ – IntegerOutput
On exit: $\mathit{licmax}$ the dimension of the array icom that must be passed to d01raf to enable it to exhaust the adaptive process controlled by the currently set options for the ${n}_{i}$ integrals over the interval $\left[a,b\right]$ with ${s}_{\mathit{pri}}$ initial segments.
7:     $\mathbf{lcmin}$ – IntegerOutput
On exit: $\mathit{lcmin}$, the minimum dimension of the array com that must be passed to d01raf to enable it to calculate a single approximation to all the ${n}_{i}$ integrals over the interval $\left[a,b\right]$ with ${s}_{\mathit{pri}}$ initial segments.
8:     $\mathbf{lcmax}$ – IntegerOutput
On exit: $\mathit{lcmax}$, the dimension of the array com that must be passed to d01raf to enable it to exhaust the adaptive process controlled by the currently set options for the ${n}_{i}$ integrals over the interval $\left[a,b\right]$ with ${s}_{\mathit{pri}}$ initial segments.
9:     $\mathbf{iopts}\left(*\right)$ – Integer arrayCommunication Array
Note: the dimension of this array is dictated by the requirements of associated functions that must have been previously called. This array must be the same array passed as argument iopts in the previous call to d01zkf.
On entry: the integer option array as returned by d01zkf.
Constraint: iopts must not be changed between calls to d01zkf, d01zlf, d01rcf and d01raf.
10:   $\mathbf{opts}\left(*\right)$ – Real (Kind=nag_wp) arrayCommunication Array
Note: the dimension of this array is dictated by the requirements of associated functions that must have been previously called. This array must be the same array passed as argument opts in the previous call to d01zkf.
On entry: the real option array as returned by d01zkf.
Constraint: opts must not be changed between calls to d01zkf, d01zlf, d01rcf and d01raf.
11:   $\mathbf{ifail}$ – IntegerInput/Output
On entry: ifail must be set to $0$, . 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  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  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}}=21$
On entry, ${\mathbf{ni}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{ni}}>0$.
${\mathbf{ifail}}=1001$
One of the option arrays iopts or opts has become corrupted. Re-initialize the arrays using d01zkf.
${\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

d01rcf is not threaded in any implementation.