34 character(len=LENFTYPE) ::
ftype =
'PRP'
35 character(len=16) ::
text =
' PRP'
41 logical(LGP),
pointer :: extend => null()
42 logical(LGP),
pointer :: frctrn => null()
43 logical(LGP),
pointer :: drape => null()
44 logical(LGP),
pointer :: localz => null()
45 integer(I4B),
pointer :: istopweaksink => null()
46 integer(I4B),
pointer :: istopzone => null()
47 integer(I4B),
pointer :: idrymeth => null()
48 integer(I4B),
pointer :: itrkout => null()
49 integer(I4B),
pointer :: itrkhdr => null()
50 integer(I4B),
pointer :: itrkcsv => null()
51 integer(I4B),
pointer :: irlstls => null()
52 integer(I4B),
pointer :: iexmeth => null()
53 integer(I4B),
pointer :: ichkmeth => null()
54 integer(I4B),
pointer :: icycwin => null()
55 real(dp),
pointer :: extol => null()
56 real(dp),
pointer :: rttol => null()
57 real(dp),
pointer :: rtfreq => null()
58 real(dp),
pointer :: offset => null()
59 real(dp),
pointer :: stoptime => null()
60 real(dp),
pointer :: stoptraveltime => null()
65 integer(I4B),
pointer :: nreleasepoints => null()
66 integer(I4B),
pointer :: nreleasetimes => null()
67 integer(I4B),
pointer :: nparticles => null()
68 integer(I4B),
pointer,
contiguous :: rptnode(:) => null()
69 integer(I4B),
pointer,
contiguous :: rptzone(:) => null()
70 real(dp),
pointer,
contiguous :: rptx(:) => null()
71 real(dp),
pointer,
contiguous :: rpty(:) => null()
72 real(dp),
pointer,
contiguous :: rptz(:) => null()
73 real(dp),
pointer,
contiguous :: rptm(:) => null()
74 character(len=LENBOUNDNAME),
pointer,
contiguous :: rptname(:) => null()
75 character(len=LINELENGTH),
allocatable :: period_block_lines(:)
76 integer(I4B) :: applied_kper
125 subroutine prp_create(packobj, id, ibcnum, inunit, iout, namemodel, &
126 pakname, fmi, input_mempath)
128 class(
bndtype),
pointer :: packobj
129 integer(I4B),
intent(in) :: id
130 integer(I4B),
intent(in) :: ibcnum
131 integer(I4B),
intent(in) :: inunit
132 integer(I4B),
intent(in) :: iout
133 character(len=*),
intent(in) :: namemodel
134 character(len=*),
intent(in) :: pakname
135 character(len=*),
intent(in),
optional :: input_mempath
141 character(len=*),
parameter :: fmtheader = &
142 "(1x, /1x, 'PRP PARTICLE RELEASE POINT PACKAGE', &
143 &' INPUT READ FROM MEMPATH: ', a, /)"
144 character(len=*),
parameter :: fmtexgheader = &
145 "(1x, /1x, 'PRP-EXG EXCHANGE PARTICLE RELEASE POINT PACKAGE', &
146 &' (PROGRAMMATIC INPUT)', /)"
148 if (
present(input_mempath))
then
153 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, input_mempath)
156 call prpobj%prp_allocate_scalars()
157 call packobj%pack_initialize()
159 packobj%inunit = inunit
162 packobj%ibcnum = ibcnum
167 if (inunit > 0)
write (iout, fmtheader) input_mempath
173 call packobj%set_names(ibcnum, namemodel, pakname,
ftype)
174 exgprpobj%text =
text
176 call exgprpobj%prp_allocate_scalars()
177 call packobj%pack_initialize()
179 packobj%inunit = inunit
182 packobj%ibcnum = ibcnum
187 if (iout > 0)
write (iout, fmtexgheader)
196 call this%BndExtType%bnd_da()
232 if (
allocated(this%period_block_lines))
deallocate (this%period_block_lines)
235 call this%particles%destroy(this%memoryPath)
236 call this%schedule%destroy()
237 deallocate (this%particles)
238 deallocate (this%schedule)
244 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
245 integer(I4B),
dimension(:),
pointer,
contiguous :: izone
247 this%ibound => ibound
248 this%rptzone => izone
255 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
256 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
260 call this%BndExtType%allocate_arrays()
266 this%nreleasepoints, &
270 call mem_allocate(this%rptx, this%nreleasepoints,
'RPTX', this%memoryPath)
271 call mem_allocate(this%rpty, this%nreleasepoints,
'RPTY', this%memoryPath)
272 call mem_allocate(this%rptz, this%nreleasepoints,
'RPTZ', this%memoryPath)
273 call mem_allocate(this%rptm, this%nreleasepoints,
'RPTMASS', &
275 call mem_allocate(this%rptnode, this%nreleasepoints,
'RPTNODER', &
278 'RPTNAME', this%memoryPath)
281 do nps = 1, this%nreleasepoints
282 this%rptm(nps) =
dzero
291 call this%BndExtType%allocate_scalars()
294 call mem_allocate(this%localz,
'LOCALZ', this%memoryPath)
295 call mem_allocate(this%extend,
'EXTEND', this%memoryPath)
296 call mem_allocate(this%offset,
'OFFSET', this%memoryPath)
297 call mem_allocate(this%stoptime,
'STOPTIME', this%memoryPath)
298 call mem_allocate(this%stoptraveltime,
'STOPTRAVELTIME', this%memoryPath)
299 call mem_allocate(this%istopweaksink,
'ISTOPWEAKSINK', this%memoryPath)
300 call mem_allocate(this%istopzone,
'ISTOPZONE', this%memoryPath)
302 call mem_allocate(this%idrymeth,
'IDRYMETH', this%memoryPath)
303 call mem_allocate(this%nreleasepoints,
'NRELEASEPOINTS', this%memoryPath)
304 call mem_allocate(this%nreleasetimes,
'NRELEASETIMES', this%memoryPath)
305 call mem_allocate(this%nparticles,
'NPARTICLES', this%memoryPath)
306 call mem_allocate(this%itrkout,
'ITRKOUT', this%memoryPath)
307 call mem_allocate(this%itrkhdr,
'ITRKHDR', this%memoryPath)
308 call mem_allocate(this%itrkcsv,
'ITRKCSV', this%memoryPath)
309 call mem_allocate(this%irlstls,
'IRLSTLS', this%memoryPath)
310 call mem_allocate(this%frctrn,
'FRCTRN', this%memoryPath)
311 call mem_allocate(this%iexmeth,
'IEXMETH', this%memoryPath)
312 call mem_allocate(this%ichkmeth,
'ICHKMETH', this%memoryPath)
313 call mem_allocate(this%icycwin,
'ICYCWIN', this%memoryPath)
316 call mem_allocate(this%rtfreq,
'RTFREQ', this%memoryPath)
319 this%localz = .false.
320 this%extend = .false.
322 this%stoptime = huge(1d0)
323 this%stoptraveltime = huge(1d0)
324 this%istopweaksink = 0
328 this%nreleasepoints = 0
329 this%nreleasetimes = 0
335 this%frctrn = .false.
342 this%applied_kper = 0
351 call this%obs%obs_ar()
353 if (this%inamedbound /= 0)
then
354 do n = 1, this%nreleasepoints
355 this%boundname(n) = this%rptname(n)
358 do n = 1, this%nreleasepoints
359 this%nodelist(n) = this%rptnode(n)
371 integer(I4B),
pointer :: iper, ionper
373 this%input_mempath = trim(this%memoryPath)//
'-INPUT'
383 call this%PrtPrpType%prp_allocate_scalars()
395 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
396 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
398 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid
399 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
401 real(DP),
dimension(:, :),
pointer,
contiguous :: auxvar_input
403 call mem_allocate(cellid, this%dis%ndim, 0,
'CELLID', this%input_mempath)
404 call mem_allocate(nodeulist, 0,
'NODEULIST', this%input_mempath)
407 call mem_allocate(auxvar_input, 0, 0,
'AUXVAR', this%input_mempath)
409 call this%PrtPrpType%prp_allocate_arrays(nodelist, auxvar)
421 integer(I4B) :: ip, it
434 do ip = 1, this%nreleasepoints
435 this%rptm(ip) =
dzero
443 if (
kstp == 1 .and. &
444 kper /= this%applied_kper .and. &
445 allocated(this%period_block_lines))
then
446 call this%schedule%advance(lines=this%period_block_lines)
447 this%applied_kper =
kper
449 call this%schedule%advance()
453 if (.not. this%schedule%any())
return
456 call this%log_release()
460 call this%particles%resize( &
461 this%particles%num_stored() + &
462 (this%nreleasepoints * this%schedule%count()), &
467 do ip = 1, this%nreleasepoints
468 do it = 1, this%schedule%count()
469 t = this%schedule%times(it)
474 'Skipping negative release time (t=', t,
').'
479 'Skipping release time falling after the end of the &
480 &simulation (t=', t,
'). Enable EXTEND_TRACKING to &
481 &release particles after the simulation end time.'
485 call this%release(ip, t)
501 real(DP),
dimension(:),
intent(in) :: hnew
502 real(DP),
dimension(:),
intent(inout) :: flowja
503 integer(I4B),
intent(in) :: imover
511 type(
budgettype),
intent(inout) :: model_budget
518 integer(I4B),
intent(in) :: icbcfl
519 integer(I4B),
intent(in) :: ibudfl
520 integer(I4B),
intent(in) :: icbcun
521 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
527 if (this%iprpak > 0)
then
528 write (this%iout,
"(1x,/1x,a,1x,i0)") &
529 'PARTICLE RELEASE FOR PRP', this%ibcnum
530 call this%schedule%log(this%iout)
542 integer(I4B),
intent(in) :: ic
543 real(DP),
intent(in) :: x, y, z
545 real(DP),
allocatable :: polyverts(:, :)
547 call this%fmi%dis%get_polyverts(ic, polyverts)
549 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
550 'Error: release point (x=', x,
', y=', y,
') is not in cell ', &
551 this%dis%get_nodeuser(ic)
555 if (z > maxval(this%dis%top))
then
556 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
557 'Error: release point (z=', z,
') is above grid top ', &
561 else if (z < minval(this%dis%bot))
then
562 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
563 'Error: release point (z=', z,
') is below grid bottom ', &
568 deallocate (polyverts)
586 integer(I4B),
intent(in) :: ip
587 real(DP),
intent(in) :: trelease
592 call this%initialize_particle(particle, ip, trelease)
593 np = this%nparticles + 1
595 call this%particles%put(particle, np)
596 deallocate (particle)
597 this%rptm(ip) = this%rptm(ip) +
done
605 integer(I4B),
intent(in) :: ip
606 real(DP),
intent(in) :: trelease
608 logical(LGP) :: draped
609 integer(I4B) :: irow, icol, ilay, icpl
610 integer(I4B) :: ic, icu, ic_old
612 real(DP) :: top, bot, hds
614 character(len=*),
parameter :: fmticterr = &
615 "('Error in ',a,': Flow model interface does not contain ICELLTYPE. &
616 &ICELLTYPE is required for PRT to distinguish convertible cells &
617 &from confined cells if LOCAL_Z release coordinates are provided. &
618 &Make sure a GWFGRID entry is configured in the PRT FMI package.')"
620 ic = this%rptnode(ip)
622 call create_particle(particle)
624 if (
size(this%boundname) /= 0)
then
625 particle%name = this%boundname(ip)
631 particle%istopweaksink = this%istopweaksink
632 particle%istopzone = this%istopzone
633 particle%idrymeth = this%idrymeth
640 if (this%ibound(ic) == 0)
then
643 call this%dis%highest_active(ic, this%ibound)
644 draped = ic /= ic_old
645 if (.not. draped .and. this%ibound(ic) == 0)
then
656 icu = this%dis%get_nodeuser(ic)
658 select type (dis => this%dis)
660 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, irow, icol, ilay)
662 call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)
665 particle%izone = this%rptzone(ic)
675 z = this%fmi%dis%bot(ic) + &
676 this%fmi%gwfsat(ic) * &
677 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
678 else if (this%localz)
then
685 top = this%fmi%dis%top(ic)
686 bot = this%fmi%dis%bot(ic)
687 if (this%fmi%gwfceltyp(icu) /= 0)
then
688 hds = this%fmi%gwfhead(ic)
692 z = bot + this%rptz(ip) * (top - bot)
700 if (this%ichkmeth > 0) &
701 call this%validate_release_point(ic, x, y, z)
706 particle%trelease = trelease
709 if (this%stoptraveltime == huge(1d0))
then
710 particle%tstop = this%stoptime
712 particle%tstop = particle%trelease + this%stoptraveltime
713 if (this%stoptime < particle%tstop) particle%tstop = this%stoptime
716 particle%ttrack = particle%trelease
723 particle%frctrn = this%frctrn
724 particle%iexmeth = this%iexmeth
725 particle%extend = this%extend
726 particle%icycwin = this%icycwin
727 particle%extol = this%extol
741 integer(I4B),
pointer :: iper, ionper, nlist
745 call mem_setptr(iper,
'IPER', this%input_mempath)
746 call mem_setptr(ionper,
'IONPER', this%input_mempath)
748 if (
kper == 1 .and. &
750 (ionper >
nper) .and. &
751 size(this%schedule%time_select%times) == 0)
then
757 if (
allocated(this%period_block_lines))
deallocate (this%period_block_lines)
758 allocate (this%period_block_lines(1))
759 this%period_block_lines(1) =
"FIRST"
761 else if (iper /=
kper)
then
766 call mem_setptr(nlist,
'NBOUND', this%input_mempath)
767 call mem_setptr(settings,
'SETTING', this%input_mempath)
770 if (
allocated(this%period_block_lines))
deallocate (this%period_block_lines)
771 allocate (this%period_block_lines(nlist))
773 this%period_block_lines(n) = settings(n)
788 real(DP),
dimension(:),
intent(in) :: hnew
789 real(DP),
dimension(:),
intent(inout) :: flowja
790 integer(I4B),
intent(in) :: imover
794 integer(I4B) :: idiag
798 if (this%nbound <= 0)
return
801 do i = 1, this%nbound
802 node = this%nodelist(i)
807 idiag = this%dis%con%ia(node)
808 rrate = this%rptm(i) * (
done /
delt)
809 flowja(idiag) = flowja(idiag) + rrate
813 this%simvals(i) = rrate
834 call this%obs%StoreObsType(
'prp', .true., indx)
839 call this%obs%StoreObsType(
'to-mvr', .true., indx)
854 character(len=LENVARNAME),
dimension(3) :: drytrack_method = &
855 &[character(len=LENVARNAME) ::
'DROP',
'STOP',
'STAY']
856 character(len=
lenvarname),
dimension(2) :: coorcheck_method = &
857 &[
character(len=LENVARNAME) ::
'NONE',
'EAGER']
858 character(len=LINELENGTH) :: trackfile, trackcsvfile, fname
860 character(len=*),
parameter :: fmtextolwrn = &
861 "('WARNING: EXIT_SOLVE_TOLERANCE is set to ',g10.3,' &
862 &which is much greater than the default value of ',g10.3,'. &
863 &The tolerance that strikes the best balance between accuracy &
864 &and runtime is problem-dependent. Since the variable being &
865 &solved varies from 0 to 1, tolerance values much less than 1 &
866 &typically give the best results.')"
869 call this%BndExtType%source_options()
872 call mem_set_value(this%stoptime,
'STOPTIME', this%input_mempath, &
875 this%input_mempath, found%stoptraveltime)
876 call mem_set_value(this%istopweaksink,
'ISTOPWEAKSINK', this%input_mempath, &
878 call mem_set_value(this%istopzone,
'ISTOPZONE', this%input_mempath, &
880 call mem_set_value(this%drape,
'DRAPE', this%input_mempath, &
882 call mem_set_value(this%idrymeth,
'IDRYMETH', this%input_mempath, &
883 drytrack_method, found%idrymeth)
884 call mem_set_value(trackfile,
'TRACKFILE', this%input_mempath, &
886 call mem_set_value(trackcsvfile,
'TRACKCSVFILE', this%input_mempath, &
888 call mem_set_value(this%localz,
'LOCALZ', this%input_mempath, &
890 call mem_set_value(this%extend,
'EXTEND', this%input_mempath, &
892 call mem_set_value(this%extol,
'EXTOL', this%input_mempath, &
894 call mem_set_value(this%rttol,
'RTTOL', this%input_mempath, &
896 call mem_set_value(this%rtfreq,
'RTFREQ', this%input_mempath, &
898 call mem_set_value(this%frctrn,
'FRCTRN', this%input_mempath, &
900 call mem_set_value(this%iexmeth,
'IEXMETH', this%input_mempath, &
902 call mem_set_value(this%ichkmeth,
'ICHKMETH', this%input_mempath, &
903 coorcheck_method, found%ichkmeth)
904 call mem_set_value(this%icycwin,
'ICYCWIN', this%input_mempath, found%icycwin)
907 if (found%idrymeth)
then
908 if (this%idrymeth == 0)
then
909 write (
errmsg,
'(a)')
'Unsupported dry tracking method. &
910 &DRY_TRACKING_METHOD must be "DROP", "STOP", or "STAY"'
914 this%idrymeth = this%idrymeth - 1
918 if (found%extol)
then
919 if (this%extol <=
dzero) &
920 call store_error(
'EXIT_SOLVE_TOLERANCE MUST BE POSITIVE')
921 if (this%extol > dem2)
then
922 write (
warnmsg, fmt=fmtextolwrn) &
928 if (found%rttol)
then
929 if (this%rttol <=
dzero) &
930 call store_error(
'RELEASE_TIME_TOLERANCE MUST BE POSITIVE')
933 if (found%rtfreq)
then
934 if (this%rtfreq <=
dzero) &
935 call store_error(
'RELEASE_TIME_FREQUENCY MUST BE POSITIVE')
938 if (found%iexmeth)
then
939 if (.not. (this%iexmeth /= 1 .or. this%iexmeth /= 2)) &
941 &1 (BRENT) OR 2 (CHANDRUPATLA)')
944 if (found%ichkmeth)
then
945 if (this%ichkmeth == 0)
then
946 write (
errmsg,
'(a)')
'Unsupported coordinate check method. &
947 &COORDINATE_CHECK_METHOD must be "NONE" or "EAGER"'
951 this%ichkmeth = this%ichkmeth - 1
955 if (found%icycwin)
then
956 if (this%icycwin < 0) &
957 call store_error(
'CYCLE_DETECTION_WINDOW MUST BE NON-NEGATIVE')
961 if (found%trackfile)
then
963 call openfile(this%itrkout, this%iout, trackfile,
'DATA(BINARY)', &
968 fname = trim(trackfile)//
'.hdr'
969 call openfile(this%itrkhdr, this%iout, fname,
'CSV', &
970 filstat_opt=
'REPLACE', mode_opt=
mnormal)
974 if (found%trackcsvfile)
then
976 call openfile(this%itrkcsv, this%iout, trackcsvfile,
'CSV', &
977 filstat_opt=
'REPLACE')
987 call this%prp_log_options(found, trackfile, trackcsvfile)
1008 character(len=*),
intent(in) :: trackfile
1009 character(len=*),
intent(in) :: trackcsvfile
1012 character(len=*),
parameter :: fmttrkbin = &
1013 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
1014 &'OPENED ON UNIT: ', I0)"
1015 character(len=*),
parameter :: fmttrkcsv = &
1016 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
1017 &'OPENED ON UNIT: ', I0)"
1019 write (this%iout,
'(1x,a)')
'PROCESSING PARTICLE INPUT DIMENSIONS'
1021 if (found%frctrn)
then
1022 write (this%iout,
'(4x,a)') &
1023 'IF DISV, TRACKING WILL USE THE TERNARY METHOD REGARDLESS OF CELL TYPE'
1026 if (found%trackfile)
then
1027 write (this%iout, fmttrkbin) trim(adjustl(trackfile)), this%itrkout
1030 if (found%trackcsvfile)
then
1031 write (this%iout, fmttrkcsv) trim(adjustl(trackcsvfile)), this%itrkcsv
1034 write (this%iout,
'(1x,a)')
'END OF PARTICLE INPUT DIMENSIONS'
1047 call mem_set_value(this%nreleasepoints,
'NRELEASEPTS', this%input_mempath, &
1049 call mem_set_value(this%nreleasetimes,
'NRELEASETIMES', this%input_mempath, &
1050 found%nreleasetimes)
1052 write (this%iout,
'(1x,a)')
'PROCESSING PARTICLE INPUT DIMENSIONS'
1053 write (this%iout,
'(4x,a,i0)')
'NRELEASEPTS = ', this%nreleasepoints
1054 write (this%iout,
'(4x,a,i0)')
'NRELEASETIMES = ', this%nreleasetimes
1055 write (this%iout,
'(1x,a)')
'END OF PARTICLE INPUT DIMENSIONS'
1058 this%maxbound = this%nreleasepoints
1059 this%nbound = this%nreleasepoints
1061 call this%prp_allocate_arrays()
1062 call this%prp_packagedata()
1063 call this%prp_releasetimes()
1064 call this%prp_load_releasetimefrequency()
1072 this%nreleasepoints = 0
1073 this%nreleasetimes = 0
1077 call this%prp_allocate_arrays()
1089 integer(I4B),
dimension(:),
pointer,
contiguous :: irptno
1090 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellids
1091 real(DP),
dimension(:),
pointer,
contiguous :: xrpts, yrpts, zrpts
1093 contiguous :: boundnames
1094 character(len=LENBOUNDNAME) :: bndName, bndNameTemp
1095 character(len=9) :: cno
1096 character(len=20) :: cellidstr
1097 integer(I4B),
dimension(:),
allocatable :: nboundchk
1098 integer(I4B),
dimension(:),
pointer :: cellid
1099 integer(I4B) :: n, noder, nodeu, rptno
1102 call mem_setptr(irptno,
'IRPTNO', this%input_mempath)
1103 call mem_setptr(cellids,
'CELLID', this%input_mempath)
1104 call mem_setptr(xrpts,
'XRPT', this%input_mempath)
1105 call mem_setptr(yrpts,
'YRPT', this%input_mempath)
1106 call mem_setptr(zrpts,
'ZRPT', this%input_mempath)
1107 call mem_setptr(boundnames,
'BOUNDNAME', this%input_mempath)
1110 allocate (nboundchk(this%nreleasepoints))
1111 do n = 1, this%nreleasepoints
1115 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName)) &
1118 do n = 1,
size(irptno)
1122 if (rptno < 1 .or. rptno > this%nreleasepoints)
then
1123 write (
errmsg,
'(a,i0,a,i0,a)') &
1124 'Expected ', this%nreleasepoints,
' release points. &
1125 &Points must be numbered from 1 to ', this%nreleasepoints,
'.'
1131 nboundchk(rptno) = nboundchk(rptno) + 1
1134 cellid => cellids(:, n)
1137 if (this%dis%ndim == 1)
then
1139 elseif (this%dis%ndim == 2)
then
1140 nodeu =
get_node(cellid(1), 1, cellid(2), &
1141 this%dis%mshape(1), 1, &
1144 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
1145 this%dis%mshape(1), &
1146 this%dis%mshape(2), &
1151 noder = this%dis%get_nodenumber(nodeu, 1)
1152 if (noder <= 0)
then
1153 call this%dis%nodeu_to_string(nodeu, cellidstr)
1155 'Particle release point configured for nonexistent cell: '// &
1156 trim(adjustl(cellidstr))//
'. This cell has IDOMAIN <= 0 and '&
1157 &
'therefore does not exist in the model grid.'
1161 this%rptnode(rptno) = noder
1164 if (this%localz .and. (zrpts(n) < 0 .or. zrpts(n) > 1))
then
1165 call store_error(
'Local z coordinate must fall in the interval [0, 1]')
1170 this%rptx(rptno) = xrpts(n)
1171 this%rpty(rptno) = yrpts(n)
1172 this%rptz(rptno) = zrpts(n)
1175 write (cno,
'(i9.9)') rptno
1176 bndname =
'PRP'//cno
1179 if (this%inamedbound /= 0)
then
1180 bndnametemp = boundnames(n)
1181 if (bndnametemp /=
'') bndname = bndnametemp
1187 this%rptname(rptno) = bndname
1190 write (this%iout,
'(1x,a)') &
1191 'END OF '//trim(adjustl(this%packName))//
' PACKAGEDATA'
1194 do n = 1, this%nreleasepoints
1195 if (nboundchk(n) == 0)
then
1196 write (
errmsg,
'(a,a,1x,i0,a)')
'No data specified for particle ', &
1197 'release point', n,
'.'
1199 else if (nboundchk(n) > 1)
then
1200 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1201 'Data for particle release point', n,
'specified', nboundchk(n), &
1213 deallocate (nboundchk)
1229 real(DP),
dimension(:),
pointer,
contiguous :: time
1230 integer(I4B) :: n, isize
1231 real(DP),
allocatable :: times(:)
1233 if (this%nreleasetimes <= 0)
return
1236 allocate (times(this%nreleasetimes))
1239 call get_isize(
'TIME', this%input_mempath, isize)
1241 if (isize <= 0)
then
1242 errmsg =
"RELEASTIMES block expected when &
1243 &NRELEASETIMES dimension is non-zero."
1249 call mem_setptr(time,
'TIME', this%input_mempath)
1252 do n = 1,
size(time)
1257 call this%schedule%time_select%extend(times)
1260 if (.not. this%schedule%time_select%increasing())
then
1261 errmsg =
"RELEASTIMES block entries must strictly increase."
1277 real(DP),
allocatable :: times(:)
1280 if (this%rtfreq <=
dzero)
return
1289 call this%schedule%time_select%extend(times)
1292 if (.not. this%schedule%time_select%increasing())
then
1293 errmsg =
"Release times must strictly increase"
This module contains the extended boundary package.
This module contains the base boundary package.
This module contains the BudgetModule.
This module contains simulation constants.
real(dp), parameter dsame
real constant for values that are considered the same based on machine precision
integer(i4b), parameter linelength
maximum length of a standard line
@ tabcenter
centered table column
@ tableft
left justified table column
@ mnormal
normal output mode
real(dp), parameter dep3
real constant 1000
integer(i4b), parameter lenpakloc
maximum length of a package location
real(dp), parameter dem1
real constant 1e-1
real(dp), parameter dep9
real constant 1e9
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dzero
real constant zero
real(dp), parameter dem5
real constant 1e-5
real(dp), parameter dem2
real constant 1e-2
real(dp), parameter done
real constant 1
subroutine pstop(status, message)
Stop the program, optionally specifying an error status code.
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...
logical function, public point_in_polygon(x, y, poly)
Check if a point is within a polygon.
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,...
subroutine, public get_jk(nodenumber, ncpl, nlay, icpl, ilay)
Get layer index and within-layer node index from node number and grid dimensions. If nodenumber is in...
This module defines variable data types.
pure real(dp) function, dimension(:), allocatable, public arange(start, stop, step)
Return reals separated by the given step over the given interval.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Particle tracking strategies.
@, public level_subfeature
This module contains the derived type ObsType.
subroutine, public defaultobsidprocessor(obsrv, dis, inunitobs, iout)
@ brief Process IDstring provided for each observation
subroutine create_particle_store(store, np, mempath)
Allocate particle store.
@ term_unreleased
terminated permanently unreleased
subroutine create_particle(particle)
Create a new particle.
Particle release scheduling.
type(particlereleasescheduletype) function, pointer, public create_release_schedule(tolerance)
Create a new release schedule.
Particle track output module.
character(len= *), parameter, public trackheader
character(len= *), parameter, public trackdtypes
subroutine exg_prp_allocate_arrays(this, nodelist, auxvar)
Allocate arrays for exchange PRP.
subroutine exg_prp_ar(this)
@ brief No-op AR method override for exchange PRP.
subroutine prp_allocate_arrays(this, nodelist, auxvar)
Allocate arrays.
subroutine exg_prp_cq_simrate(this, hnew, flowja, imover)
No-op flow calculation for exchange PRP.
subroutine prp_rp(this)
@ brief Read and prepare period data for particle input
subroutine exg_prp_rp(this)
@ brief No-op RP method override for exchange PRP.
subroutine prp_load_releasetimefrequency(this)
Load regularly spaced release times if configured.
subroutine prp_cq_simrate(this, hnew, flowja, imover)
@ brief Calculate flow between package and model.
subroutine exg_prp_allocate_scalars(this)
Allocate scalars for exchange PRP.
subroutine exg_prp_ad(this)
No-op AD method override for exchange PRP.
character(len=lenftype) ftype
subroutine exg_prp_bd(this, model_budget)
No-op budget method for exchange PRP. Likewise about the STORAGE term accounting.
subroutine prp_df_obs(this)
Store supported observations.
real(dp), parameter default_exit_solve_tolerance
subroutine define_listlabel(this)
subroutine log_release(this)
Log the release scheduled for this time step.
subroutine exg_prp_options(this)
@ brief No-op options method override for exchange PRP. Just creates an empty release schedule.
subroutine prp_ad(this)
Advance a time step and release particles if scheduled.
subroutine prp_allocate_scalars(this)
Allocate scalars.
subroutine prp_dimensions(this)
@ brief Set dimensions specific to PrtPrpType
subroutine exg_prp_dimensions(this)
@ brief Dimensions method override for exchange PRP. Just set all dimensions to zero and allocate arr...
subroutine prp_set_pointers(this, ibound, izone)
@ brief Set pointers to model variables
subroutine exg_prp_ot_model_flows(this, icbcfl, ibudfl, icbcun, imap)
No-op flow output method for exchange PRP. No contribution to budget, no need to write output.
subroutine initialize_particle(this, particle, ip, trelease)
subroutine prp_da(this)
Deallocate memory.
subroutine prp_releasetimes(this)
Load explicitly specified release times.
subroutine prp_options(this)
@ brief Set options specific to PrtPrpType
subroutine prp_log_options(this, found, trackfile, trackcsvfile)
@ brief Log options specific to PrtPrpType
logical function prp_obs_supported(this)
Indicates whether observations are supported.
subroutine prp_ar(this)
@ brief Allocate and read period data
subroutine release(this, ip, trelease)
Release a particle at the specified time.
subroutine, public prp_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, fmi, input_mempath)
Create a new particle release point package.
subroutine validate_release_point(this, ic, x, y, z)
Verify that the release point is in the cell.
subroutine prp_packagedata(this)
Load package data (release points).
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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
real(dp), pointer, public totalsimtime
time at end 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
integer(i4b), pointer, public nper
number of stress period
Derived type for the Budget object.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Structured grid discretization.
Vertex grid discretization.
Structure of arrays to store particles.
Particle tracked by the PRT model.
Particle release scheduling utility.
Particle track output manager. Handles printing as well as writing to files. One output unit can be c...
Exchange PRP package. A variant of the normal PRP package that doesn't read from input files but inst...
Particle release point (PRP) package.