Encyclopaedia Index

(r) Handling slabwise arrays by means of the FN-function library

PHOENICS users can save themselves the trouble of creating DO loops for handling arrays of variables in GROUND by making use of appropriate members of the PHOENICS function library. These functions are the FN-subroutines which are listed in PHENC entry: FUNCT.

Numerous examples of the use of the FN-subroutines are to be found in the listing of the GX suite, which can be inspected via gxfiles.htm Their operation can in part be revealed by the statement that the settings of density discussed above can be effected by the single statement:


Indeed, a call very similar to this will be found in the GRND5 section of the subroutine GXDENS.

The integer functions HIGH, LOW, ANYZ, OLD, etc can be used as integer arguments of the FN-subroutines. Examples will be found in the subroutine GXNEPA and elsewhere.

The consideration underlying the creation of the FN-subroutines is this: because it is easier to write a subroutine CALL correctly than to code a DO loop, sufficient FN-subroutines should be provided to enable GROUND users to achieve their ends by making subroutine CALLs only.

The FN-subroutines themselves embody DO-loops, operating over the IX-range from IXF to IXL and over the IY-range from IYF to IYL. These quantities are conveyed by means of COMMON, which is provided in the file GRDEAR. When called from groups 11 and 13, the IXF, IXL, etc. have already been set in EARTH to correspond to the PATCH size; otherwise they take the values 1, NX, 1 and NY respectively.

How the FN-subroutines are used, both individually and in sequences of CALLs, it is left to the reader to observe, by browsing through the GX... files. If not all the uses are at first obvious, there are enough which are so to make the study an educative one. In the end the nature, flexibility and power of the FN-subroutine library will become clear.