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

Data Types

type  gwecndtype

Functions/Subroutines

subroutine, public cnd_cr (cndobj, name_model, input_mempath, inunit, iout, fmi, eqnsclfac, gwecommon)
 Create a new CND object.
subroutine cnd_df (this, dis, cndoptions)
 Define CND object.
subroutine cnd_ac (this, moffset, sparse)
 Add connections to CND.
subroutine cnd_mc (this, moffset, matrix_sln)
 Map CND connections.
subroutine cnd_ar (this, ibound, porosity)
 Allocate and read method for package.
subroutine cnd_ad (this)
 Advance method for the package.
subroutine cnd_fc (this, kiter, nodes, nja, matrix_sln, idxglo, rhs, cnew)
 Fill coefficient method for package.
subroutine cnd_cq (this, cnew, flowja)
 Calculate flows for package.
subroutine allocate_scalars (this)
 Allocate scalar variables for package.
subroutine allocate_arrays (this, nodes)
 Allocate arrays for package.
subroutine cnd_da (this)
 Deallocate memory.
subroutine log_options (this, found)
 Write user options to list file.
subroutine source_options (this)
 Update simulation mempath options.
subroutine log_griddata (this, found)
 Write dimensions to list file.
subroutine source_griddata (this)
 Update CND simulation data from input mempath.
subroutine calcdispellipse (this)
 Calculate dispersion coefficients.

Function/Subroutine Documentation

◆ allocate_arrays()

subroutine gwecndmodule::allocate_arrays ( class(gwecndtype) this,
integer(i4b), intent(in) nodes )
private

Method to allocate arrays for the package.

Definition at line 396 of file gwe-cnd.f90.

397 ! -- modules
399 use constantsmodule, only: dzero
400 ! -- dummy
401 class(GweCndType) :: this
402 integer(I4B), intent(in) :: nodes
403 !
404 ! -- Allocate
405 call mem_allocate(this%alh, nodes, 'ALH', trim(this%memoryPath))
406 call mem_allocate(this%alv, nodes, 'ALV', trim(this%memoryPath))
407 call mem_allocate(this%ath1, nodes, 'ATH1', trim(this%memoryPath))
408 call mem_allocate(this%ath2, nodes, 'ATH2', trim(this%memoryPath))
409 call mem_allocate(this%atv, nodes, 'ATV', trim(this%memoryPath))
410 call mem_allocate(this%d11, nodes, 'D11', trim(this%memoryPath))
411 call mem_allocate(this%d22, nodes, 'D22', trim(this%memoryPath))
412 call mem_allocate(this%d33, nodes, 'D33', trim(this%memoryPath))
413 call mem_allocate(this%angle1, nodes, 'ANGLE1', trim(this%memoryPath))
414 call mem_allocate(this%angle2, nodes, 'ANGLE2', trim(this%memoryPath))
415 call mem_allocate(this%angle3, nodes, 'ANGLE3', trim(this%memoryPath))
416 call mem_allocate(this%ktw, nodes, 'KTW', trim(this%memoryPath))
417 call mem_allocate(this%kts, nodes, 'KTS', trim(this%memoryPath))
418 !
419 ! -- Allocate dispersion coefficient array if xt3d not in use
420 if (this%ixt3d == 0) then
421 call mem_allocate(this%dispcoef, this%dis%njas, 'DISPCOEF', &
422 trim(this%memoryPath))
423 else
424 call mem_allocate(this%dispcoef, 0, 'DISPCOEF', trim(this%memoryPath))
425 end if
This module contains simulation constants.
Definition Constants.f90:9
real(dp), parameter dzero
real constant zero
Definition Constants.f90:65

◆ allocate_scalars()

subroutine gwecndmodule::allocate_scalars ( class(gwecndtype) this)
private

Method to allocate scalar variables for the package.

Definition at line 345 of file gwe-cnd.f90.

346 ! -- modules
348 use constantsmodule, only: dzero
349 ! -- dummy
350 class(GweCndType) :: this
351 !
352 ! -- allocate scalars in NumericalPackageType
353 call this%NumericalPackageType%allocate_scalars()
354 !
355 ! -- Allocate
356 call mem_allocate(this%idisp, 'IDISP', this%memoryPath)
357 call mem_allocate(this%ialh, 'IALH', this%memoryPath)
358 call mem_allocate(this%ialv, 'IALV', this%memoryPath)
359 call mem_allocate(this%iath1, 'IATH1', this%memoryPath)
360 call mem_allocate(this%iath2, 'IATH2', this%memoryPath)
361 call mem_allocate(this%iatv, 'IATV', this%memoryPath)
362 call mem_allocate(this%ixt3doff, 'IXT3DOFF', this%memoryPath)
363 call mem_allocate(this%ixt3drhs, 'IXT3DRHS', this%memoryPath)
364 call mem_allocate(this%ixt3d, 'IXT3D', this%memoryPath)
365 call mem_allocate(this%id22, 'ID22', this%memoryPath)
366 call mem_allocate(this%id33, 'ID33', this%memoryPath)
367 call mem_allocate(this%iangle1, 'IANGLE1', this%memoryPath)
368 call mem_allocate(this%iangle2, 'IANGLE2', this%memoryPath)
369 call mem_allocate(this%iangle3, 'IANGLE3', this%memoryPath)
370 call mem_allocate(this%iktw, 'IKTW', this%memoryPath)
371 call mem_allocate(this%ikts, 'IKTS', this%memoryPath)
372 !
373 ! -- Initialize
374 this%idisp = 0
375 this%ialh = 0
376 this%ialv = 0
377 this%iath1 = 0
378 this%iath2 = 0
379 this%iatv = 0
380 this%ixt3doff = 0
381 this%ixt3drhs = 0
382 this%ixt3d = 0
383 this%id22 = 1
384 this%id33 = 1
385 this%iangle1 = 1
386 this%iangle2 = 1
387 this%iangle3 = 1
388 this%iktw = 1
389 this%ikts = 1

◆ calcdispellipse()

subroutine gwecndmodule::calcdispellipse ( class(gwecndtype) this)
private

Definition at line 649 of file gwe-cnd.f90.

650 ! -- modules
651 ! -- dummy
652 class(GweCndType) :: this
653 ! -- local
654 integer(I4B) :: nodes, n
655 real(DP) :: q, qx, qy, qz
656 real(DP) :: alh, alv, ath1, ath2, atv, a
657 real(DP) :: al, at1, at2
658 real(DP) :: qzoqsquared
659 real(DP) :: ktbulk ! TODO: Implement additional options for characterizing ktbulk (see Markle refs)
660 real(DP) :: dstar
661 real(DP) :: qsw
662 !
663 ! -- loop through and calculate dispersion coefficients and angles
664 nodes = size(this%d11)
665 do n = 1, nodes
666 !
667 ! -- initialize
668 this%d11(n) = dzero
669 this%d22(n) = dzero
670 this%d33(n) = dzero
671 this%angle1(n) = dzero
672 this%angle2(n) = dzero
673 this%angle3(n) = dzero
674 if (this%fmi%ibdgwfsat0(n) == 0) cycle
675 !
676 ! -- specific discharge
677 qx = dzero
678 qy = dzero
679 qz = dzero
680 q = dzero
681 qx = this%fmi%gwfspdis(1, n)
682 qy = this%fmi%gwfspdis(2, n)
683 qz = this%fmi%gwfspdis(3, n)
684 q = qx**2 + qy**2 + qz**2
685 if (q > dzero) q = sqrt(q)
686 !
687 ! -- dispersion coefficients
688 alh = dzero
689 alv = dzero
690 ath1 = dzero
691 ath2 = dzero
692 atv = dzero
693 if (this%idisp > 0) then
694 alh = this%alh(n)
695 alv = this%alv(n)
696 ath1 = this%ath1(n)
697 ath2 = this%ath2(n)
698 atv = this%atv(n)
699 end if
700 !
701 ! -- calculate
702 ktbulk = dzero
703 if (this%iktw > 0) ktbulk = ktbulk + this%porosity(n) * this%ktw(n) * &
704 this%fmi%gwfsat(n)
705 if (this%ikts > 0) ktbulk = ktbulk + (done - this%porosity(n)) * this%kts(n)
706 !
707 ! -- The division by rhow*cpw below is undertaken to render dstar in the
708 ! form of a thermal diffusivity, and not because the governing
709 ! equation is scaled by rhow*cpw. Because of this conceptual
710 ! distinction, ktbulk is divided by the explicitly calculated product
711 ! rhow*cpw, and not by the equivalent scale factor eqnsclfac, even
712 ! though it should make no practical difference in the result.
713 dstar = ktbulk / (this%gwecommon%gwecpw * this%gwecommon%gwerhow)
714 !
715 ! -- Calculate the longitudal and transverse dispersivities
716 al = dzero
717 at1 = dzero
718 at2 = dzero
719 if (q > dzero) then
720 qzoqsquared = (qz / q)**2
721 al = alh * (done - qzoqsquared) + alv * qzoqsquared
722 at1 = ath1 * (done - qzoqsquared) + atv * qzoqsquared
723 at2 = ath2 * (done - qzoqsquared) + atv * qzoqsquared
724 end if
725 !
726 ! -- Calculate and save the diagonal components of the dispersion tensor
727 qsw = q * this%fmi%gwfsat(n) * this%eqnsclfac
728 this%d11(n) = al * qsw + ktbulk
729 this%d22(n) = at1 * qsw + ktbulk
730 this%d33(n) = at2 * qsw + ktbulk
731 !
732 ! -- Angles of rotation if velocity based dispersion tensor
733 if (this%idisp > 0) then
734 !
735 ! -- angle3 is zero
736 this%angle3(n) = dzero
737
738 ! -- angle2: vertical inclination
739 if (q > dzero) then
740 a = max(-done, min(done, qz / q))
741 else
742 a = dzero
743 end if
744 this%angle2(n) = asin(a)
745
746 ! -- angle1: horizontal azimuth
747 if (qx /= dzero .or. qy /= dzero) then
748 this%angle1(n) = atan2(qy, qx)
749 else
750 this%angle1(n) = dzero
751 end if
752 end if
753 end do

◆ cnd_ac()

subroutine gwecndmodule::cnd_ac ( class(gwecndtype) this,
integer(i4b), intent(in) moffset,
type(sparsematrix), intent(inout) sparse )
private

Add connections for extended neighbors to the sparse matrix

Definition at line 176 of file gwe-cnd.f90.

177 ! -- modules
178 use sparsemodule, only: sparsematrix
180 ! -- dummy
181 class(GweCndType) :: this
182 integer(I4B), intent(in) :: moffset
183 type(sparsematrix), intent(inout) :: sparse
184 !
185 ! -- Add extended neighbors (neighbors of neighbors)
186 if (this%ixt3d > 0) call this%xt3d%xt3d_ac(moffset, sparse)

◆ cnd_ad()

subroutine gwecndmodule::cnd_ad ( class(gwecndtype) this)
private

Definition at line 228 of file gwe-cnd.f90.

