regrid_interp module reference
Vertical interpolation for regridding
Data Types
Control structure for regrid_interp module |
Functions/Subroutines
Builds an interpolated profile for the densities within each grid cell. |
|
Given target values (e.g., density), build new grid based on polynomial |
|
Build a grid by interpolating for target values |
|
Given a target value, find corresponding coordinate for given polynomial |
|
Numeric value of interpolation_scheme corresponding to scheme name |
|
Store the interpolation_scheme value in the interp_CS based on the input string. |
|
Store the boundary_extrapolation value in the interp_CS |
|
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
Text view
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
- 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
Callers call graph
- 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
- 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
Callers call graph
- 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
- 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"
- 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
- 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