regrid_interp module reference

Vertical interpolation for regridding

Data Types

interp_CS_type

Control structure for regrid_interp module

Functions/Subroutines

regridding_set_ppolys

Builds an interpolated profile for the densities within each grid cell.

interpolate_grid

Given target values (e.g., density), build new grid based on polynomial

build_and_interpolate_grid

Build a grid by interpolating for target values

get_polynomial_coordinate

Given a target value, find corresponding coordinate for given polynomial

interpolation_scheme

Numeric value of interpolation_scheme corresponding to scheme name

set_interp_scheme

Store the interpolation_scheme value in the interp_CS based on the input string.

set_interp_extrap

Store the boundary_extrapolation value in the interp_CS

set_interp_answer_date

Store the value of the answer_date in the interp_CS

Type Documentation

type, public :: interp_CS_type

Control structure for regrid_interp module

Parameters
  • interpolation_scheme

    Indicate whether high-order boundary extrapolation should be used within boundary cells

  • boundary_extrapolation

    The vintage of the expressions to use for regridding

Functions/Subroutine Documentation

subroutine regridding_set_ppolys(CS, densities, n0, h0, ppoly0_E, ppoly0_S, ppoly0_coefs, degree, h_neglect, h_neglect_edge)

Builds an interpolated profile for the densities within each grid cell.

It may happen that, given a high-order interpolator, the number of available layers is insufficient (e.g., there are two available layers for a third-order PPM ih4 scheme). In these cases, we resort to the simplest continuous linear scheme (P1M h2).

Parameters
  • CS [in]

    Interpolation control structure

  • n0 [in]

    Number of cells on source grid

  • densities [in]

    Actual cell densities [A]

  • h0 [in]

    cell widths on source grid [H]

  • ppoly0_E [inout]

    Edge value of polynomial [A]

  • ppoly0_S [inout]

    Edge slope of polynomial [A H-1]

  • ppoly0_coefs [inout]

    Coefficients of polynomial [A]

  • degree [inout]

    The degree of the polynomials

  • h_neglect [in]

    A negligibly small width for the purpose of cell reconstructions [H] in the same units as h0.

  • h_neglect_edge [in]

    A negligibly small width for the purpose of edge value calculations [H] in the same units as h0.

Callees call graph
Callees of regrid_interp::regridding_set_ppolys calls cluster_p1m_functions P1M_functions cluster_p3m_functions P3M_functions cluster_plm_functions PLM_functions cluster_ppm_functions PPM_functions cluster_pqm_functions PQM_functions cluster_regrid_edge_values regrid_edge_values cluster_regrid_interp regrid_interp p1m_functions::p1m_boundary_extrapolation P1M_boundary_extrapolation p1m_functions::p1m_interpolation P1M_interpolation p3m_functions::p3m_boundary_extrapolation P3M_boundary_extrapolation p3m_functions::p3m_interpolation P3M_interpolation plm_functions::plm_boundary_extrapolation PLM_boundary_extrapolation plm_functions::plm_reconstruction PLM_reconstruction ppm_functions::ppm_boundary_extrapolation PPM_boundary_extrapolation ppm_functions::ppm_monotonicity PPM_monotonicity ppm_functions::ppm_reconstruction PPM_reconstruction pqm_functions::pqm_boundary_extrapolation_v1 PQM_boundary_extrapolation_v1 pqm_functions::pqm_reconstruction PQM_reconstruction regrid_edge_values::edge_slopes_implicit_h3 edge_slopes_implicit_h3 regrid_edge_values::edge_slopes_implicit_h5 edge_slopes_implicit_h5 regrid_edge_values::edge_values_explicit_h2 edge_values_explicit_h2 regrid_edge_values::edge_values_explicit_h4 edge_values_explicit_h4 regrid_edge_values::edge_values_explicit_h4cw edge_values_explicit_h4cw regrid_edge_values::edge_values_implicit_h4 edge_values_implicit_h4 regrid_edge_values::edge_values_implicit_h6 edge_values_implicit_h6 regrid_interp::regridding_set_ppolys regridding_set_ppolys regrid_interp::regridding_set_ppolys->p1m_functions::p1m_boundary_extrapolation regrid_interp::regridding_set_ppolys->p1m_functions::p1m_interpolation regrid_interp::regridding_set_ppolys->p3m_functions::p3m_boundary_extrapolation regrid_interp::regridding_set_ppolys->p3m_functions::p3m_interpolation regrid_interp::regridding_set_ppolys->plm_functions::plm_boundary_extrapolation regrid_interp::regridding_set_ppolys->plm_functions::plm_reconstruction regrid_interp::regridding_set_ppolys->ppm_functions::ppm_boundary_extrapolation regrid_interp::regridding_set_ppolys->ppm_functions::ppm_monotonicity regrid_interp::regridding_set_ppolys->ppm_functions::ppm_reconstruction regrid_interp::regridding_set_ppolys->pqm_functions::pqm_boundary_extrapolation_v1 regrid_interp::regridding_set_ppolys->pqm_functions::pqm_reconstruction regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_slopes_implicit_h3 regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_slopes_implicit_h5 regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_values_explicit_h2 regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_values_explicit_h4 regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_values_explicit_h4cw regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_values_implicit_h4 regrid_interp::regridding_set_ppolys->regrid_edge_values::edge_values_implicit_h6
Text view
Callers call graph
Callers of regrid_interp::regridding_set_ppolys calls cluster_coord_hycom coord_hycom cluster_regrid_interp regrid_interp coord_hycom::build_hycom1_target_anomaly build_hycom1_target_anomaly [private/internal] regrid_interp::regridding_set_ppolys regridding_set_ppolys coord_hycom::build_hycom1_target_anomaly->regrid_interp::regridding_set_ppolys regrid_interp::build_and_interpolate_grid build_and_interpolate_grid regrid_interp::build_and_interpolate_grid->regrid_interp::regridding_set_ppolys
Text view
subroutine interpolate_grid(n0, h0, x0, ppoly0_E, ppoly0_coefs, target_values, degree, n1, h1, x1, answer_date)

Given target values (e.g., density), build new grid based on polynomial

Given the grid 'grid0' and the piecewise polynomial interpolant 'ppoly0' (possibly discontinuous), the coordinates of the new grid 'grid1' are determined by finding the corresponding target interface densities.

Parameters
  • n0 [in]

    Number of points on source grid

  • n1 [in]

    Number of points on target grid

  • h0 [in]

    Thicknesses of source grid cells [H]

  • x0 [in]

    Source interface positions [H]

  • ppoly0_E [in]

    Edge values of interpolating polynomials [A]

  • ppoly0_coefs [in]

    Coefficients of interpolating polynomials [A]

  • target_values [in]

    Target values of interfaces [A]

  • degree [in]

    Degree of interpolating polynomials

  • h1 [inout]

    Thicknesses of target grid cells [H]

  • x1 [inout]

    Target interface positions [H]

  • answer_date [in]

    The vintage of the expressions to use

Callees call graph
Callees of regrid_interp::interpolate_grid calls cluster_regrid_interp regrid_interp regrid_interp::get_polynomial_coordinate get_polynomial_coordinate [private/internal] regrid_interp::interpolate_grid interpolate_grid [private/internal] regrid_interp::interpolate_grid->regrid_interp::get_polynomial_coordinate
Text view
Callers call graph
Callers of regrid_interp::interpolate_grid calls cluster_regrid_interp regrid_interp regrid_interp::build_and_interpolate_grid build_and_interpolate_grid regrid_interp::interpolate_grid interpolate_grid [private/internal] regrid_interp::build_and_interpolate_grid->regrid_interp::interpolate_grid
Text view
subroutine build_and_interpolate_grid(CS, densities, n0, h0, x0, target_values, n1, h1, x1, h_neglect, h_neglect_edge)

Build a grid by interpolating for target values

