This module, part of the MPAS interface, integrates MPAS dynamical core with CAM-SIMA by implementing the necessary APIs and managing their interaction.
It contains the instance of MPAS dynamical core, which is used extensively throughout CAM-SIMA. It provides core functionalities such as the initialization, running, and finalization of MPAS dynamical core. Various utility procedures for debug printing, exchanging constituent states, inquiring mesh dimensions, etc. are also provided here.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(mpas_dynamical_core_type), | public | :: | mpas_dynamical_core |
The "instance/object" of MPAS dynamical core. |
|||
integer, | public | :: | ncells | ||||
integer, | public | :: | ncells_global | ||||
integer, | public | :: | ncells_max | ||||
integer, | public | :: | ncells_solve | ||||
integer, | public | :: | nedges | ||||
integer, | public | :: | nedges_global | ||||
integer, | public | :: | nedges_max | ||||
integer, | public | :: | nedges_solve | ||||
integer, | public | :: | nvertices | ||||
integer, | public | :: | nvertices_global | ||||
integer, | public | :: | nvertices_solve | ||||
integer, | public | :: | nvertlevels | ||||
real(kind=kind_dyn_mpas), | public | :: | sphere_radius |
This derived type is not used by MPAS dynamical core. It exists only as a placeholder because CAM-SIMA requires it. Developers/Maintainers/Users who wish to interact with MPAS dynamical core may do so by using the "instance/object" below.
This derived type is not used by MPAS dynamical core. It exists only as a placeholder because CAM-SIMA requires it. Developers/Maintainers/Users who wish to interact with MPAS dynamical core may do so by using the "instance/object" below.
Helper function for reversing the order of elements in array
.
(KCW, 2024-07-17)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=kind_r8), | intent(in) | :: | array(:) |
Check for consistency in topography data. The presence of topography file is inferred from the pio_file
pointer.
If topography file is used, check that the "PHIS" variable, which denotes surface geopotential,
is consistent with the surface geometric height in MPAS.
Otherwise, if topography file is not used, check that the surface geometric height in MPAS is zero.
(KCW, 2024-05-10)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(file_desc_t), | intent(in), | pointer | :: | pio_file |
Print a debug message at a debug level. The debug message will be prefixed by "MPAS Interface (N): ", where N
is the MPI rank. The debug level is one of the debugout_*
constants from the cam_logfile
module.
If printer
is not supplied, the MPI root rank will print. Otherwise, the designated MPI rank will print instead.
(KCW, 2024-02-03)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | level | |||
character(len=*), | intent(in) | :: | message | |||
integer, | intent(in), | optional | :: | printer |
Exchange and/or convert constituent states between CAM-SIMA and MPAS.
If exchange
is .true.
and direction
is "e" or "export", set MPAS state scalars
from physics state constituents
.
If exchange
is .true.
and direction
is "i" or "import", set physics state constituents
from MPAS state scalars
.
Think of it as "exporting/importing constituent states in CAM-SIMA to/from MPAS".
Otherwise, if exchange
is .false.
, no exchange is performed at all.
If conversion
is .true.
, appropriate conversion is performed for constituent mixing ratios that have different
definitions between CAM-SIMA and MPAS (i.e., dry/moist).
Otherwise, if conversion
is .false.
, no conversion is performed at all.
This subroutine is intentionally designed to have these elaborate controls due to complications in CAM-SIMA.
Some procedures in CAM-SIMA expect constituent states to be dry, while the others expect them to be moist.
(KCW, 2024-09-26)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | direction | |||
logical, | intent(in) | :: | exchange | |||
logical, | intent(in) | :: | conversion |
Finalize MPAS dynamical core as well as its framework. (KCW, 2024-10-04)
Initialize MPAS dynamical core by one of the following: 1. Setting analytic initial condition; 2. Reading initial condition from a file; 3. Restarting from a file. (KCW, 2024-05-28)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(runtime_options), | intent(in) | :: | cam_runtime_opts | |||
type(dyn_import_t), | intent(in) | :: | dyn_in | |||
type(dyn_export_t), | intent(in) | :: | dyn_out |
Inquire local and global mesh dimensions. Save them as protected module variables. (KCW, 2024-11-21)
Read MPAS namelist from the supplied path. Additionally, perform early initialization of MPAS dynamical core. (KCW, 2024-02-09)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | namelist_path |
Run MPAS dynamical core to integrate the dynamical states with time. (KCW, 2024-07-11)
Mark everything in the physics_types
module along with constituents as initialized
to prevent physics from attempting to read them from a file.
(KCW, 2024-05-23)
Set analytic initial condition for MPAS. (KCW, 2024-05-22)