See also the tutorial on GROUND coding.
GROUND is a FORTRAN subroutine which forms part of the EARTH module. It resides in the sub-directory d_earth/d_grxfor.
GROUND is supplied as a structured set of GOTO's and statement labels, between which users are invited to insert coding sequences which will augment or replace those with which EARTH is already provided.
Like the subroutine SATLIT attached to the SATELLITE, GROUND is an empty subroutine, organised into 24 parts; it performs no function unless the user inserts some coding in the spaces provided.
Although 24 parts are provided for conformity with SATELLITE data- entry GROUPs (See PHENC: GROUP), not all are active. Specifically EARTH does not call GROUND when it is concerned with the activities associated with GROUPs 7, 12, 15, 16, 17, 18, 21 or 22.
By contrast, several of the other groups are entered for so many different purposes that they have been divided into sections, for example GROUPs 8, 9, 10, 13 and 19.
EARTH calls the empty GROUND subroutine via GREX3 (see PHENC entry), which is structured similarly to GROUND but with many CALLs and other executable statements in the blank spaces. These calls to GREX3 are made at pre-set occasions in the equation-solving process, sometimes on the prompting of information supplied by SATELLITE.
If the variable USEGRX has been set as T by SATELLITE, the statements in GREX will be executed first; otherwise, control is passed to label 25, near the end of the subroutine, where conditional CALLs are provided to other GROUND-style subroutines, of which the last is the empty GROUND. The statement:
IF(USEGRD) CALL GROUND
at the end of GREX, is the one in question.
These are indicated briefly by comments in the listing (qv), and much more extensively by the examples in GREX3. Both may be inspected via POLIS/PHOENICS-2/Fortran.
Common uses of GROUND are for the introduction of coding sequences which add to those supplied by CHAM in respect of:-
Users contemplating the creation of their own GROUND subroutine are advised first to inspect GREX3, and indeed the GX.. subroutines which it calls, for two reasons. First, they may find that what they need is already in fact provided by PHOENICS; and secondly, if it is not provided, there may well exist something which is close enough to make copying and modifying to be the speediest effective course of action.
After the new coding sequences have been introduced, GROUND must of course be re-compiled and the EARTH module re-linked.
Most users who have successfully created GROUNDs which meets their needs find it convenient to rename them, for example to NEWGR1, NEWGR2, etc. Then they insert at the bottom of an empty GROUND subroutine the statements:
IF(condition1) CALL NEWGR1
IF(condition2) CALL NEWGR2 etc,
the conditions being of their own contriving.
This parallels the IF(NAMGRD.EQ.'xxxx') statements of GREX3, and ensures that they still have an empty GROUND for any further work.
(see USEGRD)
See PHENC entries: Fortran coding and F-array
(see NAMGRD)
wbs