Parameters
  • CS [in]

    A control structure for regrid_interp

  • n0 [in]

    The number of points on the input grid

  • n1 [in]

    The number of points on the output grid

  • densities [in]

    Input cell densities [R ~> kg m-3]

  • target_values [in]

    Target values of interfaces [R ~> kg m-3]

  • h0 [in]

    Initial cell widths usually in [H ~> m or kg m-2] or [Z ~> m]

  • x0 [in]

    Source interface positions [H ~> m or kg m-2] or [Z ~> m]

  • h1 [inout]

    Output cell widths [H ~> m or kg m-2] or [Z ~> m]

  • x1 [inout]

    Target interface positions [H ~> m or kg m-2] or [Z ~> m]

  • h_neglect [in]

    A negligibly small width for the purpose of cell reconstructions in the same units as h0 [H ~> m or kg m-2] or [Z ~> m].

  • h_neglect_edge [in]

    A negligibly small width for the purpose of edge value calculations in the same units as h0 [H ~> m or kg m-2] or [Z ~> m]

Callees call graph
Callees of regrid_interp::build_and_interpolate_grid calls cluster_regrid_interp regrid_interp regrid_interp::build_and_interpolate_grid build_and_interpolate_grid regrid_interp::interpolate_grid interpolate_grid [private/internal] regrid_interp::build_and_interpolate_grid->regrid_interp::interpolate_grid regrid_interp::regridding_set_ppolys regridding_set_ppolys regrid_interp::build_and_interpolate_grid->regrid_interp::regridding_set_ppolys
Text view
Callers call graph
Callers of regrid_interp::build_and_interpolate_grid calls cluster_coord_hycom coord_hycom cluster_coord_rho coord_rho cluster_regrid_interp regrid_interp coord_hycom::build_hycom1_column build_hycom1_column regrid_interp::build_and_interpolate_grid build_and_interpolate_grid coord_hycom::build_hycom1_column->regrid_interp::build_and_interpolate_grid coord_rho::build_rho_column build_rho_column coord_rho::build_rho_column->regrid_interp::build_and_interpolate_grid coord_rho::build_rho_column_iteratively build_rho_column_iteratively [private/internal] coord_rho::build_rho_column_iteratively->regrid_interp::build_and_interpolate_grid
Text view
function get_polynomial_coordinate(N, h, x_g, edge_values, ppoly_coefs, target_value, degree, answer_date) result(x_tgt)

Given a target value, find corresponding coordinate for given polynomial

Here, 'ppoly' is assumed to be a piecewise discontinuous polynomial of degree 'degree' throughout the domain defined by 'grid'. A target value is given and we need to determine the corresponding grid coordinate to define the new grid.

If the target value is out of range, the grid coordinate is simply set to be equal to one of the boundary coordinates, which results in vanished layers near the boundaries.

IT IS ASSUMED THAT THE PIECEWISE POLYNOMIAL IS MONOTONICALLY INCREASING. IF THIS IS NOT THE CASE, THE NEW GRID MAY BE ILL-DEFINED.

It is assumed that the number of cells defining 'grid' and 'ppoly' are the same.

Parameters
  • N [in]

    Number of grid cells

  • h [in]

    Grid cell thicknesses [H]

  • x_g [in]

    Grid interface locations [H]

  • edge_values [in]

    Edge values of interpolating polynomials [A]

  • ppoly_coefs [in]

    Coefficients of interpolating polynomials [A]

  • target_value [in]

    Target value to find position for [A]

  • degree [in]

    Degree of the interpolating polynomials

  • answer_date [in]

    The vintage of the expressions to use

  • x_tgt

    The position of x_g at which target_value is found [H]

Callees call graph
Callees of regrid_interp::get_polynomial_coordinate calls cluster_mom_error_handler MOM_error_handler cluster_regrid_interp regrid_interp mom_error_handler::mom_error MOM_error regrid_interp::get_polynomial_coordinate get_polynomial_coordinate [private/internal] regrid_interp::get_polynomial_coordinate->mom_error_handler::mom_error
Text view
Callers call graph
Callers of regrid_interp::get_polynomial_coordinate calls cluster_regrid_interp regrid_interp regrid_interp::get_polynomial_coordinate get_polynomial_coordinate [private/internal] regrid_interp::interpolate_grid interpolate_grid [private/internal] regrid_interp::interpolate_grid->regrid_interp::get_polynomial_coordinate
Text view
integer function interpolation_scheme(interp_scheme)

Numeric value of interpolation_scheme corresponding to scheme name

Parameters
  • interp_scheme [in]

    Name of the interpolation scheme Valid values include "P1M_H2", "P1M_H4", "P1M_IH2", "PLM", "PPM_CW", "PPM_H4", "PPM_IH4", "P3M_IH4IH3", "P3M_IH6IH5", "PQM_IH4IH3", and "PQM_IH6IH5"

Callees call graph
Callees of regrid_interp::interpolation_scheme calls cluster_mom_error_handler MOM_error_handler cluster_mom_string_functions MOM_string_functions cluster_regrid_interp regrid_interp mom_error_handler::mom_error MOM_error mom_string_functions::uppercase uppercase regrid_interp::interpolation_scheme interpolation_scheme [private/internal] regrid_interp::interpolation_scheme->mom_error_handler::mom_error regrid_interp::interpolation_scheme->mom_string_functions::uppercase
Text view
Callers call graph
Callers of regrid_interp::interpolation_scheme calls cluster_regrid_interp regrid_interp regrid_interp::interpolation_scheme interpolation_scheme [private/internal] regrid_interp::set_interp_scheme set_interp_scheme regrid_interp::set_interp_scheme->regrid_interp::interpolation_scheme
Text view
subroutine set_interp_scheme(CS, interp_scheme)

Store the interpolation_scheme value in the interp_CS based on the input string.

Parameters
  • CS [inout]

    A control structure for regrid_interp

  • interp_scheme [in]

    Name of the interpolation scheme Valid values include "P1M_H2", "P1M_H4", "P1M_IH2", "PLM", "PPM_CW", "PPM_H4", "PPM_IH4", "P3M_IH4IH3", "P3M_IH6IH5", "PQM_IH4IH3", and "PQM_IH6IH5"

Callees call graph
Callees of regrid_interp::set_interp_scheme calls cluster_regrid_interp regrid_interp regrid_interp::interpolation_scheme interpolation_scheme [private/internal] regrid_interp::set_interp_scheme set_interp_scheme regrid_interp::set_interp_scheme->regrid_interp::interpolation_scheme
Text view
Callers call graph
Callers of regrid_interp::set_interp_scheme calls cluster_mom_regridding MOM_regridding cluster_regrid_interp regrid_interp mom_regridding::set_regrid_params set_regrid_params regrid_interp::set_interp_scheme set_interp_scheme mom_regridding::set_regrid_params->regrid_interp::set_interp_scheme
Text view
subroutine set_interp_extrap(CS, extrap)

Store the boundary_extrapolation value in the interp_CS

Parameters
  • CS [inout]

    A control structure for regrid_interp

  • extrap [in]

    Indicate whether high-order boundary extrapolation should be used in boundary cells

Callers call graph
Callers of regrid_interp::set_interp_extrap calls cluster_mom_regridding MOM_regridding cluster_regrid_interp regrid_interp mom_regridding::set_regrid_params set_regrid_params regrid_interp::set_interp_extrap set_interp_extrap mom_regridding::set_regrid_params->regrid_interp::set_interp_extrap
Text view
subroutine set_interp_answer_date(CS, answer_date)

Store the value of the answer_date in the interp_CS

Parameters
  • CS [inout]

    A control structure for regrid_interp

  • answer_date [in]

    An integer encoding the vintage of the expressions to use for regridding

Callers call graph
Callers of regrid_interp::set_interp_answer_date calls cluster_mom_regridding MOM_regridding cluster_regrid_interp regrid_interp mom_regridding::set_regrid_params set_regrid_params regrid_interp::set_interp_answer_date set_interp_answer_date mom_regridding::set_regrid_params->regrid_interp::set_interp_answer_date
Text view
API generated with Flint · Rendered from reStructuredText