MODFLOW 6  version 6.7.0.dev3
USGS Modular Hydrologic Model
InterpolationSchemeInterface.f90
Go to the documentation of this file.
2  use kindmodule, only: dp, i4b
3 
4  implicit none
5  private
6 
8  public :: coefficientstype
9 
11  real(dp) :: c_n = 0.0_dp
12  real(dp) :: c_m = 0.0_dp
13  real(dp) :: rhs = 0.0_dp
14  end type coefficientstype
15 
16  type, abstract :: interpolationschemeinterface
17  contains
18  procedure(compute_if), deferred :: compute
19  procedure(set_field_if), deferred :: set_field
21 
22  abstract interface
23 
24  !> @brief Compute interpolation coefficients for a face value
25  !!
26  !! This method computes the coefficients needed to interpolate a scalar field
27  !! value at the face between two connected cells. The method returns coefficients
28  !! that define how the face value depends on the cell-centered values.
29  !<
30  function compute_if(this, n, m, iposnm) result(phi_face)
31  ! -- import
32  import dp, i4b
34  import coefficientstype
35  ! -- return
36  type(coefficientstype) :: phi_face
37  ! -- dummy
38  class(interpolationschemeinterface), target :: this
39  integer(I4B), intent(in) :: n
40  integer(I4B), intent(in) :: m
41  integer(I4B), intent(in) :: iposnm
42  end function
43 
44  !> @brief Set the scalar field for which interpolation will be computed
45  !!
46  !! This method establishes a pointer to the scalar field data that will be
47  !! used for subsequent interpolation computations. Implementations may also
48  !! update any dependent cached data to ensure consistent results.
49  !<
50  subroutine set_field_if(this, phi)
51  ! -- import
52  import dp
54  ! -- dummy
55  class(interpolationschemeinterface), target :: this
56  real(DP), intent(in), dimension(:), pointer :: phi
57  end subroutine
58 
59  end interface
60 
Compute interpolation coefficients for a face value.
Set the scalar field for which interpolation will be computed.
This module defines variable data types.
Definition: kind.f90:8