Encyclopaedia Index

There are some other integer functions returning indices which, while not actually being block-location indices (because there are no COMMON block elements corresponding to them), can be used as though they were; for they can be used as arguments of L0F, and of the FN-subroutines to be described below. These are:-

• OLD(INDVAR), which, when used as the argument of L0F, yields the zero-location in the F-array of the value of the dependent variable appropriate to the previous instant of time. Thus, the FORTRAN sequence for obtaining the difference DIFC1 between the value of C1 now, and the value at the previous time step would be:

LFC1=L0F(C1)+IY+NY*(IX-1) LFC1OL=L0F(OLD(C1))+IY+NY*(IX-1) DIFC1=F(LFC1)-F(LFC1OL)

• HIGH(INDVAR), which, when used as the argument of L0F, yields the L0F of the value of the dependent variable in question at the next- highest slab, ie at IZ+1 rather than IZ. Thus the FORTRAN sequence for calculating the average value, AVU2HI, of the local and higher values of U2 would be:

LFU2=L0F(U2)+IY+NY*(IX-1) LFU2HI=L0F(HIGH(U2))+IY+NY*(IX1) AVU2HI=0.5*(F(LFU2)+F(LFU2HI))

• LOW(INDVAR), which performs the corresponding service when the value at the next lower slab, ie at IZ-1, is required. Thus the average of the local and low-slab U2 would be calculated from:

LFU2LO=L0F(LOW(U2))+IY+NY*(IX1) AVU2LO=0.5*(F(LFU2)+F(LFU2LO))

• ANYZ(INDVAR,IZZ), which, when used as the argument of L0F, yields the L0F of the value of the dependent variable in question at the slab for which IZ equals IZZ. The function ANYZ can be used only when the dependent variables are stored in- core; this can be ascertained by the absence of references to disk storage in the preliminary printout in the RESULT file.

Note: if ANYZ is to be used outside the main EARTH IZ loop, then the variable IZ, found in the include file grdear, must be set to 1 before any reference to ANYZ.

• LBZ(LB,IZZ), which performs the same function as ANYZ(INDVAR,IZZ) but for a whole-field-solver variable (WSV).

• NORTH(INDVAR), which permits the value of the variable on the north side of the cell in question to be obtained, ie at the IY+1 cell rather than the IY cell. Thus the north-cell value of H1, H1NRTH, is given by:

LFH1NO=L0F(NORTH(H1))+IY+NY*(IX-1) H1NRTH=F(LFH1NO)

Of course the same value would be given, in this case, by the following:

LFH1NO=L0F(H1)+IY+1+NY*(IX-1)

• SOUTH(INDVAR), EAST(INDVAR), and WEST(INDVAR), which perform the corresponding functions which are obviously indicated by their names.

PHOENICS is not, it should be mentioned, equipped with all possible safety measures, such as would prevent users from invoking a high- slab value for cells having IZ=NZ, or the west value for a cell for which IX=1. Users who engage in coding operations of the kind described here are supposed to be able to look after themselves in this regard.

wbs