NAG Library Routine Document

d03ryf  (withdraw_2d_gen_order2_checkgrid)

 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

Fortran Interface
Subroutine d03ryf ( nx, ny, npts, nrows, nbnds, nbpts, lrow, irow, icol, llbnd, ilbnd, lbnd, iwk, leniwk, pgrid, ifail)
Integer, Intent (In):: nx, ny, npts, nrows, nbnds, nbpts, lrow(nrows), irow(nrows), icol(npts), llbnd(nbnds), ilbnd(nbnds), lbnd(nbpts), leniwk
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: iwk(leniwk)
Character (*), Intent (Out):: pgrid(ny)
C Header Interface
#include nagmk26.h
void  d03ryf_ ( const Integer *nx, const Integer *ny, const Integer *npts, const Integer *nrows, const Integer *nbnds, const Integer *nbpts, const Integer lrow[], const Integer irow[], const Integer icol[], const Integer llbnd[], const Integer ilbnd[], const Integer lbnd[], Integer iwk[], const Integer *leniwk, char pgrid[], Integer *ifail, const Charlen length_pgrid)

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 arguments 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
Arguments

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 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​ 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 -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.9 in How to Use the NAG Library and its Documentation for further information.
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

d03ryf is not threaded in any implementation.

9
Further Comments

None.

10
Example

See Section 10 in d03rbf.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017