31 integer(I4B),
pointer :: njausr => null()
32 integer(I4B),
pointer :: nvert => null()
33 integer(I4B),
pointer :: nangldegxerr => null()
34 real(dp),
pointer :: voffsettol => null()
35 real(dp),
dimension(:, :),
pointer,
contiguous :: vertices => null()
36 real(dp),
dimension(:, :),
pointer,
contiguous :: cellxy => null()
37 real(dp),
dimension(:),
pointer,
contiguous :: top1d => null()
38 real(dp),
dimension(:),
pointer,
contiguous :: bot1d => null()
39 real(dp),
dimension(:),
pointer,
contiguous :: area1d => null()
40 integer(I4B),
dimension(:),
pointer,
contiguous :: iainp => null()
41 integer(I4B),
dimension(:),
pointer,
contiguous :: jainp => null()
42 integer(I4B),
dimension(:),
pointer,
contiguous :: ihcinp => null()
43 real(dp),
dimension(:),
pointer,
contiguous :: cl12inp => null()
44 real(dp),
dimension(:),
pointer,
contiguous :: hwvainp => null()
45 real(dp),
dimension(:),
pointer,
contiguous :: angldegxinp => null()
46 integer(I4B),
pointer :: iangledegx => null()
47 integer(I4B),
dimension(:),
pointer,
contiguous :: iavert => null()
48 integer(I4B),
dimension(:),
pointer,
contiguous :: javert => null()
49 integer(I4B),
dimension(:),
pointer,
contiguous :: idomain => null()
50 logical(LGP) :: readfromfile
101 logical :: length_units = .false.
102 logical :: nogrb = .false.
103 logical :: xorigin = .false.
104 logical :: yorigin = .false.
105 logical :: angrot = .false.
106 logical :: voffsettol = .false.
107 logical :: nodes = .false.
108 logical :: nja = .false.
109 logical :: nvert = .false.
110 logical :: top = .false.
111 logical :: bot = .false.
112 logical :: area = .false.
113 logical :: idomain = .false.
114 logical :: iac = .false.
115 logical :: ja = .false.
116 logical :: ihc = .false.
117 logical :: cl12 = .false.
118 logical :: hwva = .false.
119 logical :: angldegx = .false.
120 logical :: iv = .false.
121 logical :: xv = .false.
122 logical :: yv = .false.
123 logical :: icell2d = .false.
124 logical :: xc = .false.
125 logical :: yc = .false.
126 logical :: ncvert = .false.
127 logical :: icvert = .false.
134 subroutine disu_cr(dis, name_model, input_mempath, inunit, iout)
137 character(len=*),
intent(in) :: name_model
138 character(len=*),
intent(in) :: input_mempath
139 integer(I4B),
intent(in) :: inunit
140 integer(I4B),
intent(in) :: iout
143 character(len=*),
parameter :: fmtheader = &
144 "(1X, /1X, 'DISU -- UNSTRUCTURED GRID DISCRETIZATION PACKAGE,', &
145 &' VERSION 2 : 3/27/2014 - INPUT READ FROM MEMPATH: ', A, //)"
152 call dis%allocate_scalars(name_model, input_mempath)
161 write (iout, fmtheader) dis%input_mempath
165 call disnew%disu_load()
177 call this%source_options()
178 call this%source_dimensions()
179 call this%source_griddata()
180 call this%source_connectivity()
183 if (this%nvert > 0)
then
184 call this%source_vertices()
185 call this%source_cell2d()
203 call this%grid_finalize()
215 integer(I4B) :: noder
216 integer(I4B) :: nrsize
218 character(len=*),
parameter :: fmtdz = &
219 "('CELL (',i0,',',i0,',',i0,') THICKNESS <= 0. ', &
220 &'TOP, BOT: ',2(1pg24.15))"
221 character(len=*),
parameter :: fmtnr = &
222 "(/1x, 'The specified IDOMAIN results in a reduced number of cells.',&
223 &/1x, 'Number of user nodes: ',I0,&
224 &/1X, 'Number of nodes in solution: ', I0, //)"
228 do n = 1, this%nodesuser
229 if (this%idomain(n) > 0) this%nodes = this%nodes + 1
233 if (this%nodes == 0)
then
234 call store_error(
'Model does not have any active nodes. &
235 &Ensure IDOMAIN array has some values greater &
241 if (this%nodes < this%nodesuser)
then
242 write (this%iout, fmtnr) this%nodesuser, this%nodes
246 call this%allocate_arrays()
252 if (this%nodes < this%nodesuser)
then
254 do node = 1, this%nodesuser
255 if (this%idomain(node) > 0)
then
256 this%nodereduced(node) = noder
258 elseif (this%idomain(node) < 0)
then
259 this%nodereduced(node) = -1
261 this%nodereduced(node) = 0
267 if (this%nodes < this%nodesuser)
then
269 do node = 1, this%nodesuser
270 if (this%idomain(node) > 0)
then
271 this%nodeuser(noder) = node
278 do node = 1, this%nodesuser
280 if (this%nodes < this%nodesuser) noder = this%nodereduced(node)
281 if (noder <= 0) cycle
282 this%top(noder) = this%top1d(node)
283 this%bot(noder) = this%bot1d(node)
284 this%area(noder) = this%area1d(node)
288 if (this%nvert > 0)
then
289 do node = 1, this%nodesuser
291 if (this%nodes < this%nodesuser) noder = this%nodereduced(node)
292 if (noder <= 0) cycle
293 this%xc(noder) = this%cellxy(1, node)
294 this%yc(noder) = this%cellxy(2, node)
303 if (this%nodes < this%nodesuser) nrsize = this%nodes
305 call this%con%disuconnections(this%name_model, this%nodes, &
306 this%nodesuser, nrsize, &
307 this%nodereduced, this%nodeuser, &
308 this%iainp, this%jainp, &
309 this%ihcinp, this%cl12inp, &
310 this%hwvainp, this%angldegxinp, &
312 this%nja = this%con%nja
313 this%njas = this%con%njas
324 integer(I4B) :: ipos, jpos, kpos
326 integer(I4B) :: nsym, ndir, nvrt, nwarn
329 real(DP) :: angn, angm, dang
330 real(DP) :: dx, dy, dist, cosang, angc
331 real(DP) :: xnorm, ynorm, angv
332 real(DP) :: angn_sym, angm_sym
333 real(DP) :: angn_dir, angc_dir
334 real(DP) :: angn_vrt, angv_vrt
335 real(DP) :: angn_warn, angc_warn
336 integer(I4B) :: n_sym, m_sym
337 integer(I4B) :: n_dir, m_dir
338 integer(I4B) :: n_vrt, m_vrt
339 integer(I4B) :: n_warn, m_warn
340 character(len=LENBIGLINE) :: bigmsg
341 real(DP),
parameter :: angtol = 0.01_dp
342 real(DP),
parameter :: angvtol = 1.0_dp
343 real(DP),
parameter :: cos45 = 0.70710678118654752_dp
345 character(len=*),
parameter :: fmtidm = &
346 &
"('Invalid idomain value ', i0, ' specified for node ', i0)"
347 character(len=*),
parameter :: fmtangsym = &
348 "('ANGLDEGX values for ', i0, ' cell faces associated with &
349 &horizontal connections in the DISU Package are inconsistent with &
350 &the values for the reverse connections (for example, ANGLDEGX = ', &
351 &f0.3, ' for the connection from cell ', i0, ' to cell ', i0, &
352 &' and ANGLDEGX = ', f0.3, ' for the connection from cell ', i0, &
353 &' to cell ', i0, '). The two values must differ by 180 degrees &
354 &(within 0.01 degrees) because they are the outward normals of the &
355 &two sides of the same cell face. Only the value for the connection &
356 &from the lower to the higher cell number is used.')"
357 character(len=*),
parameter :: fmtangdir = &
358 "('ANGLDEGX values for ', i0, ' cell faces associated with &
359 &horizontal connections in the DISU Package point away from the &
360 &connected cell (for example, ANGLDEGX = ', f0.3, ' for the &
361 &connection from cell ', i0, ' to cell ', i0, ', but the direction &
362 &from the center of cell ', i0, ' to the center of cell ', i0, &
363 &' is ', f0.3, ' degrees). The centers of two connected cells must &
364 &lie on opposite sides of their shared face, so ANGLDEGX, the &
365 &outward normal of the face, must be within 90 degrees of the &
366 &direction from the cell center to the center of the connected &
367 &cell, in the coordinate system of the VERTICES.')"
368 character(len=*),
parameter :: fmtangvrt = &
369 "('ANGLDEGX values for ', i0, ' cell faces associated with &
370 &horizontal connections in the DISU Package differ by more than 1 &
371 °ree from the outward normal of the face computed from the two &
372 &VERTICES shared by the connected cells (for example, ANGLDEGX = ', &
373 &f0.3, ' for the connection from cell ', i0, ' to cell ', i0, &
374 &', but the normal computed from the vertices is ', f0.3, &
375 &' degrees). ANGLDEGX must be expressed in the coordinate system of &
377 character(len=*),
parameter :: fmtangwarn = &
378 "('ANGLDEGX values for ', i0, ' cell faces associated with &
379 &horizontal connections in the DISU Package deviate by more than 45 &
380 °rees from the direction between the centers of the connected &
381 &cells (for example, ANGLDEGX = ', f0.3, ' for the connection from &
382 &cell ', i0, ' to cell ', i0, ', but the direction between the cell &
383 ¢ers is ', f0.3, ' degrees). This is not necessarily an error, &
384 &but such connections depart substantially from the assumptions of &
385 &the control-volume finite-difference method and may warrant a &
386 &closer look at the grid.')"
387 character(len=*),
parameter :: fmtdz = &
388 &
"('Cell ', i0, ' with thickness <= 0. Top, bot: ', 2(1pg24.15))"
389 character(len=*),
parameter :: fmtarea = &
390 &
"('Cell ', i0, ' with area <= 0. Area: ', 1(1pg24.15))"
391 character(len=*),
parameter :: fmtjan = &
392 &
"('Cell ', i0, ' must have its first connection be itself. Found: ', i0)"
393 character(len=*),
parameter :: fmtjam = &
394 &
"('Cell ', i0, ' has invalid connection in JA. Found: ', i0)"
395 character(len=*),
parameter :: fmterrmsg = &
396 "('Top elevation (', 1pg15.6, ') for cell ', i0, ' is above bottom &
397 &elevation (', 1pg15.6, ') for cell ', i0, '. Based on node numbering &
398 &rules cell ', i0, ' must be below cell ', i0, '.')"
401 do n = 1, this%nodesuser
412 write (
errmsg, fmtjan) n, m
417 do ipos = this%iainp(n) + 1, this%iainp(n + 1) - 1
419 if (m < 0 .or. m > this%nodesuser)
then
421 write (
errmsg, fmtjam) n, m
429 if (this%inunit > 0)
then
435 do n = 1, this%nodesuser
436 if (this%idomain(n) > 1 .or. this%idomain(n) < 0)
then
437 write (
errmsg, fmtidm) this%idomain(n), n
444 do n = 1, this%nodesuser
445 if (this%idomain(n) == 1)
then
446 dz = this%top1d(n) - this%bot1d(n)
447 if (dz <=
dzero)
then
448 write (
errmsg, fmt=fmtdz) n, this%top1d(n), this%bot1d(n)
451 if (this%area1d(n) <=
dzero)
then
452 write (
errmsg, fmt=fmtarea) n, this%area1d(n)
459 if (this%voffsettol <
dzero)
then
460 write (
errmsg,
'(a, 1pg15.6)') &
461 'Vertical offset tolerance must be greater than zero. Found ', &
464 if (this%inunit > 0)
then
471 do n = 1, this%nodesuser
472 do ipos = this%iainp(n) + 1, this%iainp(n + 1) - 1
474 ihc = this%ihcinp(ipos)
475 if (ihc == 0 .and. m > n)
then
476 dz = this%top1d(m) - this%bot1d(n)
477 if (dz > this%voffsettol)
then
478 write (
errmsg, fmterrmsg) this%top1d(m), m, this%bot1d(n), n, m, n
500 if (this%iangledegx == 1)
then
521 do n = 1, this%nodesuser
522 if (this%idomain(n) == 0) cycle
523 do ipos = this%iainp(n) + 1, this%iainp(n + 1) - 1
525 if (m < 1 .or. m > this%nodesuser) cycle
526 if (this%ihcinp(ipos) == 0) cycle
527 if (this%idomain(m) == 0) cycle
528 angn = this%angldegxinp(ipos)
534 do kpos = this%iainp(m) + 1, this%iainp(m + 1) - 1
535 if (this%jainp(kpos) == n)
then
541 angm = this%angldegxinp(jpos)
542 dang = modulo(angm - angn, 360.0_dp)
543 if (abs(dang - 180.0_dp) > angtol)
then
556 if (this%nvert > 0)
then
557 dx = this%cellxy(1, m) - this%cellxy(1, n)
558 dy = this%cellxy(2, m) - this%cellxy(2, n)
559 dist = sqrt(dx * dx + dy * dy)
560 if (dist >
dzero)
then
561 cosang = (cos(angn *
dpio180) * dx + &
562 sin(angn *
dpio180) * dy) / dist
563 angc = modulo(atan2(dy, dx) /
dpio180, 360.0_dp)
564 if (cosang <=
dzero)
then
572 else if (cosang < cos45)
then
587 call this%disu_face_normal(n, m, found, xnorm, ynorm)
589 angv = modulo(atan2(ynorm, xnorm) /
dpio180, 360.0_dp)
590 dang = abs(modulo(angn - angv + 180.0_dp, 360.0_dp) - 180.0_dp)
591 if (dang > angvtol)
then
605 this%nangldegxerr = nsym + ndir + nvrt
611 write (bigmsg, fmtangsym) nsym, angn_sym, n_sym, m_sym, &
612 angm_sym, m_sym, n_sym
614 call this%disu_write_warning(bigmsg)
617 write (bigmsg, fmtangdir) ndir, angn_dir, n_dir, m_dir, &
618 n_dir, m_dir, angc_dir
620 call this%disu_write_warning(bigmsg)
623 write (bigmsg, fmtangvrt) nvrt, angn_vrt, n_vrt, m_vrt, angv_vrt
625 call this%disu_write_warning(bigmsg)
628 write (bigmsg, fmtangwarn) nwarn, angn_warn, n_warn, m_warn, angc_warn
630 call this%disu_write_warning(bigmsg)
636 if (this%inunit > 0)
then
648 character(len=*),
intent(in) :: msg
650 if (this%iout > 0)
then
652 skipbefore=1, skipafter=1)
669 integer(I4B),
intent(in) :: n
670 integer(I4B),
intent(in) :: m
671 logical,
intent(out) :: found
672 real(DP),
intent(out) :: xnorm
673 real(DP),
intent(out) :: ynorm
675 integer(I4B) :: i, j, iv, jv, nshared
676 integer(I4B),
dimension(2) :: ivshared
677 real(DP) :: ex, ey, elen, dx, dy, tol
686 dx = this%cellxy(1, m) - this%cellxy(1, n)
687 dy = this%cellxy(2, m) - this%cellxy(2, n)
688 tol =
dem6 * sqrt(dx * dx + dy * dy)
692 do i = this%iavert(n), this%iavert(n + 1) - 1
694 if (any(this%javert(this%iavert(n):i - 1) == iv)) cycle
695 do j = this%iavert(m), this%iavert(m + 1) - 1
697 if (abs(this%vertices(1, jv) - this%vertices(1, iv)) <= tol .and. &
698 abs(this%vertices(2, jv) - this%vertices(2, iv)) <= tol)
then
699 nshared = nshared + 1
700 if (nshared > 2)
return
701 ivshared(nshared) = iv
706 if (nshared /= 2)
return
709 ex = this%vertices(1, ivshared(2)) - this%vertices(1, ivshared(1))
710 ey = this%vertices(2, ivshared(2)) - this%vertices(2, ivshared(1))
711 elen = sqrt(ex * ex + ey * ey)
712 if (elen <=
dzero)
return
715 if (xnorm * dx + ynorm * dy <
dzero)
then
741 if (this%readFromFile)
then
745 if (
associated(this%iavert))
then
765 call this%DisBaseType%dis_da()
774 integer(I4B),
intent(in) :: nodeu
775 character(len=*),
intent(inout) :: str
777 character(len=10) :: nstr
779 write (nstr,
'(i0)') nodeu
780 str =
'('//trim(adjustl(nstr))//
')'
788 integer(I4B),
intent(in) :: nodeu
789 integer(I4B),
dimension(:),
intent(inout) :: arr
791 integer(I4B) :: isize
795 if (isize /= this%ndim)
then
796 write (
errmsg,
'(a,i0,a,i0,a)') &
797 'Program error: nodeu_to_array size of array (', isize, &
798 ') is not equal to the discretization dimension (', this%ndim,
')'
813 character(len=LENVARNAME),
dimension(3) :: lenunits = &
814 &[character(len=LENVARNAME) ::
'FEET',
'METERS',
'CENTIMETERS']
818 call mem_set_value(this%lenuni,
'LENGTH_UNITS', this%input_mempath, &
819 lenunits, found%length_units)
820 call mem_set_value(this%nogrb,
'NOGRB', this%input_mempath, found%nogrb)
821 call mem_set_value(this%xorigin,
'XORIGIN', this%input_mempath, found%xorigin)
822 call mem_set_value(this%yorigin,
'YORIGIN', this%input_mempath, found%yorigin)
823 call mem_set_value(this%angrot,
'ANGROT', this%input_mempath, found%angrot)
824 call mem_set_value(this%voffsettol,
'VOFFSETTOL', this%input_mempath, &
828 if (this%iout > 0)
then
829 call this%log_options(found)
841 write (this%iout,
'(1x,a)')
'Setting Discretization Options'
843 if (found%length_units)
then
844 write (this%iout,
'(4x,a,i0)')
'Model length unit [0=UND, 1=FEET, &
845 &2=METERS, 3=CENTIMETERS] set as ', this%lenuni
848 if (found%nogrb)
then
849 write (this%iout,
'(4x,a,i0)')
'Binary grid file [0=GRB, 1=NOGRB] &
850 &set as ', this%nogrb
853 if (found%xorigin)
then
854 write (this%iout,
'(4x,a,G0)')
'XORIGIN = ', this%xorigin
857 if (found%yorigin)
then
858 write (this%iout,
'(4x,a,G0)')
'YORIGIN = ', this%yorigin
861 if (found%angrot)
then
862 write (this%iout,
'(4x,a,G0)')
'ANGROT = ', this%angrot
865 if (found%voffsettol)
then
866 write (this%iout,
'(4x,a,G0)')
'VERTICAL_OFFSET_TOLERANCE = ', &
870 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Options'
884 call mem_set_value(this%nodesuser,
'NODES', this%input_mempath, found%nodes)
885 call mem_set_value(this%njausr,
'NJA', this%input_mempath, found%nja)
886 call mem_set_value(this%nvert,
'NVERT', this%input_mempath, found%nvert)
889 if (this%iout > 0)
then
890 call this%log_dimensions(found)
894 if (this%nodesuser < 1)
then
896 'NODES was not specified or was specified incorrectly.')
898 if (this%njausr < 1)
then
900 'NJA was not specified or was specified incorrectly.')
909 this%readFromFile = .true.
910 call mem_allocate(this%top1d, this%nodesuser,
'TOP1D', this%memoryPath)
911 call mem_allocate(this%bot1d, this%nodesuser,
'BOT1D', this%memoryPath)
912 call mem_allocate(this%area1d, this%nodesuser,
'AREA1D', this%memoryPath)
913 call mem_allocate(this%idomain, this%nodesuser,
'IDOMAIN', this%memoryPath)
914 call mem_allocate(this%vertices, 2, this%nvert,
'VERTICES', this%memoryPath)
915 call mem_allocate(this%iainp, this%nodesuser + 1,
'IAINP', this%memoryPath)
916 call mem_allocate(this%jainp, this%njausr,
'JAINP', this%memoryPath)
917 call mem_allocate(this%ihcinp, this%njausr,
'IHCINP', this%memoryPath)
918 call mem_allocate(this%cl12inp, this%njausr,
'CL12INP', this%memoryPath)
919 call mem_allocate(this%hwvainp, this%njausr,
'HWVAINP', this%memoryPath)
920 call mem_allocate(this%angldegxinp, this%njausr,
'ANGLDEGXINP', &
922 if (this%nvert > 0)
then
923 call mem_allocate(this%cellxy, 2, this%nodesuser,
'CELLXY', this%memoryPath)
925 call mem_allocate(this%cellxy, 2, 0,
'CELLXY', this%memoryPath)
929 do n = 1, this%nodesuser
941 write (this%iout,
'(1x,a)')
'Setting Discretization Dimensions'
943 if (found%nodes)
then
944 write (this%iout,
'(4x,a,i0)')
'NODES = ', this%nodesuser
948 write (this%iout,
'(4x,a,i0)')
'NJA = ', this%njausr
951 if (found%nvert)
then
952 write (this%iout,
'(4x,a,i0)')
'NVERT = ', this%nvert
955 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Dimensions'
968 call mem_set_value(this%top1d,
'TOP', this%input_mempath, found%top)
969 call mem_set_value(this%bot1d,
'BOT', this%input_mempath, found%bot)
970 call mem_set_value(this%area1d,
'AREA', this%input_mempath, found%area)
971 call mem_set_value(this%idomain,
'IDOMAIN', this%input_mempath, found%idomain)
974 if (this%iout > 0)
then
975 call this%log_griddata(found)
987 write (this%iout,
'(1x,a)')
'Setting Discretization Griddata'
990 write (this%iout,
'(4x,a)')
'TOP set from input file'
994 write (this%iout,
'(4x,a)')
'BOT set from input file'
998 write (this%iout,
'(4x,a)')
'AREA set from input file'
1001 if (found%idomain)
then
1002 write (this%iout,
'(4x,a)')
'IDOMAIN set from input file'
1005 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Griddata'
1016 integer(I4B),
dimension(:),
contiguous,
pointer :: iac => null()
1020 call mem_set_value(this%jainp,
'JA', this%input_mempath, found%ja)
1021 call mem_set_value(this%ihcinp,
'IHC', this%input_mempath, found%ihc)
1022 call mem_set_value(this%cl12inp,
'CL12', this%input_mempath, found%cl12)
1023 call mem_set_value(this%hwvainp,
'HWVA', this%input_mempath, found%hwva)
1024 call mem_set_value(this%angldegxinp,
'ANGLDEGX', this%input_mempath, &
1028 call mem_setptr(iac,
'IAC', this%input_mempath)
1031 if (
associated(iac))
call iac_to_ia(iac, this%iainp)
1034 if (found%angldegx) this%iangledegx = 1
1037 if (this%iout > 0)
then
1038 call this%log_connectivity(found, iac)
1048 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: iac
1050 write (this%iout,
'(1x,a)')
'Setting Discretization Connectivity'
1052 if (
associated(iac))
then
1053 write (this%iout,
'(4x,a)')
'IAC set from input file'
1057 write (this%iout,
'(4x,a)')
'JA set from input file'
1061 write (this%iout,
'(4x,a)')
'IHC set from input file'
1064 if (found%cl12)
then
1065 write (this%iout,
'(4x,a)')
'CL12 set from input file'
1068 if (found%hwva)
then
1069 write (this%iout,
'(4x,a)')
'HWVA set from input file'
1072 if (found%angldegx)
then
1073 write (this%iout,
'(4x,a)')
'ANGLDEGX set from input file'
1076 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Connectivity'
1087 real(DP),
dimension(:),
contiguous,
pointer :: vert_x => null()
1088 real(DP),
dimension(:),
contiguous,
pointer :: vert_y => null()
1092 call mem_setptr(vert_x,
'XV', this%input_mempath)
1093 call mem_setptr(vert_y,
'YV', this%input_mempath)
1096 if (
associated(vert_x) .and.
associated(vert_y))
then
1097 do i = 1, this%nvert
1098 this%vertices(1, i) = vert_x(i)
1099 this%vertices(2, i) = vert_y(i)
1102 call store_error(
'Required Vertex arrays not found.')
1106 if (this%iout > 0)
then
1107 write (this%iout,
'(1x,a)')
'Discretization Vertex data loaded'
1121 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: icell2d
1122 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: ncvert
1123 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: icvert
1126 integer(I4B) :: i, j, ierr
1127 integer(I4B) :: icv_idx, startvert, maxnnz = 5
1130 call vert_spm%init(this%nodesuser, this%nvert, maxnnz)
1134 do i = 1, this%nodesuser
1135 if (icell2d(i) /= i)
call store_error(
'ICELL2D input sequence violation.')
1137 call vert_spm%addconnection(i, icvert(icv_idx), 0)
1139 startvert = icvert(icv_idx)
1140 elseif (j == ncvert(i) .and. (icvert(icv_idx) /= startvert))
then
1141 call vert_spm%addconnection(i, startvert, 0)
1143 icv_idx = icv_idx + 1
1148 call mem_allocate(this%iavert, this%nodesuser + 1,
'IAVERT', this%memoryPath)
1149 call mem_allocate(this%javert, vert_spm%nnz,
'JAVERT', this%memoryPath)
1150 call vert_spm%filliaja(this%iavert, this%javert, ierr)
1151 call vert_spm%destroy()
1161 integer(I4B),
dimension(:),
contiguous,
pointer :: icell2d => null()
1162 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert => null()
1163 integer(I4B),
dimension(:),
contiguous,
pointer :: icvert => null()
1164 real(DP),
dimension(:),
contiguous,
pointer :: cell_x => null()
1165 real(DP),
dimension(:),
contiguous,
pointer :: cell_y => null()
1169 call mem_setptr(icell2d,
'ICELL2D', this%input_mempath)
1170 call mem_setptr(ncvert,
'NCVERT', this%input_mempath)
1171 call mem_setptr(icvert,
'ICVERT', this%input_mempath)
1174 if (
associated(icell2d) .and.
associated(ncvert) &
1175 .and.
associated(icvert))
then
1176 call this%define_cellverts(icell2d, ncvert, icvert)
1178 call store_error(
'Required cell vertex arrays not found.')
1182 call mem_setptr(cell_x,
'XC', this%input_mempath)
1183 call mem_setptr(cell_y,
'YC', this%input_mempath)
1186 if (
associated(cell_x) .and.
associated(cell_y))
then
1187 do i = 1, this%nodesuser
1188 this%cellxy(1, i) = cell_x(i)
1189 this%cellxy(2, i) = cell_y(i)
1192 call store_error(
'Required cell center arrays not found.')
1196 if (this%iout > 0)
then
1197 write (this%iout,
'(1x,a)')
'Discretization Cell2d data loaded'
1215 integer(I4B),
dimension(:),
intent(in) :: icelltype
1217 integer(I4B) :: i, iunit, ntxt, version
1218 integer(I4B),
parameter :: lentxt = 100
1219 character(len=50) :: txthdr
1220 character(len=lentxt) :: txt
1221 character(len=LINELENGTH) :: fname
1222 character(len=LENBIGLINE) :: crs
1223 logical(LGP) :: found_crs
1225 character(len=*),
parameter :: fmtgrdsave = &
1226 "(4X,'BINARY GRID INFORMATION WILL BE WRITTEN TO:', &
1227 &/,6X,'UNIT NUMBER: ', I0,/,6X, 'FILE NAME: ', A)"
1232 if (this%nvert > 0) ntxt = ntxt + 5
1234 call mem_set_value(crs,
'CRS', this%input_mempath, found_crs)
1243 fname = trim(this%output_fname)
1245 write (this%iout, fmtgrdsave) iunit, trim(adjustl(fname))
1246 call openfile(iunit, this%iout, trim(adjustl(fname)),
'DATA(BINARY)', &
1250 write (txthdr,
'(a)')
'GRID DISU'
1251 txthdr(50:50) = new_line(
'a')
1252 write (iunit) txthdr
1253 write (txthdr,
'(a, i0)')
'VERSION ', version
1254 txthdr(50:50) = new_line(
'a')
1255 write (iunit) txthdr
1256 write (txthdr,
'(a, i0)')
'NTXT ', ntxt
1257 txthdr(50:50) = new_line(
'a')
1258 write (iunit) txthdr
1259 write (txthdr,
'(a, i0)')
'LENTXT ', lentxt
1260 txthdr(50:50) = new_line(
'a')
1261 write (iunit) txthdr
1264 write (txt,
'(3a, i0)')
'NODES ',
'INTEGER ',
'NDIM 0 # ', this%nodesuser
1265 txt(lentxt:lentxt) = new_line(
'a')
1267 write (txt,
'(3a, i0)')
'NJA ',
'INTEGER ',
'NDIM 0 # ', this%con%nja
1268 txt(lentxt:lentxt) = new_line(
'a')
1270 write (txt,
'(3a, 1pg24.15)')
'XORIGIN ',
'DOUBLE ',
'NDIM 0 # ', this%xorigin
1271 txt(lentxt:lentxt) = new_line(
'a')
1273 write (txt,
'(3a, 1pg24.15)')
'YORIGIN ',
'DOUBLE ',
'NDIM 0 # ', this%yorigin
1274 txt(lentxt:lentxt) = new_line(
'a')
1276 write (txt,
'(3a, 1pg24.15)')
'ANGROT ',
'DOUBLE ',
'NDIM 0 # ', this%angrot
1277 txt(lentxt:lentxt) = new_line(
'a')
1279 write (txt,
'(3a, i0)')
'TOP ',
'DOUBLE ',
'NDIM 1 ', this%nodesuser
1280 txt(lentxt:lentxt) = new_line(
'a')
1282 write (txt,
'(3a, i0)')
'BOT ',
'DOUBLE ',
'NDIM 1 ', this%nodesuser
1283 txt(lentxt:lentxt) = new_line(
'a')
1285 write (txt,
'(3a, i0)')
'IA ',
'INTEGER ',
'NDIM 1 ', this%nodesuser + 1
1286 txt(lentxt:lentxt) = new_line(
'a')
1288 write (txt,
'(3a, i0)')
'JA ',
'INTEGER ',
'NDIM 1 ', this%con%nja
1289 txt(lentxt:lentxt) = new_line(
'a')
1291 write (txt,
'(3a, i0)')
'IDOMAIN ',
'INTEGER ',
'NDIM 1 ', this%nodesuser
1292 txt(lentxt:lentxt) = new_line(
'a')
1294 write (txt,
'(3a, i0)')
'ICELLTYPE ',
'INTEGER ',
'NDIM 1 ', this%nodesuser
1295 txt(lentxt:lentxt) = new_line(
'a')
1299 if (this%nvert > 0)
then
1300 write (txt,
'(3a, i0)')
'VERTICES ',
'DOUBLE ',
'NDIM 2 2 ', this%nvert
1301 txt(lentxt:lentxt) = new_line(
'a')
1303 write (txt,
'(3a, i0)')
'CELLX ',
'DOUBLE ',
'NDIM 1 ', this%nodesuser
1304 txt(lentxt:lentxt) = new_line(
'a')
1306 write (txt,
'(3a, i0)')
'CELLY ',
'DOUBLE ',
'NDIM 1 ', this%nodesuser
1307 txt(lentxt:lentxt) = new_line(
'a')
1309 write (txt,
'(3a, i0)')
'IAVERT ',
'INTEGER ',
'NDIM 1 ', this%nodesuser + 1
1310 txt(lentxt:lentxt) = new_line(
'a')
1312 write (txt,
'(3a, i0)')
'JAVERT ',
'INTEGER ',
'NDIM 1 ',
size(this%javert)
1313 txt(lentxt:lentxt) = new_line(
'a')
1318 if (version == 2)
then
1320 write (txt,
'(3a, i0)')
'CRS ',
'CHARACTER ',
'NDIM 1 ', &
1322 txt(lentxt:lentxt) = new_line(
'a')
1328 write (iunit) this%nodesuser
1329 write (iunit) this%nja
1330 write (iunit) this%xorigin
1331 write (iunit) this%yorigin
1332 write (iunit) this%angrot
1333 write (iunit) this%top1d
1334 write (iunit) this%bot1d
1335 write (iunit) this%con%iausr
1336 write (iunit) this%con%jausr
1337 write (iunit) this%idomain
1338 write (iunit) icelltype
1341 if (this%nvert > 0)
then
1342 write (iunit) this%vertices
1343 write (iunit) (this%cellxy(1, i), i=1, this%nodesuser)
1344 write (iunit) (this%cellxy(2, i), i=1, this%nodesuser)
1345 write (iunit) this%iavert
1346 write (iunit) this%javert
1350 if (version == 2)
then
1351 if (found_crs)
write (iunit) trim(crs)
1362 class(
disutype),
intent(in) :: this
1363 integer(I4B),
intent(in) :: nodeu
1364 integer(I4B),
intent(in) :: icheck
1365 integer(I4B) :: nodenumber
1367 if (icheck /= 0)
then
1368 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
1369 write (
errmsg,
'(a,i0,a,i0,a)') &
1370 'Node number (', nodeu,
') is less than 1 or greater than nodes (', &
1371 this%nodesuser,
').'
1378 if (this%nodes == this%nodesuser)
then
1381 nodenumber = this%nodereduced(nodeu)
1394 integer(I4B),
intent(in) :: noden
1395 integer(I4B),
intent(in) :: nodem
1396 integer(I4B),
intent(in) :: ihc
1397 real(DP),
intent(inout) :: xcomp
1398 real(DP),
intent(inout) :: ycomp
1399 real(DP),
intent(inout) :: zcomp
1400 integer(I4B),
intent(in) :: ipos
1402 real(DP) :: angle, dmult
1410 if (nodem < noden)
then
1422 angle = this%con%anglex(this%con%jas(ipos))
1424 if (nodem < noden) dmult = -
done
1425 xcomp = cos(angle) * dmult
1426 ycomp = sin(angle) * dmult
1438 xcomp, ycomp, zcomp, conlen)
1441 integer(I4B),
intent(in) :: noden
1442 integer(I4B),
intent(in) :: nodem
1443 logical,
intent(in) :: nozee
1444 real(DP),
intent(in) :: satn
1445 real(DP),
intent(in) :: satm
1446 integer(I4B),
intent(in) :: ihc
1447 real(DP),
intent(inout) :: xcomp
1448 real(DP),
intent(inout) :: ycomp
1449 real(DP),
intent(inout) :: zcomp
1450 real(DP),
intent(inout) :: conlen
1452 real(DP) :: xn, xm, yn, ym, zn, zm
1456 if (
size(this%cellxy, 2) < 1)
then
1458 'Cannot calculate unit vector components for DISU grid if VERTEX '// &
1459 'data are not specified'
1473 zn = this%bot(noden) +
dhalf * (this%top(noden) - this%bot(noden))
1474 zm = this%bot(nodem) +
dhalf * (this%top(nodem) - this%bot(nodem))
1483 zn = this%bot(noden) +
dhalf * satn * (this%top(noden) - this%bot(noden))
1484 zm = this%bot(nodem) +
dhalf * satm * (this%top(nodem) - this%bot(nodem))
1498 class(
disutype),
intent(in) :: this
1499 character(len=*),
intent(out) :: dis_type
1508 class(
disutype),
intent(in) :: this
1509 integer(I4B) :: dis_enum
1518 character(len=*),
intent(in) :: name_model
1519 character(len=*),
intent(in) :: input_mempath
1522 call this%DisBaseType%allocate_scalars(name_model, input_mempath)
1525 call mem_allocate(this%njausr,
'NJAUSR', this%memoryPath)
1526 call mem_allocate(this%nvert,
'NVERT', this%memoryPath)
1527 call mem_allocate(this%nangldegxerr,
'NANGLDEGXERR', this%memoryPath)
1528 call mem_allocate(this%voffsettol,
'VOFFSETTOL', this%memoryPath)
1529 call mem_allocate(this%iangledegx,
'IANGLEDEGX', this%memoryPath)
1535 this%nangldegxerr = 0
1536 this%voffsettol =
dzero
1538 this%readFromFile = .false.
1549 call this%DisBaseType%allocate_arrays()
1552 if (this%nodes < this%nodesuser)
then
1553 call mem_allocate(this%nodeuser, this%nodes,
'NODEUSER', this%memoryPath)
1554 call mem_allocate(this%nodereduced, this%nodesuser,
'NODEREDUCED', &
1557 call mem_allocate(this%nodeuser, 1,
'NODEUSER', this%memoryPath)
1558 call mem_allocate(this%nodereduced, 1,
'NODEREDUCED', this%memoryPath)
1562 this%mshape(1) = this%nodesuser
1574 call mem_allocate(this%idomain, this%nodes,
'IDOMAIN', this%memoryPath)
1575 call mem_allocate(this%vertices, 2, this%nvert,
'VERTICES', this%memoryPath)
1576 if (this%icondir > 0)
then
1577 call mem_allocate(this%cellxy, 2, this%nodes,
'CELLXY', this%memoryPath)
1579 call mem_allocate(this%cellxy, 2, 0,
'CELLXY', this%memoryPath)
1591 flag_string, allow_zero)
result(nodeu)
1594 integer(I4B),
intent(inout) :: lloc
1595 integer(I4B),
intent(inout) :: istart
1596 integer(I4B),
intent(inout) :: istop
1597 integer(I4B),
intent(in) :: in
1598 integer(I4B),
intent(in) :: iout
1599 character(len=*),
intent(inout) :: line
1600 logical,
optional,
intent(in) :: flag_string
1601 logical,
optional,
intent(in) :: allow_zero
1602 integer(I4B) :: nodeu
1604 integer(I4B) :: lloclocal, ndum, istat, n
1607 if (
present(flag_string))
then
1608 if (flag_string)
then
1611 call urword(line, lloclocal, istart, istop, 1, ndum, r, iout, in)
1612 read (line(istart:istop), *, iostat=istat) n
1613 if (istat /= 0)
then
1621 call urword(line, lloc, istart, istop, 2, nodeu, r, iout, in)
1623 if (nodeu == 0)
then
1624 if (
present(allow_zero))
then
1625 if (allow_zero)
then
1631 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
1632 write (
errmsg,
'(a,i0,a)') &
1633 "Node number in list (", nodeu,
") is outside of the grid. "// &
1634 "Cell number cannot be determined in line '"// &
1635 trim(adjustl(line))//
"'."
1651 allow_zero)
result(nodeu)
1653 integer(I4B) :: nodeu
1656 character(len=*),
intent(inout) :: cellid
1657 integer(I4B),
intent(in) :: inunit
1658 integer(I4B),
intent(in) :: iout
1659 logical,
optional,
intent(in) :: flag_string
1660 logical,
optional,
intent(in) :: allow_zero
1662 integer(I4B) :: lloclocal, istart, istop, ndum, n
1663 integer(I4B) :: istat
1666 if (
present(flag_string))
then
1667 if (flag_string)
then
1670 call urword(cellid, lloclocal, istart, istop, 1, ndum, r, iout, inunit)
1671 read (cellid(istart:istop), *, iostat=istat) n
1672 if (istat /= 0)
then
1681 call urword(cellid, lloclocal, istart, istop, 2, nodeu, r, iout, inunit)
1683 if (nodeu == 0)
then
1684 if (
present(allow_zero))
then
1685 if (allow_zero)
then
1691 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
1692 write (
errmsg,
'(a,i0,a)') &
1693 "Cell number cannot be determined for cellid ("// &
1694 trim(adjustl(cellid))//
") and results in a user "// &
1695 "node number (", nodeu,
") that is outside of the grid."
1729 class(
disutype),
intent(inout) :: this
1730 character(len=*),
intent(inout) :: line
1731 integer(I4B),
intent(inout) :: lloc
1732 integer(I4B),
intent(inout) :: istart
1733 integer(I4B),
intent(inout) :: istop
1734 integer(I4B),
intent(in) :: in
1735 integer(I4B),
intent(in) :: iout
1736 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: iarray
1737 character(len=*),
intent(in) :: aname
1739 integer(I4B) :: nval
1740 integer(I4B),
dimension(:),
pointer,
contiguous :: itemp
1746 if (this%nodes < this%nodesuser)
then
1747 nval = this%nodesuser
1756 call readarray(in, itemp, aname, this%ndim, nval, iout, 0)
1759 if (this%nodes < this%nodesuser)
then
1760 call this%fill_grid_array(itemp, iarray)
1770 class(
disutype),
intent(inout) :: this
1771 character(len=*),
intent(inout) :: line
1772 integer(I4B),
intent(inout) :: lloc
1773 integer(I4B),
intent(inout) :: istart
1774 integer(I4B),
intent(inout) :: istop
1775 integer(I4B),
intent(in) :: in
1776 integer(I4B),
intent(in) :: iout
1777 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: darray
1778 character(len=*),
intent(in) :: aname
1780 integer(I4B) :: nval
1781 real(DP),
dimension(:),
pointer,
contiguous :: dtemp
1787 if (this%nodes < this%nodesuser)
then
1788 nval = this%nodesuser
1796 call readarray(in, dtemp, aname, this%ndim, nval, iout, 0)
1799 if (this%nodes < this%nodesuser)
then
1800 call this%fill_grid_array(dtemp, darray)
1811 cdatafmp, nvaluesp, nwidthp, editdesc, dinact)
1813 class(
disutype),
intent(inout) :: this
1814 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: darray
1815 integer(I4B),
intent(in) :: iout
1816 integer(I4B),
intent(in) :: iprint
1817 integer(I4B),
intent(in) :: idataun
1818 character(len=*),
intent(in) :: aname
1819 character(len=*),
intent(in) :: cdatafmp
1820 integer(I4B),
intent(in) :: nvaluesp
1821 integer(I4B),
intent(in) :: nwidthp
1822 character(len=*),
intent(in) :: editdesc
1823 real(DP),
intent(in) :: dinact
1825 integer(I4B) :: k, ifirst
1826 integer(I4B) :: nlay
1827 integer(I4B) :: nrow
1828 integer(I4B) :: ncol
1829 integer(I4B) :: nval
1830 integer(I4B) :: nodeu, noder
1831 integer(I4B) :: istart, istop
1832 real(DP),
dimension(:),
pointer,
contiguous :: dtemp
1834 character(len=*),
parameter :: fmthsv = &
1835 "(1X,/1X,a,' WILL BE SAVED ON UNIT ',I4, &
1836 &' AT END OF TIME STEP',I5,', STRESS PERIOD ',I4)"
1841 ncol = this%mshape(1)
1845 if (this%nodes < this%nodesuser)
then
1848 do nodeu = 1, this%nodesuser
1849 noder = this%get_nodenumber(nodeu, 0)
1850 if (noder <= 0)
then
1851 dtemp(nodeu) = dinact
1854 dtemp(nodeu) = darray(noder)
1862 if (iprint /= 0)
then
1865 istop = istart + nrow * ncol - 1
1867 aname, cdatafmp, nvaluesp, nwidthp, editdesc)
1873 if (idataun > 0)
then
1878 istop = istart + nrow * ncol - 1
1879 if (ifirst == 1)
write (iout, fmthsv) &
1880 trim(adjustl(aname)), idataun, &
1887 elseif (idataun < 0)
then
1890 call ubdsv1(
kstp,
kper, aname, -idataun, dtemp, ncol, nrow, nlay, &
1899 dstmodel, dstpackage, naux, auxtxt, &
1900 ibdchn, nlist, iout)
1903 character(len=16),
intent(in) :: text
1904 character(len=16),
intent(in) :: textmodel
1905 character(len=16),
intent(in) :: textpackage
1906 character(len=16),
intent(in) :: dstmodel
1907 character(len=16),
intent(in) :: dstpackage
1908 integer(I4B),
intent(in) :: naux
1909 character(len=16),
dimension(:),
intent(in) :: auxtxt
1910 integer(I4B),
intent(in) :: ibdchn
1911 integer(I4B),
intent(in) :: nlist
1912 integer(I4B),
intent(in) :: iout
1914 integer(I4B) :: nlay, nrow, ncol
1918 ncol = this%mshape(1)
1921 call ubdsv06(
kstp,
kper, text, textmodel, textpackage, dstmodel, dstpackage, &
1922 ibdchn, naux, auxtxt, ncol, nrow, nlay, &
1937 class(
disutype),
intent(inout) :: this
1938 integer(I4B),
intent(in) :: ic
1939 real(DP),
allocatable,
intent(out) :: polyverts(:, :)
1940 logical(LGP),
intent(in),
optional :: closed
1942 integer(I4B) :: icu, iavert, nverts, m, j
1943 logical(LGP) :: lclosed
1946 nverts = this%get_npolyverts(ic)
1947 if (nverts == 0)
then
1948 allocate (polyverts(2, 0))
1953 if (.not. (
present(closed)))
then
1961 allocate (polyverts(2, nverts + 1))
1963 allocate (polyverts(2, nverts))
1967 icu = this%get_nodeuser(ic)
1968 iavert = this%iavert(icu)
1970 j = this%javert(iavert - 1 + m)
1971 polyverts(:, m) = (/this%vertices(1, j), this%vertices(2, j)/)
1976 polyverts(:, nverts + 1) = polyverts(:, 1)
1982 class(
disutype),
intent(inout) :: this
1983 integer(I4B),
intent(in) :: ic
1984 logical(LGP),
intent(in),
optional :: closed
1985 integer(I4B) :: npolyverts
1990 if (this%nvert < 1)
then
1995 icu = this%get_nodeuser(ic)
1996 npolyverts = this%iavert(icu + 1) - this%iavert(icu) - 1
1997 if (
present(closed))
then
1998 if (closed) npolyverts = npolyverts + 1
2004 class(
disutype),
intent(inout) :: this
2005 logical(LGP),
intent(in),
optional :: closed
2006 integer(I4B) :: max_npolyverts
2010 do ic = 1, this%nodes
2011 max_npolyverts = max(max_npolyverts, this%get_npolyverts(ic, closed))
2017 class(*),
pointer :: dis
subroutine, public iac_to_ia(iac, ia)
Convert an iac array into an ia array.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenbigline
maximum length of a big line
@ disu
DISV6 discretization.
integer(i4b), parameter lenvarname
maximum length of a variable name
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dpio180
real constant
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
subroutine allocate_scalars(this, name_model, input_mempath)
Allocate and initialize scalar variables.
subroutine write_grb(this, icelltype)
Write a binary grid file.
subroutine allocate_arrays(this)
Allocate and initialize arrays.
subroutine disu_load(this)
Transfer IDM data into this discretization object.
subroutine get_polyverts(this, ic, polyverts, closed)
Cast base to DISU.
subroutine source_connectivity(this)
Copy grid connectivity info from IDM into package.
subroutine, public disu_cr(dis, name_model, input_mempath, inunit, iout)
Create a new unstructured discretization object.
subroutine source_dimensions(this)
Copy dimensions from IDM into package.
subroutine source_options(this)
Copy options from IDM into package.
subroutine log_dimensions(this, found)
Write dimensions to list file.
subroutine disu_da(this)
Deallocate variables.
class(disutype) function, pointer, public castasdisutype(dis)
integer(i4b) function get_ncpl(this)
Get number of cells per layer (total nodes since DISU isn't layered)
subroutine define_cellverts(this, icell2d, ncvert, icvert)
Build data structures to hold cell vertex info.
subroutine read_dbl_array(this, line, lloc, istart, istop, iout, in, darray, aname)
Read a double precision array.
integer(i4b) function nodeu_from_cellid(this, cellid, inunit, iout, flag_string, allow_zero)
Convert a cellid string to a user nodenumber.
subroutine disu_face_normal(this, n, m, found, xnorm, ynorm)
Outward normal of the face shared by two cells from the vertices.
subroutine log_options(this, found)
Write user options to list file.
subroutine record_srcdst_list_header(this, text, textmodel, textpackage, dstmodel, dstpackage, naux, auxtxt, ibdchn, nlist, iout)
Record list header for imeth=6.
subroutine get_dis_type(this, dis_type)
Get the discretization type.
subroutine source_vertices(this)
Copy grid vertex data from IDM into package.
integer(i4b) function get_max_npolyverts(this, closed)
Get the maximum number of cell polygon vertices.
subroutine source_cell2d(this)
Copy cell2d data from IDM into package.
subroutine log_griddata(this, found)
Write griddata found to list file.
subroutine allocate_arrays_mem(this)
Allocate arrays in memory manager.
subroutine source_griddata(this)
Copy grid data from IDM into package.
subroutine nodeu_to_array(this, nodeu, arr)
Convert a user nodenumber to an array (nodenumber)
subroutine connection_vector(this, noden, nodem, nozee, satn, satm, ihc, xcomp, ycomp, zcomp, conlen)
Get unit vector components between the cell and a given neighbor.
subroutine record_array(this, darray, iout, iprint, idataun, aname, cdatafmp, nvaluesp, nwidthp, editdesc, dinact)
Record a double precision array.
subroutine disu_df(this)
Define the discretization.
logical function supports_layers(this)
Indicates whether the grid discretization supports layers.
subroutine read_int_array(this, line, lloc, istart, istop, iout, in, iarray, aname)
Read an integer array.
subroutine grid_finalize(this)
Finalize the grid.
subroutine disu_write_warning(this, msg)
Write a warning message to the model listing file.
integer(i4b) function get_nodenumber_idx1(this, nodeu, icheck)
Get reduced node number from user node number.
subroutine nodeu_to_string(this, nodeu, str)
Convert a user nodenumber to a string (nodenumber)
integer(i4b) function nodeu_from_string(this, lloc, istart, istop, in, iout, line, flag_string, allow_zero)
Convert a string to a user nodenumber.
subroutine disu_ck(this)
Check discretization info.
integer(i4b) function get_dis_enum(this)
Get the discretization type enumeration.
subroutine log_connectivity(this, found, iac)
Write griddata found to list file.
subroutine connection_normal(this, noden, nodem, ihc, xcomp, ycomp, zcomp, ipos)
Get normal vector components between the cell and a given neighbor.
integer(i4b) function get_npolyverts(this, ic, closed)
Get the number of cell polygon vertices, 0 if none are defined.
subroutine, public line_unit_vector(x0, y0, z0, x1, y1, z1, xcomp, ycomp, zcomp, vmag)
Calculate the vector components (xcomp, ycomp, and zcomp) for a line defined by two points,...
This module defines variable data types.
subroutine, public memorystore_remove(component, subcomponent, context)
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
Store and issue logging messages to output units.
subroutine, public write_message_counter(text, iunit, icount, iwidth, skipbefore, skipafter)
Write a message with configurable indentation and numbering.
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) idm_context
real(dp), pointer, public pertim
time relative to start of stress period
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
Unstructured grid discretization.