MOM_diag_remap module reference
provides runtime remapping of diagnostics to z star, sigma and rho vertical coordinates.
The diag_remap_ctrl type represents a remapping of diagnostics to a particular vertical coordinate. The module is used by the diag mediator module in the following way:
diag_remap_init() is called to initialize a diag_remap_ctrl instance.
diag_remap_configure_axes() is called to read the configuration file and set up the vertical coordinate / axes definitions.
diag_remap_get_axes_info() returns information needed for the diag mediator to define new axes for the remapped diagnostics.
diag_remap_update() is called periodically (whenever h, T or S change) to either create or update the target remapping grids.
diag_remap_do_remap() is called from within a diag post() to do the remapping before the diagnostic is written out.
Data Types
Represents remapping of diagnostics to a particular vertical coordinate. |
Functions/Subroutines
Initialize a diagnostic remapping type with the given vertical coordinate. |
|
De-init a diagnostic remapping type. Free allocated memory. |
|
Inform that all diagnostics have been registered. If _set_active() has not been called on the remapping control structure will be disabled. This saves time in the case that a vertical coordinate was configured but no diagnostics which use the coordinate appeared in the diag_table. |
|
Indicate that this remapping type is actually used by the diag manager. If this is never called then the type will be disabled to save time. See further explanation with diag_remap_registration_closed. |
|
Configure the vertical axes for a diagnostic remapping control structure. Reads a configuration parameters to determine coordinate generation. |
|
Get layer and interface axes ids for this coordinate Needed when defining axes groups. |
|
Whether or not the axes for this vertical coordinated has been configured. Configuration is complete when diag_remap_configure_axes() has been successfully called. |
|
Build/update target vertical grids for diagnostic remapping. |
|
Remap diagnostic field to alternative vertical grid. |
|
The internal routine to remap a diagnostic field to an alternative vertical grid. |
|
Calculate masks for target grid |
|
Vertically re-grid an already vertically-integrated diagnostic field to alternative vertical grid. |
|
The internal routine to vertically re-grid an already vertically-integrated diagnostic field to an alternative vertical grid. |
|
Vertically interpolate diagnostic field to alternative vertical grid. |
|
Internal routine to vertically interpolate a diagnostic field to an alternative vertical grid. |
|
Horizontally average a diagnostic field |
|
Horizontally average a diagnostic field |
Type Documentation
- type :: diag_remap_ctrl
Represents remapping of diagnostics to a particular vertical coordinate.
There is one of these types for each vertical coordinate. The vertical axes of a diagnostic will reference an instance of this type indicating how (or if) the diagnostic should be vertically remapped when being posted.
- Parameters
configured
Whether vertical coordinate has been configured
initialized
Whether remappping initialized
used
Whether this coordinate actually gets used.
vertical_coord
The vertical coordinate that we remap to
vertical_coord_name
The coordinate name as understood by ALE
Z_based_coord
If true, this coordinate is based on remapping of geometric distances across layers (in [Z ~> m]) rather than layer thicknesses (in [H ~> m or kg m-2]). This distinction only matters in non-Boussinesq mode.
diag_coord_name
A name for the purpose of run-time parameters
diag_module_suffix
The suffix for the module to appear in diag_table
remap_cs
Remapping control structure use for this axes
regrid_cs
Regridding control structure that defines the coordinates for this axes
nz
Number of vertical levels used for remapping
h
Remap grid thicknesses in [H ~> m or kg m-2] or vertical extents in [Z ~> m], depending on the setting of Z_based_coord.
h_extensive
Remap grid thicknesses in [H ~> m or kg m-2] or vertical extents in [Z ~> m] for remapping extensive variables
interface_axes_id
Vertical axes id for remapping at interfaces
layer_axes_id
Vertical axes id for remapping on layers
om4_remap_via_sub_cells
Use the OM4-era ramap_via_sub_cells
answer_date
The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the answers from 2018, while higher values use more robust forms of the same remapping expressions.
Functions/Subroutine Documentation
- subroutine diag_remap_init(remap_cs, coord_tuple, om4_remap_via_sub_cells, answer_date, GV)
Initialize a diagnostic remapping type with the given vertical coordinate.
- Parameters
remap_cs [inout]
Diag remapping control structure
coord_tuple [in]
A string in form of MODULE_SUFFIX PARAMETER_SUFFIX COORDINATE_NAME
om4_remap_via_sub_cells [in]
Use the OM4-era ramap_via_sub_cells
answer_date [in]
The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the answers from 2018, while higher values use more robust forms of the same remapping expressions.
GV [in]
The ocean vertical grid structure, used here to evaluate whether the model is in non-Boussinesq mode.
Callees call graph
Callers call graph
- subroutine diag_remap_end(remap_cs)
De-init a diagnostic remapping type. Free allocated memory.
- Parameters
remap_cs [inout]
Diag remapping control structure
- subroutine diag_remap_diag_registration_closed(remap_cs)
Inform that all diagnostics have been registered. If _set_active() has not been called on the remapping control structure will be disabled. This saves time in the case that a vertical coordinate was configured but no diagnostics which use the coordinate appeared in the diag_table.
- Parameters
remap_cs [inout]
Diag remapping control structure
Callees call graph
Callers call graph
- subroutine diag_remap_set_active(remap_cs)
Indicate that this remapping type is actually used by the diag manager. If this is never called then the type will be disabled to save time. See further explanation with diag_remap_registration_closed.
- Parameters
remap_cs [inout]
Diag remapping control structure
Callers call graph
- subroutine diag_remap_configure_axes(remap_cs, G, GV, US, param_file)
Configure the vertical axes for a diagnostic remapping control structure. Reads a configuration parameters to determine coordinate generation.
- Parameters
remap_cs [inout]
Diag remap control structure
G [in]
The ocean's grid type
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
param_file [in]
Parameter file structure
Callees call graph
Text view
mom_diag_remap::diag_remap_configure_axes → mom_diag_manager_infra::mom_diag_axis_init
mom_diag_remap::diag_remap_configure_axes → mom_regridding::get_regrid_size
mom_diag_remap::diag_remap_configure_axes → mom_regridding::getcoordinateinterfaces
mom_diag_remap::diag_remap_configure_axes → mom_regridding::initialize_regridding
mom_diag_remap::diag_remap_configure_axes → mom_regridding::set_regrid_params
mom_diag_remap::diag_remap_configure_axes → mom_string_functions::lowercase
mom_diag_remap::diag_remap_configure_axes → regrid_consts::coordinatemode
Callers call graph
- subroutine diag_remap_get_axes_info(remap_cs, nz, id_layer, id_interface)
Get layer and interface axes ids for this coordinate Needed when defining axes groups.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
nz [out]
Number of vertical levels for the coordinate
id_layer [out]
1D-axes id for layer points
id_interface [out]
1D-axes id for interface points
- function diag_remap_axes_configured(remap_cs)
Whether or not the axes for this vertical coordinated has been configured. Configuration is complete when diag_remap_configure_axes() has been successfully called.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
- subroutine diag_remap_update(remap_cs, G, GV, US, h, T, S, eqn_of_state, h_target)
Build/update target vertical grids for diagnostic remapping.
Note: The target grids need to be updated whenever sea surface height or layer thicknesses changes. In the case of density-based coordinates then technically we should also regenerate the target grid whenever T/S change.
- Parameters
remap_cs [inout]
Diagnostic coordinate control structure
G
The ocean's grid type
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
h [in]
New thickness in [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_cs%Z_based_coord
T [in]
New temperatures [C ~> degC]
S [in]
New salinities [S ~> ppt]
eqn_of_state [in]
A pointer to the equation of state
h_target [inout]
The new diagnostic thicknesses in [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_cs%Z_based_coord
Callees call graph
Text view
mom_diag_remap::diag_remap_update → coord_rho::build_rho_column
mom_diag_remap::diag_remap_update → coord_sigma::build_sigma_column
mom_diag_remap::diag_remap_update → coord_zlike::build_zstar_column
mom_diag_remap::diag_remap_update → mom_error_handler::mom_error
mom_diag_remap::diag_remap_update → mom_regridding::get_rho_cs
mom_diag_remap::diag_remap_update → mom_regridding::get_sigma_cs
mom_diag_remap::diag_remap_update → mom_regridding::get_zlike_cs
mom_diag_remap::diag_remap_update → mom_regridding::set_dz_neglect
mom_diag_remap::diag_remap_update → mom_regridding::set_h_neglect
mom_diag_remap::diag_remap_update → mom_remapping::initialize_remapping
mom_diag_remap::diag_remap_update → regrid_consts::coordinatemode
Callers call graph
- subroutine diag_remap_do_remap(remap_cs, G, GV, US, h, OBC_u, OBC_v, staggered_in_x, staggered_in_y, mask, field, remapped_field)
Remap diagnostic field to alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
h [in]
The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_CS%Z_based_coord
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
mask
A mask for the field [nondim].
field [in]
The diagnostic field to be remapped [A]
remapped_field [out]
Field remapped to new coordinate [A]
isdf
The starting i- and j-indices in memory for field
jsdf
The starting i- and j-indices in memory for field
Callees call graph
- subroutine do_remap(remap_cs, G, GV, US, isdf, jsdf, h, OBC_u, OBC_v, staggered_in_x, staggered_in_y, field, remapped_field, mask)
The internal routine to remap a diagnostic field to an alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
isdf [in]
The starting i-index in memory for field
jsdf [in]
The starting j-index in memory for field
h [in]
The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_CS%Z_based_coord
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
field [in]
The diagnostic field to be remapped [A]
remapped_field [out]
Field remapped to new coordinate [A]
mask [in]
A mask for the field [nondim]
Callees call graph
- subroutine diag_remap_calc_hmask(remap_cs, G, mask)
Calculate masks for target grid
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
mask [out]
h-point mask for target grid [nondim]
Callees call graph
Callers call graph
- subroutine vertically_reintegrate_diag_field(remap_cs, G, h, h_target, OBC_u, OBC_v, staggered_in_x, staggered_in_y, mask, field, reintegrated_field)
Vertically re-grid an already vertically-integrated diagnostic field to alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
h [in]
The thicknesses of the source grid [H ~> m or kg m-2] or [Z ~> m]
h_target [in]
The thicknesses of the target grid [H ~> m or kg m-2] or [Z ~> m]
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
mask
A mask for the field [nondim]. Note that because this is a pointer it retains its declared indexing conventions.
field [in]
The diagnostic field to be remapped [A]
reintegrated_field [out]
Field argument remapped to alternative coordinate [A]
isdf
The starting i- and j-indices in memory for field
jsdf
The starting i- and j-indices in memory for field
Callees call graph
Callers call graph
- subroutine vertically_reintegrate_field(remap_cs, G, isdf, jsdf, h, h_target, OBC_u, OBC_v, staggered_in_x, staggered_in_y, field, reintegrated_field, mask)
The internal routine to vertically re-grid an already vertically-integrated diagnostic field to an alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
isdf [in]
The starting i-index in memory for field
jsdf [in]
The starting j-index in memory for field
h [in]
The thicknesses of the source grid [H ~> m or kg m-2] or [Z ~> m]
h_target [in]
The thicknesses of the target grid [H ~> m or kg m-2] or [Z ~> m]
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
field [in]
The diagnostic field to be remapped [A]
reintegrated_field [out]
Field argument remapped to alternative coordinate [A]
mask [in]
A mask for the field [nondim]
Callees call graph
Callers call graph
- subroutine vertically_interpolate_diag_field(remap_cs, G, h, OBC_u, OBC_v, staggered_in_x, staggered_in_y, mask, field, interpolated_field)
Vertically interpolate diagnostic field to alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
h [in]
The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_cs%Z_based_coord
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
mask
A mask for the field [nondim]. Note that because this is a pointer it retains its declared indexing conventions.
field [in]
The diagnostic field to be remapped [A]
interpolated_field [inout]
Field argument remapped to alternative coordinate [A]
isdf
The starting i- and j-indices in memory for field
jsdf
The starting i- and j-indices in memory for field
Callees call graph
Callers call graph
- subroutine vertically_interpolate_field(remap_cs, G, isdf, jsdf, h, OBC_u, OBC_v, staggered_in_x, staggered_in_y, field, interpolated_field, mask)
Internal routine to vertically interpolate a diagnostic field to an alternative vertical grid.
- Parameters
remap_cs [in]
Diagnostic coordinate control structure
G [in]
Ocean grid structure
isdf [in]
The starting i-index in memory for field
jsdf [in]
The starting j-index in memory for field
h [in]
The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_cs%Z_based_coord
OBC_u [in]
An array that indicates the presence and direction of any open boundary conditions at u-points, with a value of 0 for no OBC, 1 for an Eastern OBC or -1 for a Western OBC
OBC_v [in]
An array that indicates the presence and direction of any open boundary conditions at v-points, with a value of 0 for no OBC, 1 for a Northern OBC or -1 for a Southern OBC
staggered_in_x [in]
True is the x-axis location is at u or q points
staggered_in_y [in]
True is the y-axis location is at v or q points
field [in]
The diagnostic field to be remapped [A]
interpolated_field [out]
Field argument remapped to alternative coordinate [A]
mask [in]
A mask for the field [nondim]
i
Grid index
j
Grid index
Callees call graph
Callers call graph
- subroutine horizontally_average_diag_field(G, GV, h, staggered_in_x, staggered_in_y, is_layer, is_extensive, field, averaged_field, averaged_mask)
Horizontally average a diagnostic field
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean vertical grid structure
h [in]
The current thicknesses [H ~> m or kg m-2]
staggered_in_x [in]
True if the x-axis location is at u or q points
staggered_in_y [in]
True if the y-axis location is at v or q points
is_layer [in]
True if the z-axis location is at h points
is_extensive [in]
True if the z-direction is spatially integrated (over layers)
field [in]
The diagnostic field to be remapped [A]
averaged_field [out]
Field argument horizontally averaged [A]
averaged_mask [out]
Mask for horizontally averaged field [nondim]
isdf
The starting i- and j-indices in memory for field
jsdf
The starting i- and j-indices in memory for field
Callees call graph
Callers call graph
- subroutine horizontally_average_field(G, GV, isdf, jsdf, h, staggered_in_x, staggered_in_y, is_layer, is_extensive, field, averaged_field, averaged_mask)
Horizontally average a diagnostic field
- Parameters
G [in]
Ocean grid structure
GV [in]
The ocean vertical grid structure
isdf [in]
The starting i-index in memory for field
jsdf [in]
The starting j-index in memory for field
h [in]
The current thicknesses [H ~> m or kg m-2]
staggered_in_x [in]
True if the x-axis location is at u or q points
staggered_in_y [in]
True if the y-axis location is at v or q points
is_layer [in]
True if the z-axis location is at h points
is_extensive [in]
True if the z-direction is spatially integrated (over layers)
field [in]
The diagnostic field to be remapped [A]
averaged_field [out]
Field argument horizontally averaged [A]
averaged_mask [out]
Mask for horizontally averaged field [nondim]
Callees call graph
Text view
mom_diag_remap::horizontally_average_field → mom_coms::efp_to_real
mom_diag_remap::horizontally_average_field → mom_coms::interface::efp_sum_across_pes
mom_diag_remap::horizontally_average_field → mom_coms::interface::reproducing_sum_efp
mom_diag_remap::horizontally_average_field → mom_error_handler::assert