mom_diag_remap module reference

provides runtime remapping of diagnostics to z star, sigma and rho vertical coordinates.

More…

Data Types

diag_remap_ctrl

Represents remapping of diagnostics to a particular vertical coordinate.

Functions/Subroutines

diag_remap_init()

Initialize a diagnostic remapping type with the given vertical coordinate.

diag_remap_end()

De-init a diagnostic remapping type.

diag_remap_diag_registration_closed()

Inform that all diagnostics have been registered.

diag_remap_set_active()

Indicate that this remapping type is actually used by the diag manager.

diag_remap_configure_axes()

Configure the vertical axes for a diagnostic remapping control structure.

diag_remap_get_axes_info()

Get layer and interface axes ids for this coordinate Needed when defining axes groups.

diag_remap_axes_configured()

Whether or not the axes for this vertical coordinated has been configured.

diag_remap_update()

Build/update target vertical grids for diagnostic remapping.

diag_remap_do_remap()

Remap diagnostic field to alternative vertical grid.

diag_remap_calc_hmask()

Calculate masks for target grid.

vertically_reintegrate_diag_field()

Vertically re-grid an already vertically-integrated diagnostic field to alternative vertical grid.

vertically_interpolate_diag_field()

Vertically interpolate diagnostic field to alternative vertical grid.

horizontally_average_diag_field()

Horizontally average 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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,private] :: Whether vertical coordinate has been configured.

  • % initialized [logical,private] :: Whether remappping initialized.

  • % used [logical,private] :: Whether this coordinate actually gets used.

  • % vertical_coord [integer,private] :: The vertical coordinate that we remap to.

  • % vertical_coord_name [character (len=10),private] :: The coordinate name as understood by ALE.

  • % diag_coord_name [character (len=16),private] :: A name for the purpose of run-time parameters.

  • % diag_module_suffix [character (len=8),private] :: The suffix for the module to appear in diag_table.

  • % remap_cs [type(remapping_cs),private] :: Remapping control structure use for this axes.

  • % regrid_cs [type(regridding_cs),private] :: Regridding control structure that defines the coordinates for this axes.

  • % nz [integer,private] :: Number of vertical levels used for remapping.

  • % h [real(:,:,:),allocatable, private] :: Remap grid thicknesses [H ~> m or kg m-2].

  • % h_extensive [real(:,:,:),allocatable, private] :: Remap grid thicknesses for extensive variables [H ~> m or kg m-2].

  • % interface_axes_id [integer,private] :: Vertical axes id for remapping at interfaces.

  • % layer_axes_id [integer,private] :: Vertical axes id for remapping on layers.

  • % answers_2018 [logical,private] :: If true, use the order of arithmetic and expressions for remapping that recover the answers from the end of 2018. Otherwise, use updated more robust forms of the same expressions.

Function/Subroutine Documentation

subroutine mom_diag_remap/diag_remap_init(remap_cs, coord_tuple, answers_2018)

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

  • answers_2018 :: [in] If true, use the order of arithmetic and expressions for remapping that recover the answers from the end of 2018. Otherwise, use more robust forms of the same expressions.

Call to

regrid_consts::coordinatemode mom_string_functions::extractword

subroutine mom_diag_remap/diag_remap_end(remap_cs)

De-init a diagnostic remapping type. Free allocated memory.

Parameters

remap_cs :: [inout] Diag remapping control structure

Called from

diag_remap_diag_registration_closed

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 :: [inout] Diag remapping control structure

Call to

diag_remap_end

Called from

mom_diag_mediator::diag_mediator_close_registration

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 :: [inout] Diag remapping control structure

Called from

mom_diag_mediator::register_diag_field

subroutine mom_diag_remap/diag_remap_configure_axes(remap_cs, 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

  • gv :: [in] ocean vertical grid structure

  • us :: [in] A dimensional unit scaling type

  • param_file :: [in] Parameter file structure

Call to

regrid_consts::coordinatemode mom_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 :: [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 mom_diag_remap/diag_remap_axes_configured(remap_cs) [logical]

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 :: [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 :: [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 [H ~> m or kg m-2]

  • t :: [in] New temperatures [degC]

  • s :: [in] New salinities [ppt]

  • eqn_of_state :: A pointer to the equation of state

  • h_target :: [inout] The new diagnostic thicknesses [H ~> m or kg m-2]

Call to

coord_rho::build_rho_column coord_sigma::build_sigma_column coord_zlike::build_zstar_column regrid_consts::coordinatemode mom_regridding::get_rho_cs mom_regridding::get_sigma_cs mom_regridding::get_zlike_cs mom_error_handler::mom_error

subroutine mom_diag_remap/diag_remap_do_remap(remap_cs, G, GV, h, staggered_in_x, staggered_in_y, mask, field, remapped_field)

Remap diagnostic field to alternative vertical grid.

Parameters
  • remap_cs :: [in] Diagnostic coodinate control structure

  • g :: [in] Ocean grid structure

  • gv :: [in] ocean vertical grid structure

  • h :: [in] The current thicknesses [H ~> m or kg m-2]

  • 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 :: [inout] Field remapped to new coordinate [A]

Call to

mom_error_handler::assert mom_remapping::remapping_core_h

subroutine mom_diag_remap/diag_remap_calc_hmask(remap_cs, G, mask)

Calculate masks for target grid.

Parameters
  • remap_cs :: [in] Diagnostic coodinate control structure

  • g :: [in] Ocean grid structure

  • mask :: [out] h-point mask for target grid [nondim]

Call to

mom_error_handler::assert regrid_consts::coordinatemode

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 :: [in] Diagnostic coodinate control structure

  • g :: [in] Ocean grid structure

  • h :: [in] The thicknesses of the source grid [H ~> m or kg m-2]

  • h_target :: [in] The thicknesses of the target grid [H ~> m or kg m-2]

  • 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]

  • reintegrated_field :: [inout] Field argument remapped to alternative coordinate [A]

Call to

mom_error_handler::assert mom_diag_vkernels::reintegrate_column

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 :: [in] Diagnostic coodinate control structure

  • g :: [in] Ocean grid structure

  • h :: [in] The current thicknesses [H ~> m or kg m-2]

  • 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]

  • interpolated_field :: [inout] Field argument remapped to alternative coordinate [A]

Call to

mom_error_handler::assert mom_diag_vkernels::interpolate_column

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 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 :: [inout] Field argument horizontally averaged [A]

  • averaged_mask :: [inout] Mask for horizontally averaged field [nondim]

Call to

mom_error_handler::assert