24 integer(I4B),
pointer :: nrow => null()
25 integer(I4B),
pointer :: ncol => null()
26 real(dp),
dimension(:),
pointer,
contiguous :: delr => null()
27 real(dp),
dimension(:),
pointer,
contiguous :: delc => null()
28 real(dp),
dimension(:, :),
pointer,
contiguous :: bottom => null()
29 integer(I4B),
dimension(:, :),
pointer,
contiguous :: idomain => null()
30 real(dp),
dimension(:),
pointer,
contiguous :: cellx => null()
31 real(dp),
dimension(:),
pointer,
contiguous :: celly => null()
76 logical :: length_units = .false.
77 logical :: nogrb = .false.
78 logical :: xorigin = .false.
79 logical :: yorigin = .false.
80 logical :: angrot = .false.
81 logical :: nrow = .false.
82 logical :: ncol = .false.
83 logical :: delr = .false.
84 logical :: delc = .false.
85 logical :: bottom = .false.
86 logical :: idomain = .false.
93 subroutine dis2d_cr(dis, name_model, input_mempath, inunit, iout)
96 character(len=*),
intent(in) :: name_model
97 character(len=*),
intent(in) :: input_mempath
98 integer(I4B),
intent(in) :: inunit
99 integer(I4B),
intent(in) :: iout
103 character(len=*),
parameter :: fmtheader = &
104 "(1X, /1X, 'DIS -- STRUCTURED GRID DISCRETIZATION PACKAGE,', &
105 &' VERSION 2 : 3/27/2014 - INPUT READ FROM MEMPATH: ', A, /)"
109 call disnew%allocate_scalars(name_model, input_mempath)
118 write (iout, fmtheader) dis%input_mempath
131 if (this%inunit /= 0)
then
134 call this%source_options()
137 call this%source_dimensions()
140 call this%source_griddata()
144 call this%grid_finalize()
158 call this%DisBaseType%dis_da()
182 character(len=LENVARNAME),
dimension(3) :: lenunits = &
183 &[character(len=LENVARNAME) ::
'FEET',
'METERS',
'CENTIMETERS']
187 call mem_set_value(this%lenuni,
'LENGTH_UNITS', this%input_mempath, &
188 lenunits, found%length_units)
189 call mem_set_value(this%nogrb,
'NOGRB', this%input_mempath, found%nogrb)
190 call mem_set_value(this%xorigin,
'XORIGIN', this%input_mempath, found%xorigin)
191 call mem_set_value(this%yorigin,
'YORIGIN', this%input_mempath, found%yorigin)
192 call mem_set_value(this%angrot,
'ANGROT', this%input_mempath, found%angrot)
195 if (this%iout > 0)
then
196 call this%log_options(found)
208 write (this%iout,
'(1x,a)')
'Setting Discretization Options'
210 if (found%length_units)
then
211 write (this%iout,
'(4x,a,i0)')
'Model length unit [0=UND, 1=FEET, &
212 &2=METERS, 3=CENTIMETERS] set as ', this%lenuni
215 if (found%nogrb)
then
216 write (this%iout,
'(4x,a,i0)')
'Binary grid file [0=GRB, 1=NOGRB] &
217 &set as ', this%nogrb
220 if (found%xorigin)
then
221 write (this%iout,
'(4x,a,G0)')
'XORIGIN = ', this%xorigin
224 if (found%yorigin)
then
225 write (this%iout,
'(4x,a,G0)')
'YORIGIN = ', this%yorigin
228 if (found%angrot)
then
229 write (this%iout,
'(4x,a,G0)')
'ANGROT = ', this%angrot
232 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Options'
246 call mem_set_value(this%nrow,
'NROW', this%input_mempath, found%nrow)
247 call mem_set_value(this%ncol,
'NCOL', this%input_mempath, found%ncol)
250 if (this%iout > 0)
then
251 call this%log_dimensions(found)
255 if (this%nrow < 1)
then
257 'NROW was not specified or was specified incorrectly.')
260 if (this%ncol < 1)
then
262 'NCOL was not specified or was specified incorrectly.')
267 this%nodesuser = this%nrow * this%ncol
270 call mem_allocate(this%delr, this%ncol,
'DELR', this%memoryPath)
271 call mem_allocate(this%delc, this%nrow,
'DELC', this%memoryPath)
272 call mem_allocate(this%idomain, this%ncol, this%nrow,
'IDOMAIN', &
274 call mem_allocate(this%bottom, this%ncol, this%nrow,
'BOTTOM', &
276 call mem_allocate(this%cellx, this%ncol,
'CELLX', this%memoryPath)
277 call mem_allocate(this%celly, this%nrow,
'CELLY', this%memoryPath)
282 this%idomain(j, i) = 1
295 write (this%iout,
'(1x,a)')
'Setting Discretization Dimensions'
298 write (this%iout,
'(4x,a,i0)')
'NROW = ', this%nrow
302 write (this%iout,
'(4x,a,i0)')
'NCOL = ', this%ncol
305 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Dimensions'
317 call mem_set_value(this%delr,
'DELR', this%input_mempath, found%delr)
318 call mem_set_value(this%delc,
'DELC', this%input_mempath, found%delc)
319 call mem_set_value(this%bottom,
'BOTTOM', this%input_mempath, found%bottom)
320 call mem_set_value(this%idomain,
'IDOMAIN', this%input_mempath, found%idomain)
323 if (this%iout > 0)
then
324 call this%log_griddata(found)
336 write (this%iout,
'(1x,a)')
'Setting Discretization Griddata'
339 write (this%iout,
'(4x,a)')
'DELR set from input file'
343 write (this%iout,
'(4x,a)')
'DELC set from input file'
346 if (found%bottom)
then
347 write (this%iout,
'(4x,a)')
'BOTTOM set from input file'
350 if (found%idomain)
then
351 write (this%iout,
'(4x,a)')
'IDOMAIN set from input file'
354 write (this%iout,
'(1x,a,/)')
'End Setting Discretization Griddata'
368 integer(I4B) :: noder
369 integer(I4B) :: nrsize
371 character(len=*),
parameter :: fmtdz = &
372 "('CELL (',i0,',',i0,',',i0,') THICKNESS <= 0. ', &
373 &'TOP, BOT: ',2(1pg24.15))"
374 character(len=*),
parameter :: fmtnr = &
375 "(/1x, 'The specified IDOMAIN results in a reduced number of cells.',&
376 &/1x, 'Number of user nodes: ',I0,&
377 &/1X, 'Number of nodes in solution: ', I0, //)"
383 if (this%idomain(j, i) > 0) this%nodes = this%nodes + 1
388 if (this%nodes == 0)
then
389 call store_error(
'Model does not have any active nodes. &
390 &Ensure IDOMAIN array has some values greater &
396 if (this%nodes < this%nodesuser)
then
397 write (this%iout, fmtnr) this%nodesuser, this%nodes
401 call this%allocate_arrays()
407 if (this%nodes < this%nodesuser)
then
412 if (this%idomain(j, i) > 0)
then
413 this%nodereduced(node) = noder
415 elseif (this%idomain(j, i) < 0)
then
416 this%nodereduced(node) = -1
418 this%nodereduced(node) = 0
426 if (this%nodes < this%nodesuser)
then
431 if (this%idomain(j, i) > 0)
then
432 this%nodeuser(noder) = node
441 this%cellx(1) =
dhalf * this%delr(1)
442 this%celly(this%nrow) =
dhalf * this%delc(this%nrow)
444 this%cellx(j) = this%cellx(j - 1) +
dhalf * this%delr(j - 1) + &
448 do i = this%nrow - 1, 1, -1
449 this%celly(i) = this%celly(i + 1) +
dhalf * this%delc(i + 1) + &
459 if (this%nodes < this%nodesuser) noder = this%nodereduced(node)
460 if (noder <= 0) cycle
461 this%bot(noder) = this%bottom(j, i)
462 this%area(noder) = this%delr(j) * this%delc(i)
463 this%xc(noder) = this%cellx(j)
464 this%yc(noder) = this%celly(i)
470 if (this%nodes < this%nodesuser) nrsize = this%nodes
472 call this%con%disconnections(this%name_model, this%nodes, &
473 this%ncol, this%nrow, 1, &
474 nrsize, this%delr, this%delc, &
475 this%top, this%bot, this%nodereduced, &
477 this%nja = this%con%nja
478 this%njas = this%con%njas
490 integer(I4B),
dimension(:),
intent(in) :: icelltype
492 integer(I4B) :: iunit, ntxt, version
493 integer(I4B),
parameter :: lentxt = 100
494 character(len=50) :: txthdr
495 character(len=lentxt) :: txt
496 character(len=LINELENGTH) :: fname
497 character(len=LENBIGLINE) :: crs
498 logical(LGP) :: found_crs
499 character(len=*),
parameter :: fmtgrdsave = &
500 "(4X,'BINARY GRID INFORMATION WILL BE WRITTEN TO:', &
501 &/,6X,'UNIT NUMBER: ', I0,/,6X, 'FILE NAME: ', A)"
507 call mem_set_value(crs,
'CRS', this%input_mempath, found_crs)
516 fname = trim(this%output_fname)
518 write (this%iout, fmtgrdsave) iunit, trim(adjustl(fname))
519 call openfile(iunit, this%iout, trim(adjustl(fname)),
'DATA(BINARY)', &
523 write (txthdr,
'(a)')
'GRID DIS2D'
524 txthdr(50:50) = new_line(
'a')
526 write (txthdr,
'(a)')
'VERSION 1'
527 txthdr(50:50) = new_line(
'a')
529 write (txthdr,
'(a, i0)')
'NTXT ', ntxt
530 txthdr(50:50) = new_line(
'a')
532 write (txthdr,
'(a, i0)')
'LENTXT ', lentxt
533 txthdr(50:50) = new_line(
'a')
537 write (txt,
'(3a, i0)')
'NCELLS ',
'INTEGER ',
'NDIM 0 # ', this%nodesuser
538 txt(lentxt:lentxt) = new_line(
'a')
540 write (txt,
'(3a, i0)')
'NROW ',
'INTEGER ',
'NDIM 0 # ', this%nrow
541 txt(lentxt:lentxt) = new_line(
'a')
543 write (txt,
'(3a, i0)')
'NCOL ',
'INTEGER ',
'NDIM 0 # ', this%ncol
544 txt(lentxt:lentxt) = new_line(
'a')
546 write (txt,
'(3a, i0)')
'NJA ',
'INTEGER ',
'NDIM 0 # ', this%nja
547 txt(lentxt:lentxt) = new_line(
'a')
549 write (txt,
'(3a, 1pg24.15)')
'XORIGIN ',
'DOUBLE ',
'NDIM 0 # ', this%xorigin
550 txt(lentxt:lentxt) = new_line(
'a')
552 write (txt,
'(3a, 1pg24.15)')
'YORIGIN ',
'DOUBLE ',
'NDIM 0 # ', this%yorigin
553 txt(lentxt:lentxt) = new_line(
'a')
555 write (txt,
'(3a, 1pg24.15)')
'ANGROT ',
'DOUBLE ',
'NDIM 0 # ', this%angrot
556 txt(lentxt:lentxt) = new_line(
'a')
558 write (txt,
'(3a, i0)')
'DELR ',
'DOUBLE ',
'NDIM 1 ', this%ncol
559 txt(lentxt:lentxt) = new_line(
'a')
561 write (txt,
'(3a, i0)')
'DELC ',
'DOUBLE ',
'NDIM 1 ', this%nrow
562 txt(lentxt:lentxt) = new_line(
'a')
564 write (txt,
'(3a, i0)')
'BOTM ',
'DOUBLE ',
'NDIM 1 ', this%nodesuser
565 txt(lentxt:lentxt) = new_line(
'a')
567 write (txt,
'(3a, i0)')
'IA ',
'INTEGER ',
'NDIM 1 ', this%nodesuser + 1
568 txt(lentxt:lentxt) = new_line(
'a')
570 write (txt,
'(3a, i0)')
'JA ',
'INTEGER ',
'NDIM 1 ',
size(this%con%jausr)
571 txt(lentxt:lentxt) = new_line(
'a')
573 write (txt,
'(3a, i0)')
'IDOMAIN ',
'INTEGER ',
'NDIM 1 ', this%nodesuser
574 txt(lentxt:lentxt) = new_line(
'a')
576 write (txt,
'(3a, i0)')
'ICELLTYPE ',
'INTEGER ',
'NDIM 1 ', this%nodesuser
577 txt(lentxt:lentxt) = new_line(
'a')
581 if (version == 2)
then
583 write (txt,
'(3a, i0)')
'CRS ',
'CHARACTER ',
'NDIM 1 ', &
585 txt(lentxt:lentxt) = new_line(
'a')
591 write (iunit) this%nodesuser
592 write (iunit) this%nrow
593 write (iunit) this%ncol
594 write (iunit) this%nja
595 write (iunit) this%xorigin
596 write (iunit) this%yorigin
597 write (iunit) this%angrot
598 write (iunit) this%delr
599 write (iunit) this%delc
600 write (iunit) this%bottom
601 write (iunit) this%con%iausr
602 write (iunit) this%con%jausr
603 write (iunit) this%idomain
604 write (iunit) icelltype
607 if (version == 2)
then
608 if (found_crs)
write (iunit) trim(crs)
621 integer(I4B),
intent(in) :: nodeu
622 character(len=*),
intent(inout) :: str
624 integer(I4B) :: i, j, k
625 character(len=10) :: istr, jstr
627 call get_ijk(nodeu, this%nrow, this%ncol, 1, i, j, k)
628 write (istr,
'(i10)') i
629 write (jstr,
'(i10)') j
630 str =
'('//trim(adjustl(istr))//
','// &
631 trim(adjustl(jstr))//
')'
640 integer(I4B),
intent(in) :: nodeu
641 integer(I4B),
dimension(:),
intent(inout) :: arr
643 integer(I4B) :: isize
644 integer(I4B) :: i, j, k
648 if (isize /= this%ndim)
then
649 write (
errmsg,
'(a,i0,a,i0,a)') &
650 'Program error: nodeu_to_array size of array (', isize, &
651 ') is not equal to the discretization dimension (', this%ndim,
')'
656 call get_ijk(nodeu, this%nrow, this%ncol, 1, i, j, k)
668 integer(I4B) :: nodenumber
671 integer(I4B),
intent(in) :: nodeu
672 integer(I4B),
intent(in) :: icheck
675 if (icheck /= 0)
then
678 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
679 write (
errmsg,
'(a,i0,a)') &
680 'Node number (', nodeu, &
681 ') less than 1 or greater than the number of nodes.'
686 if (this%nodes < this%nodesuser) nodenumber = this%nodereduced(nodeu)
690 if (this%nodes < this%nodesuser) nodenumber = this%nodereduced(nodeu)
699 integer(I4B) :: nodenumber
702 integer(I4B),
intent(in) :: k, j
703 integer(I4B),
intent(in) :: icheck
705 integer(I4B) :: nodeu, i
707 character(len=*),
parameter :: fmterr = &
708 "('Error in structured-grid cell indices: row = ',i0,&
712 nodeu =
get_node(1, i, j, 1, this%nrow, this%ncol)
714 write (
errmsg, fmterr) i, j
718 if (this%nodes < this%nodesuser) nodenumber = this%nodereduced(nodeu)
721 if (icheck /= 0)
then
723 if (i < 1 .or. i > this%nrow) &
724 call store_error(
'Row less than one or greater than nrow')
725 if (j < 1 .or. j > this%ncol) &
726 call store_error(
'Column less than one or greater than ncol')
729 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
730 write (
errmsg,
'(a,i0,a)') &
731 'Node number (', nodeu,
')less than 1 or greater than nodes.'
743 character(len=*),
intent(in) :: name_model
744 character(len=*),
intent(in) :: input_mempath
747 call this%DisBaseType%allocate_scalars(name_model, input_mempath)
767 call this%DisBaseType%allocate_arrays()
770 if (this%nodes < this%nodesuser)
then
771 call mem_allocate(this%nodeuser, this%nodes,
'NODEUSER', this%memoryPath)
772 call mem_allocate(this%nodereduced, this%nodesuser,
'NODEREDUCED', &
775 call mem_allocate(this%nodeuser, 1,
'NODEUSER', this%memoryPath)
776 call mem_allocate(this%nodereduced, 1,
'NODEREDUCED', this%memoryPath)
780 this%mshape(1) = this%nrow
781 this%mshape(2) = this%ncol
792 flag_string, allow_zero)
result(nodeu)
795 integer(I4B),
intent(inout) :: lloc
796 integer(I4B),
intent(inout) :: istart
797 integer(I4B),
intent(inout) :: istop
798 integer(I4B),
intent(in) :: in
799 integer(I4B),
intent(in) :: iout
800 character(len=*),
intent(inout) :: line
801 logical,
optional,
intent(in) :: flag_string
802 logical,
optional,
intent(in) :: allow_zero
803 integer(I4B) :: nodeu
805 integer(I4B) :: i, j, nrow, ncol
806 integer(I4B) :: lloclocal, ndum, istat, n
809 if (
present(flag_string))
then
810 if (flag_string)
then
813 call urword(line, lloclocal, istart, istop, 1, ndum, r, iout, in)
814 read (line(istart:istop), *, iostat=istat) n
823 nrow = this%mshape(1)
824 ncol = this%mshape(2)
826 call urword(line, lloc, istart, istop, 2, i, r, iout, in)
827 call urword(line, lloc, istart, istop, 2, j, r, iout, in)
829 if (i == 0 .and. j == 0)
then
830 if (
present(allow_zero))
then
840 if (i < 1 .or. i > nrow)
then
841 write (
errmsg,
'(a,1x,a,i0,a)') &
842 trim(adjustl(
errmsg)),
'Row number in list (', i, &
843 ') is outside of the grid.'
845 if (j < 1 .or. j > ncol)
then
846 write (
errmsg,
'(a,1x,a,i0,a)') &
847 trim(adjustl(
errmsg)),
'Column number in list (', j, &
848 ') is outside of the grid.'
851 nodeu =
get_node(1, i, j, 1, nrow, ncol)
853 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
854 write (
errmsg,
'(a,1x,a,i0,a)') &
856 "Node number in list (", nodeu,
") is outside of the grid. "// &
857 "Cell number cannot be determined in line '"// &
858 trim(adjustl(line))//
"'."
861 if (len_trim(adjustl(
errmsg)) > 0)
then
877 allow_zero)
result(nodeu)
879 integer(I4B) :: nodeu
882 character(len=*),
intent(inout) :: cellid
883 integer(I4B),
intent(in) :: inunit
884 integer(I4B),
intent(in) :: iout
885 logical,
optional,
intent(in) :: flag_string
886 logical,
optional,
intent(in) :: allow_zero
888 integer(I4B) :: lloclocal, istart, istop, ndum, n
889 integer(I4B) :: i, j, nrow, ncol
890 integer(I4B) :: istat
893 if (
present(flag_string))
then
894 if (flag_string)
then
897 call urword(cellid, lloclocal, istart, istop, 1, ndum, r, iout, inunit)
898 read (cellid(istart:istop), *, iostat=istat) n
907 nrow = this%mshape(1)
908 ncol = this%mshape(2)
911 call urword(cellid, lloclocal, istart, istop, 2, i, r, iout, inunit)
912 call urword(cellid, lloclocal, istart, istop, 2, j, r, iout, inunit)
914 if (i == 0 .and. j == 0)
then
915 if (
present(allow_zero))
then
925 if (i < 1 .or. i > nrow)
then
926 write (
errmsg,
'(a,1x,a,i0,a)') &
927 trim(adjustl(
errmsg)),
'Row number in list (', i, &
928 ') is outside of the grid.'
930 if (j < 1 .or. j > ncol)
then
931 write (
errmsg,
'(a,1x,a,i0,a)') &
932 trim(adjustl(
errmsg)),
'Column number in list (', j, &
933 ') is outside of the grid.'
936 nodeu =
get_node(1, i, j, 1, nrow, ncol)
938 if (nodeu < 1 .or. nodeu > this%nodesuser)
then
939 write (
errmsg,
'(a,1x,a,i0,a)') &
941 "Cell number cannot be determined for cellid ("// &
942 trim(adjustl(cellid))//
") and results in a user "// &
943 "node number (", nodeu,
") that is outside of the grid."
946 if (len_trim(adjustl(
errmsg)) > 0)
then
979 integer(I4B),
intent(in) :: noden
980 integer(I4B),
intent(in) :: nodem
981 integer(I4B),
intent(in) :: ihc
982 real(DP),
intent(inout) :: xcomp
983 real(DP),
intent(inout) :: ycomp
984 real(DP),
intent(inout) :: zcomp
985 integer(I4B),
intent(in) :: ipos
987 integer(I4B) :: nodeu1, i1, j1, k1
988 integer(I4B) :: nodeu2, i2, j2, k2
994 if (nodem < noden)
then
1007 nodeu1 = this%get_nodeuser(noden)
1008 nodeu2 = this%get_nodeuser(nodem)
1009 call get_ijk(nodeu1, this%nrow, this%ncol, 1, i1, j1, k1)
1010 call get_ijk(nodeu2, this%nrow, this%ncol, 1, i2, j2, k2)
1013 elseif (j2 < j1)
then
1015 elseif (j2 > j1)
then
1029 xcomp, ycomp, zcomp, conlen)
1034 integer(I4B),
intent(in) :: noden
1035 integer(I4B),
intent(in) :: nodem
1036 logical,
intent(in) :: nozee
1037 real(DP),
intent(in) :: satn
1038 real(DP),
intent(in) :: satm
1039 integer(I4B),
intent(in) :: ihc
1040 real(DP),
intent(inout) :: xcomp
1041 real(DP),
intent(inout) :: ycomp
1042 real(DP),
intent(inout) :: zcomp
1043 real(DP),
intent(inout) :: conlen
1046 real(DP) :: x1, y1, x2, y2
1048 integer(I4B) :: i1, i2, j1, j2, k1, k2
1049 integer(I4B) :: nodeu1, nodeu2, ipos
1054 ipos = this%con%getjaindex(noden, nodem)
1055 ds = this%con%cl1(this%con%jas(ipos)) + this%con%cl2(this%con%jas(ipos))
1056 nodeu1 = this%get_nodeuser(noden)
1057 nodeu2 = this%get_nodeuser(nodem)
1058 call get_ijk(nodeu1, this%nrow, this%ncol, 1, i1, j1, k1)
1059 call get_ijk(nodeu2, this%nrow, this%ncol, 1, i2, j2, k2)
1066 elseif (j2 < j1)
then
1068 elseif (j2 > j1)
then
1081 character(len=*),
intent(out) :: dis_type
1091 integer(I4B) :: dis_enum
1102 integer(I4B),
intent(in) :: ic
1103 real(DP),
allocatable,
intent(out) :: polyverts(:, :)
1104 logical(LGP),
intent(in),
optional :: closed
1106 integer(I4B) :: icu, nverts, irow, jcol, klay
1107 real(DP) :: cellx, celly, dxhalf, dyhalf
1108 logical(LGP) :: lclosed
1113 if (.not. (
present(closed)))
then
1121 allocate (polyverts(2, nverts + 1))
1123 allocate (polyverts(2, nverts))
1127 icu = this%get_nodeuser(ic)
1128 call get_ijk(icu, this%nrow, this%ncol, 1, irow, jcol, klay)
1129 cellx = this%cellx(jcol)
1130 celly = this%celly(irow)
1131 dxhalf =
dhalf * this%delr(jcol)
1132 dyhalf =
dhalf * this%delc(irow)
1133 polyverts(:, 1) = (/cellx - dxhalf, celly - dyhalf/)
1134 polyverts(:, 2) = (/cellx - dxhalf, celly + dyhalf/)
1135 polyverts(:, 3) = (/cellx + dxhalf, celly + dyhalf/)
1136 polyverts(:, 4) = (/cellx + dxhalf, celly - dyhalf/)
1140 polyverts(:, nverts + 1) = polyverts(:, 1)
1147 integer(I4B),
intent(in) :: ic
1148 logical(LGP),
intent(in),
optional :: closed
1149 integer(I4B) :: npolyverts
1151 if (
present(closed))
then
1152 if (closed) npolyverts = 5
1159 logical(LGP),
intent(in),
optional :: closed
1160 integer(I4B) :: max_npolyverts
1162 if (
present(closed))
then
1163 if (closed) max_npolyverts = 5
1173 character(len=*),
intent(inout) :: line
1174 integer(I4B),
intent(inout) :: lloc
1175 integer(I4B),
intent(inout) :: istart
1176 integer(I4B),
intent(inout) :: istop
1177 integer(I4B),
intent(in) :: in
1178 integer(I4B),
intent(in) :: iout
1179 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: iarray
1180 character(len=*),
intent(in) :: aname
1192 character(len=*),
intent(inout) :: line
1193 integer(I4B),
intent(inout) :: lloc
1194 integer(I4B),
intent(inout) :: istart
1195 integer(I4B),
intent(inout) :: istop
1196 integer(I4B),
intent(in) :: in
1197 integer(I4B),
intent(in) :: iout
1198 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: darray
1199 character(len=*),
intent(in) :: aname
1209 icolbnd, aname, inunit, iout)
1212 integer(I4B),
intent(in) :: maxbnd
1213 integer(I4B),
dimension(maxbnd) :: nodelist
1214 integer(I4B),
intent(in) :: ncolbnd
1215 real(DP),
dimension(ncolbnd, maxbnd),
intent(inout) :: darray
1216 integer(I4B),
intent(in) :: icolbnd
1217 character(len=*),
intent(in) :: aname
1218 integer(I4B),
intent(in) :: inunit
1219 integer(I4B),
intent(in) :: iout
1229 cdatafmp, nvaluesp, nwidthp, editdesc, dinact)
1232 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: darray
1233 integer(I4B),
intent(in) :: iout
1234 integer(I4B),
intent(in) :: iprint
1235 integer(I4B),
intent(in) :: idataun
1236 character(len=*),
intent(in) :: aname
1237 character(len=*),
intent(in) :: cdatafmp
1238 integer(I4B),
intent(in) :: nvaluesp
1239 integer(I4B),
intent(in) :: nwidthp
1240 character(len=*),
intent(in) :: editdesc
1241 real(DP),
intent(in) :: dinact
1243 integer(I4B) :: k, ifirst
1244 integer(I4B) :: nlay
1245 integer(I4B) :: nrow
1246 integer(I4B) :: ncol
1247 integer(I4B) :: nval
1248 integer(I4B) :: nodeu, noder
1249 integer(I4B) :: istart, istop
1250 real(DP),
dimension(:),
pointer,
contiguous :: dtemp
1252 character(len=*),
parameter :: fmthsv = &
1253 "(1X,/1X,a,' WILL BE SAVED ON UNIT ',I4, &
1254 &' AT END OF TIME STEP',I5,', STRESS PERIOD ',I4)"
1258 nrow = this%mshape(1)
1259 ncol = this%mshape(2)
1263 if (this%nodes < this%nodesuser)
then
1266 do nodeu = 1, this%nodesuser
1267 noder = this%get_nodenumber(nodeu, 0)
1268 if (noder <= 0)
then
1269 dtemp(nodeu) = dinact
1272 dtemp(nodeu) = darray(noder)
1280 if (iprint /= 0)
then
1283 istop = istart + nrow * ncol - 1
1285 aname, cdatafmp, nvaluesp, nwidthp, editdesc)
1291 if (idataun > 0)
then
1296 istop = istart + nrow * ncol - 1
1297 if (ifirst == 1)
write (iout, fmthsv) &
1298 trim(adjustl(aname)), idataun, &
1305 elseif (idataun < 0)
then
1308 call ubdsv1(
kstp,
kper, aname, -idataun, dtemp, ncol, nrow, nlay, &
1317 dstmodel, dstpackage, naux, auxtxt, &
1318 ibdchn, nlist, iout)
1321 character(len=16),
intent(in) :: text
1322 character(len=16),
intent(in) :: textmodel
1323 character(len=16),
intent(in) :: textpackage
1324 character(len=16),
intent(in) :: dstmodel
1325 character(len=16),
intent(in) :: dstpackage
1326 integer(I4B),
intent(in) :: naux
1327 character(len=16),
dimension(:),
intent(in) :: auxtxt
1328 integer(I4B),
intent(in) :: ibdchn
1329 integer(I4B),
intent(in) :: nlist
1330 integer(I4B),
intent(in) :: iout
1332 integer(I4B) :: nlay, nrow, ncol
1335 nrow = this%mshape(1)
1336 ncol = this%mshape(2)
1339 call ubdsv06(
kstp,
kper, text, textmodel, textpackage, dstmodel, dstpackage, &
1340 ibdchn, naux, auxtxt, ncol, nrow, nlay, &
1350 integer(I4B),
intent(in) :: maxbnd
1351 integer(I4B),
dimension(:),
pointer,
contiguous :: darray
1352 integer(I4B),
dimension(maxbnd),
intent(inout) :: nodelist
1353 integer(I4B),
intent(inout) :: nbound
1354 character(len=*),
intent(in) :: aname
1356 integer(I4B) :: il, ir, ic, ncol, nrow, nlay, nval, nodeu, noder, ipos, ierr
1360 nrow = this%mshape(1)
1361 ncol = this%mshape(2)
1363 if (this%ndim > 1)
then
1372 nodeu =
get_node(1, ir, ic, nlay, nrow, ncol)
1374 if (il < 1 .or. il > nlay)
then
1375 write (
errmsg,
'(a,1x,i0)')
'Invalid layer number:', il
1378 nodeu =
get_node(il, ir, ic, nlay, nrow, ncol)
1379 noder = this%get_nodenumber(nodeu, 0)
1380 if (ipos > maxbnd)
then
1383 nodelist(ipos) = noder
1392 write (
errmsg,
'(a,1x,i0)') &
1393 'MAXBOUND dimension is too small.'// &
1394 'INCREASE MAXBOUND TO:', ierr
1399 if (nbound < maxbnd)
then
1400 do ipos = nbound + 1, maxbnd
1409 do noder = 1, maxbnd
1410 if (noder < 1 .or. noder > this%nodes)
then
1411 write (
errmsg,
'(a,1x,i0)')
'Invalid node number:', noder
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
@ dis2d
DIS2D6 discretization.
integer(i4b), parameter lenvarname
maximum length of a variable name
real(dp), parameter dhalf
real constant 1/2
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 read_layer_array(this, nodelist, darray, ncolbnd, maxbnd, icolbnd, aname, inunit, iout)
Read a 2d double array into col icolbnd of darray.
subroutine read_int_array(this, line, lloc, istart, istop, iout, in, iarray, aname)
Read an integer array.
integer(i4b) function get_nodenumber_idx2(this, k, j, icheck)
Get reduced node number from layer, row and column indices.
subroutine log_options(this, found)
Write user options to list file.
subroutine, public dis2d_cr(dis, name_model, input_mempath, inunit, iout)
Create a new structured discretization object.
subroutine nodeu_to_string(this, nodeu, str)
Convert a user nodenumber to a string (nodenumber) or (k,i,j)
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.
integer(i4b) function nodeu_from_cellid(this, cellid, inunit, iout, flag_string, allow_zero)
Convert a cellid string to a user nodenumber.
integer(i4b) function get_dis_enum(this)
Get the discretization type enumeration.
subroutine dis3d_da(this)
Deallocate variables.
subroutine nodeu_to_array(this, nodeu, arr)
Convert a user nodenumber to an array (nodenumber) or (i,j)
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 read_dbl_array(this, line, lloc, istart, istop, iout, in, darray, aname)
Read a double precision array.
subroutine source_options(this)
Copy options from IDM into package.
subroutine log_griddata(this, found)
Write dimensions to list file.
integer(i4b) function get_ncpl(this)
Return number of cells per layer (nrow * ncol)
subroutine record_array(this, darray, iout, iprint, idataun, aname, cdatafmp, nvaluesp, nwidthp, editdesc, dinact)
Record a double precision array.
subroutine allocate_scalars(this, name_model, input_mempath)
Allocate and initialize scalar variables.
subroutine grid_finalize(this)
Finalize grid (check properties, allocate arrays, compute connections)
logical function supports_layers(this)
Indicates whether the grid discretization supports layers.
subroutine log_dimensions(this, found)
Write dimensions to list file.
subroutine allocate_arrays(this)
Allocate and initialize arrays.
integer(i4b) function get_nodenumber_idx1(this, nodeu, icheck)
Get reduced node number from user node number.
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 polygon vertices.
integer(i4b) function get_max_npolyverts(this, closed)
Get the maximum number of polygon vertices.
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 source_dimensions(this)
Copy dimensions from IDM into package.
subroutine source_griddata(this)
Copy grid data from IDM into package.
subroutine nlarray_to_nodelist(this, darray, nodelist, maxbnd, nbound, aname)
Convert an integer array (layer numbers) to nodelist.
subroutine write_grb(this, icelltype)
Write a binary grid file.
subroutine get_polyverts(this, ic, polyverts, closed)
Get a 2D array of polygon vertices, listed in.
subroutine dis3d_df(this)
Define the discretization.
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,...
integer(i4b) function, public get_node(ilay, irow, icol, nlay, nrow, ncol)
Get node number, given layer, row, and column indices for a structured grid. If any argument is inval...
subroutine, public get_ijk(nodenumber, nrow, ncol, nlay, irow, icol, ilay)
Get row, column and layer indices from node number and grid dimensions. If nodenumber is invalid,...
This module defines variable data types.
subroutine, public memorystore_remove(component, subcomponent, context)
This module contains simulation methods.
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
Structured grid discretization.
Simplifies tracking parameters sourced from the input context.