MOM_hybgen_regrid module reference
This module contains the hybgen regridding routines from HYCOM, with minor modifications to follow the MOM6 coding conventions
Data Types
Control structure containing required parameters for the hybgen coordinate generator |
Functions/Subroutines
Initialise a hybgen_regrid_CS control structure and store its parameters |
|
Writes out a file containing any available data related to the vertical grid used by the MOM ocean model. |
|
This subroutine deallocates memory in the control structure for the hybgen module |
|
This subroutine can be used to retrieve the parameters for the hybgen regrid module |
|
Modify the input grid to give a new vertical grid based on the HYCOM hybgen code. |
|
Initialize some of the variables that are used for regridding or unmixing, including the stretched contraits on where the new interfaces can be. |
|
The cushion function from Bleck & Benjamin, 1992, which returns a smoothly varying but limited value that goes between dp0 and delp |
|
Create a new grid for a column of water using the Hybgen algorithm. |
Type Documentation
- type, public :: hybgen_regrid_CS
Control structure containing required parameters for the hybgen coordinate generator
- Parameters
min_thickness
Minimum thickness allowed for layers [H ~> m or kg m-2]
nk
Number of layers on the target grid
Reference pressure for density calculations [R L2 T-2 ~> Pa]
ref_pressure
Hybgen uses PCM if layer is within hybiso of target density [R ~> kg m-3]
hybiso
Number of sigma levels used by HYBGEN
dp00i
Deep isopycnal spacing minimum thickness [H ~> m or kg m-2]
qhybrlx
Fractional relaxation within a regridding step [nondim]
dp0k
minimum deep z-layer separation [H ~> m or kg m-2]
ds0k
minimum shallow z-layer separation [H ~> m or kg m-2]
coord_scale
A scaling factor to restores the depth coordinates to values in m [m H-1 ~> 1 or m3 kg-1]
Rho_coord_scale
A scaling factor to restores the denesity coordinates to values in kg m-3 [kg m-3 R-1 ~> 1]
dpns
depth to start terrain following [H ~> m or kg m-2]
dsns
depth to stop terrain following [H ~> m or kg m-2]
min_dilate
The minimum amount of dilation that is permitted when converting target coordinates from z to z* [nondim]. This limit applies when wetting occurs.
max_dilate
The maximum amount of dilation that is permitted when converting target coordinates from z to z* [nondim]. This limit applies when drying occurs.
thkbot
Thickness of a bottom boundary layer, within which hybgen does something different. [H ~> m or kg m-2]
Shallowest depth for isopycnal layers [H ~> m or kg m-2]
topiso_const
Nominal density of interfaces [R ~> kg m-3]
dp_far_from_sfc
A distance that determines when an interface is suffiently far from the surface that certain adjustments can be made in the Hybgen regridding code [H ~> m or kg m-2]. In Hycom, this is set to tenm (nominally 10 m).
dp_far_from_bot
A distance that determines when an interface is suffiently far from the bottom that certain adjustments can be made in the Hybgen regridding code [H ~> m or kg m-2]. In Hycom, this is set to onem (nominally 1 m).
h_thin
A layer thickness below which a layer is considered to be too thin for certain adjustments to be made in the Hybgen regridding code [H ~> m or kg m-2]. In Hycom, this is set to onemm (nominally 0.001 m).
rho_eps
A small nonzero density that is used to prevent division by zero in several expressions in the Hybgen regridding code [R ~> kg m-3].
onem
Nominally one m in thickness units [H ~> m or kg m-2], used only in certain debugging tests.
Functions/Subroutine Documentation
- subroutine init_hybgen_regrid(CS, GV, US, param_file)
Initialise a hybgen_regrid_CS control structure and store its parameters
- Parameters
CS
Unassociated pointer to hold the control structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
param_file [in]
Parameter file
Callees call graph
Text view
mom_hybgen_regrid::init_hybgen_regrid → mom_error_handler::mom_error
mom_hybgen_regrid::init_hybgen_regrid → mom_file_parser::interface::get_param
mom_hybgen_regrid::init_hybgen_regrid → mom_file_parser::interface::log_param
mom_hybgen_regrid::init_hybgen_regrid → mom_io::interface::mom_read_data
mom_hybgen_regrid::init_hybgen_regrid → mom_io_infra::interface::file_exists
mom_hybgen_regrid::init_hybgen_regrid → mom_string_functions::slasher
- subroutine write_Hybgen_coord_file(GV, CS, filepath)
Writes out a file containing any available data related to the vertical grid used by the MOM ocean model.
- Parameters
GV [in]
The ocean's vertical grid structure
CS [in]
Control structure for this module
filepath [in]
The full path to the file to write
Callees call graph
Callers call graph
- subroutine end_hybgen_regrid(CS)
This subroutine deallocates memory in the control structure for the hybgen module
- Parameters
CS
Coordinate control structure
- subroutine get_hybgen_regrid_params(CS, nk, ref_pressure, hybiso, nsigma, dp00i, qhybrlx, dp0k, ds0k, dpns, dsns, min_dilate, max_dilate, thkbot, topiso_const, target_density)
This subroutine can be used to retrieve the parameters for the hybgen regrid module
- Parameters
CS
Coordinate regridding control structure
nk [out]
Number of layers on the target grid
ref_pressure [out]
Reference pressure for density calculations [R L2 T-2 ~> Pa]
hybiso [out]
Hybgen uses PCM if layer is within hybiso of target density [R ~> kg m-3]
nsigma [out]
Number of sigma levels used by HYBGEN
dp00i [out]
Deep isopycnal spacing minimum thickness [H ~> m or kg m-2]
qhybrlx [out]
Fractional relaxation amount per timestep, 0 < qyhbrlx <= 1 [nondim]
dp0k [out]
minimum deep z-layer separation [H ~> m or kg m-2]
ds0k [out]
minimum shallow z-layer separation [H ~> m or kg m-2]
dpns [out]
depth to start terrain following [H ~> m or kg m-2]
dsns [out]
depth to stop terrain following [H ~> m or kg m-2]
min_dilate [out]
The minimum amount of dilation that is permitted when converting target coordinates from z to z* [nondim]. This limit applies when wetting occurs.
max_dilate [out]
The maximum amount of dilation that is permitted when converting target coordinates from z to z* [nondim]. This limit applies when drying occurs.
thkbot [out]
Thickness of a bottom boundary layer, within which hybgen does something different. [H ~> m or kg m-2]
topiso_const [out]
Shallowest depth for isopycnal layers [H ~> m or kg m-2]
target_density [out]
Nominal density of interfaces [R ~> kg m-3]
Callees call graph
Callers call graph
- subroutine hybgen_regrid(G, GV, US, dp, nom_depth_H, tv, CS, dzInterface, PCM_cell)
Modify the input grid to give a new vertical grid based on the HYCOM hybgen code.
- Parameters
G [in]
Ocean grid structure
GV [in]
Ocean vertical grid structure
US [in]
A dimensional unit scaling type
dp [in]
Source grid layer thicknesses [H ~> m or kg m-2]
nom_depth_H [in]
The bathymetric depth of this column relative to mean sea level or another locally valid reference height, converted to thickness units [H ~> m or kg m-2]
tv [in]
Thermodynamics structure
CS [in]
hybgen control structure
dzInterface [inout]
The change in height of each interface, using a sign convention opposite to the change in pressure [H ~> m or kg m-2]
PCM_cell [inout]
If true, PCM remapping should be used in a cell. This is effectively intent out, but values in wide halo regions and land points are reused.
Callees call graph
- subroutine hybgen_column_init(nk, nsigma, dp0k, ds0k, dp00i, topiso_i_j, qhybrlx, dpns, dsns, h_tot, dilate, h_col, fixlay, qhrlx, dp0ij, dp0cum)
Initialize some of the variables that are used for regridding or unmixing, including the stretched contraits on where the new interfaces can be.
- Parameters
nk [in]
The number of layers in the new grid
nsigma [in]
The number of sigma levels
dp0k [in]
Layer deep z-level spacing minimum thicknesses [H ~> m or kg m-2]
ds0k [in]
Layer shallow z-level spacing minimum thicknesses [H ~> m or kg m-2]
dp00i [in]
Deep isopycnal spacing minimum thickness [H ~> m or kg m-2]
topiso_i_j [in]
Shallowest depth for isopycnal layers [H ~> m or kg m-2]
qhybrlx [in]
Fractional relaxation amount per timestep, 0 < qyhbrlx <= 1 [nondim]
h_tot [in]
The sum of the initial layer thicknesses [H ~> m or kg m-2]
dilate [in]
A factor by which to dilate the target positions from z to z* [nondim]
h_col [in]
Initial layer thicknesses [H ~> m or kg m-2]
dpns [in]
Vertical sum of dp0k [H ~> m or kg m-2]
dsns [in]
Vertical sum of ds0k [H ~> m or kg m-2]
fixlay [out]
Deepest fixed coordinate layer
qhrlx [out]
Fractional relaxation within a timestep (between 0 and 1) [nondim]
dp0ij [out]
minimum layer thickness [H ~> m or kg m-2]
dp0cum [out]
minimum interface depth [H ~> m or kg m-2]
Callers call graph
- real function cushn(delp, dp0)
The cushion function from Bleck & Benjamin, 1992, which returns a smoothly varying but limited value that goes between dp0 and delp
- subroutine hybgen_column_regrid(CS, nk, thkbot, Rcv_tgt, fixlay, qhrlx, dp0ij, dp0cum, Rcv, h_in, dp_int)
Create a new grid for a column of water using the Hybgen algorithm.
- Parameters
CS [in]
hybgen regridding control structure
nk [in]
number of layers
thkbot [in]
thickness of bottom boundary layer [H ~> m or kg m-2]
Rcv_tgt [in]
Target potential density [R ~> kg m-3]
fixlay [in]
deepest fixed coordinate layer
qhrlx [in]
relaxation coefficient per timestep [nondim]
dp0ij [in]
minimum layer thickness [H ~> m or kg m-2]
dp0cum [in]
minimum interface depth [H ~> m or kg m-2]
Rcv [in]
Coordinate potential density [R ~> kg m-3]
h_in [in]
Layer thicknesses [H ~> m or kg m-2]
dp_int [out]
The change in interface positions [H ~> m or kg m-2]