229 ! -- modules
230 use tdismodule, only: kstp, kper
231 ! -- dummy
232 class(GweCndType) :: this
233 !
234 ! -- xt3d
235 ! TODO: might consider adding a new mf6 level set pointers method, and
236 ! doing this stuff there instead of in the time step loop.
237 if (kstp * kper == 1) then
238 if (this%ixt3d > 0) then
239 call this%xt3d%xt3d_ar(this%fmi%ibdgwfsat0, this%d11, this%id33, &
240 this%d33, this%fmi%gwfsat, this%id22, this%d22, &
241 this%iangle1, this%iangle2, this%iangle3, &
242 this%angle1, this%angle2, this%angle3)
243 end if
244 end if
245 !
246 ! -- Fill d11, d22, d33, angle1, angle2, angle3 using specific discharge
247 call this%calcdispellipse()
248 !
249 ! -- Recalculate dispersion coefficients if the flows were updated
250 if (this%fmi%iflowsupdated == 1) then
251 if (this%ixt3d == 0) then
252 call calc_dispcoef(this%dis, this%fmi%ibdgwfsat0, &
253 real(this%fmi%ibdgwfsat0, DP), this%d11, this%d22, &
254 this%d33, this%angle1, this%angle2, &
255 this%angle3, this%dispcoef)
256 else if (this%ixt3d > 0) then
257 call this%xt3d%xt3d_fcpc(this%dis%nodes, .true.)
258 end if
259 end if
integer(i4b), pointer, public kstp
current time step number
Definition tdis.f90:27
integer(i4b), pointer, public kper
current stress period number
Definition tdis.f90:26
Here is the call graph for this function:

◆ cnd_ar()

subroutine gwecndmodule::cnd_ar ( class(gwecndtype) this,
integer(i4b), dimension(:), pointer, contiguous ibound,
real(dp), dimension(:), pointer, contiguous porosity )
private

Method to allocate and read static data for the package.

Definition at line 209 of file gwe-cnd.f90.

210 ! -- modules
211 ! -- dummy
212 class(GweCndType) :: this
213 integer(I4B), dimension(:), pointer, contiguous :: ibound
214 real(DP), dimension(:), pointer, contiguous :: porosity
215 ! -- local
216 ! -- formats
217 character(len=*), parameter :: fmtcnd = &
218 "(1x,/1x,'CND-- THERMAL CONDUCTION AND DISPERSION PACKAGE, VERSION 1, ', &
219 &'5/01/2023, INPUT READ FROM UNIT ', i0, //)"
220 !
221 ! -- cnd pointers to arguments that were passed in
222 this%ibound => ibound
223 this%porosity => porosity

◆ cnd_cq()

subroutine gwecndmodule::cnd_cq ( class(gwecndtype) this,
real(dp), dimension(:), intent(inout) cnew,
real(dp), dimension(:), intent(inout) flowja )
private

Method to calculate dispersion contribution to flowja

Definition at line 312 of file gwe-cnd.f90.

313 ! -- modules
314 ! -- dummy
315 class(GweCndType) :: this
316 real(DP), intent(inout), dimension(:) :: cnew
317 real(DP), intent(inout), dimension(:) :: flowja
318 ! -- local
319 integer(I4B) :: n, m, ipos, isympos
320 real(DP) :: dnm, qnm
321 !
322 ! -- Calculate dispersion and add to flowja
323 if (this%ixt3d > 0) then
324 call this%xt3d%xt3d_flowja(cnew, flowja)
325 else
326 do n = 1, this%dis%nodes
327 if (this%fmi%ibdgwfsat0(n) == 0) cycle
328 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
329 m = this%dis%con%ja(ipos)
330 if (this%fmi%ibdgwfsat0(m) == 0) cycle
331 isympos = this%dis%con%jas(ipos)
332 dnm = this%dispcoef(isympos)
333!! qnm = dnm * (cnew(m) - cnew(n)) * this%eqnsclfac
334 qnm = dnm * (cnew(m) - cnew(n))
335 flowja(ipos) = flowja(ipos) + qnm
336 end do
337 end do
338 end if

◆ cnd_cr()

subroutine, public gwecndmodule::cnd_cr ( type(gwecndtype), pointer cndobj,
character(len=*), intent(in) name_model,
character(len=*), intent(in) input_mempath,
integer(i4b), intent(in) inunit,
integer(i4b), intent(in) iout,
type(tspfmitype), intent(in), target fmi,
real(dp), intent(in), pointer eqnsclfac,
type(gweinputdatatype), intent(in), optional, target gwecommon )

Create a new CND package

Parameters
[in]eqnsclfacgoverning equation scale factor
[in]gwecommonshared data container for use by multiple GWE packages

