# NAG FL Interfaceg01zuf (init_​vavilov)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

g01zuf is used to initialize routines g01euf and g01muf.
It is intended to be used before a call to g01euf or g01muf.

## 2Specification

Fortran Interface
 Subroutine g01zuf ( mode, xl, xu,
 Integer, Intent (In) :: mode Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: rkappa, beta2 Real (Kind=nag_wp), Intent (Out) :: xl, xu, rcomm(322)
#include <nag.h>
 void g01zuf_ (const double *rkappa, const double *beta2, const Integer *mode, double *xl, double *xu, double rcomm[], Integer *ifail)
The routine may be called by the names g01zuf or nagf_stat_init_vavilov.

## 3Description

g01zuf initializes the array rcomm for use by g01euf or g01muf in the evaluation of the Vavilov functions ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ respectively.
Multiple calls to g01euf or g01muf can be made following a single call to g01zuf, provided that rkappa or beta2 do not change, and that either all calls are to g01euf or all calls are to g01muf. If you wish to call both g01euf and g01muf, then you will need to initialize both separately.

## 4References

Schorr B (1974) Programs for the Landau and the Vavilov distributions and the corresponding random numbers Comp. Phys. Comm. 7 215–224

## 5Arguments

1: $\mathbf{rkappa}$Real (Kind=nag_wp) Input
On entry: the argument $\kappa$ of the function.
Constraint: $0.01\le {\mathbf{rkappa}}\le 10.0$.
2: $\mathbf{beta2}$Real (Kind=nag_wp) Input
On entry: the argument ${\beta }^{2}$ of the function.
Constraint: $0.0\le {\mathbf{beta2}}\le 1.0$.
3: $\mathbf{mode}$Integer Input
On entry: if ${\mathbf{mode}}=0$, g01muf is to be called after the call to g01zuf. Otherwise, g01euf is to be called.
4: $\mathbf{xl}$Real (Kind=nag_wp) Output
On exit: ${x}_{l}$, a threshold value below which ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01muf and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01euf if $\lambda <{x}_{l}$.
5: $\mathbf{xu}$Real (Kind=nag_wp) Output
On exit: ${x}_{u}$, a threshold value above which ${\varphi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to zero by g01muf and ${\Phi }_{V}\left(\lambda \text{;}\kappa ,{\beta }^{2}\right)$ will be set to unity by g01euf if $\lambda >{x}_{u}$.
6: $\mathbf{rcomm}\left(322\right)$Real (Kind=nag_wp) array Communication Array
On exit: this argument should be passed unchanged to g01euf or g01muf.
7: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ 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{beta2}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{beta2}}\le 1.0$.
On entry, ${\mathbf{beta2}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{beta2}}\ge 0.0$.
On entry, ${\mathbf{rkappa}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{rkappa}}\le 10.0$.
On entry, ${\mathbf{rkappa}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{rkappa}}\ge 0.01$.
${\mathbf{ifail}}=2$
The initialization has been abandoned due to an internal error. This error exit is unlikely to occur, but if it does change the values of rkappa and/or beta2 and rerun g01zuf.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

## 7Accuracy

At least five significant digits are usually correct.

## 8Parallelism and Performance

g01zuf is not threaded in any implementation.