GENIE Main
Philosophy & Design
GENIE (Grid ENabled Integrated Earth system model) is comprised of a number of state-of-the-art components contributed by various authors. genie-main acts as the linchpin and couples together the other components. GENIE has a strict hierarchical design. Anything which is common or shared between components should reside in genie-main. Maintenance of this hierarchy promotes clarity for and significantly benefits the task of extending and improving the model over time.
<diagram>
Values are exchanged between coupled components by argument passing. They are declared in genie-main and passed to the relevant components through subroutine calls. This significantly aids traceability and debugging and avoids the pitfalls of 'spaghetti code', which may use common blocks as 'secret passages' between components--the source of many a debugging headache!
Default Settings
GENIE has a number of compile-time and run-time settings. The default values of these creates what may be termed as the vanilla model. The default compile-time settings reside in the makefiles (user.mak and makefile.arc). The run-time defaults are listed in runtime_defaults.sh as var=value pairs.
Configuration Files
The repository contains a number of configuration files in the directory genie-main/configs. Any compile-time or run-time default can be overridden in a config' file. In this way we can morph the vanilla model into one of the numerous flavours available.
(The tests use special case config' files. The filenames of these end with _test.config. Please do not edit these files.)
Compile
Key files in the build system are:
- user.mak
- for details of your local setup
- makefile.arc
- main body of makefile variables and settings
- makefile
- rules and targets
- testing.mak
- holds the testing targets
Sub-makefiles in the various component directories are called from the top-level makefile (and useful varibales such as the compiler name and flags are exported).
Top-level make targets include: cleanall, docs, tags (for emacs users), test, testebgogs, testbiogem, testglimmer, together with a number of assumedgood targets.
Run the Model
The model is run (and can be compiled) through genie_example.job. This BASH script makes use of other scripts, including:
- user.sh
- containing detail of your local run-time setup.
- runtime_defaults.sh
- vanilla settings.
- XXX.config
- most likely you will also make use of a config' file.
- namelists.sh
- to translate your run-time sttings into a format easily digested by Fortran (namelists).
Source Code
- genie_control.f90
- flags to control the component coupling
- genie_global.f90
- any common variables (i.e. those used during coupling)
- constants, e.g. Pi
(** functions or subroutines which shold be common--put in a different module)
- genie.F
- the overall coupling logic and time loop: do this, then that, then the other, if, then, else.
argument passing.
(genie_ini_wrappers.f90, genie_loop_wrappers.f90)