recon1d_ppm_hybgen module reference
Piecewise Parabolic Method 1D reconstruction following Colella and Woodward, 1984.
Data Types
PPM reconstruction following White and Adcroft, 2008. |
Functions/Subroutines
Calculate a 1D PPM_hybgen reconstruction based on h(:) and u(:) |
|
Average between xa and xb for cell k of a PPM_hybgen reconstruction [A]. |
|
Checks the PPM_hybgen reconstruction for consistency. |
|
Runs PPM_hybgen reconstruction unit tests and returns True for any fails, False otherwise. |
|
Set up edge values for PPM reconstruction using the hybgen (HYCOM) algorithm. |
|
Bound edge values by the averages of the neighboring cells. |
|
Replace discontinuous edge values with their average when not monotonic. |
Detailed Description
This implementation of PPM follows Colella and Woodward, 1984 [17], with cells resorting to PCM for extrema including first and last cells in column. The algorithm was first ported from Hycom as hybgen_ppm_coefs() in the in the mom_hybgen_remap() module. This module is a refactor to facilitate more complete testing and evaluation.module. This module is a refactor to facilitate more complete testing and evaluation.
The mom_hybgen_remap.hybgen_ppm_coefs() function (reached with “PPM_HYGEN”), function (reached with “PPM_HYGEN”), regrid_edge_values.edge_values_explicit_h4cw() function followed by function followed by ppm_functions.ppm_reconstruction() (reached with “PPM_CW”), are equivalent. Similarly (reached with “PPM_CW”), are equivalent. Similarly recon1d_ppm_hybgen() (this implementation) is equivalent also. (this implementation) is equivalent also.
Type Documentation
- type recon1d_ppm_hybgen/ppm_hybgen
PPM reconstruction following White and Adcroft, 2008.
- Type fields:
% reconstruct ::
procedure, privateImplementation of the PPM_hybgen reconstruction.% average ::
procedure, privateImplementation of the PPM_hybgen average over an interval [A].% check_reconstruction ::
procedure, privateImplementation of check reconstruction for the PPM_hybgen reconstruction.% unit_tests ::
procedure, privateImplementation of unit tests for the PPM_hybgen reconstruction.
Function/Subroutine Documentation
- subroutine recon1d_ppm_hybgen/reconstruct(this, h, u)
Calculate a 1D PPM_hybgen reconstruction based on h(:) and u(:)
First pass:
hybgen_ppm_coefs()computes initial edge estimates with CW monotonicity. Second pass: applies OM4-era computes initial edge estimates with CW monotonicity. Second pass: applies OM4-erabound_edge_values()and andcheck_discontinuous_edge_values(), then the standard CW PPM limiter (post-2018 expressions, answer_date=99991231). This reproduces bit-for-bit the behavior of the old-style PPM_HYBGEN scheme. , then the standard CW PPM limiter (post-2018 expressions, answer_date=99991231). This reproduces bit-for-bit the behavior of the old-style PPM_HYBGEN scheme.- Parameters:
this ::
this[inout] This reconstructionh ::
h[in] Grid spacing (thickness) [typically H]u ::
u[in] Cell mean values [A]
- Call to:
bound_edge_valuescheck_discontinuous_edge_valueshybgen_ppm_coefs
- function recon1d_ppm_hybgen/average(this, k, xa, xb)
Average between xa and xb for cell k of a PPM_hybgen reconstruction [A].
Calls the parent PPM_CW average and then clamps the result to [min(ul,ur), max(ul,ur)]. This replicates the force_bounds_in_subcell behavior of the equivalent old-style PPM_HYBGEN scheme.
- Parameters:
this ::
this[in] This reconstructionk ::
k[in] Cell numberxa ::
xa[in] Start of averaging interval on element (0 to 1)xb ::
xb[in] End of averaging interval on element (0 to 1)
- function recon1d_ppm_hybgen/check_reconstruction(this, h, u)
Checks the PPM_hybgen reconstruction for consistency.
- Parameters:
this ::
this[in] This reconstructionh ::
h[in] Grid spacing (thickness) [typically H]u ::
u[in] Cell mean values [A]
- function recon1d_ppm_hybgen/unit_tests(this, verbose, stdout, stderr)
Runs PPM_hybgen reconstruction unit tests and returns True for any fails, False otherwise.
- Parameters:
this ::
this[inout] This reconstructionverbose ::
verbose[in] True, if verbosestdout ::
stdout[in] I/O channel for stdoutstderr ::
stderr[in] I/O channel for stderr
- subroutine recon1d_ppm_hybgen/hybgen_ppm_coefs(s, h_src, edges, nk, thin, PCM_lay)
Set up edge values for PPM reconstruction using the hybgen (HYCOM) algorithm.
Copied from
MOM_hybgen_remap.hybgen_ppm_coefs(). Original code by Tim Campbell (MSU, 2002) and Alan Wallcraft (NRL, 2007). . Original code by Tim Campbell (MSU, 2002) and Alan Wallcraft (NRL, 2007).- Parameters:
nk ::
nk[in] The number of input layerss ::
s[in] The input scalar fields [A]h_src ::
h_src[in] The input grid layer thicknesses [H ~> m or kg m-2]edges ::
edges[out] The PPM interpolation edge values [A]thin ::
thin[in] A negligible layer thickness [H ~> m or kg m-2]pcm_lay :: [in] If true for a layer, use PCM remapping
- Called from:
- subroutine recon1d_ppm_hybgen/bound_edge_values(N, h, u, edge_val, h_neglect, answer_date)
Bound edge values by the averages of the neighboring cells.
Copied from
regrid_edge_values.bound_edge_values(). .- Parameters:
n :: [in] Number of cells
h ::
h[in] Cell widths [H]u ::
u[in] Cell averages [A]edge_val ::
edge_val[inout] Edge values [A]h_neglect ::
h_neglect[in] A negligibly small width [H]answer_date ::
answer_date[in] The vintage of the expressions to use
- Called from:
- subroutine recon1d_ppm_hybgen/check_discontinuous_edge_values(N, u, edge_val)
Replace discontinuous edge values with their average when not monotonic.
Copied from
regrid_edge_values.check_discontinuous_edge_values(). .- Parameters:
n :: [in] Number of cells
u ::
u[in] Cell averages [A]edge_val ::
edge_val[inout] Edge values [A]
- Called from: