mom_remapping module reference
Provides column-wise vertical remapping functions.
Data Types
Container for remapping parameters. |
Functions/Subroutines
Set parameters within remapping object. |
|
Remaps column of values u0 on grid h0 to grid h1 assuming the top edge is aligned and using the OM4 reconstruction methods. |
|
Remaps column of values u0 on grid h0 to implied grid h1 where the interfaces of h1 differ from those of h0 by dx. |
|
Creates polynomial reconstructions of u0 on the source grid h0. |
|
Checks that edge values and reconstructions satisfy bounds. |
|
Returns the intersection of source and targets grids along with and auxiliary lists or indices. |
|
Adjust h_sub to ensure accurate conservation. |
|
Remaps column of n0 values u0 on grid h0 to subgrid h_sub. |
|
Remaps column of n0+n1+1 values usub on sub-grid h_sub to targets on grid h1 using the OM4-era algorithm. |
|
Remaps column of n0+n1+1 values usub on sub-grid h_sub to targets on grid h1. |
|
Linearly interpolate interface data, u_src, from grid h_src to a grid h_dest. |
|
Conservatively calculate integrated data, uh_dest, on grid h_dest, from layer-integrated data, uh_src, on grid h_src. |
|
Returns the average value of a reconstruction within a single source cell, i0, between the non-dimensional positions xa and xb (xa<=xb) with dimensional separation dh. |
|
This subroutine checks for sufficient consistence in the extrema and total amounts on the old and new grids. |
|
Measure totals and bounds on source grid. |
|
Measure totals and bounds on destination grid. |
|
Calculates the change in interface positions based on h1 and h2. |
|
Constructor for remapping control structure. |
|
Changes the method of reconstruction Use this routine to parse a string parameter specifying the reconstruction and re-allocates work arrays appropriately. |
|
Destrcutor for remapping control structure. |
|
Test if |
|
Test if |
|
Test class-based remapping for internal consistency on random data. |
|
Test that remapping a uniform field remains uniform. |
|
Test that remapping to the same grid preserves answers. |
|
Test class-based remapping bitwise reproduces original implementation. |
|
Runs unit tests on remapping functions. |
Detailed Description
Provides column-wise vertical remapping functions.
Type Documentation
- type mom_remapping/remapping_cs
Container for remapping parameters.
- Type fields:
% remapping_scheme ::
integerDetermines which reconstruction to use.% degree ::
integerDegree of polynomial reconstruction.% boundary_extrapolation ::
logicalIf true, extrapolate boundaries.% check_reconstruction ::
logicalIf true, reconstructions are checked for consistency.% check_remapping ::
logicalIf true, the result of remapping are checked for conservation and bounds.% force_bounds_in_subcell ::
logicalIf true, the intermediate values used in remapping are forced to be bounded.% force_bounds_in_target ::
logicalIf true, impose bounds on the remapping from sub-cells to target grid.% better_force_bounds_in_target ::
logicalIf true, impose bounds on the remapping from non-vanished sub-cells to target grid.% offset_tgt_summation ::
logicalIf true, calculate and use an offset when summing sub-cells to the target grid.% answer_date ::
integerThe vintage of the expressions to use for remapping. Values below 20190101 result in the use of older, less accurate expressions.% om4_remap_via_sub_cells ::
logicalIf true, use the OM4 version of the remapping algorithm that makes poor assumptions about the reconstructions in top and bottom layers of the source grid.% h_neglect ::
realA negligibly small width for the purpose of cell reconstructions in the same units as the h0 argument to remapping_core_h [H].% h_neglect_edge ::
realA negligibly small width for the purpose of edge value calculations in the same units as the h0 argument to remapping_core_h [H].% debug ::
logicalIf true, do some debugging as operations proceed.% reconstruction ::
class(recon1d), pointerThe instance of the actual equation of state.
Function/Subroutine Documentation
- subroutine mom_remapping/remapping_set_param(CS, remapping_scheme, boundary_extrapolation, check_reconstruction, check_remapping, force_bounds_in_subcell, force_bounds_in_target, better_force_bounds_in_target, offset_tgt_summation, om4_remap_via_sub_cells, answers_2018, answer_date, nk, h_neglect, h_neglect_edge)
Set parameters within remapping object.
- Parameters:
cs :: [inout] Remapping control structure
remapping_scheme ::
remapping_scheme[in] Remapping scheme to useboundary_extrapolation ::
boundary_extrapolation[in] Indicate to extrapolate in boundary cellscheck_reconstruction ::
check_reconstruction[in] Indicate to check reconstructionscheck_remapping ::
check_remapping[in] Indicate to check results of remappingforce_bounds_in_subcell ::
force_bounds_in_subcell[in] Force subcells values to be boundedforce_bounds_in_target ::
force_bounds_in_target[in] Force target values to be boundedbetter_force_bounds_in_target ::
better_force_bounds_in_target[in] Force target values to be boundedoffset_tgt_summation ::
offset_tgt_summation[in] Use an offset when summing sub-cellsom4_remap_via_sub_cells ::
om4_remap_via_sub_cells[in] If true, use OM4 remapping algorithmanswers_2018 ::
answers_2018[in] If true use older, less accurate expressions.answer_date ::
answer_date[in] The vintage of the expressions to useh_neglect ::
h_neglect[in] A negligibly small width for the purpose of cell reconstructions in the same units as the h0 argument to remapping_core_h [H]h_neglect_edge ::
h_neglect_edge[in] A negligibly small width for the purpose of edge value calculations in the same units as as the h0 argument to remapping_core_h [H]nk ::
nk[in] Number of levels to initialize reconstruction class with
- Call to:
- Called from:
mom_ale::ale_set_extrap_boundariesmom_ale::ale_set_om4_remap_algorithminitialize_remappingremapping_unit_tests
- subroutine mom_remapping/extract_member_remapping_cs(CS, remapping_scheme, degree, boundary_extrapolation, check_reconstruction, check_remapping, force_bounds_in_subcell, force_bounds_in_target, better_force_bounds_in_target, offset_tgt_summation)
- Parameters:
cs :: [in] Control structure for remapping module
remapping_scheme ::
remapping_scheme[out] Determines which reconstruction scheme to usedegree ::
degree[out] Degree of polynomial reconstructionboundary_extrapolation ::
boundary_extrapolation[out] If true, extrapolate boundariescheck_reconstruction ::
check_reconstruction[out] If true, reconstructions are checked for consistency.check_remapping ::
check_remapping[out] If true, the result of remapping are checked for conservation and bounds.force_bounds_in_subcell ::
force_bounds_in_subcell[out] If true, the intermediate values used in remapping are forced to be bounded.force_bounds_in_target ::
force_bounds_in_target[out] Force target values to be boundedbetter_force_bounds_in_target ::
better_force_bounds_in_target[out] Force target values to be boundedoffset_tgt_summation ::
offset_tgt_summation[out] Use an offset when summing sub-cells
- subroutine mom_remapping/remapping_core_h(CS, n0, h0, u0, n1, h1, u1, net_err, PCM_cell)
Remaps column of values u0 on grid h0 to grid h1 assuming the top edge is aligned and using the OM4 reconstruction methods.
Todo
Remove h_neglect argument by moving into remapping_CS
Remove PCM_cell argument by adding new method in Recon1D class
- Parameters:
cs :: [in] Remapping control structure
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]n1 ::
n1[in] Number of cells on target gridh1 ::
h1[in] Cell widths on target grid [H]u1 ::
u1[out] Cell averages on target grid [A]net_err ::
net_err[out] Error in total column [A H]pcm_cell :: [in] If present, use PCM remapping for cells in the source grid where this is true.
- Call to:
build_reconstructions_1dcheck_reconstructions_1dcheck_remapped_valuesintersect_src_tgt_gridsremap_src_to_sub_gridremap_src_to_sub_grid_om4remap_sub_to_tgt_gridremap_sub_to_tgt_grid_om4remapping_via_class- Called from:
mom_ale_sponge::apply_ale_spongemom_oda_driver_mod::apply_oda_tracer_incrementscoord_hycom::build_hycom1_columncoord_rho::build_rho_column_iterativelymom_tidal_mixing::calculate_cvmix_tidalcompare_two_schemesmom_state_initialization::cut_off_column_topmarbl_tracers::marbl_tracers_column_physicsremapping_unit_testsmom_oda_driver_mod::set_prior_tracertest_preserve_uniformtest_unchanged_gridmom_wave_speed::wave_speedmom_wave_speed::wave_speeds
- subroutine mom_remapping/remapping_core_w(CS, n0, h0, u0, n1, dx, u1)
Remaps column of values u0 on grid h0 to implied grid h1 where the interfaces of h1 differ from those of h0 by dx.
- Parameters:
cs :: [in] Remapping control structure
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]n1 ::
n1[in] Number of cells on target griddx ::
dx[in] Cell widths on target grid [H]u1 ::
u1[out] Cell averages on target grid [A]
- Call to:
build_reconstructions_1dcheck_reconstructions_1dcheck_remapped_valuesintersect_src_tgt_gridsremap_src_to_sub_grid_om4remap_sub_to_tgt_grid_om4- Called from:
- subroutine mom_remapping/build_reconstructions_1d(CS, n0, h0, u0, ppoly_r_coefs, ppoly_r_E, ppoly_r_S, iMethod, h_neglect, h_neglect_edge, PCM_cell, debug)
Creates polynomial reconstructions of u0 on the source grid h0.
- Parameters:
cs :: [in] Remapping control structure
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]ppoly_r_coefs ::
ppoly_r_coefs[out] Coefficients of polynomial [A]ppoly_r_e :: [out] Edge value of polynomial [A]
ppoly_r_s :: [out] Edge slope of polynomial [A H-1]
imethod :: [out] Integration method
h_neglect ::
h_neglect[in] A negligibly small width for the purpose of cell reconstructions in the same units as h0 [H]h_neglect_edge ::
h_neglect_edge[in] A negligibly small width for the purpose of edge value calculations in the same units as h0 [H]. The default is h_neglect.pcm_cell :: [in] If present, use PCM remapping for cells from the source grid where this is true.
debug ::
debug[in] If true, enable debugging
- Call to:
regrid_edge_values::edge_slopes_implicit_h3regrid_edge_values::edge_slopes_implicit_h5mom_hybgen_remap::hybgen_plm_coefsmom_hybgen_remap::hybgen_ppm_coefsmom_hybgen_remap::hybgen_weno_coefsintegration_pcmintegration_plmintegration_ppmintegration_pqmmom_error_handler::mom_errorpcm_functions::pcm_reconstructionplm_functions::plm_boundary_extrapolationplm_functions::plm_reconstructionppm_functions::ppm_monotonicitypqm_functions::pqm_boundary_extrapolation_v1pqm_functions::pqm_reconstructionremapping_pcmremapping_plmremapping_plm_hybgenremapping_ppm_cwremapping_ppm_h4remapping_ppm_hybgenremapping_ppm_ih4remapping_pqm_ih4ih3remapping_pqm_ih6ih5remapping_via_classremapping_weno_hybgen- Called from:
- subroutine mom_remapping/check_reconstructions_1d(n0, h0, u0, deg, boundary_extrapolation, ppoly_r_coefs, ppoly_r_E)
Checks that edge values and reconstructions satisfy bounds.
- Parameters:
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]deg ::
deg[in] Degree of polynomial reconstructionboundary_extrapolation ::
boundary_extrapolation[in] Extrapolate at boundaries if trueppoly_r_coefs ::
ppoly_r_coefs[in] Coefficients of polynomial [A]ppoly_r_e :: [in] Edge value of polynomial [A]
- Call to:
- Called from:
- subroutine mom_remapping/intersect_src_tgt_grids(n0, h0, n1, h1, h_sub, h0_eff, isrc_start, isrc_end, isrc_max, itgt_start, itgt_end, isub_src)
Returns the intersection of source and targets grids along with and auxiliary lists or indices.
For source grid with thicknesses h0(1:n0) and target grid with thicknesses h1(1:n1) the intersection or “subgrid” has thicknesses h_sub(1:n0+n1+1). h0 and h1 must have the same units. h_sub will return with the same units as h0 and h1.
Notes on the algorithm: Internally, grids are defined by the interfaces (although we describe grids via thicknesses for accuracy). The intersection or union of two grids is thus defined by the super set of both lists of interfaces. Because both source and target grids can contain vanished cells, we do not eliminate repeated interfaces from the union. That is, the total number of interfaces of the sub-cells is equal to the total numer of interfaces of the source grid (n0+1) plus the total number of interfaces of the target grid (n1+1), i.e. n0+n1+2. Whenever target and source interfaces align, then the retention of identical interfaces leads to a vanished subcell. The remapping uses a common point of reference to the left (top) so there is always a vanished subcell at the left (top). If the total column thicknesses are the same, then the right (bottom) interfaces are also aligned and so the last subcell will also be vanished.
- Parameters:
n0 ::
n0[in] Number of cells in source gridh0 ::
h0[in] Source grid widths (size n0) [H]n1 ::
n1[in] Number of cells in target gridh1 ::
h1[in] Target grid widths (size n1) [H]h_sub ::
h_sub[out] Overlapping sub-cell thicknesses, h_sub [H]h0_eff ::
h0_eff[out] Effective thickness of source cells [H]isrc_start ::
isrc_start[out] Index of first sub-cell within each source cellisrc_end ::
isrc_end[out] Index of last sub-cell within each source cellisrc_max ::
isrc_max[out] Index of thickest sub-cell within each source cellitgt_start ::
itgt_start[out] Index of first sub-cell within each target cellitgt_end ::
itgt_end[out] Index of last sub-cell within each target cellisub_src ::
isub_src[out] Index of source cell for each sub-cell
- Called from:
- subroutine mom_remapping/remap_src_to_sub_grid_om4(n0, h0, u0, ppoly0_E, ppoly0_coefs, n1, h_sub, h0_eff, isrc_start, isrc_end, isrc_max, isub_src, method, force_bounds_in_subcell, u_sub, uh_sub, u02_err)
Adjust h_sub to ensure accurate conservation.
Loop over each source cell substituting the thickest sub-cell (within the source cell) with the residual of the source cell thickness minus the sum of other sub-cells aka a genius algorithm for accurate conservation when remapping from Robert Hallberg (@Hallberg-NOAA). Remaps column of n0 values u0 on grid h0 to subgrid h_sub
This includes an error for the scenario where the source grid is much thicker than the target grid and extrapolation is needed.
- Parameters:
n0 ::
n0[in] Number of cells in source gridh0 ::
h0[in] Source grid widths (size n0) [H]u0 ::
u0[in] Source grid widths (size n0) [H]ppoly0_e :: [in] Edge value of polynomial [A]
ppoly0_coefs ::
ppoly0_coefs[in] Coefficients of polynomial [A]n1 ::
n1[in] Number of cells in target gridh_sub ::
h_sub[in] Overlapping sub-cell thicknesses, h_sub [H]h0_eff ::
h0_eff[in] Effective thickness of source cells [H]isrc_start ::
isrc_start[in] Index of first sub-cell within each source cellisrc_end ::
isrc_end[in] Index of last sub-cell within each source cellisrc_max ::
isrc_max[in] Index of thickest sub-cell within each source cellisub_src ::
isub_src[in] Index of source cell for each sub-cellmethod ::
method[in] Remapping scheme to useforce_bounds_in_subcell ::
force_bounds_in_subcell[in] Force sub-cell values to be boundedu_sub ::
u_sub[out] Sub-cell cell averages (size n1) [A]uh_sub ::
uh_sub[out] Sub-cell cell integrals (size n1) [A H]u02_err ::
u02_err[out] Integrated reconstruction error estimates [A H]
- Call to:
- Called from:
- subroutine mom_remapping/remap_src_to_sub_grid(n0, h0, u0, ppoly0_E, ppoly0_coefs, n1, h_sub, isrc_start, isrc_end, isrc_max, isub_src, method, force_bounds_in_subcell, u_sub, uh_sub, u02_err)
Remaps column of n0 values u0 on grid h0 to subgrid h_sub.
- Parameters:
n0 ::
n0[in] Number of cells in source gridh0 ::
h0[in] Source grid widths (size n0) [H]u0 ::
u0[in] Source grid widths (size n0) [H]ppoly0_e :: [in] Edge value of polynomial [A]
ppoly0_coefs ::
ppoly0_coefs[in] Coefficients of polynomial [A]n1 ::
n1[in] Number of cells in target gridh_sub ::
h_sub[in] Overlapping sub-cell thicknesses, h_sub [H]isrc_start ::
isrc_start[in] Index of first sub-cell within each source cellisrc_end ::
isrc_end[in] Index of last sub-cell within each source cellisrc_max ::
isrc_max[in] Index of thickest sub-cell within each source cellisub_src ::
isub_src[in] Index of source cell for each sub-cellmethod ::
method[in] Remapping scheme to useforce_bounds_in_subcell ::
force_bounds_in_subcell[in] Force sub-cell values to be boundedu_sub ::
u_sub[out] Sub-cell cell averages (size n1) [A]uh_sub ::
uh_sub[out] Sub-cell cell integrals (size n1) [A H]u02_err ::
u02_err[out] Integrated reconstruction error estimates [A H]
- Call to:
- Called from:
- subroutine mom_remapping/remap_sub_to_tgt_grid_om4(n0, n1, h1, h_sub, u_sub, uh_sub, itgt_start, itgt_end, force_bounds_in_target, u1, uh_err)
Remaps column of n0+n1+1 values usub on sub-grid h_sub to targets on grid h1 using the OM4-era algorithm.
- Parameters:
n0 ::
n0[in] Number of cells in source gridn1 ::
n1[in] Number of cells in target gridh1 ::
h1[in] Target grid widths (size n1) [H]h_sub ::
h_sub[in] Overlapping sub-cell thicknesses, h_sub [H]u_sub ::
u_sub[in] Sub-cell cell averages (size n1) [A]uh_sub ::
uh_sub[in] Sub-cell cell integrals (size n1) [A H]itgt_start ::
itgt_start[in] Index of first sub-cell within each target cellitgt_end ::
itgt_end[in] Index of last sub-cell within each target cellforce_bounds_in_target ::
force_bounds_in_target[in] Force sub-cell values to be boundedu1 ::
u1[out] Target cell averages (size n1) [A]uh_err ::
uh_err[out] Estimate of bound on error in sum of u*h [A H]
- Called from:
- subroutine mom_remapping/remap_sub_to_tgt_grid(n0, n1, h1, h_sub, u_sub, uh_sub, itgt_start, itgt_end, force_bounds_in_target, better_force_bounds_in_target, offset_summation, u1, uh_err)
Remaps column of n0+n1+1 values usub on sub-grid h_sub to targets on grid h1.
- Parameters:
n0 ::
n0[in] Number of cells in source gridn1 ::
n1[in] Number of cells in target gridh1 ::
h1[in] Target grid widths (size n1) [H]h_sub ::
h_sub[in] Overlapping sub-cell thicknesses, h_sub [H]u_sub ::
u_sub[in] Sub-cell cell averages (size n1) [A]uh_sub ::
uh_sub[in] Sub-cell cell integrals (size n1) [A H]itgt_start ::
itgt_start[in] Index of first sub-cell within each target cellitgt_end ::
itgt_end[in] Index of last sub-cell within each target cellforce_bounds_in_target ::
force_bounds_in_target[in] Force sub-cell values to be boundedbetter_force_bounds_in_target ::
better_force_bounds_in_target[in] Force sub-cell values to be boundedoffset_summation ::
offset_summation[in] Offset values in summation for accuracyu1 ::
u1[out] Target cell averages (size n1) [A]uh_err ::
uh_err[out] Estimate of bound on error in sum of u*h [A H]
- Called from:
- subroutine mom_remapping/interpolate_column(nsrc, h_src, u_src, ndest, h_dest, u_dest, mask_edges)
Linearly interpolate interface data, u_src, from grid h_src to a grid h_dest.
- Parameters:
nsrc ::
nsrc[in] Number of source cellsh_src ::
h_src[in] Thickness of source cells [H]u_src ::
u_src[in] Values at source cell interfaces [A]ndest ::
ndest[in] Number of destination cellsh_dest ::
h_dest[in] Thickness of destination cells [H]u_dest ::
u_dest[inout] Interpolated value at destination cell interfaces [A]mask_edges ::
mask_edges[in] If true, mask the values outside of massless layers at the top and bottom of the column.
- Called from:
test_interpmom_diag_remap::vertically_interpolate_fieldmom_wave_speed::wave_speeds
- subroutine mom_remapping/reintegrate_column(nsrc, h_src, uh_src, ndest, h_dest, uh_dest)
Conservatively calculate integrated data, uh_dest, on grid h_dest, from layer-integrated data, uh_src, on grid h_src.
- Parameters:
nsrc ::
nsrc[in] Number of source cellsh_src ::
h_src[in] Thickness of source cells [H]uh_src ::
uh_src[in] Values at source cell interfaces [A H]ndest ::
ndest[in] Number of destination cellsh_dest ::
h_dest[in] Thickness of destination cells [H]uh_dest ::
uh_dest[inout] Interpolated value at destination cell interfaces [A H]
- Called from:
test_reintegratemom_diag_remap::vertically_reintegrate_field
- function mom_remapping/average_value_ppoly(n0, u0, ppoly0_E, ppoly0_coefs, method, i0, xa, xb)
Returns the average value of a reconstruction within a single source cell, i0, between the non-dimensional positions xa and xb (xa<=xb) with dimensional separation dh.
- Parameters:
n0 ::
n0[in] Number of cells in source gridu0 ::
u0[in] Cell means [A]ppoly0_e :: [in] Edge value of polynomial [A]
ppoly0_coefs ::
ppoly0_coefs[in] Coefficients of polynomial [A]method ::
method[in] Remapping scheme to usei0 ::
i0[in] Source cell indexxa ::
xa[in] Non-dimensional start position within source cell [nondim]xb ::
xb[in] Non-dimensional end position within source cell [nondim]
- Call to:
integration_pcmintegration_plmintegration_ppmintegration_pqmmom_error_handler::mom_error- Called from:
mom_neutral_diffusion::neutral_surface_t_evalremap_src_to_sub_gridremap_src_to_sub_grid_om4
- subroutine mom_remapping/check_remapped_values(n0, h0, u0, ppoly_r_E, deg, ppoly_r_coefs, n1, h1, u1, iMethod, uh_err, caller)
This subroutine checks for sufficient consistence in the extrema and total amounts on the old and new grids.
- Parameters:
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]ppoly_r_e :: [in] Edge values of polynomial fits [A]
deg ::
deg[in] Degree of the piecewise polynomial reconstrutionppoly_r_coefs ::
ppoly_r_coefs[in] Coefficients of the piecewise polynomial reconstructions [A]n1 ::
n1[in] Number of cells on target gridh1 ::
h1[in] Cell widths on target grid [H]u1 ::
u1[in] Cell averages on target grid [A]imethod :: [in] An integer indicating the integration method used
uh_err ::
uh_err[in] A bound on the error in the sum of u*h as estimated by the remapping code [H A]caller ::
caller[in] The name of the calling routine.
- Call to:
measure_input_boundsmeasure_output_boundsmom_error_handler::mom_error- Called from:
- subroutine mom_remapping/measure_input_bounds(n0, h0, u0, edge_values, h0tot, h0err, u0tot, u0err, u0min, u0max)
Measure totals and bounds on source grid.
- Parameters:
n0 ::
n0[in] Number of cells on source gridh0 ::
h0[in] Cell widths on source grid [H]u0 ::
u0[in] Cell averages on source grid [A]edge_values ::
edge_values[in] Cell edge values on source grid [A]h0tot ::
h0tot[out] Sum of cell widths [H]h0err ::
h0err[out] Magnitude of round-off error in h0tot [H]u0tot ::
u0tot[out] Sum of cell widths times values [H A]u0err ::
u0err[out] Magnitude of round-off error in u0tot [H A]u0min ::
u0min[out] Minimum value in reconstructions of u0 [A]u0max ::
u0max[out] Maximum value in reconstructions of u0 [A]
- Called from:
- subroutine mom_remapping/measure_output_bounds(n1, h1, u1, h1tot, h1err, u1tot, u1err, u1min, u1max)
Measure totals and bounds on destination grid.
- Parameters:
n1 ::
n1[in] Number of cells on destination gridh1 ::
h1[in] Cell widths on destination grid [H]u1 ::
u1[in] Cell averages on destination grid [A]h1tot ::
h1tot[out] Sum of cell widths [H]h1err ::
h1err[out] Magnitude of round-off error in h1tot [H]u1tot ::
u1tot[out] Sum of cell widths times values [H A]u1err ::
u1err[out] Magnitude of round-off error in u1tot [H A]u1min ::
u1min[out] Minimum value in reconstructions of u1 [A]u1max ::
u1max[out] Maximum value in reconstructions of u1 [A]
- Called from:
- subroutine mom_remapping/dzfromh1h2(n1, h1, n2, h2, dx)
Calculates the change in interface positions based on h1 and h2.
- Parameters:
n1 ::
n1[in] Number of cells on source gridh1 ::
h1[in] Cell widths of source grid (size n1) [H]n2 ::
n2[in] Number of cells on target gridh2 ::
h2[in] Cell widths of target grid (size n2) [H]dx ::
dx[out] Change in interface position (size n2+1) [H]
- Called from:
- subroutine mom_remapping/initialize_remapping(CS, remapping_scheme, boundary_extrapolation, check_reconstruction, check_remapping, force_bounds_in_subcell, force_bounds_in_target, better_force_bounds_in_target, offset_tgt_summation, om4_remap_via_sub_cells, answers_2018, answer_date, nk, h_neglect, h_neglect_edge)
Constructor for remapping control structure.
- Parameters:
cs :: [inout] Remapping control structure
remapping_scheme ::
remapping_scheme[in] Remapping scheme to useboundary_extrapolation ::
boundary_extrapolation[in] Indicate to extrapolate in boundary cellscheck_reconstruction ::
check_reconstruction[in] Indicate to check reconstructionscheck_remapping ::
check_remapping[in] Indicate to check results of remappingforce_bounds_in_subcell ::
force_bounds_in_subcell[in] Force subcells values to be boundedforce_bounds_in_target ::
force_bounds_in_target[in] Force target values to be boundedbetter_force_bounds_in_target ::
better_force_bounds_in_target[in] Force target values to be boundedoffset_tgt_summation ::
offset_tgt_summation[in] Use an offset when summing sub-cellsom4_remap_via_sub_cells ::
om4_remap_via_sub_cells[in] If true, use OM4 remapping algorithmanswers_2018 ::
answers_2018[in] If true use older, less accurate expressions.answer_date ::
answer_date[in] The vintage of the expressions to useh_neglect ::
h_neglect[in] A negligibly small width for the purpose of cell reconstructions in the same units as h0 [H]h_neglect_edge ::
h_neglect_edge[in] A negligibly small width for the purpose of edge value calculations in the same units as h0 [H].nk ::
nk[in] Number of levels to initialize reconstruction class with
- Call to:
- Called from:
mom_oda_driver_mod::init_odamom_ale_sponge::initialize_ale_sponge::initialize_ale_sponge_fixedmom_ale_sponge::initialize_ale_sponge::initialize_ale_sponge_varyingmom_tracer_initialization_from_z::mom_initialize_tracer_from_zmom_open_boundary::open_boundary_setup_vertmom_tidal_mixing::read_tidal_constituentsmarbl_tracers::register_marbl_tracersremapping_unit_teststest_preserve_uniformtest_recon_consistencytest_unchanged_gridmom_state_initialization::trim_for_icemom_wave_speed::wave_speed_init
- subroutine mom_remapping/setreconstructiontype(string, CS)
Changes the method of reconstruction Use this routine to parse a string parameter specifying the reconstruction and re-allocates work arrays appropriately. It is called from initialize_remapping but can be called from an external module too.
- Parameters:
string ::
string[in] String to parse for methodcs :: [inout] Remapping control structure
- Call to:
mom_error_handler::mom_errorremapping_pcmremapping_plmremapping_plm_hybgenremapping_ppm_cwremapping_ppm_h4remapping_ppm_hybgenremapping_ppm_ih4remapping_pqm_ih4ih3remapping_pqm_ih6ih5remapping_via_classremapping_weno_hybgenmom_string_functions::uppercase- Called from:
- subroutine mom_remapping/end_remapping(CS)
Destrcutor for remapping control structure.
- Parameters:
cs :: [inout] Remapping control structure
- Called from:
- subroutine mom_remapping/test_interp(test, msg, nsrc, h_src, u_src, ndest, h_dest, u_true)
Test if
interpolate_column()produces the wrong answer. produces the wrong answer.- Parameters:
test ::
test[inout] Unit testing convenience functionsmsg ::
msg[in] Message to label testnsrc ::
nsrc[in] Number of source cellsh_src ::
h_src[in] Thickness of source cells [H]u_src ::
u_src[in] Values at source cell interfaces [A]ndest ::
ndest[in] Number of destination cellsh_dest ::
h_dest[in] Thickness of destination cells [H]u_true ::
u_true[in] Correct value at destination cell interfaces [A]
- Call to:
- Called from:
- subroutine mom_remapping/test_reintegrate(test, msg, nsrc, h_src, uh_src, ndest, h_dest, uh_true)
Test if
reintegrate_column()produces the wrong answer. produces the wrong answer.- Parameters:
test ::
test[inout] Unit testing convenience functionsmsg ::
msg[in] Message to label testnsrc ::
nsrc[in] Number of source cellsh_src ::
h_src[in] Thickness of source cells [H]uh_src ::
uh_src[in] Values of source cell stuff [A H]ndest ::
ndest[in] Number of destination cellsh_dest ::
h_dest[in] Thickness of destination cells [H]uh_true ::
uh_true[in] Correct value of destination cell stuff [A H]
- Call to:
- Called from:
- subroutine mom_remapping/test_recon_consistency(test, scheme, n0, niter, h_neglect)
Test class-based remapping for internal consistency on random data.
- Parameters:
test ::
test[inout] Unit testing convenience functionsscheme ::
scheme[in] Name of scheme to usen0 ::
n0[in] Number of source cellsniter ::
niter[in] Number of randomized columns to tryh_neglect ::
h_neglect[in] A negligibly small width used in cell reconstructions [H]
- Call to:
- Called from:
- subroutine mom_remapping/test_preserve_uniform(test, scheme, n0, niter, h_neglect)
Test that remapping a uniform field remains uniform.
- Parameters:
test ::
test[inout] Unit testing convenience functionsscheme ::
scheme[in] Name of scheme to usen0 ::
n0[in] Number of source cellsniter ::
niter[in] Number of randomized columns to tryh_neglect ::
h_neglect[in] A negligibly small width used in cell reconstructions [H]
- Call to:
- Called from:
- subroutine mom_remapping/test_unchanged_grid(test, scheme, n0, niter, h_neglect)
Test that remapping to the same grid preserves answers.
Notes: 1) this test is currently imperfect since occasionally we see round-off implying that ( A * B ) / A != B 2) this test does not work for vanished layers
- Parameters:
test ::
test[inout] Unit testing convenience functionsscheme ::
scheme[in] Name of scheme to usen0 ::
n0[in] Number of source cellsniter ::
niter[in] Number of randomized columns to tryh_neglect ::
h_neglect[in] A negligibly small width used in cell reconstructions [H]
- Call to:
- Called from:
- subroutine mom_remapping/compare_two_schemes(test, CS1, CS2, n0, n1, niter, msg)
Test class-based remapping bitwise reproduces original implementation.
- Parameters:
test ::
test[inout] Unit testing convenience functionscs1 :: [inout] Remapping control structure configured for original implementation
cs2 :: [inout] Remapping control structure configured for class-based implementation
n0 ::
n0[in] Number of source cellsn1 ::
n1[in] Number of destination cellsniter ::
niter[in] Number of randomized columns to trymsg ::
msg[in] Message to label test
- Call to:
- Called from:
- function mom_remapping/remapping_unit_tests(verbose, num_comp_samp)
Runs unit tests on remapping functions. Should only be called from a single/root thread Returns True if a test fails, otherwise False.
- Parameters:
verbose ::
verbose[in] If true, write results to stdoutnum_comp_samp ::
num_comp_samp[in] If present, number of samples to try comparing class-based cade against OM4 code
- Call to:
compare_two_schemesdzfromh1h2end_remappinginitialize_remappingintegration_plmintersect_src_tgt_gridspcm_functions::pcm_reconstructionplm_functions::plm_boundary_extrapolationplm_functions::plm_reconstructionremap_src_to_sub_gridremap_src_to_sub_grid_om4remap_sub_to_tgt_gridremapping_core_hremapping_core_wremapping_set_paramtest_interptest_preserve_uniformtest_recon_consistencytest_reintegratetest_unchanged_grid- Called from: