D03RYF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D03RYF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

D03RYF is designed to be used in conjunction with D03RBF. It can be called from the INIDOM to check the user-specified initial grid data and to obtain a simple graphical representation of the initial grid.

2  Specification

SUBROUTINE D03RYF ( NX, NY, NPTS, NROWS, NBNDS, NBPTS, LROW, IROW, ICOL, LLBND, ILBND, LBND, IWK, LENIWK, PGRID, IFAIL)
INTEGER  NX, NY, NPTS, NROWS, NBNDS, NBPTS, LROW(NROWS), IROW(NROWS), ICOL(NPTS), LLBND(NBNDS), ILBND(NBNDS), LBND(NBPTS), IWK(LENIWK), LENIWK, IFAIL
CHARACTER(*)  PGRID(NY)

3  Description

D03RYF outputs a character array which can be printed to provide a simple graphical representation of the virtual and base grids supplied to D03RBF. It must be called only from within the INIDOM after all output parameters of INIDOM (other than IERR) have been set. D03RYF also checks the validity of the grid data specified in INIDOM.
You are strongly advised to call D03RYF during the initial call of D03RBF (at least) and to print the resulting character array in order to check that the base grid is exactly as required.
D03RYF writes a representation of each point in the virtual and base grids to the character array PGRID as follows:
internal base grid points are written as two dots (..);
boundary base grid points are written as the ILBND value (i.e., the type) of the boundary;
points external to the base grid are written as XX.
As an example, consider a rectangular domain with a rectangular hole in which the virtual domain extends by one base grid point beyond the actual domain in all directions. The output when each row of PGRID is printed consecutively is as follows:
 XX XX XX XX XX XX XX XX XX XX XX XX XX XX
 XX 23  3  3  3  3  3  3  3  3  3  3 34 XX
 XX  2 .. .. .. .. .. .. .. .. .. ..  4 XX
 XX  2 .. .. .. .. .. .. .. .. .. ..  4 XX
 XX  2 .. .. 14  1  1  1  1 21 .. ..  4 XX
 XX  2 .. ..  4 XX XX XX XX  2 .. ..  4 XX
 XX  2 .. ..  4 XX XX XX XX  2 .. ..  4 XX
 XX  2 .. ..  4 XX XX XX XX  2 .. ..  4 XX
 XX  2 .. ..  4 XX XX XX XX  2 .. ..  4 XX
 XX  2 .. ..  4 XX XX XX XX  2 .. ..  4 XX
 XX  2 .. .. 43  3  3  3  3 32 .. ..  4 XX
 XX  2 .. .. .. .. .. .. .. .. .. ..  4 XX
 XX  2 .. .. .. .. .. .. .. .. .. ..  4 XX
 XX 12  1  1  1  1  1  1  1  1  1  1 41 XX
 XX XX XX XX XX XX XX XX XX XX XX XX XX XX

4  References

None.

5  Parameters

1:     NX – INTEGERInput
2:     NY – INTEGERInput
On entry: the number of virtual grid points in the x- and y-direction respectively (including the boundary points).
Constraint: NX and NY4.
3:     NPTS – INTEGERInput
On entry: the total number of points in the base grid.
Constraint: NPTSNX×NY.
4:     NROWS – INTEGERInput
On entry: the total number of rows of the virtual grid that contain base grid points.
Constraint: 4NROWSNY.
5:     NBNDS – INTEGERInput
On entry: the total number of physical boundaries and corners in the base grid.
Constraint: NBNDS8.
6:     NBPTS – INTEGERInput
On entry: the total number of boundary points in the base grid.
Constraint: 12NBPTS<NPTS.
7:     LROWNROWS – INTEGER arrayInput
On entry: LROWi, for i=1,2,,NROWS, contains the base grid index of the first grid point in base grid row i.
Constraints:
  • 1LROWiNPTS, for i=1,2,,NROWS;
  • LROWi-1<LROWi, for i=2,3,,NROWS.
8:     IROWNROWS – INTEGER arrayInput
On entry: IROWi, for i=1,2,,NROWS, contains the virtual grid row number that corresponds to base grid row i.
Constraints:
  • 0IROWiNY, for i=1,2,,NROWS;
  • IROWi-1<IROWi, for i=2,3,,NROWS.
9:     ICOLNPTS – INTEGER arrayInput
On entry: ICOLi, for i=1,2,,NPTS, contains the virtual grid column number that contains base grid point i.
Constraint: 0ICOLiNX, for i=1,2,,NPTS.
10:   LLBNDNBNDS – INTEGER arrayInput
On entry: LLBNDi, for i=1,2,,NBNDS, contains the element of LBND corresponding to the start of the ith boundary (or corner).
Constraints:
  • 1LLBNDiNBPTS, for i=1,2,,NBNDS;
  • LLBNDi-1<LLBNDi, for i=2,3,,NBNDS.
11:   ILBNDNBNDS – INTEGER arrayInput
On entry: ILBNDi, for i=1,2,,NBNDS, contains the type of the ith boundary (or corner), as defined in D03RBF.
Constraint: ILBNDi must be equal to one of the following: 1, 2, 3, 4, 12, 23, 34, 41, 21, 32, 43 or 14, for i=1,2,,NBNDS.
12:   LBNDNBPTS – INTEGER arrayInput
On entry: LBNDi, for i=1,2,,NBPTS, contains the grid index of the ith boundary point.
Constraint: 1LBNDiNPTS, for i=1,2,,NBPTS.
13:   IWKLENIWK – INTEGER arrayWorkspace
14:   LENIWK – INTEGERInput
On entry: the dimension of the array IWK as declared in the (sub)program from which D03RYF is called.
Constraint: LENIWKNX×NY+1.
15:   PGRIDNY – CHARACTER(*) arrayOutput
On exit: PGRIDi, for i=1,2,,NY, contains a graphical representation of row NY-i+1 of the virtual grid (see Section 3).
Constraint: LENPGRID13×NX.
16:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. 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 -1​ 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 parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry 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:
IFAIL=1
On entry,NX or NY<4,
orNPTS>NX×NY,
orNROWS<4,
orNROWS>NY,
orNBNDS<8,
orNBPTS<12,
orNBPTSNPTS,
orLROWi<1, for some i=1,2,,NROWS,
orLROWi>NPTS, for some i=1,2,,NROWS,
orLROWiLROWi-1, for some i=2,3,,NROWS,
orIROWi<0, for some i=1,2,,NROWS,
orIROWi>NY, for some i=1,2,,NROWS,
orIROWiIROWi-1, for some i=2,3,,NROWS,
orICOLi<0, for some i=1,2,,NPTS,
orICOLi>NX, for some i=1,2,,NPTS,
orLLBNDi<1, for some i=1,2,,NBNDS,
orLLBNDi>NBPTS, for some i=1,2,,NBNDS,
orLLBNDiLLBNDi-1, for some i=2,3,,NBPTS,
orILBNDi1, 2, 3, 4, 12, 23, 34, 41, 21, 32, 43 or 14, for some i=1,2,,NBNDS,
orLBNDi<1, for some i=1,2,,NBPTS,
orLBNDi>NPTS, for some i=1,2,,NBPTS,
orLENIWK<NX×NY+1,
orLENPGRID1<3×NX.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

See Section 10 in D03RBF.

D03RYF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015