Definition at line 84 of file gwe-cnd.f90.

86 ! -- modules
87 use kindmodule, only: lgp
89 ! -- dummy
90 type(GweCndType), pointer :: cndobj
91 character(len=*), intent(in) :: name_model
92 character(len=*), intent(in) :: input_mempath
93 integer(I4B), intent(in) :: inunit
94 integer(I4B), intent(in) :: iout
95 type(TspFmiType), intent(in), target :: fmi
96 real(DP), intent(in), pointer :: eqnsclfac !< governing equation scale factor
97 type(GweInputDataType), intent(in), target, optional :: gwecommon !< shared data container for use by multiple GWE packages
98 ! -- formats
99 character(len=*), parameter :: fmtcnd = &
100 "(1x,/1x,'CND-- THERMAL CONDUCTION AND DISPERSION PACKAGE, VERSION 1, ', &
101 &'01/01/2024, INPUT READ FROM MEMPATH ', A, //)"
102 !
103 ! -- Create the object
104 allocate (cndobj)
105 !
106 ! -- create name and memory path
107 call cndobj%set_names(1, name_model, 'CND', 'CND', input_mempath)
108 !
109 ! -- Allocate scalars
110 call cndobj%allocate_scalars()
111 !
112 ! -- Set variables
113 cndobj%inunit = inunit
114 cndobj%iout = iout
115 cndobj%fmi => fmi
116 cndobj%eqnsclfac => eqnsclfac
117 if (present(gwecommon)) then
118 cndobj%gwecommon => gwecommon
119 end if
120 !
121 if (cndobj%inunit > 0) then
122 !
123 ! -- Print a message identifying the dispersion package.
124 if (cndobj%iout > 0) then
125 write (cndobj%iout, fmtcnd) input_mempath
126 end if
127 end if
This module defines variable data types.
Definition kind.f90:8
Here is the caller graph for this function:

◆ cnd_da()

subroutine gwecndmodule::cnd_da ( class(gwecndtype) this)
private

Method to deallocate memory for the package.

Definition at line 432 of file gwe-cnd.f90.

433 ! -- modules
437 ! -- dummy
438 class(GweCndType) :: this
439 ! -- local
440 !
441 ! -- Deallocate input memory
442 call memorystore_remove(this%name_model, 'CND', idm_context)
443 !
444 ! -- deallocate arrays
445 if (this%inunit /= 0) then
446 call mem_deallocate(this%alh, 'ALH', trim(this%memoryPath))
447 call mem_deallocate(this%alv, 'ALV', trim(this%memoryPath))
448 call mem_deallocate(this%ath1, 'ATH1', trim(this%memoryPath))
449 call mem_deallocate(this%ath2, 'ATH2', trim(this%memoryPath))
450 call mem_deallocate(this%atv, 'ATV', trim(this%memoryPath))
451 call mem_deallocate(this%d11)
452 call mem_deallocate(this%d22)
453 call mem_deallocate(this%d33)
454 call mem_deallocate(this%angle1)
455 call mem_deallocate(this%angle2)
456 call mem_deallocate(this%angle3)
457 call mem_deallocate(this%ktw)
458 call mem_deallocate(this%kts)
459 call mem_deallocate(this%dispcoef)
460 if (this%ixt3d > 0) call this%xt3d%xt3d_da()
461 end if
462 !
463 ! -- deallocate objects
464 if (this%ixt3d > 0) deallocate (this%xt3d)
465 nullify (this%gwecommon)
466 !
467 ! -- deallocate scalars
468 call mem_deallocate(this%idisp)
469 call mem_deallocate(this%ialh)
470 call mem_deallocate(this%ialv)
471 call mem_deallocate(this%iath1)
472 call mem_deallocate(this%iath2)
473 call mem_deallocate(this%iatv)
474 call mem_deallocate(this%ixt3doff)
475 call mem_deallocate(this%ixt3drhs)
476 call mem_deallocate(this%ixt3d)
477 call mem_deallocate(this%id22)
478 call mem_deallocate(this%id33)
479 call mem_deallocate(this%iangle1)
480 call mem_deallocate(this%iangle2)
481 call mem_deallocate(this%iangle3)
482 call mem_deallocate(this%iktw)
483 call mem_deallocate(this%ikts)
484 !
485 ! -- deallocate variables in NumericalPackageType
486 call this%NumericalPackageType%da()
subroutine, public memorystore_remove(component, subcomponent, context)
This module contains simulation variables.
character(len=linelength) idm_context
Here is the call graph for this function:

