mom_ale module reference¶
This module contains the main regridding routines.
Functions/Subroutines¶
This routine is typically called (from initialize_MOM in file |
|
Initialize diagnostics for the ALE module. |
|
Crudely adjust (initial) grid for integrity. |
|
End of regridding (memory deallocation). |
|
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. |
|
Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. |
|
Regrid/remap stored fields used for offline tracer integrations. |
|
Remaps all tracers from h onto h_target. |
|
Check grid for negative thicknesses. |
|
Generates new grid. |
|
For a state-based coordinate, accelerate the process of regridding by repeatedly applying the grid calculation algorithm. |
|
This routine takes care of remapping all variable between the old and the new grids. |
|
Remaps a single scalar between grids described by thicknesses h_src and h_dst. |
|
Calculate edge values (top and bottom of layer) for T and S consistent with a PLM reconstruction in the vertical direction. |
|
Calculate edge values (top and bottom of layer) 3d scalar array. |
|
Calculate edge values (top and bottom of layer) for T and S consistent with a PPM reconstruction in the vertical direction. |
|
Initializes regridding for the main ALE algorithm. |
|
Query the target coordinate interfaces positions. |
|
Query the target coordinate units. |
|
Returns true if initial conditions should be regridded and remapped. |
|
Updates the weights for time filtering the new grid generated in regridding. |
|
Update the vertical grid type with ALE information. |
|
Write the vertical coordinate information into a file. |
|
Set h to coordinate values for fixed coordinate systems. |
Detailed Description¶
Regridding comprises two steps:
Interpolation and creation of a new grid based on target interface densities (or any other criterion).
Remapping of quantities between old grid and new grid.
Original module written by Laurent White, 2008.06.09
Type Documentation¶
-
type
mom_ale/
ale_cs
¶ ALE control structure.
- Type fields
%
remap_uv_using_old_alg
[logical] :: If true, uses the old “remapping via a delta z” method. If False, uses the new method that remaps between grids described by h.%
regrid_time_scale
[real] :: The time-scale used in blending between the current (old) grid and the target (new) grid [T ~> s].%
regridcs
[type(regridding_cs)] :: Regridding parameters and work arrays.%
remapcs
[type(remapping_cs)] :: Remapping parameters and work arrays.%
nk
[integer] :: Used only for queries, not directly by this module.%
remap_after_initialization
[logical] :: Indicates whether to regrid/remap after initializing the state.%
answers_2018
[logical] :: If true, use the order of arithmetic and expressions for remapping that recover the answers from the end of 2018. Otherwise, use more robust and accurate forms of mathematically equivalent expressions.%
show_call_tree
[logical] :: For debugging.%
diag
[type(diag_ctrl),pointer] :: structure to regulate output%
id_tracer_remap_tendency
[integer(:),allocatable] :: diagnostic id%
id_htracer_remap_tendency
[integer(:),allocatable] :: diagnostic id%
id_htracer_remap_tendency_2d
[integer(:),allocatable] :: diagnostic id%
do_tendency_diag
[logical(:),allocatable] :: flag for doing diagnostics%
id_dzregrid
[integer] :: diagnostic id%
id_u_preale
[integer] :: diagnostic id for zonal velocity before ALE.%
id_v_preale
[integer] :: diagnostic id for meridional velocity before ALE.%
id_h_preale
[integer] :: diagnostic id for layer thicknesses before ALE.%
id_t_preale
[integer] :: diagnostic id for temperatures before ALE.%
id_s_preale
[integer] :: diagnostic id for salinities before ALE.%
id_e_preale
[integer] :: diagnostic id for interface heights before ALE.%
id_vert_remap_h
[integer] :: diagnostic id for layer thicknesses used for remapping%
id_vert_remap_h_tendency
[integer] :: diagnostic id for layer thickness tendency due to ALE
Function/Subroutine Documentation¶
-
subroutine
mom_ale/
ale_init
(param_file, GV, US, max_depth, CS)¶ This routine is typically called (from initialize_MOM in file
MOM.F90
) before the main time integration loop to initialize the regridding stuff. We read the MOM_input file to register the values of different regridding/remapping parameters.- Parameters
param_file :: [in] Parameter file
gv :: [in] Ocean vertical grid structure
us :: [in] A dimensional unit scaling type
max_depth :: [in] The maximum depth of the ocean [Z ~> m].
cs :: Module control structure
- Call to
ale_initregridding
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
- Called from
-
subroutine
mom_ale/
ale_register_diags
(Time, G, GV, US, diag, CS)¶ Initialize diagnostics for the ALE module.
- Parameters
time :: [in] Time structure
g :: [in] Grid structure
us :: [in] A dimensional unit scaling type
gv :: [in] Ocean vertical grid structure
diag :: [in] Diagnostics control structure
cs :: Module control structure
- Call to
-
subroutine
mom_ale/
adjustgridforintegrity
(CS, G, GV, h)¶ Crudely adjust (initial) grid for integrity. This routine is typically called (from initialize_MOM in file
MOM.F90
) before the main time integration loop to initialize the regridding stuff. We read the MOM_input file to register the values of different regridding/remapping parameters.- Parameters
cs :: Regridding parameters and options
g :: [in] Ocean grid informations
gv :: [in] Ocean vertical grid structure
h :: [inout] Current 3D grid thickness that are to be adjusted [H ~> m or kg-2]
-
subroutine
mom_ale/
ale_end
(CS)¶ End of regridding (memory deallocation). This routine is typically called (from MOM_end in file
MOM.F90
) after the main time integration loop to deallocate the regridding stuff.- Parameters
cs :: module control structure
-
subroutine
mom_ale/
ale_main
(G, GV, US, h, u, v, tv, Reg, CS, OBC, dt, frac_shelf_h)¶ Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system.
- Parameters
g :: [in] Ocean grid informations
gv :: [in] Ocean vertical grid structure
us :: [in] A dimensional unit scaling type
h :: [inout] Current 3D grid obtained after the last time step [H ~> m or kg m-2]
u :: [inout] Zonal velocity field [L T-1 ~> m s-1]
v :: [inout] Meridional velocity field [L T-1 ~> m s-1]
tv :: [inout] Thermodynamic variable structure
reg :: Tracer registry structure
cs :: Regridding parameters and options
obc :: Open boundary structure
dt :: [in] Time step between calls to ALE_main [T ~> s]
frac_shelf_h :: Fractional ice shelf coverage
- Call to
ale_update_regrid_weights
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
mom_error_handler::calltree_waypoint
check_grid
mom_diag_mediator::diag_update_remap_grids
remap_all_state_vars
-
subroutine
mom_ale/
ale_main_offline
(G, GV, h, tv, Reg, CS, OBC, dt)¶ Takes care of (1) building a new grid and (2) remapping all variables between the old grid and the new grid. The creation of the new grid can be based on z coordinates, target interface densities, sigma coordinates or any arbitrary coordinate system.
- Parameters
g :: [in] Ocean grid informations
gv :: [in] Ocean vertical grid structure
h :: [inout] Current 3D grid obtained after the last time step [H ~> m or kg-2]
tv :: [inout] Thermodynamic variable structure
reg :: Tracer registry structure
cs :: Regridding parameters and options
obc :: Open boundary structure
dt :: [in] Time step between calls to ALE_main [T ~> s]
- Call to
ale_update_regrid_weights
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
mom_error_handler::calltree_waypoint
check_grid
remap_all_state_vars
- Called from
-
subroutine
mom_ale/
ale_offline_inputs
(CS, G, GV, h, tv, Reg, uhtr, vhtr, Kd, debug, OBC)¶ Regrid/remap stored fields used for offline tracer integrations. These input fields are assumed to have the same layer thicknesses at the end of the last offline interval (which should be a Zstar grid). This routine builds a grid on the runtime specified vertical coordinate.
- Parameters
cs :: Regridding parameters and options
g :: [in] Ocean grid informations
gv :: [in] Ocean vertical grid structure
h :: [inout] Layer thicknesses
tv :: [inout] Thermodynamic variable structure
reg :: Tracer registry structure
uhtr :: [inout] Zonal mass fluxes
vhtr :: [inout] Meridional mass fluxes
kd :: [inout] Input diffusivites
debug :: [in] If true, then turn checksums
obc :: Open boundary structure
- Call to
ale_remap_scalar
mom_error_handler::calltree_leave
mom_error_handler::calltree_waypoint
mom_debugging::check_column_integrals
check_grid
mom_diag_vkernels::interpolate_column
mom_tracer_registry::mom_tracer_chkinv
mom_diag_vkernels::reintegrate_column
remap_all_state_vars
- Called from
-
subroutine
mom_ale/
ale_offline_tracer_final
(G, GV, h, tv, h_target, Reg, CS, OBC)¶ Remaps all tracers from h onto h_target. This is intended to be called when tracers are done offline. In the case where transports don’t quite conserve, we still want to make sure that layer thicknesses offline do not drift too far away from the online model.
- Parameters
g :: [in] Ocean grid informations
gv :: [in] Ocean vertical grid structure
h :: [inout] Current 3D grid obtained after the last time step [H ~> m or kg-2]
tv :: [inout] Thermodynamic variable structure
h_target :: [inout] Current 3D grid obtained after last time step [H ~> m or kg-2]
reg :: Tracer registry structure
cs :: Regridding parameters and options
obc :: Open boundary structure
- Call to
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
mom_error_handler::calltree_waypoint
check_grid
remap_all_state_vars
-
subroutine
mom_ale/
check_grid
(G, GV, h, threshold)¶ Check grid for negative thicknesses.
- Parameters
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
h :: [in] Current 3D grid obtained after the last time step [H ~> m or kg m-2]
threshold :: [in] Value below which to flag issues, [H ~> m or kg m-2]
- Called from
ale_main
ale_main_offline
ale_offline_inputs
ale_offline_tracer_final
-
subroutine
mom_ale/
ale_build_grid
(G, GV, regridCS, remapCS, h, tv, debug, frac_shelf_h)¶ Generates new grid.
- Parameters
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
regridcs :: [in] Regridding parameters and options
remapcs :: [in] Remapping parameters and options
tv :: [inout] Thermodynamical variable structure
h :: [inout] Current 3D grid obtained after the last time step [H ~> m or kg-2]
debug :: [in] If true, show the call tree
frac_shelf_h :: Fractional ice shelf coverage
- Call to
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
-
subroutine
mom_ale/
ale_regrid_accelerated
(CS, G, GV, h, tv, n, u, v, OBC, Reg, dt, dzRegrid, initial)¶ For a state-based coordinate, accelerate the process of regridding by repeatedly applying the grid calculation algorithm.
- Parameters
cs :: ALE control structure
g :: [inout] Ocean grid
gv :: [in] Vertical grid
h :: [inout] Original thicknesses [H ~> m or kg-2]
tv :: [inout] Thermo vars (T/S/EOS)
n :: [in] Number of times to regrid
u :: [inout] Zonal velocity [L T-1 ~> m s-1]
v :: [inout] Meridional velocity [L T-1 ~> m s-1]
obc :: Open boundary structure
reg :: Tracer registry to remap onto new grid
dt :: [in] Model timestep to provide a timescale for regridding [T ~> s]
dzregrid :: [inout] Final change in interface positions
initial :: [in] Whether we’re being called from an initialization routine (and expect diagnostics to work)
- Call to
ale_update_regrid_weights
mom_domains::do_group_pass
remap_all_state_vars
-
subroutine
mom_ale/
remap_all_state_vars
(CS_remapping, CS_ALE, G, GV, h_old, h_new, Reg, OBC, dxInterface, u, v, debug, dt)¶ This routine takes care of remapping all variable between the old and the new grids. When velocity components need to be remapped, thicknesses at velocity points are taken to be arithmetic averages of tracer thicknesses. This routine is called during initialization of the model at time=0, to remap initiali conditions to the model grid. It is also called during a time step to update the state.
- Parameters
cs_remapping :: [in] Remapping control structure
cs_ale :: [in] ALE control structure
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
h_old :: [in] Thickness of source grid [H ~> m or kg-2]
h_new :: [in] Thickness of destination grid [H ~> m or kg-2]
reg :: Tracer registry structure
obc :: Open boundary structure
dxinterface :: [in] Change in interface position
u :: [inout] Zonal velocity [L T-1 ~> m s-1]
v :: [inout] Meridional velocity [L T-1 ~> m s-1]
debug :: [in] If true, show the call tree
dt :: [in] time step for diagnostics [T ~> s]
- Call to
mom_error_handler::calltree_enter
mom_error_handler::calltree_leave
mom_error_handler::calltree_waypoint
mom_open_boundary::obc_direction_n
- Called from
ale_main
ale_main_offline
ale_offline_inputs
ale_offline_tracer_final
ale_regrid_accelerated
-
subroutine
mom_ale/
ale_remap_scalar
(CS, G, GV, nk_src, h_src, s_src, h_dst, s_dst, all_cells, old_remap, answers_2018)¶ Remaps a single scalar between grids described by thicknesses h_src and h_dst. h_dst must be dimensioned as a model array with GVke layers while h_src can have an arbitrary number of layers specified by nk_src.
- Parameters
cs :: [in] Remapping control structure
g :: [in] Ocean grid structure
gv :: [in] Ocean vertical grid structure
nk_src :: [in] Number of levels on source grid
h_src :: [in] Level thickness of source grid [H ~> m or kg-2]
s_src :: [in] Scalar on source grid
h_dst :: [in] Level thickness of destination grid [H ~> m or kg-2]
s_dst :: [inout] Scalar on destination grid
all_cells :: [in] If false, only reconstruct for non-vanished cells. Use all vanished layers otherwise (default).
old_remap :: [in] If true, use the old “remapping_core_w” method, otherwise use “remapping_core_h”.
answers_2018 :: [in] If true, use the order of arithmetic and expressions that recover the answers for remapping from the end of 2018. Otherwise, use more robust forms of the same expressions.
- Call to
- Called from
ale_offline_inputs
mom_tracer_initialization_from_z::mom_initialize_tracer_from_z
-
subroutine
mom_ale/
ts_plm_edge_values
(CS, S_t, S_b, T_t, T_b, G, GV, tv, h, bdry_extrap)¶ Calculate edge values (top and bottom of layer) for T and S consistent with a PLM reconstruction in the vertical direction. Boundary reconstructions are PCM unless bdry_extrap is true.
- Parameters
g :: [in] ocean grid structure
gv :: [in] Ocean vertical grid structure
cs :: [inout] module control structure
s_t :: [inout] Salinity at the top edge of each layer
s_b :: [inout] Salinity at the bottom edge of each layer
t_t :: [inout] Temperature at the top edge of each layer
t_b :: [inout] Temperature at the bottom edge of each layer
tv :: [in] thermodynamics structure
h :: [in] layer thickness [H ~> m or kg m-2]
bdry_extrap :: [in] If true, use high-order boundary extrapolation within boundary cells
- Call to
- Called from
mom_pressureforce_fv::pressureforce_fv_bouss
mom_pressureforce_fv::pressureforce_fv_nonbouss
mom_state_initialization::trim_for_ice
-
subroutine
mom_ale/
ale_plm_edge_values
(CS, G, GV, h, Q, bdry_extrap, Q_t, Q_b)¶ Calculate edge values (top and bottom of layer) 3d scalar array. Boundary reconstructions are PCM unless bdry_extrap is true.
- Parameters
cs :: [in] module control structure
g :: [in] ocean grid structure
gv :: [in] Ocean vertical grid structure
h :: [in] layer thickness [H ~> m or kg m-2]
q :: [in] 3d scalar array
bdry_extrap :: [in] If true, use high-order boundary extrapolation within boundary cells
q_t :: [inout] Scalar at the top edge of each layer
q_b :: [inout] Scalar at the bottom edge of each layer
- Call to
plm_functions::plm_extrapolate_slope
plm_functions::plm_monotonized_slope
plm_functions::plm_slope_wa
- Called from
-
subroutine
mom_ale/
ts_ppm_edge_values
(CS, S_t, S_b, T_t, T_b, G, GV, tv, h, bdry_extrap)¶ Calculate edge values (top and bottom of layer) for T and S consistent with a PPM reconstruction in the vertical direction. Boundary reconstructions are PCM unless bdry_extrap is true.
- Parameters
g :: [in] ocean grid structure
gv :: [in] Ocean vertical grid structure
cs :: [inout] module control structure
s_t :: [inout] Salinity at the top edge of each layer
s_b :: [inout] Salinity at the bottom edge of each layer
t_t :: [inout] Temperature at the top edge of each layer
t_b :: [inout] Temperature at the bottom edge of each layer
tv :: [in] thermodynamics structure
h :: [in] layer thicknesses [H ~> m or kg m-2]
bdry_extrap :: [in] If true, use high-order boundary extrapolation within boundary cells
- Call to
regrid_edge_values::edge_values_implicit_h4
ppm_functions::ppm_boundary_extrapolation
ppm_functions::ppm_reconstruction
- Called from
mom_pressureforce_fv::pressureforce_fv_bouss
mom_pressureforce_fv::pressureforce_fv_nonbouss
-
subroutine
mom_ale/
ale_initregridding
(GV, US, max_depth, param_file, mdl, regridCS)¶ Initializes regridding for the main ALE algorithm.
- Parameters
gv :: [in] Ocean vertical grid structure
us :: [in] A dimensional unit scaling type
max_depth :: [in] The maximum depth of the ocean [Z ~> m].
param_file :: [in] parameter file
mdl :: [in] Name of calling module
regridcs :: [out] Regridding parameters and work arrays
- Called from
-
function
mom_ale/
ale_getcoordinate
(CS) [real]¶ Query the target coordinate interfaces positions.
- Parameters
cs :: module control structure
-
function
mom_ale/
ale_getcoordinateunits
(CS) [character(len=20)]¶ Query the target coordinate units.
- Parameters
cs :: module control structure
-
function
mom_ale/
ale_remap_init_conds
(CS) [logical]¶ Returns true if initial conditions should be regridded and remapped.
- Parameters
cs :: module control structure
-
subroutine
mom_ale/
ale_update_regrid_weights
(dt, CS)¶ Updates the weights for time filtering the new grid generated in regridding.
- Parameters
dt :: [in] Time-step used between ALE calls [T ~> s]
cs :: ALE control structure
- Called from
-
subroutine
mom_ale/
ale_updateverticalgridtype
(CS, GV)¶ Update the vertical grid type with ALE information. This subroutine sets information in the verticalGrid_type to be consistent with the use of ALE mode.
- Parameters
cs :: ALE control structure
gv :: vertical grid information
- Called from
-
subroutine
mom_ale/
ale_writecoordinatefile
(CS, GV, directory)¶ Write the vertical coordinate information into a file. This subroutine writes out a file containing any available data related to the vertical grid used by the MOM ocean model when in ALE mode.
- Parameters
cs :: module control structure
gv :: [in] ocean vertical grid structure
directory :: [in] directory for writing grid info
- Call to
-
subroutine
mom_ale/
ale_initthicknesstocoord
(CS, G, GV, h)¶ Set h to coordinate values for fixed coordinate systems.
- Parameters
cs :: [inout] module control structure
g :: [in] module grid structure
gv :: [in] Ocean vertical grid structure
h :: [out] layer thickness [H ~> m or kg m-2]
- Call to
- Called from