recon1d_ppm_hybgen module reference

Piecewise Parabolic Method 1D reconstruction following Colella and Woodward, 1984.

More…

Data Types

ppm_hybgen

PPM reconstruction following White and Adcroft, 2008.

Functions/Subroutines

reconstruct()

Calculate a 1D PPM_hybgen reconstruction based on h(:) and u(:)

average()

Average between xa and xb for cell k of a PPM_hybgen reconstruction [A].

check_reconstruction()

Checks the PPM_hybgen reconstruction for consistency.

unit_tests()

Runs PPM_hybgen reconstruction unit tests and returns True for any fails, False otherwise.

hybgen_ppm_coefs()

Set up edge values for PPM reconstruction using the hybgen (HYCOM) algorithm.

bound_edge_values()

Bound edge values by the averages of the neighboring cells.

check_discontinuous_edge_values()

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, private Implementation of the PPM_hybgen reconstruction.

  • % average :: procedure, private Implementation of the PPM_hybgen average over an interval [A].

  • % check_reconstruction :: procedure, private Implementation of check reconstruction for the PPM_hybgen reconstruction.

  • % unit_tests :: procedure, private Implementation of unit tests for the PPM_hybgen reconstruction.

[source]

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-era bound_edge_values() and 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. , 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 reconstruction

  • h :: h [in] Grid spacing (thickness) [typically H]

  • u :: u [in] Cell mean values [A]

Call to:

bound_edge_values check_discontinuous_edge_values hybgen_ppm_coefs

[source]

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 reconstruction

  • k :: k [in] Cell number

  • xa :: xa [in] Start of averaging interval on element (0 to 1)

  • xb :: xb [in] End of averaging interval on element (0 to 1)

[source]

function  recon1d_ppm_hybgen/check_reconstruction(this, h, u)

Checks the PPM_hybgen reconstruction for consistency.

Parameters:
  • this :: this [in] This reconstruction

  • h :: h [in] Grid spacing (thickness) [typically H]

  • u :: u [in] Cell mean values [A]

[source]

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 reconstruction

  • verbose :: verbose [in] True, if verbose

  • stdout :: stdout [in] I/O channel for stdout

  • stderr :: stderr [in] I/O channel for stderr

[source]

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 layers

  • s :: 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:

reconstruct

[source]

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:

reconstruct

[source]

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:

reconstruct

[source]

[source]