next up previous
Next: Subroutines and functions Up: Archetype implementation Previous: Data declarations

Program skeleton

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:

and can provide additional subroutines as needed for the application. The user can also define COMMON blocks; data in COMMON blocks is typically declared using archetype-supplied dimensions, as described above. For Fortran M implementations of the archetype, COMMON blocks should be declared as PROCESS COMMON blocks to indicate that each process is to have a unique copy of the COMMON block.

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



Berna L Massingill
Mon Jun 8 19:35:58 PDT 1998