MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
solutiongroupmodule Module Reference

Data Types

type  solutiongrouptype
 

Functions/Subroutines

subroutine, public solutiongroup_create (sgp, id)
 
subroutine sgp_ca (this)
 
subroutine sgp_da (this)
 
subroutine allocate_scalars (this)
 
subroutine add_solution (this, isoln, sp)
 
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 160 of file SolutionGroup.f90.

161 ! ******************************************************************************
162 ! add_solution
163 ! ******************************************************************************
164 !
165 ! SPECIFICATIONS:
166 ! ------------------------------------------------------------------------------
167  ! -- modules
169  ! -- dummy
170  class(SolutionGroupType) :: this
171  integer(I4B), intent(in) :: isoln
172  class(BaseSolutionType), pointer, intent(in) :: sp
173  ! -- local
174  integer(I4B) :: ipos
175 ! ------------------------------------------------------------------------------
176  !
177  call expandarray(this%idsolutions)
178  ipos = size(this%idsolutions)
179  this%idsolutions(ipos) = isoln
180  this%nsolutions = this%nsolutions + 1
181  !
182  ! -- return
183  return

◆ addsolutiongrouptolist()

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

Definition at line 201 of file SolutionGroup.f90.

202  implicit none
203  ! -- dummy
204  type(ListType), intent(inout) :: list
205  type(SolutionGroupType), pointer, intent(inout) :: solutiongroup
206  ! -- local
207  class(*), pointer :: obj
208  !
209  obj => solutiongroup
210  call list%Add(obj)
211  !
212  return

◆ allocate_scalars()

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

Definition at line 139 of file SolutionGroup.f90.

140 ! ******************************************************************************
141 ! allocate_scalars
142 ! ******************************************************************************
143 !
144 ! SPECIFICATIONS:
145 ! ------------------------------------------------------------------------------
146  class(SolutionGroupType) :: this
147 ! ------------------------------------------------------------------------------
148  !
149  allocate (this%id)
150  allocate (this%mxiter)
151  allocate (this%nsolutions)
152  this%id = 0
153  this%mxiter = 1
154  this%nsolutions = 0
155  !
156  ! -- return
157  return

◆ castassolutiongroupclass()

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

Definition at line 186 of file SolutionGroup.f90.

187  implicit none
188  class(*), pointer, intent(inout) :: obj
189  class(SolutionGroupType), pointer :: res
190  !
191  res => null()
192  if (.not. associated(obj)) return
193  !
194  select type (obj)
195  class is (solutiongrouptype)
196  res => obj
197  end select
198  return
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 215 of file SolutionGroup.f90.

216  implicit none
217  ! -- dummy
218  type(ListType), intent(inout) :: list
219  integer(I4B), intent(in) :: idx
220  class(SolutionGroupType), pointer :: res
221  ! -- local
222  class(*), pointer :: obj
223  !
224  obj => list%GetItem(idx)
225  res => castassolutiongroupclass(obj)
226  !
227  return
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

Definition at line 47 of file SolutionGroup.f90.

48 ! ******************************************************************************
49 ! sgp_ca -- Calculate the solution group
50 ! Solve each solution group and each solution. Start with converge
51 ! flag equal true and reset to zero if any non-convergence triggers
52 ! are encountered.
53 ! ******************************************************************************
54 !
55 ! SPECIFICATIONS:
56 ! ------------------------------------------------------------------------------
57  ! -- modules
58  use constantsmodule, only: linelength
60  use tdismodule, only: kstp, kper
61  ! -- dummy
62  class(SolutionGroupType) :: this
63  ! -- local
64  class(BaseSolutionType), pointer :: sp
65  integer(I4B) :: kpicard, isgcnvg, isuppress_output
66  integer(I4B) :: is, isoln
67  ! -- formats
68  character(len=*), parameter :: fmtnocnvg = &
69  "(1X,'Solution Group ', i0, ' did not converge for stress period ', i0, &
70  &' and time step ', i0)"
71 ! ------------------------------------------------------------------------------
72  !
73  ! -- Suppress output during picard iterations
74  if (this%mxiter > 1) then
75  isuppress_output = 1
76  else
77  isuppress_output = 0
78  end if
79  !
80  ! -- set failed flag
81  laststepfailed = 0
82  !
83  ! -- Picard loop
84  picardloop: do kpicard = 1, this%mxiter
85  if (this%mxiter > 1) then
86  write (iout, '(/a,i6/)') 'SOLUTION GROUP PICARD ITERATION: ', kpicard
87  end if
88  isgcnvg = 1
89  do is = 1, this%nsolutions
90  isoln = this%idsolutions(is)
91  sp => getbasesolutionfromlist(basesolutionlist, isoln)
92  call sp%sln_ca(isgcnvg, isuppress_output)
93  end do
94  if (isgcnvg == 1) exit picardloop
95  end do picardloop
96  !
97  ! -- if a picard loop was used and the solution group converged
98  ! then rerun the timestep and save the output. Or if there
99  ! is only one picard iteration, then do nothing as models
100  ! are assumed to be explicitly coupled.
101  if (isgcnvg == 1) then
102  if (this%mxiter > 1) then
103  isuppress_output = 0
104  do is = 1, this%nsolutions
105  isoln = this%idsolutions(is)
106  sp => getbasesolutionfromlist(basesolutionlist, isoln)
107  call sp%sln_ca(isgcnvg, isuppress_output)
108  end do
109  end if
110  else
111  isimcnvg = 0
112  laststepfailed = 1
113  write (iout, fmtnocnvg) this%id, kper, kstp
114  end if
115  !
116  ! -- return
117  return
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:44
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 120 of file SolutionGroup.f90.

121 ! ******************************************************************************
122 ! deallocate
123 ! ******************************************************************************
124 !
125 ! SPECIFICATIONS:
126 ! ------------------------------------------------------------------------------
127  class(SolutionGroupType) :: this
128 ! ------------------------------------------------------------------------------
129  !
130  deallocate (this%id)
131  deallocate (this%mxiter)
132  deallocate (this%nsolutions)
133  deallocate (this%idsolutions)
134  !
135  ! -- return
136  return

◆ solutiongroup_create()

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

Definition at line 28 of file SolutionGroup.f90.

29 ! ******************************************************************************
30 ! solutiongroup_create -- Create a new solution group
31 ! ******************************************************************************
32 !
33 ! SPECIFICATIONS:
34 ! ------------------------------------------------------------------------------
35  type(SolutionGroupType), pointer :: sgp
36  integer(I4B), intent(in) :: id
37 ! ------------------------------------------------------------------------------
38  !
39  allocate (sgp)
40  call sgp%allocate_scalars()
41  sgp%id = id
42  !
43  ! -- return
44  return
Here is the caller graph for this function: