The atmospheric driver sets up the initializations of the atmospheric component subpackages. It also reads the namelist option and control information for the simulation and couples the dynamics and physics packages.
Code Template for the Atmospheric Model Driver use CAM_GComp, only: CAM_init, CAM_run, CAM_final CAM_init ( cam_import, cam_export, clock ) CAM_run ( cam_import, cam_export, clock ) CAM_final( cam_import, cam_export, clock )
cam_import and cam_export are ESMF import and export states respectively, and clock is a ESMF clock with a start-time, stop-time, and time-step. The import state are the set of fields that the CAM component needs to run, and, the export state are the list of fields that the CAM component can provide to another component it is linked to.
Initialization of the packages occurs in CAM_INIT which calls DYN_INIT and PHYS_INIT. The initial conditions and boundary conditions of the prognostic variables are handled in DYN_INT while, non-advected tracers and other data required by the physcial parameterizations are initialized in PHYS_INIT. Finally, the information required for the coupling of the physics and dynamics packages and the initialization of the 'communicator' are set. The different phases of the initialization of sub-packages follows a prescribed order. First dimension and control information are processed, then initial conditions are read and boundary data initialized. The following assumptions apply about the order of the initialization phase.
CAM Initialization initialize control initialize history and dp_coupling for registration of packages and ports initialize dynamics(initial_conditions, boundary_conditions, restart) initialize physics(lnd and cpl,non-advected tracers, boundary_conditions) initialize history initialize dp_coupling for communicators
The CAM_run (formerly known as STEPON) method controls the time stepping of the model and calls the physics and dynamics packages and DP_COUPLING. CAM_run enforces a standard interface, by encapsulating state and tendency information in derived types. This design implements Requirement DYN03.
An option of the dynamics is if the dynamics is first or if the physics are first. The time loop in CAM_run reflects this difference. A query method asks the dynamics if it is first or not, and depending on the The time loop continues to iterate until the control finds the simulation to be complete.
time loop : do while (.not.done)
if ( dycore_is_first() ) then
dyn_run(dyn_state, dyn_tend, dyn_buffer, dtime)
end if
d_p_coupling(dyn_state, phys_state)
phys_run(phys_state, phys_tend, pbuf, dtime)
p_d_coupling(phys_tend, dyn_tend)
if ( .not. dycore_is_first() ) then
dyn_run(dyn_state, dyn_tend, dyn_buffer, dtime)
end if
history_write
restart_write
end time loop
Notes
The general prediction equation for a generic prognostic variable
is
The parameterization package can be applied to produce an updated field
as indicated in (4). Thus we can write (4) with an operator notation
Or as above with
replaced by
and
by
Basic time steps are described below.
Assumptions:
Given
Calculate parameterization (using
)
For process split parameterizations the time should
be
. For time split, which is conceptually what is being done to create
the state variables for history tape, the time should be
. However, since
time only enters the radiation, it is ok for the current parameterization suite.
However, if radiation went before convection, it must be considered.
Calculate dynamics
Given
Calculate parameterization (using
)
(same issue as with three-time-level Eulerian above, except time levels
are
and
here.
Calculate dynamics
Given
Calculate dynamics
Calculate parameterization (using
)
Given
Calculate parameterization (using
)
Calculate dynamics
Possibly not desirable because analysis based on
not available before dynamics produces
The primary task of DP_COUPLING is to effect the transformation of data structures from the dynamics block decomposition to and from the physics chunk decomposition. Thus it must have access to the DYN_GRID and PHYS_GRID modules. The data transpose or regridding takes into account load balanced maps from the physics package and the assignment of block and chunk sizes from the coupled sizes in order to effect an effecient message passing and data movement method.
DP_COUPLING module also manages the interfaces for external components that specify what a component is, how it is registered and the interface to other functions offered by a framework. The two frameworks we are specifically designing for are the Earth System Modeling Framework (ESMF) and the Common Component Architecture (CCA). Since neither of these are mature at this writing we must leave place holders that will be adapted at a later date. However, the basic outlines are known.