MODFLOW 6  version 6.7.0.dev2
USGS Modular Hydrologic Model
IGradient.f90
Go to the documentation of this file.
1 module igradient
2  use kindmodule, only: dp, i4b
3 
4  implicit none
5  private
6 
7  public :: igradienttype
8 
9  !> @brief Abstract interface for cell-based gradient computation.
10  !!
11  !! This module defines the abstract type `IGradientType`, which provides a deferred
12  !! interface for computing the gradient of a scalar field at a given cell.
13  !! Any concrete gradient implementation must extend this type and implement the `get` method.
14  !<
15  type, abstract :: igradienttype
16  contains
17  procedure(get_if), deferred :: get
18  end type igradienttype
19 
20  abstract interface
21 
22  function get_if(this, n, c) result(grad_c)
23  ! -- import
24  import igradienttype
25  import dp, i4b
26  ! -- dummy
27  class(igradienttype), target :: this
28  integer(I4B), intent(in) :: n
29  real(dp), dimension(:), intent(in) :: c
30  !-- return
31  real(dp), dimension(3) :: grad_c
32  end function
33 
34  end interface
35 
36 contains
37 
38 end module igradient
This module defines variable data types.
Definition: kind.f90:8
Abstract interface for cell-based gradient computation.
Definition: IGradient.f90:15