PCM_functions.F90

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