MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
ImsLinearSolver.f90
Go to the documentation of this file.
2  use kindmodule, only: i4b, dp
10 
11  implicit none
12  private
13 
14  public :: create_ims_solver
15 
16  type, public, extends(linearsolverbasetype) :: imslinearsolvertype
17  contains
18  procedure :: initialize => ims_initialize
19  procedure :: print_summary => ims_print_summary
20  procedure :: solve => ims_solve
21  procedure :: destroy => ims_destroy
22 
23  procedure :: create_matrix => ims_create_matrix
24  end type
25 
26 contains
27 
28  function create_ims_solver(sln_name) result(solver)
29  class(linearsolverbasetype), pointer :: solver
30  character(len=LENSOLUTIONNAME) :: sln_name
31  ! local
32  class(imslinearsolvertype), pointer :: ims_solver
33 
34  allocate (ims_solver)
35  solver => ims_solver
36  solver%name = sln_name
37 
38  end function create_ims_solver
39 
40  subroutine ims_initialize(this, matrix, linear_settings, convergence_summary)
41  class(imslinearsolvertype) :: this
42  class(matrixbasetype), pointer :: matrix
43  type(imslinearsettingstype), pointer :: linear_settings
44  type(convergencesummarytype), pointer :: convergence_summary
45  end subroutine ims_initialize
46 
47  subroutine ims_print_summary(this)
48  class(imslinearsolvertype) :: this
49  end subroutine ims_print_summary
50 
51  subroutine ims_solve(this, kiter, rhs, x, cnvg_summary)
52  class(imslinearsolvertype) :: this
53  integer(I4B) :: kiter
54  class(vectorbasetype), pointer :: rhs
55  class(vectorbasetype), pointer :: x
56  type(convergencesummarytype) :: cnvg_summary
57  end subroutine ims_solve
58 
59  subroutine ims_destroy(this)
60  class(imslinearsolvertype) :: this
61  end subroutine ims_destroy
62 
63  function ims_create_matrix(this) result(matrix)
64  class(imslinearsolvertype) :: this
65  class(matrixbasetype), pointer :: matrix
66  ! local
67  class(sparsematrixtype), pointer :: ims_matrix
68 
69  allocate (ims_matrix)
70  matrix => ims_matrix
71 
72  end function ims_create_matrix
73 
74 end module imslinearsolvermodule
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lensolutionname
maximum length of the solution name
Definition: Constants.f90:21
subroutine destroy(this)
Cleanup.
subroutine ims_destroy(this)
subroutine ims_solve(this, kiter, rhs, x, cnvg_summary)
class(matrixbasetype) function, pointer ims_create_matrix(this)
subroutine ims_print_summary(this)
class(linearsolverbasetype) function, pointer, public create_ims_solver(sln_name)
subroutine ims_initialize(this, matrix, linear_settings, convergence_summary)
This module defines variable data types.
Definition: kind.f90:8
This structure stores the generic convergence info for a solution.