◆ cnd_df()

subroutine gwecndmodule::cnd_df ( class(gwecndtype) this,
class(disbasetype), pointer dis,
type(gwecndoptionstype), intent(in), optional cndoptions )
private
Parameters
[in]cndoptionsthe optional CND options, used when not creating CND from file

Definition at line 132 of file gwe-cnd.f90.

133 ! -- modules
134 ! -- dummy
135 class(GweCndType) :: this
136 class(DisBaseType), pointer :: dis
137 type(GweCndOptionsType), optional, intent(in) :: cndOptions !< the optional CND options, used when not
138 !! creating CND from file
139 !
140 ! -- Store pointer to dis
141 this%dis => dis
142 !
143 !
144 ! -- set default xt3d representation to on and lhs
145 this%ixt3d = 1
146 !
147 ! -- Read dispersion options
148 if (present(cndoptions)) then
149 this%ixt3d = cndoptions%ixt3d
150 !
151 ! -- Allocate only, grid data will not be read from file
152 call this%allocate_arrays(this%dis%nodes)
153 else
154 !
155 ! -- Source options
156 call this%source_options()
157 call this%allocate_arrays(this%dis%nodes)
158 !
159 ! -- Source dispersion data
160 call this%source_griddata()
161 end if
162 !
163 ! -- xt3d create
164 if (this%ixt3d > 0) then
165 call xt3d_cr(this%xt3d, this%name_model, this%inunit, this%iout, &
166 ldispopt=.true.)
167 this%xt3d%ixt3d = this%ixt3d
168 call this%xt3d%xt3d_df(dis)
169 end if
Here is the call graph for this function:

◆ cnd_fc()

subroutine gwecndmodule::cnd_fc ( class(gwecndtype) this,
integer(i4b) kiter,
integer(i4b), intent(in) nodes,
integer(i4b), intent(in) nja,
class(matrixbasetype), pointer matrix_sln,
integer(i4b), dimension(nja), intent(in) idxglo,
real(dp), dimension(nodes), intent(inout) rhs,
real(dp), dimension(nodes), intent(inout) cnew )
private

Method to calculate and fill coefficients for the package.

Definition at line 266 of file gwe-cnd.f90.

267 ! -- dummy
268 class(GweCndType) :: this
269 integer(I4B) :: kiter
270 integer(I4B), intent(in) :: nodes
271 integer(I4B), intent(in) :: nja
272 class(MatrixBaseType), pointer :: matrix_sln
273 integer(I4B), intent(in), dimension(nja) :: idxglo
274 real(DP), intent(inout), dimension(nodes) :: rhs
275 real(DP), intent(inout), dimension(nodes) :: cnew
276 ! -- local
277 integer(I4B) :: n, m, idiag, idiagm, ipos, isympos, isymcon
278 real(DP) :: dnm
279 !
280 if (this%ixt3d > 0) then
281 call this%xt3d%xt3d_fc(kiter, matrix_sln, idxglo, rhs, cnew)
282 else
283 do n = 1, nodes
284 if (this%fmi%ibdgwfsat0(n) == 0) cycle
285 idiag = this%dis%con%ia(n)
286 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
287 if (this%dis%con%mask(ipos) == 0) cycle
288 m = this%dis%con%ja(ipos)
289 if (m < n) cycle
290 if (this%fmi%ibdgwfsat0(m) == 0) cycle
291 isympos = this%dis%con%jas(ipos)
292 dnm = this%dispcoef(isympos)
293 !
294 ! -- Contribution to row n
295 call matrix_sln%add_value_pos(idxglo(ipos), dnm)
296 call matrix_sln%add_value_pos(idxglo(idiag), -dnm)
297 !
298 ! -- Contribution to row m
299 idiagm = this%dis%con%ia(m)
300 isymcon = this%dis%con%isym(ipos)
301 call matrix_sln%add_value_pos(idxglo(isymcon), dnm)
302 call matrix_sln%add_value_pos(idxglo(idiagm), -dnm)
303 end do
304 end do
305 end if

