MOM6
PCM_functions.F90
1 !> Piecewise constant reconstruction functions
3 
4 ! This file is part of MOM6. See LICENSE.md for the license.
5 
6 implicit none ; private
7 
8 public pcm_reconstruction
9 
10 contains
11 
12 !> Reconstruction by constant polynomials within each cell. There is nothing to
13 !! do but this routine is provided to ensure a homogeneous interface
14 !! throughout the regridding toolbox.
15 !!
16 !! It is assumed that the dimension of 'u' is equal to the number of cells
17 !! defining 'grid' and 'ppoly'. No consistency check is performed.
18 subroutine pcm_reconstruction( N, u, ppoly_E, ppoly_coef )
19  integer, intent(in) :: n !< Number of cells
20  real, dimension(:), intent(in) :: u !< cell averages
21  real, dimension(:,:), intent(inout) :: ppoly_e !< Edge value of polynomial,
22  !! with the same units as u.
23  real, dimension(:,:), intent(inout) :: ppoly_coef !< Coefficients of polynomial,
24  !! with the same units as u.
25 
26  ! Local variables
27  integer :: k
28 
29  ! The coefficients of the piecewise constant polynomial are simply
30  ! the cell averages.
31  ppoly_coef(:,1) = u(:)
32 
33  ! The edge values are equal to the cell average
34  do k = 1,n
35  ppoly_e(k,:) = u(k)
36  enddo
37 
38 end subroutine pcm_reconstruction
39 
40 !> \namespace PCM_functions
41 !!
42 !! Date of creation: 2008.06.06
43 !! L. White
44 !!
45 !! This module contains routines that handle one-dimensionnal finite volume
46 !! reconstruction using the piecewise constant method (PCM).
47 
48 end module pcm_functions
pcm_functions
Piecewise constant reconstruction functions.
Definition: PCM_functions.F90:2