Encyclopaedia Index

(s) Handling slabwise arrays by means of the -YX subroutines

Whereas the FN-subroutines always put the array of values which they create into a segment of EARTH's F-array, two -YX subroutines effect interactions between the F-array and arrays dimensioned by the user in GROUND. The -YX subroutines in question are:

Here "array name" is that which appears in the dimension statement, and NYDIM and NXDIM are the numbers appearing in that statement. Thus, for the example in section (p), "array name" is UUDEN, NYDIM is 20 and NXDIM is 30. The parameter NXDIM may be greater than NX, and the parameter NYDIM may be greater than NY. Over-dimensioning of user-dimensioned arrays in GROUND is often desirable because it reduces the need to re-dimension the arrays when the grid is refined.

GETYX takes NX*NY values from the F-array segment with zero index L0F(LB) and puts it into the user's 2-dimensional array; SETYX proceeds in the reverse direction.

There is another -YX subroutine, namely:

This simply prints out the contents of the array, under the heading 'name'.

The method of using GETYX and SETYX to calculate the density from the ideal-gas law (to continue with the above example) is as follows:

This method of coding is still very popular among GROUND users, partly because of its conceptual simplicity, but mainly because, in earlier versions of PHOENICS, it was the ONLY possible method. However, it is wasteful of both storage and of computer time; it does not remove the burden of writing DO-loops; and it provides many opportunities for making mistakes. If a DO-loop has to be written, one might as well directly address the EARTH variables involved.