886 |
Package runtime config. options are imported |
Package runtime config. options are imported |
887 |
into a common block held in a header file |
into a common block held in a header file |
888 |
called "${PKG}.h". |
called "${PKG}.h". |
889 |
|
Note: In some packages, the header file "${PKG}.h" is splitted |
890 |
|
into "${PKG}_PARAMS.h" that contains the package parameters and |
891 |
|
${PKG}_VARS.h" for the field arrays. |
892 |
|
|
893 |
o The core driver part of the model can check |
o The core driver part of the model can check |
894 |
for runtime enabling or disabling of individual packages |
for runtime enabling or disabling of individual packages |
911 |
1. Within the core driver code flags of the form |
1. Within the core driver code flags of the form |
912 |
ALLOW_${PKG} are used to include or exclude |
ALLOW_${PKG} are used to include or exclude |
913 |
whole packages. The ALLOW_${PKG} flags are included |
whole packages. The ALLOW_${PKG} flags are included |
914 |
from a PKG_CPP_OPTIONS block which is currently |
from a PACKAGES_CONFIG.h file that is automatically |
915 |
|
generated by genmake2 (see genmake2 section). |
916 |
held in-line in the CPP_OPTIONS.h header file. |
held in-line in the CPP_OPTIONS.h header file. |
917 |
e.g. |
e.g. |
918 |
|
|
919 |
Core model code ..... |
Core model code ..... |
920 |
|
|
921 |
|
#include "PACKAGES_CONFIG.h" |
922 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
923 |
: |
: |
924 |
: |
: |
930 |
|
|
931 |
2. Within an individual package a header file, |
2. Within an individual package a header file, |
932 |
"${PKG}_OPTIONS.h", is used to set CPP flags |
"${PKG}_OPTIONS.h", is used to set CPP flags |
933 |
specific to that package. It is not recommended |
specific to that package. It also includes |
934 |
to include this file in "CPP_OPTIONS.h". |
"PACKAGES_CONFIG.h" and "CPP_OPTIONS.h". |
935 |
|
|
936 |
|
|
937 |
Package Boot Sequence |
Package Boot Sequence |
983 |
|
|
984 |
#ifdef ALLOW_${PKG} |
#ifdef ALLOW_${PKG} |
985 |
if ( use${Pkg} ) |
if ( use${Pkg} ) |
986 |
& CALL ${PKG}_DIAGS( ) |
& CALL ${PKG}_DIAGS( ) [ or CALL ${PKG}_OUTPUT( ) ] |
987 |
#endif |
#endif |
988 |
|
|
989 |
7. S/R PACKAGES_WRITE_PICKUP() |
7. S/R PACKAGES_WRITE_PICKUP() |
999 |
- ${PKG}_READPARMS() |
- ${PKG}_READPARMS() |
1000 |
is responsible for reading |
is responsible for reading |
1001 |
in the package parameters file data.${pkg}, and storing |
in the package parameters file data.${pkg}, and storing |
1002 |
the package parameters in "${PKG}.h". |
the package parameters in "${PKG}.h" (or in "${PKG}_PARAMS.h"). |
1003 |
-> called from INITIALISE_FIXED in PACKAGES_READPARMS |
-> called from INITIALISE_FIXED in PACKAGES_READPARMS |
1004 |
|
|
1005 |
- ${PKG}_INIT_FIXED() |
- ${PKG}_INIT_FIXED() |
1029 |
use for e.g. ${PKG}_INI_VARS, ${PKG}_INIT_VARIABLES, or the old |
use for e.g. ${PKG}_INI_VARS, ${PKG}_INIT_VARIABLES, or the old |
1030 |
form ${PKG}_INIT |
form ${PKG}_INIT |
1031 |
|
|
1032 |
- ${PKG}_DIAGS() |
- ${PKG}_DIAGS() [or ${PKG}_OUTPUT( ) ] |
1033 |
is responsible for writing time-average diagnostics to output |
is responsible for writing time-average fields to output files |
1034 |
files (but the cumulating step is done within the package main S/R). |
(but the cumulating step is done within the package main S/R). |
1035 |
Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR) |
Can also contain other diagnostics (.e.g. CALL ${PKG}_MONITOR) |
1036 |
and write snap-shot fields that are hold in common blocks. Other |
and write snap-shot fields that are hold in common blocks. Other |
1037 |
temporary fields are directly dump to file where they are available. |
temporary fields are directly dump to file where they are available. |
1038 |
NOTE: this part does not yet have a standard form and should be called |
NOTE: 1) ${PKG}_OUTPUT is progressively replacing ${PKG}_DIAGS() |
1039 |
from a package dedicated S/R such as PACKAGE_WRITE_DIAGS |
to avoid confusion with pkg/diagnostics functionality. |
1040 |
|
2) the output part is not yet in a standard form and might still |
1041 |
|
evolve a lot. |
1042 |
-> called within DO_THE_MODEL_IO |
-> called within DO_THE_MODEL_IO |
1043 |
|
|
1044 |
- ${PKG}_WRITE_PICKUP() |
- ${PKG}_WRITE_PICKUP() |
1065 |
----------------------- |
----------------------- |
1066 |
* ${PKG}_OPTIONS.h has further package-specific CPP options |
* ${PKG}_OPTIONS.h has further package-specific CPP options |
1067 |
* ${PKG}.h package-specific common block variables, fields |
* ${PKG}.h package-specific common block variables, fields |
1068 |
|
or ${PKG}_PARAMS.h package-specific common block parameters |
1069 |
|
and ${PKG}_VARS.h package-specific common block fields |
1070 |
|
|
1071 |
- FORTRAN source files |
- FORTRAN source files |
1072 |
----------------------- |
----------------------- |
1075 |
* ${pkg}_check.F checks package dependencies and consistencies |
* ${pkg}_check.F checks package dependencies and consistencies |
1076 |
* ${pkg}_init_varia.F initialises package-related fields |
* ${pkg}_init_varia.F initialises package-related fields |
1077 |
* ${pkg}_... .F package source code |
* ${pkg}_... .F package source code |
1078 |
* ${pkg}_diags.F write diagnostics to file. |
* ${pkg}_diags.F write output to file. |
1079 |
|
or ${pkg}_output.F write output to file. |
1080 |
* ${pkg}_write_pickup.F write a package pickup file to restart the model |
* ${pkg}_write_pickup.F write a package pickup file to restart the model |
1081 |
|
|
1082 |
|
New: Subroutine in one package (pkgA) that only contains code which |
1083 |
|
is connected to a 2nd package (pkgB) (e.g.: gmredi_diagnostics_init.F) |
1084 |
|
will be named: pkgA_pkgB_something.F |
1085 |
|
|
1086 |
- parameter file |
- parameter file |
1087 |
----------------------- |
----------------------- |
1088 |
* data.${pkg} parameter file |
* data.${pkg} parameter file |