MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
solutiongroupmodule Module Reference

Data Types

type  solutiongrouptype
 

Functions/Subroutines

subroutine, public solutiongroup_create (sgp, id)
 Create a new solution group. More...
 
subroutine sgp_ca (this)
 Calculate the solution group. More...
 
subroutine sgp_da (this)
 Deallocate. More...
 
subroutine allocate_scalars (this)
 Allocate scalars. More...
 
subroutine add_solution (this, isoln, sp)
 Add solution. More...
 
class(solutiongrouptype) function, pointer, private castassolutiongroupclass (obj)
 
subroutine, public addsolutiongrouptolist (list, solutiongroup)
 
class(solutiongrouptype) function, pointer, public getsolutiongroupfromlist (list, idx)
 

Function/Subroutine Documentation

◆ add_solution()

subroutine solutiongroupmodule::add_solution ( class(solutiongrouptype this,
integer(i4b), intent(in)  isoln,
class(basesolutiontype), intent(in), pointer  sp 
)
private

Definition at line 136 of file SolutionGroup.f90.

137  ! -- modules
139  ! -- dummy
140  class(SolutionGroupType) :: this
141  integer(I4B), intent(in) :: isoln
142  class(BaseSolutionType), pointer, intent(in) :: sp
143  ! -- local
144  integer(I4B) :: ipos
145  !
146  call expandarray(this%idsolutions)
147  ipos = size(this%idsolutions)
148  this%idsolutions(ipos) = isoln
149  this%nsolutions = this%nsolutions + 1

◆ addsolutiongrouptolist()

subroutine, public solutiongroupmodule::addsolutiongrouptolist ( type(listtype), intent(inout)  list,
type(solutiongrouptype), intent(inout), pointer  solutiongroup 
)

Definition at line 168 of file SolutionGroup.f90.

169  implicit none
170  ! -- dummy
171  type(ListType), intent(inout) :: list
172  type(SolutionGroupType), pointer, intent(inout) :: solutiongroup
173  ! -- local
174  class(*), pointer :: obj
175  !
176  obj => solutiongroup
177  call list%Add(obj)

◆ allocate_scalars()

subroutine solutiongroupmodule::allocate_scalars ( class(solutiongrouptype this)
private

Definition at line 122 of file SolutionGroup.f90.

123  ! -- dummy
124  class(SolutionGroupType) :: this
125  !
126  allocate (this%id)
127  allocate (this%mxiter)
128  allocate (this%nsolutions)
129  this%id = 0
130  this%mxiter = 1
131  this%nsolutions = 0

◆ castassolutiongroupclass()

class(solutiongrouptype) function, pointer, private solutiongroupmodule::castassolutiongroupclass ( class(*), intent(inout), pointer  obj)
private

Definition at line 152 of file SolutionGroup.f90.

153  implicit none
154  ! -- dummy
155  class(*), pointer, intent(inout) :: obj
156  ! -- return
157  class(SolutionGroupType), pointer :: res
158  !
159  res => null()
160  if (.not. associated(obj)) return
161  !
162  select type (obj)
163  class is (solutiongrouptype)
164  res => obj
165  end select
Here is the caller graph for this function:

◆ getsolutiongroupfromlist()

class(solutiongrouptype) function, pointer, public solutiongroupmodule::getsolutiongroupfromlist ( type(listtype), intent(inout)  list,
integer(i4b), intent(in)  idx 
)

Definition at line 180 of file SolutionGroup.f90.

181  implicit none
182  ! -- dummy
183  type(ListType), intent(inout) :: list
184  integer(I4B), intent(in) :: idx
185  class(SolutionGroupType), pointer :: res
186  ! -- local
187  class(*), pointer :: obj
188  !
189  obj => list%GetItem(idx)
190  res => castassolutiongroupclass(obj)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgp_ca()

subroutine solutiongroupmodule::sgp_ca ( class(solutiongrouptype this)
private

Solve each solution group and each solution. Start with converge flag equal true and reset to zero if any non-convergence triggers are encountered.

Definition at line 48 of file SolutionGroup.f90.

49  ! -- modules
50  use constantsmodule, only: linelength
52  use tdismodule, only: kstp, kper
53  ! -- dummy
54  class(SolutionGroupType) :: this
55  ! -- local
56  class(BaseSolutionType), pointer :: sp
57  integer(I4B) :: kpicard, isgcnvg, isuppress_output
58  integer(I4B) :: is, isoln
59  ! -- formats
60  character(len=*), parameter :: fmtnocnvg = &
61  "(1X,'Solution Group ', i0, ' did not converge for stress period ', i0, &
62  &' and time step ', i0)"
63  !
64  ! -- Suppress output during picard iterations
65  if (this%mxiter > 1) then
66  isuppress_output = 1
67  else
68  isuppress_output = 0
69  end if
70  !
71  ! -- set failed flag
72  laststepfailed = 0
73  !
74  ! -- Picard loop
75  picardloop: do kpicard = 1, this%mxiter
76  if (this%mxiter > 1) then
77  write (iout, '(/a,i6/)') 'SOLUTION GROUP PICARD ITERATION: ', kpicard
78  end if
79  isgcnvg = 1
80  do is = 1, this%nsolutions
81  isoln = this%idsolutions(is)
82  sp => getbasesolutionfromlist(basesolutionlist, isoln)
83  call sp%sln_ca(isgcnvg, isuppress_output)
84  end do
85  if (isgcnvg == 1) exit picardloop
86  end do picardloop
87  !
88  ! -- if a picard loop was used and the solution group converged
89  ! then rerun the timestep and save the output. Or if there
90  ! is only one picard iteration, then do nothing as models
91  ! are assumed to be explicitly coupled.
92  if (isgcnvg == 1) then
93  if (this%mxiter > 1) then
94  isuppress_output = 0
95  do is = 1, this%nsolutions
96  isoln = this%idsolutions(is)
97  sp => getbasesolutionfromlist(basesolutionlist, isoln)
98  call sp%sln_ca(isgcnvg, isuppress_output)
99  end do
100  end if
101  else
102  isimcnvg = 0
103  laststepfailed = 1
104  write (iout, fmtnocnvg) this%id, kper, kstp
105  end if
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
This module contains simulation variables.
Definition: SimVariables.f90:9
integer(i4b) laststepfailed
flag indicating if the last step failed (1) if last step failed; (0) otherwise (set in converge_check...
integer(i4b) iout
file unit number for simulation output
integer(i4b) isimcnvg
simulation convergence flag (1) if all objects have converged, (0) otherwise
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
Here is the call graph for this function:

◆ sgp_da()

subroutine solutiongroupmodule::sgp_da ( class(solutiongrouptype this)

Definition at line 110 of file SolutionGroup.f90.

111  ! -- dummy
112  class(SolutionGroupType) :: this
113  !
114  deallocate (this%id)
115  deallocate (this%mxiter)
116  deallocate (this%nsolutions)
117  deallocate (this%idsolutions)

◆ solutiongroup_create()

subroutine, public solutiongroupmodule::solutiongroup_create ( type(solutiongrouptype), pointer  sgp,
integer(i4b), intent(in)  id 
)

Definition at line 32 of file SolutionGroup.f90.

33  ! -- dummy
34  type(SolutionGroupType), pointer :: sgp
35  integer(I4B), intent(in) :: id
36  !
37  allocate (sgp)
38  call sgp%allocate_scalars()
39  sgp%id = id
Here is the caller graph for this function: