MOM6
pcm_functions Module Reference

Functions/Subroutines

subroutine, public pcm_reconstruction (N, u, ppoly_E, ppoly_coefficients)
 

Function/Subroutine Documentation

◆ pcm_reconstruction()

subroutine, public pcm_functions::pcm_reconstruction ( integer, intent(in)  N,
real, dimension(:), intent(in)  u,
real, dimension(:,:), intent(inout)  ppoly_E,
real, dimension(:,:), intent(inout)  ppoly_coefficients 
)

Definition at line 24 of file PCM_functions.F90.

Referenced by mom_remapping::build_reconstructions_1d(), and mom_remapping::remapping_unit_tests().

24 !------------------------------------------------------------------------------
25 ! Reconstruction by constant polynomials within each cell. There is nothing to
26 ! do but this routine is provided to ensure a homogeneous interface
27 ! throughout the regridding toolbox.
28 !
29 ! N: number of cells in grid
30 ! h: thicknesses of grid cells
31 ! u: cell averages to use in constructing piecewise polynomials
32 ! ppoly_E : edge values of piecewise polynomials
33 ! ppoly_coefficients : coefficients of piecewise polynomials
34 !
35 ! It is assumed that the dimension of 'u' is equal to the number of cells
36 ! defining 'grid' and 'ppoly'. No consistency check is performed.
37 !------------------------------------------------------------------------------
38 
39  ! Arguments
40  integer, intent(in) :: n ! Number of cells
41  real, dimension(:), intent(in) :: u ! cell averages
42  real, dimension(:,:), intent(inout) :: ppoly_e !Edge value of polynomial
43  real, dimension(:,:), intent(inout) :: ppoly_coefficients !Coefficients of polynomial
44 
45  ! Local variables
46  integer :: k
47 
48  ! The coefficients of the piecewise constant polynomial are simply
49  ! the cell averages.
50  ppoly_coefficients(:,1) = u(:)
51 
52  ! The edge values are equal to the cell average
53  do k = 1,n
54  ppoly_e(k,:) = u(k)
55  end do
56 
Here is the caller graph for this function: