Recon1d_PPM_hybgen module reference
Piecewise Parabolic Method 1D reconstruction following Colella and Woodward, 1984
This implementation of PPM follows Colella and Woodward, 1984 [18], 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 mom_hybgen_remap 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"), regrid_edge_values.edge_values_explicit_h4cw() function followed by ppm_functions.ppm_reconstruction() (reached with "PPM_CW"), are equivalent. Similarly recon1d_ppm_hybgen (this implementation) is equivalent also.
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 |
|
Bound edge values by the averages of the neighboring cells. |
|
Replace discontinuous edge values with their average when not monotonic. |
Type Documentation
- type, extends(PPM_CW) :: PPM_hybgen
PPM reconstruction following White and Adcroft, 2008
Implemented by extending recon1d_ppm_cwk.
The source for the methods ultimately used by this class are:
init() -> recon1d_ppm_cw.init()
reconstruct() *locally defined
average() *locally defined but calls recon1d_ppm_cw.average()
f() -> recon1d_ppm_cw.f()
dfdx() -> recon1d_ppm_cw.dfdx()
check_reconstruction() *locally defined
unit_tests() -> recon1d_ppm_cw.unit_tests()
destroy() -> recon1d_ppm_cw.destroy()
remap_to_sub_grid() -> recon1d_type.remap_to_sub_grid()
init_parent() -> init()
reconstruct_parent() -> reconstruct()
Functions/Subroutine Documentation
- subroutine 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 bound_edge_values() and check_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.
- Parameters
this [inout]
This reconstruction
h [in]
Grid spacing (thickness) [typically H]
u [in]
Cell mean values [A]
- real function 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 [in]
This reconstruction
k [in]
Cell number
xa [in]
Start of averaging interval on element (0 to 1)
xb [in]
End of averaging interval on element (0 to 1)
- logical function check_reconstruction(this, h, u)
Checks the PPM_hybgen reconstruction for consistency
- Parameters
this [in]
This reconstruction
h [in]
Grid spacing (thickness) [typically H]
u [in]
Cell mean values [A]
- logical function unit_tests(this, verbose, stdout, stderr)
Runs PPM_hybgen reconstruction unit tests and returns True for any fails, False otherwise
- Parameters
this [inout]
This reconstruction
verbose [in]
True, if verbose
stdout [in]
I/O channel for stdout
stderr [in]
I/O channel for stderr
- subroutine 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).
- Parameters
nk [in]
The number of input layers
s [in]
The input scalar fields [A]
h_src [in]
The input grid layer thicknesses [H ~> m or kg m-2]
edges [out]
The PPM interpolation edge values [A]
thin [in]
A negligible layer thickness [H ~> m or kg m-2]
PCM_lay [in]
If true for a layer, use PCM remapping
- subroutine 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 [in]
Cell widths [H]
u [in]
Cell averages [A]
edge_val [inout]
Edge values [A]
h_neglect [in]
A negligibly small width [H]
answer_date [in]
The vintage of the expressions to use
Callers call graph
- subroutine 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 [in]
Cell averages [A]
edge_val [inout]
Edge values [A]