MOM6
PCM_functions.F90
Go to the documentation of this file.
2 !==============================================================================
3 !
4 ! This file is part of MOM.
5 !
6 ! Date of creation: 2008.06.06
7 ! L. White
8 !
9 ! This module contains routines that handle one-dimensionnal finite volume
10 ! reconstruction using the piecewise constant method (PCM).
11 !
12 !==============================================================================
13 
14 implicit none ; private
15 
16 public pcm_reconstruction
17 
18 contains
19 
20 !------------------------------------------------------------------------------
21 ! pcm_reconstruction
22 !------------------------------------------------------------------------------
23 subroutine pcm_reconstruction( N, u, ppoly_E, ppoly_coefficients )
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 
57 end subroutine pcm_reconstruction
58 
59 end module pcm_functions
subroutine, public pcm_reconstruction(N, u, ppoly_E, ppoly_coefficients)