Encyclopaedia Index

(o) Single-cell values

INDYX(INDVAR) is an integer function which returns the value:


Clearly, its use in (g) above would have saved some writing; and it will perform the same service for anyone using it in GROUND coding. The variables IY and IX are carried through a COMMON block appearing in GRDLOC.

VARYX(INDVAR) carries the simplification one stage further. It yields the F-array value corresponding to INDYX(INDVAR). Thus the three lines of FORTRAN leading to DIFC1 in sectopn (l) can be replaced by the following single line:

INDONE(INDVAR,IYY,IXX) has the same effect as INDYX(INDVR), but is useful when the IY and IX to be referred to are not those carried through COMMON. Thus the difference between the north and the local- cell values of H2 might be expressed as:

VARONE(INDVAR,IYY,IXX) bears to INDONE the same relation as does VARYX to INDYX. Therefore the just-mentioned difference could be expressed more compactly as:

INDZ(INDVRZ,IZZ) and VARZ(INDVRZ,IZZ) perform similar functions to those of INDYX and VARYX; but they relate to z-wise variables, ie those with NZ-long segments of the F-array. The following three expressions are therefore equivalent:

In addition to the integer functions INDYX, INDONE and INDZ, and the corresponding real functions VARYX, VARONE and VARZ, there exist the subroutines GETONE and GETZ, having related capabilities. Thus:

is equivalent to:

It should be remarked that to interchange the two sides of the last statement is not allowable, and would be rejected by most compilers. Integer and real functions can appear only on the right-hand side.

The statement:

fills the 1D array GZ with the values at each IZ of the quantity referred to by INDVRZ. The array element GZ(IZZ) is equal to the value returned by the function VARZ(INDVRZ,IZZ).