◆ cnd_mc()

subroutine gwecndmodule::cnd_mc ( class(gwecndtype) this,
integer(i4b), intent(in) moffset,
class(matrixbasetype), pointer matrix_sln )
private

Map connections and construct iax, jax, and idxglox

Definition at line 193 of file gwe-cnd.f90.

194 ! -- modules
196 ! -- dummy
197 class(GweCndType) :: this
198 integer(I4B), intent(in) :: moffset
199 class(MatrixBaseType), pointer :: matrix_sln
200 !
201 ! -- Call xt3d map connections
202 if (this%ixt3d > 0) call this%xt3d%xt3d_mc(moffset, matrix_sln)

◆ log_griddata()

subroutine gwecndmodule::log_griddata ( class(gwecndtype) this,
type(gwecndparamfoundtype), intent(in) found )
private

Definition at line 531 of file gwe-cnd.f90.

533 class(GweCndType) :: this
534 type(GweCndParamFoundType), intent(in) :: found
535 !
536 write (this%iout, '(1x,a)') 'Setting CND Griddata'
537 !
538 if (found%alh) then
539 write (this%iout, '(4x,a)') 'ALH set from input file'
540 end if
541 !
542 if (found%alv) then
543 write (this%iout, '(4x,a)') 'ALV set from input file'
544 end if
545 !
546 if (found%ath1) then
547 write (this%iout, '(4x,a)') 'ATH1 set from input file'
548 end if
549 !
550 if (found%ath2) then
551 write (this%iout, '(4x,a)') 'ATH2 set from input file'
552 end if
553 !
554 if (found%atv) then
555 write (this%iout, '(4x,a)') 'ATV set from input file'
556 end if
557 !
558 if (found%ktw) then
559 write (this%iout, '(4x,a)') 'KTW set from input file'
560 end if
561 !
562 if (found%kts) then
563 write (this%iout, '(4x,a)') 'KTS set from input file'
564 end if
565 !
566 write (this%iout, '(1x,a,/)') 'End Setting CND Griddata'

◆ log_options()

subroutine gwecndmodule::log_options ( class(gwecndtype) this,
type(gwecndparamfoundtype), intent(in) found )
private

Definition at line 491 of file gwe-cnd.f90.

493 class(GweCndType) :: this
494 type(GweCndParamFoundType), intent(in) :: found
495 !
496 write (this%iout, '(1x,a)') 'Setting CND Options'
497 write (this%iout, '(4x,a,i0)') 'XT3D formulation [0=INACTIVE, 1=ACTIVE, &
498 &3=ACTIVE RHS] set to: ', this%ixt3d
499 write (this%iout, '(1x,a,/)') 'End Setting CND Options'

◆ source_griddata()

subroutine gwecndmodule::source_griddata ( class(gwecndtype) this)
private

Definition at line 571 of file gwe-cnd.f90.

572 ! -- modules
578 ! -- dummy
579 class(GweCndType) :: this
580 ! -- locals
581 character(len=LINELENGTH) :: errmsg
582 type(GweCndParamFoundType) :: found
583 integer(I4B), dimension(:), pointer, contiguous :: map
584 ! -- formats
585 !
586 ! -- set map
587 map => null()
588 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
589 !
590 ! -- update defaults with idm sourced values
591 call mem_set_value(this%alh, 'ALH', this%input_mempath, map, found%alh)
592 call mem_set_value(this%alv, 'ALV', this%input_mempath, map, found%alv)
593 call mem_set_value(this%ath1, 'ATH1', this%input_mempath, map, found%ath1)
594 call mem_set_value(this%ath2, 'ATH2', this%input_mempath, map, found%ath2)
595 call mem_set_value(this%atv, 'ATV', this%input_mempath, map, found%atv)
596 call mem_set_value(this%ktw, 'KTW', this%input_mempath, map, found%ktw)
597 call mem_set_value(this%kts, 'KTS', this%input_mempath, map, found%kts)
598 !
599 ! -- set active flags
600 if (found%alh) this%ialh = 1
601 if (found%alv) this%ialv = 1
602 if (found%ath1) this%iath1 = 1
603 if (found%ath2) this%iath2 = 1
604 if (found%atv) this%iatv = 1
605 if (found%ktw) this%iktw = 1
606 if (found%kts) this%ikts = 1
607 !
608 ! -- set this%idisp flag
609 if (found%alh) this%idisp = this%idisp + 1
610 if (found%alv) this%idisp = this%idisp + 1
611 if (found%ath1) this%idisp = this%idisp + 1
612 if (found%ath2) this%idisp = this%idisp + 1
613 !
614 ! -- manage dispersion arrays
615 if (this%idisp > 0) then
616 if (.not. (found%alh .and. found%ath1)) then
617 write (errmsg, '(1x,a)') &
618 'If dispersivities are specified then ALH and ATH1 are required.'
619 call store_error(errmsg)
620 end if
621 ! -- If alv not specified then point it to alh
622 if (.not. found%alv) &
623 call mem_reassignptr(this%alv, 'ALV', trim(this%memoryPath), &
624 'ALH', trim(this%memoryPath))
625 ! -- If ath2 not specified then point it to ath1
626 if (.not. found%ath2) &
627 call mem_reassignptr(this%ath2, 'ATH2', trim(this%memoryPath), &
628 'ATH1', trim(this%memoryPath))
629 ! -- If atv not specified then point it to ath2
630 if (.not. found%atv) &
631 call mem_reassignptr(this%atv, 'ATV', trim(this%memoryPath), &
632 'ATH2', trim(this%memoryPath))
633 else
634 call mem_reallocate(this%alh, 0, 'ALH', trim(this%memoryPath))
635 call mem_reallocate(this%alv, 0, 'ALV', trim(this%memoryPath))
636 call mem_reallocate(this%ath1, 0, 'ATH1', trim(this%memoryPath))
637 call mem_reallocate(this%ath2, 0, 'ATH2', trim(this%memoryPath))
638 call mem_reallocate(this%atv, 0, 'ATV', trim(this%memoryPath))
639 end if
640 !
641 ! -- log griddata
642 if (this%iout > 0) then
643 call this%log_griddata(found)
644 end if
integer(i4b), parameter linelength
maximum length of a standard line
Definition Constants.f90:45
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition Constants.f90:27
This module contains simulation methods.
Definition Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition Sim.f90:94
integer(i4b) function, public count_errors()
Return number of errors.
Definition Sim.f90:60
Here is the call graph for this function:

◆ source_options()

subroutine gwecndmodule::source_options ( class(gwecndtype) this)
private

Definition at line 504 of file gwe-cnd.f90.

505 ! -- modules
508 ! -- dummy
509 class(GweCndType) :: this
510 ! -- locals
511 type(GweCndParamFoundType) :: found
512 !
513 ! -- update defaults with idm sourced values
514 call mem_set_value(this%ixt3doff, 'XT3D_OFF', this%input_mempath, &
515 found%xt3d_off)
516 call mem_set_value(this%ixt3drhs, 'XT3D_RHS', this%input_mempath, &
517 found%xt3d_rhs)
518 !
519 ! -- set xt3d state flag
520 if (found%xt3d_off) this%ixt3d = 0
521 if (found%xt3d_rhs) this%ixt3d = 2
522 !
523 ! -- log options
524 if (this%iout > 0) then
525 call this%log_options(found)
526 end if