MOM_ALE_sponge module reference
This module contains the routines used to apply sponge layers when using the ALE mode.
Applying sponges requires the following:
initialize_ALE_sponge
set_up_ALE_sponge_field (tracers) and set_up_ALE_sponge_vel_field (vel)
apply_ALE_sponge
init_ALE_sponge_diags (not being used for now)
ALE_sponge_end (not being used for now)
Data Types
A structure for creating arrays of pointers to 3D arrays with extra gridding information |
|
A structure for creating arrays of pointers to 2D arrays with extra gridding information |
|
ALE sponge control structure |
Generic Interfaces
Store the reference profile at h points for a variable |
|
This subroutine stores the reference profile at u and v points for a vector |
|
Determine the number of points which are within sponges in this computational domain. |
Functions/Subroutines
This subroutine determines the number of points which are within sponges in this computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights. |
|
Return the number of layers in the data with a fixed ALE sponge, or 0 if there are no sponge columns on this PE. |
|
Return the thicknesses used for the data with a fixed ALE sponge |
|
This subroutine determines the number of points which are to be restored in the computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. |
|
Initialize diagnostics for the ALE_sponge module. |
|
This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr. |
|
This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname. |
|
This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr. |
|
This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr. |
|
This subroutine applies damping to the layers thicknesses, temp, salt and a variety of tracers for every column where there is damping. |
|
Rotate the ALE sponge fields from the input to the model index map. |
|
Scan the ALE sponge variables and replace a prescribed pointer to a new value. |
|
This subroutine deallocates any memory associated with the ALE_sponge module. |
Type Documentation
- type :: p3d
A structure for creating arrays of pointers to 3D arrays with extra gridding information
- Parameters
nz_data
The number of vertical levels in the input field.
num_tlevs
The number of time records contained in the file
p
pointer to the data [various]
dz
pointer to the data grid spacing [Z ~> m]
- type :: p2d
A structure for creating arrays of pointers to 2D arrays with extra gridding information
- Parameters
field
Time interpolator field handle
nz_data
The number of vertical levels in the input field
num_tlevs
The number of time records contained in the file
scale
A multiplicative factor by which to rescale input data [various]
p
pointer to the data [various]
dz
pointer to the data grid spacing [Z ~> m]
name
The name of the input field
long_name
The long name of the input field
unit
The unit of the input field
axes_data
Axis types for the input field
- type, public :: ALE_sponge_CS
ALE sponge control structure
- Parameters
nz
The total number of layers.
nz_data
The total number of arbitrary layers (used by older code).
num_col
The number of sponge tracer points within the computational domain.
num_col_u
The number of sponge u-points within the computational domain.
num_col_v
The number of sponge v-points within the computational domain.
fldno
The number of fields which have already been registered by calls to set_up_sponge_field
sponge_uv
Control whether u and v are included in sponge
col_i
Array of the i-indices of each tracer column being damped
col_j
Array of the j-indices of each tracer column being damped
col_i_u
Array of the i-indices of each u-column being damped
col_j_u
Array of the j-indices of each u-column being damped
col_i_v
Array of the i-indices of each v-column being damped
col_j_v
Array of the j-indices of each v-column being damped
Iresttime_col
The inverse restoring time of each tracer column [T-1 ~> s-1]
Iresttime_col_u
The inverse restoring time of each u-column [T-1 ~> s-1]
Iresttime_col_v
The inverse restoring time of each v-column [T-1 ~> s-1]
var
Pointers to the fields that are being damped.
Ref_val
The values to which the fields are damped.
Ref_val_u
The values to which the u-velocities are damped.
Ref_val_v
The values to which the v-velocities are damped.
var_u
Pointer to the u velocities that are being damped.
var_v
Pointer to the v velocities that are being damped.
Ref_dz
Grid on which reference data is provided (older code).
Ref_dzu
u-point grid on which reference data is provided (older code).
Ref_dzv
v-point grid on which reference data is provided (older code).
diag
A structure that is used to regulate the timing of diagnostic output.
remap_cs
Remapping parameters and work arrays
remap_answer_date
The vintage of the order of arithmetic and expressions to use for remapping. Values below 20190101 recover the remapping answers from 2018, while higher values use more robust forms of the same remapping expressions.
hor_regrid_answer_date
The vintage of the order of arithmetic and expressions to use for horizontal regridding. Values below 20190101 recover the answers from 2018, while higher values use expressions that have been rearranged for rotational invariance.
time_varying_sponges
True if using newer sponge code
spongeDataOngrid
True if the sponge data are on the model horizontal grid
id_sp_tendency
Diagnostic ids for tracer tendencies due to sponges. Init all to -1.
id_sp_u_tendency
Diagnostic id for zonal momentum tendency due to Rayleigh damping
id_sp_v_tendency
Diagnostic id for meridional momentum tendency due to Rayleigh damping
Generic Interface Documentation
- interface set_up_ALE_sponge_field
Store the reference profile at h points for a variable
Callers call graph
Text view
dense_water_initialization::dense_water_initialize_sponges → mom_ale_sponge::interface::set_up_ale_sponge_field
dome2d_initialization::dome2d_initialize_sponges → mom_ale_sponge::interface::set_up_ale_sponge_field
dumbbell_initialization::dumbbell_initialize_sponges → mom_ale_sponge::interface::set_up_ale_sponge_field
isomip_initialization::isomip_initialize_sponges → mom_ale_sponge::interface::set_up_ale_sponge_field
mom_ale_sponge::rotate_ale_sponge → mom_ale_sponge::interface::set_up_ale_sponge_field
mom_state_initialization::initialize_sponges_file → mom_ale_sponge::interface::set_up_ale_sponge_field
rgc_initialization::rgc_initialize_sponges → mom_ale_sponge::interface::set_up_ale_sponge_field
rgc_tracer::initialize_rgc_tracer → mom_ale_sponge::interface::set_up_ale_sponge_field
- interface set_up_ALE_sponge_vel_field
This subroutine stores the reference profile at u and v points for a vector
- interface initialize_ALE_sponge
Determine the number of points which are within sponges in this computational domain.
Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights.
Callers call graph
Text view
dense_water_initialization::dense_water_initialize_sponges → mom_ale_sponge::interface::initialize_ale_sponge
dome2d_initialization::dome2d_initialize_sponges → mom_ale_sponge::interface::initialize_ale_sponge
dumbbell_initialization::dumbbell_initialize_sponges → mom_ale_sponge::interface::initialize_ale_sponge
isomip_initialization::isomip_initialize_sponges → mom_ale_sponge::interface::initialize_ale_sponge
mom_state_initialization::initialize_sponges_file → mom_ale_sponge::interface::initialize_ale_sponge
rgc_initialization::rgc_initialize_sponges → mom_ale_sponge::interface::initialize_ale_sponge
Functions/Subroutine Documentation
- subroutine initialize_ALE_sponge_fixed(Iresttime, G, GV, param_file, CS, data_h, nz_data, Iresttime_u_in, Iresttime_v_in, data_h_is_Z)
This subroutine determines the number of points which are within sponges in this computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights.
- Parameters
G [in]
The ocean's grid structure.
GV [in]
ocean vertical grid structure
nz_data [in]
The total number of sponge input layers.
Iresttime [inout]
The inverse of the restoring time [T-1 ~> s-1].
param_file [in]
A structure indicating the open file to parse for model parameter values.
CS
A pointer that is set to point to the control structure for this module (in/out).
data_h [inout]
The thicknesses of the sponge input layers, in [H ~> m or kg m-2] or [Z ~> m] depending on data_h_is_Z.
Iresttime_u_in [in]
The inverse of the restoring time at U-points [T-1 ~> s-1].
Iresttime_v_in [in]
The inverse of the restoring time at v-points [T-1 ~> s-1].
data_h_is_Z [in]
If present and true data_h is already in depth units. Omitting this is the same as setting it to false.
Iresttime_u
inverse of the restoring time at u points [T-1 ~> s-1]
Iresttime_v
inverse of the restoring time at v points [T-1 ~> s-1]
data_dz
The vertical extent of the sponge input layers [Z ~> m].
Callees call graph
Text view
mom_ale_sponge::initialize_ale_sponge_fixed → mom_coms_infra::interface::sum_across_pes
mom_ale_sponge::initialize_ale_sponge_fixed → mom_domain_infra::interface::pass_var
mom_ale_sponge::initialize_ale_sponge_fixed → mom_error_handler::mom_error
mom_ale_sponge::initialize_ale_sponge_fixed → mom_file_parser::interface::get_param
mom_ale_sponge::initialize_ale_sponge_fixed → mom_file_parser::interface::log_param
mom_ale_sponge::initialize_ale_sponge_fixed → mom_file_parser::interface::log_version
mom_ale_sponge::initialize_ale_sponge_fixed → mom_remapping::initialize_remapping
Callers call graph
- function get_ALE_sponge_nz_data(CS)
Return the number of layers in the data with a fixed ALE sponge, or 0 if there are no sponge columns on this PE.
- Parameters
CS [in]
ALE sponge control struct
get_ALE_sponge_nz_data
The number of layers in the fixed sponge data.
Callers call graph
- subroutine get_ALE_sponge_thicknesses(G, GV, data_h, sponge_mask, CS, data_h_in_Z)
Return the thicknesses used for the data with a fixed ALE sponge
- Parameters
G [in]
The ocean's grid structure (in).
GV [in]
ocean vertical grid structure
data_h [inout]
The thicknesses of the sponge input layers expressed as vertical extents [Z ~> m] or in thickness units [H ~> m or kg m-2], depending on the value of data_h_in_Z.
sponge_mask [out]
A logical mask that is true where sponges are being applied.
CS
A pointer that is set to point to the control structure for the ALE_sponge module.
data_h_in_Z [in]
If present and true data_h is returned in depth units. Omitting this is the same as setting it to false.
Callees call graph
- subroutine initialize_ALE_sponge_varying(Iresttime, G, GV, US, param_file, CS, Iresttime_u_in, Iresttime_v_in)
This subroutine determines the number of points which are to be restored in the computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges.
- Parameters
G [in]
The ocean's grid structure.
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
Iresttime [inout]
The inverse of the restoring time [T-1 ~> s-1].
param_file [in]
A structure indicating the open file to parse for model parameter values.
CS
A pointer that is set to point to the control structure for this module (in/out).
Iresttime_u_in [in]
The inverse of the restoring time for u [T-1 ~> s-1].
Iresttime_v_in [in]
The inverse of the restoring time for v [T-1 ~> s-1].
Iresttime_u
inverse of the restoring time at u points [T-1 ~> s-1]
Iresttime_v
inverse of the restoring time at v points [T-1 ~> s-1]
Callees call graph
Text view
mom_ale_sponge::initialize_ale_sponge_varying → mom_coms_infra::interface::sum_across_pes
mom_ale_sponge::initialize_ale_sponge_varying → mom_domain_infra::interface::pass_var
mom_ale_sponge::initialize_ale_sponge_varying → mom_error_handler::mom_error
mom_ale_sponge::initialize_ale_sponge_varying → mom_file_parser::interface::get_param
mom_ale_sponge::initialize_ale_sponge_varying → mom_file_parser::interface::log_param
mom_ale_sponge::initialize_ale_sponge_varying → mom_file_parser::interface::log_version
mom_ale_sponge::initialize_ale_sponge_varying → mom_remapping::initialize_remapping
Callers call graph
- subroutine init_ALE_sponge_diags(Time, G, diag, CS, US)
Initialize diagnostics for the ALE_sponge module.
- Parameters
Time [in]
The current model time
G [in]
The ocean's grid structure
diag [inout]
A structure that is used to regulate diagnostic output.
CS [inout]
ALE sponge control structure
US [in]
A dimensional unit scaling type
Callees call graph
- subroutine set_up_ALE_sponge_field_fixed(sp_val, G, GV, f_ptr, CS, sp_name, sp_long_name, sp_unit, scale)
This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr.
- Parameters
G [in]
Grid structure
GV [in]
ocean vertical grid structure
CS
ALE sponge control structure (in/out).
sp_val [in]
Field to be used in the sponge, it can have an arbitrary number of layers [various]
f_ptr [in]
Pointer to the field to be damped [various]
sp_name [in]
The name of the tracer field
sp_long_name [in]
The long name of the tracer field if not given, use the sp_name
sp_unit [in]
The unit of the tracer field if not given, use the none
scale [in]
A factor by which to rescale the input data, including any contributions due to dimensional rescaling [various ~> 1]. The default is 1.
Callees call graph
- subroutine set_up_ALE_sponge_field_varying(filename, fieldname, Time, G, GV, US, f_ptr, CS, sp_name, sp_long_name, sp_unit, scale)
This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname.
- Parameters
filename [in]
The name of the file with the time varying field data
fieldname [in]
The name of the field in the file with the time varying field data
Time [in]
The current model time
G [in]
Grid structure (in).
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
f_ptr [in]
Pointer to the field to be damped (in) [various].
CS
Sponge control structure (in/out).
sp_name [in]
The name of the tracer field
sp_long_name [in]
The long name of the tracer field if not given, use the sp_name
sp_unit [in]
The unit of the tracer field if not given, use 'none'
scale [in]
A factor by which to rescale the input data, including any contributions due to dimensional rescaling [various ~> 1].
nz_data
the number of vertical levels in this input field
Callees call graph
Text view
mom_ale_sponge::set_up_ale_sponge_field_varying → mom_error_handler::mom_error
mom_ale_sponge::set_up_ale_sponge_field_varying → mom_interp_infra::init_extern_field
mom_ale_sponge::set_up_ale_sponge_field_varying → mom_interp_infra::time_interp_extern_init
mom_ale_sponge::set_up_ale_sponge_field_varying → mom_interpolate::get_external_field_info
- subroutine set_up_ALE_sponge_vel_field_fixed(u_val, v_val, G, GV, u_ptr, v_ptr, CS, scale)
This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr.
- Parameters
G [in]
Grid structure (in).
GV [in]
ocean vertical grid structure
CS
Sponge structure (in/out).
u_val [in]
u field to be used in the sponge [L T-1 ~> m s-1], it is provided on its own vertical grid that may have fewer layers than the model itself, but not more.
v_val [in]
v field to be used in the sponge [L T-1 ~> m s-1], it is provided on its own vertical grid that may have fewer layers than the model itself, but not more.
u_ptr [in]
u-field to be damped [L T-1 ~> m s-1]
v_ptr [in]
v-field to be damped [L T-1 ~> m s-1]
scale [in]
A factor by which to rescale the input data, including any contributions due to dimensional rescaling [various ~> 1]. The default is 1.
- subroutine set_up_ALE_sponge_vel_field_varying(filename_u, fieldname_u, filename_v, fieldname_v, Time, G, GV, US, CS, u_ptr, v_ptr, scale)
This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr.
- Parameters
filename_u [in]
File name for u field
fieldname_u [in]
Name of u variable in file
filename_v [in]
File name for v field
fieldname_v [in]
Name of v variable in file
Time [in]
Model time
G [in]
Ocean grid (in)
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
CS
Sponge structure (in/out).
u_ptr [in]
u-field to be damped [L T-1 ~> m s-1]
v_ptr [in]
v-field to be damped [L T-1 ~> m s-1]
scale [in]
A factor by which to rescale the input data, including any contributions due to dimensional rescaling, often in [L s T-1 m-1 ~> 1]. For varying velocities the default is the same as using US%m_s_to_L_T.
- subroutine apply_ALE_sponge(h, tv, dt, G, GV, US, CS, Time)
This subroutine applies damping to the layers thicknesses, temp, salt and a variety of tracers for every column where there is damping.
- Parameters
G [inout]
The ocean's grid structure (in).
GV [in]
ocean vertical grid structure
US [in]
A dimensional unit scaling type
h [inout]
Layer thickness [H ~> m or kg m-2] (in)
tv [in]
A structure pointing to various thermodynamic variables
dt [in]
The amount of time covered by this call [T ~> s].
CS
A pointer to the control structure for this module that is set by a previous call to initialize_ALE_sponge (in).
Time [in]
The current model date
tmp
A temporary array for thermodynamic sponge tendency diagnostics [various] then in [various T-1 ~> various s-1]
tmp_u
A temporary array for u sponge acceleration diagnostics first in [L T-1 ~> m s-1] then in [L T-2 ~> m s-2]
tmp_v
A temporary array for v sponge acceleration diagnostics first in [L T-1 ~> m s-1] then in [L T-2 ~> m s-2]
Callees call graph
Text view
mom_ale_sponge::apply_ale_sponge → mom_diag_mediator::interface::post_data
mom_ale_sponge::apply_ale_sponge → mom_domain_infra::interface::pass_var
mom_ale_sponge::apply_ale_sponge → mom_horizontal_regridding::interface::horiz_interp_and_extrap_tracer
mom_ale_sponge::apply_ale_sponge → mom_remapping::remapping_core_h
Callers call graph
- subroutine rotate_ALE_sponge(sponge_in, G_in, sponge, G, GV, US, turns, param_file)
Rotate the ALE sponge fields from the input to the model index map.
- Parameters
sponge_in [in]
The control structure for this module with the original grid rotation
G_in [in]
The ocean's grid structure with the original rotation.
sponge
A pointer to the control that will be set up with the new grid rotation
G [in]
The ocean's grid structure with the new rotation.
GV [in]
The ocean's vertical grid structure
US [in]
A dimensional unit scaling type
turns [in]
The number of 90-degree turns between grids
param_file [in]
A structure indicating the open file to parse for model parameter values.
Callees call graph
Text view
mom_ale_sponge::rotate_ale_sponge → mom_ale_sponge::initialize_ale_sponge_fixed
mom_ale_sponge::rotate_ale_sponge → mom_ale_sponge::initialize_ale_sponge_varying
mom_ale_sponge::rotate_ale_sponge → mom_ale_sponge::interface::set_up_ale_sponge_field
mom_ale_sponge::rotate_ale_sponge → mom_array_transform::interface::rotate_array
mom_ale_sponge::rotate_ale_sponge → mom_error_handler::mom_error
- subroutine update_ALE_sponge_field(sponge, p_old, G, GV, p_new)
Scan the ALE sponge variables and replace a prescribed pointer to a new value.
- Parameters
sponge [inout]
ALE sponge control struct
p_old [in]
The previous array of target values [various]
G [in]
The updated ocean grid structure
GV [in]
ocean vertical grid structure
p_new [in]
The new array of target values [various]
- subroutine ALE_sponge_end(CS)
This subroutine deallocates any memory associated with the ALE_sponge module.
- Parameters
CS
A pointer to the control structure that is set by a previous call to initialize_ALE_sponge.