8.2.1 UDCNTR

1.
Function
Draws a 2-D contour graph (using a work area provided internally).
2.
Call
CALL UDCNTR(Z,MX,NX,NY)
3.
Explanation of Parameters
Z (R) A 2-D array of MX * NY. The NX * NY portion is used in the draw routine.
MX (I) The first adjustable dimension of array Z.
NX (I) The first adjustable dimension of array Z used in the draw routine
NY (I) The second adjustable dimension of array Z used in the draw routine
4.
Notes
(a)
From restrictions on the size of the work array, the size of array Z is limited to
(NX+2)n(NY+2)n2/NB+11000
when the bit length of 1 word is NB. NB inquires the internal variable 'NBITSPW' handled by GLpGET/GLpSET. Normally, this value is 32. (See user's manual for "MATH1.") If you wish to draw graphs using arrays exceeding this limit, use the subroutine UDCNTZ (see next section) in which the user specifies the work area.
(b)
When the coordinates of the grid points in the X direction are not set by either UWSGXA (see section 11.2.1) or UWSGXB (see Section 11.2.2), then the window information is inquired using SGQWND, and the grid points set so that the range between the UXMIN and UXMAX is divided equally into NX-1 sections.
(c)
When the coordinates of the grid points in the Y direction are not set by either UWSGYA (see section 11.2.1) or UWSGYB (see Section 11.2.2), then the window information is inquired using SGQWND, and the grid points set so that the range between the UYMIN and UYMAX is divided equally into NY-1 sections.
(d)
If the value of the contour level is not set by UDGCLA, UDGCLB, or UDSCLV, then the following subroutine is called internally to set approximately NLEV contour levels.
CALL UDGCLB(Z,MX,NX,NY,-REAL(NLEV))
NLEV is the value inquired by the internal variable 'NLEV' handled by UDpGET/UDpSET. (The initial value is 12.) (Hereafter, an 'internal variable" refers to an internal variable handled by UDpGET/UDpSET, unless stated otherwise.)
(e)
From restrictions for algorithms for drawing a contour, the values of the grid points must not be equal to any value of the contour level. If such a grid-point value exists, a minute correction is made internally (and a message is printed to indicate that a correction had been made.)
(f)
Missing-value handling is performed when the internal variable 'LMISS' handled by GLpGET/GLpSET is .TRUE.. (The missing value inquired in this case is the internal variable 'RMISS' handled by GLpGET/GLpSET.) When .FALSE., missing-value handling is not performed. (See user's manual for "MATH1" for details.)
(g)
Before contouring, all grid-point values are checked. In the following 2 cases, contouring is not performed, and a message is printed. Furthermore, when the internal variable 'LMSG' is .TRUE., then a message is also printed in the bottom margin. When .FALSE., the message is not printed. (The initial value is .TRUE..) The 2 cases are:
  • when all grid points are missing values (a missing field)
  • when all grid points have the same value (a constant field).
(h)
When the internal variable 'LMSG' is .TRUE. and there are more than 2 contours to draw, the floating-point function RUDLEV(1) (See Section 8.2.8) is called to print the difference (CZL2-CZL1) between contour level one (CZL1) and contour level 2 (CZL2) in the bottom margin of the graph. These messages are written using the information handled by the UZPACK when a transformation other than the map projection transformation is set. Therefore, in a case such as this, the coordinate axes should be plotted before a call is made to UDCNTR. On the other hand, when the map projection transformation is specified, then the message is printed at the center of the bottom margin.