Skip to content

Commit

Permalink
Merge pull request #818 from adcroft/even-more-doxy
Browse files Browse the repository at this point in the history
Even more doxy
  • Loading branch information
Hallberg-NOAA authored Jul 11, 2018
2 parents 922be4f + 189d7d3 commit 6519f25
Show file tree
Hide file tree
Showing 37 changed files with 766 additions and 1,197 deletions.
134 changes: 81 additions & 53 deletions docs/Doxyfile_nortd

Large diffs are not rendered by default.

98 changes: 36 additions & 62 deletions src/ALE/P1M_functions.F90
Original file line number Diff line number Diff line change
@@ -1,61 +1,30 @@
!> Linear interpolation functions
module P1M_functions

! This file is part of MOM6. See LICENSE.md for the license.

!==============================================================================
!
! Date of creation: 2008.06.09
! L. White
!
! This module contains p1m (linear) interpolation routines.
!
! p1m interpolation is performed by estimating the edge values and
! linearly interpolating between them.

! Once the edge values are estimated, the limiting process takes care of
! ensuring that (1) edge values are bounded by neighoring cell averages
! and (2) discontinuous edge values are averaged in order to provide a
! fully continuous interpolant throughout the domain. This last step is
! essential for the regridding problem to yield a unique solution.
! Also, a routine is provided that takes care of linear extrapolation
! within the boundary cells.
!
! The module contains the following routines:
!
! P1M_interpolation (public)
! P1M_boundary_extrapolation (public)
!
!==============================================================================
use regrid_edge_values, only : bound_edge_values, average_discontinuous_edge_values

implicit none ; private

! -----------------------------------------------------------------------------
! The following routines are visible to the outside world
! -----------------------------------------------------------------------------
public P1M_interpolation, P1M_boundary_extrapolation

contains


!------------------------------------------------------------------------------
!> Linearly interpolate between edge values
!!
!! The resulting piecewise interpolant is stored in 'ppoly'.
!! See 'ppoly.F90' for a definition of this structure.
!!
!! The edge values MUST have been estimated prior to calling this routine.
!!
!! The estimated edge values must be limited to ensure monotonicity of the
!! interpolant. We also make sure that edge values are NOT discontinuous.
!!
!! It is assumed that the size of the array 'u' is equal to the number of cells
!! defining 'grid' and 'ppoly'. No consistency check is performed here.
subroutine P1M_interpolation( N, h, u, ppoly_E, ppoly_coef, h_neglect )
! ------------------------------------------------------------------------------
! Linearly interpolate between edge values.
! The resulting piecewise interpolant is stored in 'ppoly'.
! See 'ppoly.F90' for a definition of this structure.
!
! The edge values MUST have been estimated prior to calling this routine.
!
! The estimated edge values must be limited to ensure monotonicity of the
! interpolant. We also make sure that edge values are NOT discontinuous.
!
! It is assumed that the size of the array 'u' is equal to the number of cells
! defining 'grid' and 'ppoly'. No consistency check is performed here.
! ------------------------------------------------------------------------------

! Arguments
integer, intent(in) :: N !< Number of cells
real, dimension(:), intent(in) :: h !< cell widths (size N)
real, dimension(:), intent(in) :: u !< cell average properties (size N)
Expand All @@ -66,7 +35,6 @@ subroutine P1M_interpolation( N, h, u, ppoly_E, ppoly_coef, h_neglect )
!! with the same units as u.
real, optional, intent(in) :: h_neglect !< A negligibly small width
!! in the same units as h.

! Local variables
integer :: k ! loop index
real :: u0_l, u0_r ! edge values (left and right)
Expand All @@ -91,25 +59,14 @@ subroutine P1M_interpolation( N, h, u, ppoly_E, ppoly_coef, h_neglect )

end subroutine P1M_interpolation


!------------------------------------------------------------------------------
!> Interpolation by linear polynomials within boundary cells
!!
!! The left and right edge values in the left and right boundary cells,
!! respectively, are estimated using a linear extrapolation within the cells.
!!
!! It is assumed that the size of the array 'u' is equal to the number of cells
!! defining 'grid' and 'ppoly'. No consistency check is performed here.
subroutine P1M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coef )
!------------------------------------------------------------------------------
! Interpolation by linear polynomials within boundary cells.
! The left and right edge values in the left and right boundary cells,
! respectively, are estimated using a linear extrapolation within the cells.
!
! N: number of cells in grid
! h: thicknesses of grid cells
! u: cell averages to use in constructing piecewise polynomials
! ppoly_E : edge values of piecewise polynomials
! ppoly_coef : coefficients of piecewise polynomials
!
! It is assumed that the size of the array 'u' is equal to the number of cells
! defining 'grid' and 'ppoly'. No consistency check is performed here.
!------------------------------------------------------------------------------

! Arguments
integer, intent(in) :: N !< Number of cells
real, dimension(:), intent(in) :: h !< cell widths (size N)
Expand All @@ -118,7 +75,6 @@ subroutine P1M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coef )
!! with the same units as u.
real, dimension(:,:), intent(inout) :: ppoly_coef !< coefficients of piecewise polynomials, mainly
!! with the same units as u.

! Local variables
real :: u0, u1 ! cell averages
real :: h0, h1 ! corresponding cell widths
Expand Down Expand Up @@ -188,4 +144,22 @@ subroutine P1M_boundary_extrapolation( N, h, u, ppoly_E, ppoly_coef )

end subroutine P1M_boundary_extrapolation

!> \namespace p1m_functions
!!
!! Date of creation: 2008.06.09
!! L. White
!!
!! This module contains p1m (linear) interpolation routines.
!!
!! p1m interpolation is performed by estimating the edge values and
!! linearly interpolating between them.
!
!! Once the edge values are estimated, the limiting process takes care of
!! ensuring that (1) edge values are bounded by neighoring cell averages
!! and (2) discontinuous edge values are averaged in order to provide a
!! fully continuous interpolant throughout the domain. This last step is
!! essential for the regridding problem to yield a unique solution.
!! Also, a routine is provided that takes care of linear extrapolation
!! within the boundary cells.

end module P1M_functions
Loading

0 comments on commit 6519f25

Please sign in to comment.