MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
numericalmodelmodule Module Reference

Data Types

type  numericalmodeltype

Functions/Subroutines

subroutine model_df (this)
subroutine model_ac (this, sparse)
subroutine model_mc (this, matrix_sln)
subroutine model_ar (this)
subroutine model_rp (this)
subroutine model_ad (this)
subroutine model_reset (this)
subroutine model_solve (this)
subroutine model_cf (this, kiter)
subroutine model_fc (this, kiter, matrix_sln, inwtflag)
subroutine model_ptcchk (this, iptc)
subroutine model_ptc (this, vec_residual, iptc, ptcf)
subroutine model_nr (this, kiter, matrix, inwtflag)
subroutine model_cc (this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
subroutine model_nur (this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
subroutine model_cq (this, icnvg, isuppress_output)
subroutine model_bd (this, icnvg, isuppress_output)
subroutine model_bdcalc (this, icnvg)
subroutine model_bdsave (this, icnvg)
subroutine model_ot (this)
subroutine model_bdentry (this, budterm, budtxt, rowlabel)
subroutine model_fp (this)
subroutine model_da (this)
subroutine set_moffset (this, moffset)
subroutine get_mrange (this, mstart, mend)
subroutine set_idsoln (this, id)
subroutine allocate_scalars (this, modelname)
subroutine allocate_arrays (this)
subroutine set_xptr (this, xsln, sln_offset, varnametgt, mempathtgt)
subroutine set_rhsptr (this, rhssln, sln_offset, varnametgt, mempathtgt)
subroutine set_iboundptr (this, iboundsln, sln_offset, varnametgt, mempathtgt)
subroutine get_mcellid (this, node, mcellid)
subroutine get_mnodeu (this, node, nodeu)
integer(i4b) function get_iasym (this)
integer(i4b) function get_idv_scale (this)
class(numericalmodeltype) function, pointer castasnumericalmodelclass (obj)
subroutine, public addnumericalmodeltolist (list, model)
class(numericalmodeltype) function, pointer, public getnumericalmodelfromlist (list, idx)

Function/Subroutine Documentation

◆ addnumericalmodeltolist()

subroutine, public numericalmodelmodule::addnumericalmodeltolist ( type(listtype), intent(inout) list,
class(numericalmodeltype), intent(inout), pointer model )

Definition at line 420 of file NumericalModel.f90.

421 implicit none
422 ! dummy
423 type(ListType), intent(inout) :: list
424 class(NumericalModelType), pointer, intent(inout) :: model
425 ! local
426 class(*), pointer :: obj
427
428 obj => model
429 call list%Add(obj)
Here is the caller graph for this function:

◆ allocate_arrays()

subroutine numericalmodelmodule::allocate_arrays ( class(numericalmodeltype) this)
private

Definition at line 281 of file NumericalModel.f90.

282 use constantsmodule, only: dzero
284 class(NumericalModelType) :: this
285 integer(I4B) :: i
286
287 call mem_allocate(this%xold, this%neq, 'XOLD', this%memoryPath)
288 call mem_allocate(this%flowja, this%nja, 'FLOWJA', this%memoryPath)
289 call mem_allocate(this%idxglo, this%nja, 'IDXGLO', this%memoryPath)
290
291 do i = 1, size(this%flowja)
292 this%flowja(i) = dzero
293 end do
This module contains simulation constants.
Definition Constants.f90:9
real(dp), parameter dzero
real constant zero
Definition Constants.f90:65

◆ allocate_scalars()

subroutine numericalmodelmodule::allocate_scalars ( class(numericalmodeltype) this,
character(len=*), intent(in) modelname )
private

Definition at line 258 of file NumericalModel.f90.

260 class(NumericalModelType) :: this
261 character(len=*), intent(in) :: modelname
262
263 ! allocate base members
264 call this%BaseModelType%allocate_scalars(modelname)
265
266 ! allocate members from this type
267 call mem_allocate(this%neq, 'NEQ', this%memoryPath)
268 call mem_allocate(this%nja, 'NJA', this%memoryPath)
269 call mem_allocate(this%icnvg, 'ICNVG', this%memoryPath)
270 call mem_allocate(this%moffset, 'MOFFSET', this%memoryPath)
271 allocate (this%filename)
272 allocate (this%bndlist)
273
274 this%filename = ''
275 this%neq = 0
276 this%nja = 0
277 this%icnvg = 0
278 this%moffset = 0

◆ castasnumericalmodelclass()

class(numericalmodeltype) function, pointer numericalmodelmodule::castasnumericalmodelclass ( class(*), intent(inout), pointer obj)
private

Definition at line 406 of file NumericalModel.f90.

407 implicit none
408 class(*), pointer, intent(inout) :: obj
409 class(NumericalModelType), pointer :: res
410
411 res => null()
412 if (.not. associated(obj)) return
413
414 select type (obj)
415 class is (numericalmodeltype)
416 res => obj
417 end select
Here is the caller graph for this function:

◆ get_iasym()

integer(i4b) function numericalmodelmodule::get_iasym ( class(numericalmodeltype) this)
private

Definition at line 394 of file NumericalModel.f90.

395 class(NumericalModelType) :: this
396 integer(I4B) :: iasym
397 iasym = 0

◆ get_idv_scale()

integer(i4b) function numericalmodelmodule::get_idv_scale ( class(numericalmodeltype) this)
private

Definition at line 400 of file NumericalModel.f90.

401 class(NumericalModelType) :: this
402 integer(I4B) :: idv_scale
403 idv_scale = 0

◆ get_mcellid()

subroutine numericalmodelmodule::get_mcellid ( class(numericalmodeltype) this,
integer(i4b), intent(in) node,
character(len=*), intent(inout) mcellid )
private

Definition at line 345 of file NumericalModel.f90.

347 ! dummy
348 class(NumericalModelType) :: this
349 integer(I4B), intent(in) :: node
350 character(len=*), intent(inout) :: mcellid
351 ! local
352 character(len=20) :: cellid
353 integer(I4B) :: ip, ipaknode, istart, istop
354 class(BndType), pointer :: packobj
355
356 if (node < 1) then
357 cellid = ''
358 else if (node <= this%dis%nodes) then
359 call this%dis%noder_to_string(node, cellid)
360 else
361 cellid = '***ERROR***'
362 ipaknode = node - this%dis%nodes
363 istart = 1
364 do ip = 1, this%bndlist%Count()
365 packobj => getbndfromlist(this%bndlist, ip)
366 if (packobj%npakeq == 0) cycle
367 istop = istart + packobj%npakeq - 1
368 if (istart <= ipaknode .and. ipaknode <= istop) then
369 write (cellid, '(a, a, a, i0, a, i0, a)') '(', &
370 trim(packobj%filtyp), '_', &
371 packobj%ibcnum, '-', ipaknode - packobj%ioffset, ')'
372 exit
373 end if
374 istart = istop + 1
375 end do
376 end if
377 write (mcellid, '(i0, a, a, a, a)') this%id, '_', this%macronym, '-', &
378 trim(adjustl(cellid))
This module contains the base boundary package.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
Here is the call graph for this function:

◆ get_mnodeu()

subroutine numericalmodelmodule::get_mnodeu ( class(numericalmodeltype) this,
integer(i4b), intent(in) node,
integer(i4b), intent(inout) nodeu )
private

Definition at line 381 of file NumericalModel.f90.

383 class(NumericalModelType) :: this
384 integer(I4B), intent(in) :: node
385 integer(I4B), intent(inout) :: nodeu
386
387 if (node <= this%dis%nodes) then
388 nodeu = this%dis%get_nodeuser(node)
389 else
390 nodeu = -(node - this%dis%nodes)
391 end if
Here is the call graph for this function:

◆ get_mrange()

subroutine numericalmodelmodule::get_mrange ( class(numericalmodeltype) this,
integer(i4b), intent(inout) mstart,
integer(i4b), intent(inout) mend )
private

Definition at line 244 of file NumericalModel.f90.

245 class(NumericalModelType) :: this
246 integer(I4B), intent(inout) :: mstart
247 integer(I4B), intent(inout) :: mend
248 mstart = this%moffset + 1
249 mend = mstart + this%neq - 1

◆ getnumericalmodelfromlist()

class(numericalmodeltype) function, pointer, public numericalmodelmodule::getnumericalmodelfromlist ( type(listtype), intent(inout) list,
integer(i4b), intent(in) idx )

Definition at line 432 of file NumericalModel.f90.

433 implicit none
434 ! dummy
435 type(ListType), intent(inout) :: list
436 integer(I4B), intent(in) :: idx
437 class(NumericalModelType), pointer :: res
438 ! local
439 class(*), pointer :: obj
440
441 obj => list%GetItem(idx)
442 res => castasnumericalmodelclass(obj)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ model_ac()

subroutine numericalmodelmodule::model_ac ( class(numericalmodeltype) this,
type(sparsematrix), intent(inout) sparse )
private

Definition at line 76 of file NumericalModel.f90.

77 class(NumericalModelType) :: this
78 type(sparsematrix), intent(inout) :: sparse

◆ model_ad()

subroutine numericalmodelmodule::model_ad ( class(numericalmodeltype) this)
private

Definition at line 94 of file NumericalModel.f90.

95 class(NumericalModelType) :: this

◆ model_ar()

subroutine numericalmodelmodule::model_ar ( class(numericalmodeltype) this)
private

Definition at line 86 of file NumericalModel.f90.

87 class(NumericalModelType) :: this

◆ model_bd()

subroutine numericalmodelmodule::model_bd ( class(numericalmodeltype) this,
integer(i4b), intent(in) icnvg,
integer(i4b), intent(in) isuppress_output )
private

Definition at line 176 of file NumericalModel.f90.

177 class(NumericalModelType) :: this
178 integer(I4B), intent(in) :: icnvg
179 integer(I4B), intent(in) :: isuppress_output

◆ model_bdcalc()

subroutine numericalmodelmodule::model_bdcalc ( class(numericalmodeltype) this,
integer(i4b), intent(in) icnvg )
private

Definition at line 182 of file NumericalModel.f90.

183 class(NumericalModelType) :: this
184 integer(I4B), intent(in) :: icnvg

◆ model_bdentry()

subroutine numericalmodelmodule::model_bdentry ( class(numericalmodeltype) this,
real(dp), dimension(:, :), intent(in) budterm,
character(len=lenbudtxt), dimension(:), intent(in) budtxt,
character(len=*), intent(in) rowlabel )
private

Definition at line 196 of file NumericalModel.f90.

197 class(NumericalModelType) :: this
198 real(DP), dimension(:, :), intent(in) :: budterm
199 character(len=LENBUDTXT), dimension(:), intent(in) :: budtxt
200 character(len=*), intent(in) :: rowlabel

◆ model_bdsave()

subroutine numericalmodelmodule::model_bdsave ( class(numericalmodeltype) this,
integer(i4b), intent(in) icnvg )
private

Definition at line 187 of file NumericalModel.f90.

188 class(NumericalModelType) :: this
189 integer(I4B), intent(in) :: icnvg

◆ model_cc()

subroutine numericalmodelmodule::model_cc ( class(numericalmodeltype) this,
integer(i4b), intent(in) innertot,
integer(i4b), intent(in) kiter,
integer(i4b), intent(in) iend,
integer(i4b), intent(in) icnvgmod,
character(len=lenpakloc), intent(inout) cpak,
integer(i4b), intent(inout) ipak,
real(dp), intent(inout) dpak )
private

Definition at line 148 of file NumericalModel.f90.

149 class(NumericalModelType) :: this
150 integer(I4B), intent(in) :: innertot
151 integer(I4B), intent(in) :: kiter
152 integer(I4B), intent(in) :: iend
153 integer(I4B), intent(in) :: icnvgmod
154 character(len=LENPAKLOC), intent(inout) :: cpak
155 integer(I4B), intent(inout) :: ipak
156 real(DP), intent(inout) :: dpak

◆ model_cf()

subroutine numericalmodelmodule::model_cf ( class(numericalmodeltype) this,
integer(i4b), intent(in) kiter )
private

Definition at line 116 of file NumericalModel.f90.

117 class(NumericalModelType) :: this
118 integer(I4B), intent(in) :: kiter

◆ model_cq()

subroutine numericalmodelmodule::model_cq ( class(numericalmodeltype) this,
integer(i4b), intent(in) icnvg,
integer(i4b), intent(in) isuppress_output )
private

Definition at line 170 of file NumericalModel.f90.

171 class(NumericalModelType) :: this
172 integer(I4B), intent(in) :: icnvg
173 integer(I4B), intent(in) :: isuppress_output

◆ model_da()

subroutine numericalmodelmodule::model_da ( class(numericalmodeltype) this)
private

Definition at line 207 of file NumericalModel.f90.

208 ! modules
210 class(NumericalModelType) :: this
211
212 ! deallocate scalars
213 call mem_deallocate(this%neq)
214 call mem_deallocate(this%nja)
215 call mem_deallocate(this%icnvg)
216 call mem_deallocate(this%moffset)
217 deallocate (this%filename)
218
219 ! deallocate arrays
220 call mem_deallocate(this%xold)
221 call mem_deallocate(this%flowja, 'FLOWJA', this%memoryPath)
222 call mem_deallocate(this%idxglo)
223
224 ! deallocate derived types
225 call this%bndlist%Clear()
226 deallocate (this%bndlist)
227
228 ! nullify pointers
229 call mem_deallocate(this%x, 'X', this%memoryPath)
230 call mem_deallocate(this%rhs, 'RHS', this%memoryPath)
231 call mem_deallocate(this%ibound, 'IBOUND', this%memoryPath)
232
233 ! base deallocation
234 call this%BaseModelType%model_da()
235

◆ model_df()

subroutine numericalmodelmodule::model_df ( class(numericalmodeltype) this)

Definition at line 72 of file NumericalModel.f90.

73 class(NumericalModelType) :: this

◆ model_fc()

subroutine numericalmodelmodule::model_fc ( class(numericalmodeltype) this,
integer(i4b), intent(in) kiter,
class(matrixbasetype), pointer matrix_sln,
integer(i4b), intent(in) inwtflag )
private

Definition at line 121 of file NumericalModel.f90.

122 class(NumericalModelType) :: this
123 integer(I4B), intent(in) :: kiter
124 class(MatrixBaseType), pointer :: matrix_sln
125 integer(I4B), intent(in) :: inwtflag

◆ model_fp()

subroutine numericalmodelmodule::model_fp ( class(numericalmodeltype) this)
private

Definition at line 203 of file NumericalModel.f90.

204 class(NumericalModelType) :: this

◆ model_mc()

subroutine numericalmodelmodule::model_mc ( class(numericalmodeltype) this,
class(matrixbasetype), pointer matrix_sln )
private

Definition at line 81 of file NumericalModel.f90.

82 class(NumericalModelType) :: this
83 class(MatrixBaseType), pointer :: matrix_sln

◆ model_nr()

subroutine numericalmodelmodule::model_nr ( class(numericalmodeltype) this,
integer(i4b), intent(in) kiter,
class(matrixbasetype), pointer matrix,
integer(i4b), intent(in) inwtflag )
private

Definition at line 141 of file NumericalModel.f90.

142 class(NumericalModelType) :: this
143 integer(I4B), intent(in) :: kiter
144 class(MatrixBaseType), pointer :: matrix
145 integer(I4B), intent(in) :: inwtflag

◆ model_nur()

subroutine numericalmodelmodule::model_nur ( class(numericalmodeltype) this,
integer(i4b), intent(in) neqmod,
real(dp), dimension(neqmod), intent(inout) x,
real(dp), dimension(neqmod), intent(in) xtemp,
real(dp), dimension(neqmod), intent(inout) dx,
integer(i4b), intent(inout) inewtonur,
real(dp), intent(inout) dxmax,
integer(i4b), intent(inout) locmax )
private

Definition at line 159 of file NumericalModel.f90.

160 class(NumericalModelType) :: this
161 integer(I4B), intent(in) :: neqmod
162 real(DP), dimension(neqmod), intent(inout) :: x
163 real(DP), dimension(neqmod), intent(in) :: xtemp
164 real(DP), dimension(neqmod), intent(inout) :: dx
165 integer(I4B), intent(inout) :: inewtonur
166 real(DP), intent(inout) :: dxmax
167 integer(I4B), intent(inout) :: locmax

◆ model_ot()

subroutine numericalmodelmodule::model_ot ( class(numericalmodeltype) this)
private

Definition at line 192 of file NumericalModel.f90.

193 class(NumericalModelType) :: this

◆ model_ptc()

subroutine numericalmodelmodule::model_ptc ( class(numericalmodeltype) this,
class(vectorbasetype), pointer vec_residual,
integer(i4b), intent(inout) iptc,
real(dp), intent(inout) ptcf )
private

Definition at line 134 of file NumericalModel.f90.

135 class(NumericalModelType) :: this
136 class(VectorBaseType), pointer :: vec_residual
137 integer(I4B), intent(inout) :: iptc
138 real(DP), intent(inout) :: ptcf

◆ model_ptcchk()

subroutine numericalmodelmodule::model_ptcchk ( class(numericalmodeltype) this,
integer(i4b), intent(inout) iptc )
private

Definition at line 128 of file NumericalModel.f90.

129 class(NumericalModelType) :: this
130 integer(I4B), intent(inout) :: iptc
131 iptc = 0

◆ model_reset()

subroutine numericalmodelmodule::model_reset ( class(numericalmodeltype) this)
private

Definition at line 98 of file NumericalModel.f90.

100 class(NumericalModelType) :: this
101 ! local
102 class(BndType), pointer :: packobj
103 integer(I4B) :: ip
104
105 do ip = 1, this%bndlist%Count()
106 packobj => getbndfromlist(this%bndlist, ip)
107 call packobj%bnd_reset()
108 end do
109
Here is the call graph for this function:

◆ model_rp()

subroutine numericalmodelmodule::model_rp ( class(numericalmodeltype) this)
private

Definition at line 90 of file NumericalModel.f90.

91 class(NumericalModelType) :: this

◆ model_solve()

subroutine numericalmodelmodule::model_solve ( class(numericalmodeltype) this)
private

Definition at line 112 of file NumericalModel.f90.

113 class(NumericalModelType) :: this

◆ set_iboundptr()

subroutine numericalmodelmodule::set_iboundptr ( class(numericalmodeltype) this,
integer(i4b), dimension(:), intent(in), pointer, contiguous iboundsln,
integer(i4b) sln_offset,
character(len=*), intent(in) varnametgt,
character(len=*), intent(in) mempathtgt )
private

Definition at line 328 of file NumericalModel.f90.

330 ! dummy
331 class(NumericalModelType) :: this
332 integer(I4B), dimension(:), pointer, contiguous, intent(in) :: iboundsln
333 integer(I4B) :: sln_offset
334 character(len=*), intent(in) :: varNameTgt
335 character(len=*), intent(in) :: memPathTgt
336 ! local
337 integer(I4B) :: offset
338
339 offset = this%moffset - sln_offset
340 this%ibound => iboundsln(offset + 1:offset + this%neq)
341 call mem_checkin(this%ibound, 'IBOUND', this%memoryPath, varnametgt, &
342 mempathtgt)

◆ set_idsoln()

subroutine numericalmodelmodule::set_idsoln ( class(numericalmodeltype) this,
integer(i4b), intent(in) id )
private

Definition at line 252 of file NumericalModel.f90.

253 class(NumericalModelType) :: this
254 integer(I4B), intent(in) :: id
255 this%idsoln = id

◆ set_moffset()

subroutine numericalmodelmodule::set_moffset ( class(numericalmodeltype) this,
integer(i4b), intent(in) moffset )
private

Definition at line 238 of file NumericalModel.f90.

239 class(NumericalModelType) :: this
240 integer(I4B), intent(in) :: moffset
241 this%moffset = moffset

◆ set_rhsptr()

subroutine numericalmodelmodule::set_rhsptr ( class(numericalmodeltype) this,
real(dp), dimension(:), intent(in), pointer, contiguous rhssln,
integer(i4b) sln_offset,
character(len=*), intent(in) varnametgt,
character(len=*), intent(in) mempathtgt )
private

Definition at line 312 of file NumericalModel.f90.

314 ! dummy
315 class(NumericalModelType) :: this
316 real(DP), dimension(:), pointer, contiguous, intent(in) :: rhssln
317 integer(I4B) :: sln_offset
318 character(len=*), intent(in) :: varNameTgt
319 character(len=*), intent(in) :: memPathTgt
320 ! local
321 integer(I4B) :: offset
322
323 offset = this%moffset - sln_offset
324 this%rhs => rhssln(offset + 1:offset + this%neq)
325 call mem_checkin(this%rhs, 'RHS', this%memoryPath, varnametgt, mempathtgt)

◆ set_xptr()

subroutine numericalmodelmodule::set_xptr ( class(numericalmodeltype) this,
real(dp), dimension(:), intent(in), pointer, contiguous xsln,
integer(i4b) sln_offset,
character(len=*), intent(in) varnametgt,
character(len=*), intent(in) mempathtgt )
private

Definition at line 296 of file NumericalModel.f90.

298 ! dummy
299 class(NumericalModelType) :: this
300 real(DP), dimension(:), pointer, contiguous, intent(in) :: xsln
301 integer(I4B) :: sln_offset
302 character(len=*), intent(in) :: varNameTgt
303 character(len=*), intent(in) :: memPathTgt
304 ! local
305 integer(I4B) :: offset
306
307 offset = this%moffset - sln_offset
308 this%x => xsln(offset + 1:offset + this%neq)
309 call mem_checkin(this%x, 'X', this%memoryPath, varnametgt, mempathtgt)