mom_diag_remap module reference
provides runtime remapping of diagnostics to z star, sigma and rho vertical coordinates.
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. |
|
Inform that all diagnostics have been registered. |
|
Indicate that this remapping type is actually used by the diag manager. |
|
Configure the vertical axes for a diagnostic remapping control structure. |
|
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. |
|
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. |
Detailed Description
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: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 is called to initialize a diag_remap_ctrl() instance.instance.
diag_remap_configure_axes()is called to read the configuration file and set up the vertical coordinate / axes definitions.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.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.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. is called from within a diag post() to do the remapping before the diagnostic is written out.
Type Documentation
- type mom_diag_remap/diag_remap_ctrl
Represents remapping of diagnostics to a particular vertical coordinate.
- Type fields:
% configured ::
logical, privateWhether vertical coordinate has been configured.% initialized ::
logical, privateWhether remappping initialized.% used ::
logical, privateWhether this coordinate actually gets used.% vertical_coord ::
integer, privateThe vertical coordinate that we remap to.% vertical_coord_name ::
character(len=10), privateThe coordinate name as understood by ALE.% z_based_coord ::
logical, privateIf 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 ::
character(len=16), privateA name for the purpose of run-time parameters.% diag_module_suffix ::
character(len=8), privateThe suffix for the module to appear in diag_table.% remap_cs ::
type(remapping_cs), privateRemapping control structure use for this axes.% regrid_cs ::
type(regridding_cs), privateRegridding control structure that defines the coordinates for this axes.% nz ::
integer, privateNumber of vertical levels used for remapping.% h ::
real, dimension(:,:,:), allocatable, privateRemap 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 ::
real, dimension(:,:,:), allocatable, privateRemap grid thicknesses in [H ~> m or kg m-2] or vertical extents in [Z ~> m] for remapping extensive variables.% interface_axes_id ::
integer, privateVertical axes id for remapping at interfaces.% layer_axes_id ::
integer, privateVertical axes id for remapping on layers.% om4_remap_via_sub_cells ::
logical, privateUse the OM4-era ramap_via_sub_cells.% answer_date ::
integer, privateThe 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.
Function/Subroutine Documentation
- subroutine mom_diag_remap/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 ::
remap_cs[inout] Diag remapping control structurecoord_tuple ::
coord_tuple[in] A string in form of MODULE_SUFFIX PARAMETER_SUFFIX COORDINATE_NAMEom4_remap_via_sub_cells ::
om4_remap_via_sub_cells[in] Use the OM4-era ramap_via_sub_cellsanswer_date ::
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.
- Call to:
regrid_consts::coordinatemodemom_string_functions::extractword
- subroutine mom_diag_remap/diag_remap_end(remap_cs)
De-init a diagnostic remapping type. Free allocated memory.
- Parameters:
remap_cs ::
remap_cs[inout] Diag remapping control structure- Called from:
- subroutine mom_diag_remap/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 ::
remap_cs[inout] Diag remapping control structure- Call to:
- Called from:
- subroutine mom_diag_remap/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 ::
remap_cs[inout] Diag remapping control structure- Called from:
- subroutine mom_diag_remap/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 ::
remap_cs[inout] Diag remap control structureg :: [in] The ocean’s grid type
gv :: [in] ocean vertical grid structure
us :: [in] A dimensional unit scaling type
param_file ::
param_file[in] Parameter file structure
- Call to:
regrid_consts::coordinatemodemom_string_functions::lowercase
- subroutine mom_diag_remap/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 ::
remap_cs[in] Diagnostic coordinate control structurenz ::
nz[out] Number of vertical levels for the coordinateid_layer ::
id_layer[out] 1D-axes id for layer pointsid_interface ::
id_interface[out] 1D-axes id for interface points
- function mom_diag_remap/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. has been successfully called.- Parameters:
remap_cs ::
remap_cs[in] Diagnostic coordinate control structure
- subroutine mom_diag_remap/diag_remap_update(remap_cs, G, GV, US, h, T, S, eqn_of_state, h_target)
Build/update target vertical grids for diagnostic remapping.
- Parameters:
remap_cs ::
remap_cs[inout] Diagnostic coordinate control structureg :: The ocean’s grid type
gv :: [in] ocean vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[in] New thickness in [H ~> m or kg m-2] or [Z ~> m], dependingt :: [in] New temperatures [C ~> degC]
s :: [in] New salinities [S ~> ppt]
eqn_of_state ::
eqn_of_state[in] A pointer to the equation of stateh_target ::
h_target[inout] The new diagnostic thicknesses in [H ~> m or kg m-2]
- Call to:
coord_rho::build_rho_columncoord_sigma::build_sigma_columncoord_zlike::build_zstar_columnregrid_consts::coordinatemodemom_regridding::get_rho_csmom_regridding::get_sigma_csmom_regridding::get_zlike_csmom_error_handler::mom_error
- subroutine mom_diag_remap/diag_remap_do_remap(remap_cs, G, GV, US, h, staggered_in_x, staggered_in_y, mask, field, remapped_field)
Remap diagnostic field to alternative vertical grid.
- Parameters:
remap_cs ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
gv :: [in] ocean vertical grid structure
us :: [in] A dimensional unit scaling type
h ::
h[in] The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_CSZ_based_coordstaggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsmask ::
maskA mask for the field [nondim].field ::
field[in] The diagnostic field to be remapped [A]remapped_field ::
remapped_field[out] Field remapped to new coordinate [A]
- Call to:
- subroutine mom_diag_remap/do_remap(remap_cs, G, GV, US, isdf, jsdf, h, 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 ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
gv :: [in] ocean vertical grid structure
us :: [in] A dimensional unit scaling type
isdf ::
isdf[in] The starting i-index in memory for fieldjsdf ::
jsdf[in] The starting j-index in memory for fieldh ::
h[in] The current thicknesses [H ~> m or kg m-2] or [Z ~> m],staggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsfield ::
field[in] The diagnostic field to be remapped [A]remapped_field ::
remapped_field[out] Field remapped to new coordinate [A]mask ::
mask[in] A mask for the field [nondim]
- Call to:
- Called from:
- subroutine mom_diag_remap/diag_remap_calc_hmask(remap_cs, G, mask)
Calculate masks for target grid.
- Parameters:
remap_cs ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
mask ::
mask[out] h-point mask for target grid [nondim]
- Call to:
- subroutine mom_diag_remap/vertically_reintegrate_diag_field(remap_cs, G, h, h_target, 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 ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
h ::
h[in] The thicknesses of the source grid [H ~> m or kg m-2] or [Z ~> m]h_target ::
h_target[in] The thicknesses of the target grid [H ~> m or kg m-2] or [Z ~> m]staggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsmask ::
maskA mask for the field [nondim]. Note that because this is a pointer it retains its declared indexing conventions.field ::
field[in] The diagnostic field to be remapped [A]reintegrated_field ::
reintegrated_field[out] Field argument remapped to alternative coordinate [A]
- Call to:
- subroutine mom_diag_remap/vertically_reintegrate_field(remap_cs, G, isdf, jsdf, h, h_target, 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 ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
isdf ::
isdf[in] The starting i-index in memory for fieldjsdf ::
jsdf[in] The starting j-index in memory for fieldh ::
h[in] The thicknesses of the source grid [H ~> m or kg m-2] or [Z ~> m]h_target ::
h_target[in] The thicknesses of the target grid [H ~> m or kg m-2] or [Z ~> m]staggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsfield ::
field[in] The diagnostic field to be remapped [A]reintegrated_field ::
reintegrated_field[out] Field argument remapped to alternative coordinate [A]mask ::
mask[in] A mask for the field [nondim]
- Call to:
- Called from:
- subroutine mom_diag_remap/vertically_interpolate_diag_field(remap_cs, G, h, staggered_in_x, staggered_in_y, mask, field, interpolated_field)
Vertically interpolate diagnostic field to alternative vertical grid.
- Parameters:
remap_cs ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
h ::
h[in] The current thicknesses [H ~> m or kg m-2] or [Z ~> m], depending on the value of remap_csZ_based_coordstaggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsmask ::
maskA mask for the field [nondim]. Note that because this is a pointer it retains its declared indexing conventions.field ::
field[in] The diagnostic field to be remapped [A]interpolated_field ::
interpolated_field[inout] Field argument remapped to alternative coordinate [A]
- Call to:
- subroutine mom_diag_remap/vertically_interpolate_field(remap_cs, G, isdf, jsdf, h, 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 ::
remap_cs[in] Diagnostic coordinate control structureg :: [in] Ocean grid structure
isdf ::
isdf[in] The starting i-index in memory for fieldjsdf ::
jsdf[in] The starting j-index in memory for fieldh ::
h[in] The current thicknesses [H ~> m or kg m-2] or [Z ~> m],staggered_in_x ::
staggered_in_x[in] True is the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True is the y-axis location is at v or q pointsfield ::
field[in] The diagnostic field to be remapped [A]interpolated_field ::
interpolated_field[out] Field argument remapped to alternative coordinate [A]mask ::
mask[in] A mask for the field [nondim]
- Call to:
- Called from:
- subroutine mom_diag_remap/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 ::
h[in] The current thicknesses [H ~> m or kg m-2]staggered_in_x ::
staggered_in_x[in] True if the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True if the y-axis location is at v or q pointsis_layer ::
is_layer[in] True if the z-axis location is at h pointsis_extensive ::
is_extensive[in] True if the z-direction is spatially integrated (over layers)field ::
field[in] The diagnostic field to be remapped [A]averaged_field ::
averaged_field[out] Field argument horizontally averaged [A]averaged_mask ::
averaged_mask[out] Mask for horizontally averaged field [nondim]
- Call to:
- subroutine mom_diag_remap/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 ::
isdf[in] The starting i-index in memory for fieldjsdf ::
jsdf[in] The starting j-index in memory for fieldh ::
h[in] The current thicknesses [H ~> m or kg m-2]staggered_in_x ::
staggered_in_x[in] True if the x-axis location is at u or q pointsstaggered_in_y ::
staggered_in_y[in] True if the y-axis location is at v or q pointsis_layer ::
is_layer[in] True if the z-axis location is at h pointsis_extensive ::
is_extensive[in] True if the z-direction is spatially integrated (over layers)field ::
field[in] The diagnostic field to be remapped [A]averaged_field ::
averaged_field[out] Field argument horizontally averaged [A]averaged_mask ::
averaged_mask[out] Mask for horizontally averaged field [nondim]
- Call to:
- Called from: