The archetype provides a program skeleton, including a main program to set up the grid of processes; the user supplies the body of two programs:
Here is the program skeleton, with comments showing what the user must supply (flagged USER SUPPLIES). Note that for no-host-process implementations, the two subroutines hostmain and gridmain are replaced by a single subroutine procmain.
C=======================================================================
C=======================================================================
C
C sample program p0 -- dummy (no user-supplied code)
C
C=======================================================================
C=======================================================================
C=======================================================================
C
C host process-main program
C
C=======================================================================
subroutine hostmain
include 'mesh_uparms.h'
include 'mesh_parms.h'
include 'mesh_common.h'
C=======USER SUPPLIES common block(s), declarations, body of program
C include '?'
C=======end of USER SUPPLIES
end
C=======================================================================
C
C grid process-main program
C
C=======================================================================
subroutine gridmain
include 'mesh_uparms.h'
include 'mesh_parms.h'
include 'mesh_common.h'
C=======USER SUPPLIES common block(s), declarations, body of program
C include '?'
C=======end of USER SUPPLIES
end
C=======================================================================
C
C additional routines
C
C=======================================================================
C=======USER SUPPLIES additional routines (optional)
C routines should generally begin with:
C include 'mesh_uparms.h'
C include 'mesh_parms.h'
C include 'mesh_common.h'
C include(s) for user common blocks, if any
C=======end of USER SUPPLIES