MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
convergencesummarymodule Module Reference

Data Types

type  convergencesummarytype
 This structure stores the generic convergence info for a solution. More...
 

Functions/Subroutines

subroutine init (this, nr_models, model_bounds, mem_path)
 Initialize the convergence summary for a solution. More...
 
subroutine reinit (this, niter_max)
 
subroutine set_defaults (this)
 
subroutine destroy (this)
 Cleanup. More...
 

Function/Subroutine Documentation

◆ destroy()

subroutine convergencesummarymodule::destroy ( class(convergencesummarytype this)
private

Definition at line 117 of file ConvergenceSummary.f90.

118  class(ConvergenceSummaryType) :: this
119 
120  ! scalars
121  call mem_deallocate(this%convnmod)
122  call mem_deallocate(this%nitermax)
123 
124  call mem_deallocate(this%locr)
125  call mem_deallocate(this%rmax)
126  call mem_deallocate(this%locdv)
127  call mem_deallocate(this%dvmax)
128 
129  ! arrays
130  call mem_deallocate(this%itinner)
131  call mem_deallocate(this%convdvmax)
132  call mem_deallocate(this%convlocdv)
133  call mem_deallocate(this%convrmax)
134  call mem_deallocate(this%convlocr)
135 

◆ init()

subroutine convergencesummarymodule::init ( class(convergencesummarytype this,
integer(i4b)  nr_models,
integer(i4b), dimension(:), pointer  model_bounds,
character(len=*)  mem_path 
)
private
Parameters
nr_modelsthe number of models in the solution
model_boundsthe start and stop index of the models
mem_paththe memory path of the owning solution

Definition at line 39 of file ConvergenceSummary.f90.

40  class(ConvergenceSummaryType) :: this
41  integer(I4B) :: nr_models !< the number of models in the solution
42  integer(I4B), dimension(:), pointer :: model_bounds !< the start and stop index of the models
43  character(len=*) :: mem_path !< the memory path of the owning solution
44 
45  this%memory_path = 'TMP'//mem_path
46  this%iter_cnt = 0
47  this%model_bounds => model_bounds
48 
49  call mem_allocate(this%convnmod, 'CONVNMOD', this%memory_path)
50  call mem_allocate(this%nitermax, 'NITERMAX', this%memory_path)
51  this%convnmod = nr_models
52  this%nitermax = 0
53 
54  call mem_allocate(this%itinner, 0, 'ITINNER', this%memory_path)
55  call mem_allocate(this%locdv, this%convnmod, 'LOCDV', this%memory_path)
56  call mem_allocate(this%dvmax, this%convnmod, 'DVMAX', this%memory_path)
57  call mem_allocate(this%locr, this%convnmod, 'LOCDR', this%memory_path)
58  call mem_allocate(this%rmax, this%convnmod, 'DRMAX', this%memory_path)
59  call mem_allocate(this%convdvmax, this%convnmod, 0, 'CONVDVMAX', &
60  this%memory_path)
61  call mem_allocate(this%convlocdv, this%convnmod, 0, 'CONVLOCDV', &
62  this%memory_path)
63  call mem_allocate(this%convrmax, this%convnmod, 0, 'CONVDRMAX', &
64  this%memory_path)
65  call mem_allocate(this%convlocr, this%convnmod, 0, 'CONVLOCDR', &
66  this%memory_path)
67 
68  call this%set_defaults()
69 

◆ reinit()

subroutine convergencesummarymodule::reinit ( class(convergencesummarytype this,
integer(i4b)  niter_max 
)
private
Parameters
niter_maxmax. nr. of iterations in a timestep

Definition at line 72 of file ConvergenceSummary.f90.

73  class(ConvergenceSummaryType) :: this
74  integer(I4B) :: niter_max !< max. nr. of iterations in a timestep
75 
76  this%nitermax = niter_max
77  call mem_reallocate(this%itinner, niter_max, 'ITINNER', this%memory_path)
78  call mem_reallocate(this%convdvmax, this%convnmod, niter_max, 'CONVDVMAX', &
79  this%memory_path)
80  call mem_reallocate(this%convlocdv, this%convnmod, niter_max, 'CONVLOCDV', &
81  this%memory_path)
82  call mem_reallocate(this%convrmax, this%convnmod, niter_max, 'CONVDRMAX', &
83  this%memory_path)
84  call mem_reallocate(this%convlocr, this%convnmod, niter_max, 'CONVLOCDR', &
85  this%memory_path)
86 
87  call this%set_defaults()
88 

◆ set_defaults()

subroutine convergencesummarymodule::set_defaults ( class(convergencesummarytype this)
private

Definition at line 91 of file ConvergenceSummary.f90.

92  class(ConvergenceSummaryType) :: this
93  ! local
94  integer(I4B) :: i, j
95 
96  do i = 1, this%convnmod
97  this%locr(i) = 0
98  this%dvmax(i) = dzero
99  this%locdv(i) = 0
100  this%rmax(i) = dzero
101  end do
102 
103  do i = 1, this%nitermax
104  this%itinner(i) = 0
105  do j = 1, this%convnmod
106  this%convdvmax(j, i) = dzero
107  this%convlocdv(j, i) = 0
108  this%convrmax(j, i) = dzero
109  this%convlocr(j, i) = 0
110  end do
111  end do
112