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()
66 integer(I4B),
pointer :: nreleasepoints => null()
67 integer(I4B),
pointer :: nreleasetimes => null()
68 integer(I4B),
pointer :: nparticles => null()
69 integer(I4B),
pointer,
contiguous :: rptnode(:) => null()
70 integer(I4B),
pointer,
contiguous :: rptzone(:) => null()
71 real(dp),
pointer,
contiguous :: rptx(:) => null()
72 real(dp),
pointer,
contiguous :: rpty(:) => null()
73 real(dp),
pointer,
contiguous :: rptz(:) => null()
74 real(dp),
pointer,
contiguous :: rptm(:) => null()
75 character(len=LENBOUNDNAME),
pointer,
contiguous :: rptname(:) => null()
76 character(len=LINELENGTH),
allocatable :: period_block_lines(:)
77 integer(I4B) :: applied_kper
127 subroutine prp_create(packobj, id, ibcnum, inunit, iout, namemodel, &
128 pakname, fmi, input_mempath)
130 class(
bndtype),
pointer :: packobj
131 integer(I4B),
intent(in) :: id
132 integer(I4B),
intent(in) :: ibcnum
133 integer(I4B),
intent(in) :: inunit
134 integer(I4B),
intent(in) :: iout
135 character(len=*),
intent(in) :: namemodel
136 character(len=*),
intent(in) :: pakname
137 character(len=*),
intent(in),
optional :: input_mempath
143 character(len=*),
parameter :: fmtheader = &
144 "(1x, /1x, 'PRP PARTICLE RELEASE POINT PACKAGE', &
145 &' INPUT READ FROM MEMPATH: ', a, /)"
146 character(len=*),
parameter :: fmtexgheader = &
147 "(1x, /1x, 'PRP-EXG EXCHANGE PARTICLE RELEASE POINT PACKAGE', &
148 &' (PROGRAMMATIC INPUT)', /)"
150 if (
present(input_mempath))
then
155 call packobj%set_names(ibcnum, namemodel, pakname,
ftype, input_mempath)
158 call prpobj%prp_allocate_scalars()
159 call packobj%pack_initialize()
161 packobj%inunit = inunit
164 packobj%ibcnum = ibcnum
169 if (inunit > 0)
write (iout, fmtheader) input_mempath
175 call packobj%set_names(ibcnum, namemodel, pakname,
ftype)
176 exgprpobj%text =
text
178 call exgprpobj%prp_allocate_scalars()
179 call packobj%pack_initialize()
181 packobj%inunit = inunit
184 packobj%ibcnum = ibcnum
189 if (iout > 0)
write (iout, fmtexgheader)
198 call this%BndExtType%bnd_da()
234 if (
allocated(this%period_block_lines))
deallocate (this%period_block_lines)
237 call this%particles%destroy(this%memoryPath)
238 call this%particles_staging%destroy(trim(this%memoryPath)//
'-STAGING')
239 call this%schedule%destroy()
240 deallocate (this%particles)
241 deallocate (this%particles_staging)
242 deallocate (this%schedule)
248 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound
249 integer(I4B),
dimension(:),
pointer,
contiguous :: izone
251 this%ibound => ibound
252 this%rptzone => izone
259 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
260 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
264 call this%BndExtType%allocate_arrays()
271 this%particles_staging, 0, &
272 trim(this%memoryPath)//
'-STAGING')
275 call mem_allocate(this%rptx, this%nreleasepoints,
'RPTX', this%memoryPath)
276 call mem_allocate(this%rpty, this%nreleasepoints,
'RPTY', this%memoryPath)
277 call mem_allocate(this%rptz, this%nreleasepoints,
'RPTZ', this%memoryPath)
278 call mem_allocate(this%rptm, this%nreleasepoints,
'RPTMASS', &
280 call mem_allocate(this%rptnode, this%nreleasepoints,
'RPTNODER', &
283 'RPTNAME', this%memoryPath)
286 do nps = 1, this%nreleasepoints
287 this%rptm(nps) =
dzero
296 call this%BndExtType%allocate_scalars()
299 call mem_allocate(this%localz,
'LOCALZ', this%memoryPath)
300 call mem_allocate(this%extend,
'EXTEND', this%memoryPath)
301 call mem_allocate(this%offset,
'OFFSET', this%memoryPath)
302 call mem_allocate(this%stoptime,
'STOPTIME', this%memoryPath)
303 call mem_allocate(this%stoptraveltime,
'STOPTRAVELTIME', this%memoryPath)
304 call mem_allocate(this%istopweaksink,
'ISTOPWEAKSINK', this%memoryPath)
305 call mem_allocate(this%istopzone,
'ISTOPZONE', this%memoryPath)
307 call mem_allocate(this%idrymeth,
'IDRYMETH', this%memoryPath)
308 call mem_allocate(this%nreleasepoints,
'NRELEASEPOINTS', this%memoryPath)
309 call mem_allocate(this%nreleasetimes,
'NRELEASETIMES', this%memoryPath)
310 call mem_allocate(this%nparticles,
'NPARTICLES', this%memoryPath)
311 call mem_allocate(this%itrkout,
'ITRKOUT', this%memoryPath)
312 call mem_allocate(this%itrkhdr,
'ITRKHDR', this%memoryPath)
313 call mem_allocate(this%itrkcsv,
'ITRKCSV', this%memoryPath)
314 call mem_allocate(this%irlstls,
'IRLSTLS', this%memoryPath)
315 call mem_allocate(this%frctrn,
'FRCTRN', this%memoryPath)
316 call mem_allocate(this%iexmeth,
'IEXMETH', this%memoryPath)
317 call mem_allocate(this%ichkmeth,
'ICHKMETH', this%memoryPath)
318 call mem_allocate(this%icycwin,
'ICYCWIN', this%memoryPath)
321 call mem_allocate(this%rtfreq,
'RTFREQ', this%memoryPath)
324 this%localz = .false.
325 this%extend = .false.
327 this%stoptime = huge(1d0)
328 this%stoptraveltime = huge(1d0)
329 this%istopweaksink = 0
333 this%nreleasepoints = 0
334 this%nreleasetimes = 0
340 this%frctrn = .false.
347 this%applied_kper = 0
356 call this%obs%obs_ar()
358 if (this%inamedbound /= 0)
then
359 do n = 1, this%nreleasepoints
360 this%boundname(n) = this%rptname(n)
363 do n = 1, this%nreleasepoints
364 this%nodelist(n) = this%rptnode(n)
376 integer(I4B),
pointer :: iper, ionper
378 this%input_mempath = trim(this%memoryPath)//
'-INPUT'
388 call this%PrtPrpType%prp_allocate_scalars()
400 integer(I4B),
dimension(:),
pointer,
contiguous,
optional :: nodelist
401 real(DP),
dimension(:, :),
pointer,
contiguous,
optional :: auxvar
403 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid
404 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
406 real(DP),
dimension(:, :),
pointer,
contiguous :: auxvar_input
408 call mem_allocate(cellid, this%dis%ndim, 0,
'CELLID', this%input_mempath)
409 call mem_allocate(nodeulist, 0,
'NODEULIST', this%input_mempath)
412 call mem_allocate(auxvar_input, 0, 0,
'AUXVAR', this%input_mempath)
414 call this%PrtPrpType%prp_allocate_arrays(nodelist, auxvar)
426 integer(I4B) :: ip, it
439 if (.not. this%fmi%flows_from_file)
then
440 call this%particles_staging%resize( &
441 this%particles%num_stored(), &
442 trim(this%memoryPath)//
'-STAGING')
443 call this%particles_staging%copy_from(this%particles)
444 this%nparticles = this%particles%num_stored()
448 do ip = 1, this%nreleasepoints
449 this%rptm(ip) =
dzero
457 if (
kstp == 1 .and. &
458 kper /= this%applied_kper .and. &
459 allocated(this%period_block_lines))
then
460 call this%schedule%advance(lines=this%period_block_lines)
461 this%applied_kper =
kper
463 call this%schedule%advance()
467 if (.not. this%schedule%any())
return
470 call this%log_release()
474 call this%particles_staging%resize( &
475 this%particles_staging%num_stored() + &
476 (this%nreleasepoints * this%schedule%count()), &
477 trim(this%memoryPath)//
'-STAGING')
481 do ip = 1, this%nreleasepoints
482 do it = 1, this%schedule%count()
483 t = this%schedule%times(it)
488 'Skipping negative release time (t=', t,
').'
493 'Skipping release time falling after the end of the &
494 &simulation (t=', t,
'). Enable EXTEND_TRACKING to &
495 &release particles after the simulation end time.'
499 call this%release(ip, t)
507 call this%particles%resize( &
508 this%particles_staging%num_stored(), &
510 call this%particles%copy_from(this%particles_staging)
524 real(DP),
dimension(:),
intent(in) :: hnew
525 real(DP),
dimension(:),
intent(inout) :: flowja
526 integer(I4B),
intent(in) :: imover
534 type(
budgettype),
intent(inout) :: model_budget
541 integer(I4B),
intent(in) :: icbcfl
542 integer(I4B),
intent(in) :: ibudfl
543 integer(I4B),
intent(in) :: icbcun
544 integer(I4B),
dimension(:),
optional,
intent(in) :: imap
550 if (this%iprpak > 0)
then
551 write (this%iout,
"(1x,/1x,a,1x,i0)") &
552 'PARTICLE RELEASE FOR PRP', this%ibcnum
553 call this%schedule%log(this%iout)
565 integer(I4B),
intent(in) :: ic
566 real(DP),
intent(in) :: x, y, z
568 real(DP),
allocatable :: polyverts(:, :)
569 real(DP) :: cellsize, tol
571 call this%fmi%dis%get_polyverts(ic, polyverts)
578 cellsize = max(maxval(polyverts(1, :)) - minval(polyverts(1, :)), &
579 maxval(polyverts(2, :)) - minval(polyverts(2, :)))
580 tol = cellsize * cellsize *
dem7
582 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
583 'Error: release point (x=', x,
', y=', y,
') is not in cell ', &
584 this%dis%get_nodeuser(ic)
588 if (z > maxval(this%dis%top))
then
589 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
590 'Error: release point (z=', z,
') is above grid top ', &
594 else if (z < minval(this%dis%bot))
then
595 write (
errmsg,
'(a,g0,a,g0,a,i0)') &
596 'Error: release point (z=', z,
') is below grid bottom ', &
601 deallocate (polyverts)
619 integer(I4B),
intent(in) :: ip
620 real(DP),
intent(in) :: trelease
625 call this%initialize_particle(particle, ip, trelease)
626 np = this%nparticles + 1
628 call this%particles_staging%put(particle, np)
629 deallocate (particle)
630 this%rptm(ip) = this%rptm(ip) +
done
638 integer(I4B),
intent(in) :: ip
639 real(DP),
intent(in) :: trelease
641 logical(LGP) :: draped
642 integer(I4B) :: irow, icol, ilay, icpl
643 integer(I4B) :: ic, icu, ic_old
646 character(len=*),
parameter :: fmticterr = &
647 "('Error in ',a,': Flow model interface does not contain ICELLTYPE. &
648 &ICELLTYPE is required for PRT to distinguish convertible cells &
649 &from confined cells if LOCAL_Z release coordinates are provided. &
650 &Make sure a GWFGRID entry is configured in the PRT FMI package.')"
652 ic = this%rptnode(ip)
654 call create_particle(particle)
656 if (
size(this%boundname) /= 0)
then
657 particle%name = this%boundname(ip)
663 particle%istopweaksink = this%istopweaksink
664 particle%istopzone = this%istopzone
665 particle%idrymeth = this%idrymeth
672 if (this%ibound(ic) == 0)
then
675 call this%dis%highest_active(ic, this%ibound)
676 draped = ic /= ic_old
677 if (.not. draped .and. this%ibound(ic) == 0)
then
688 icu = this%dis%get_nodeuser(ic)
690 select type (dis => this%dis)
692 call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, irow, icol, ilay)
694 call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)
697 particle%izone = this%rptzone(ic)
703 z = this%fmi%dis%bot(ic) + &
704 this%fmi%gwfsat(ic) * &
705 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
706 else if (this%localz)
then
707 z = this%fmi%dis%bot(ic) + &
709 this%fmi%gwfsat(ic) * &
710 (this%fmi%dis%top(ic) - this%fmi%dis%bot(ic))
718 if (this%ichkmeth > 0) &
719 call this%validate_release_point(ic, x, y, z)
724 particle%trelease = trelease
727 if (this%stoptraveltime == huge(1d0))
then
728 particle%tstop = this%stoptime
730 particle%tstop = particle%trelease + this%stoptraveltime
731 if (this%stoptime < particle%tstop) particle%tstop = this%stoptime
734 particle%ttrack = particle%trelease
741 particle%frctrn = this%frctrn
742 particle%iexmeth = this%iexmeth
743 particle%extend = this%extend
744 particle%icycwin = this%icycwin
745 particle%extol = this%extol
759 integer(I4B),
pointer :: iper, ionper, nlist
763 call mem_setptr(iper,
'IPER', this%input_mempath)
764 call mem_setptr(ionper,
'IONPER', this%input_mempath)
766 if (
kper == 1 .and. &
768 (ionper >
nper) .and. &
769 size(this%schedule%time_select%times) == 0)
then
776 call this%schedule%time_select%extend([
dzero])
778 else if (iper /=
kper)
then
783 call mem_setptr(nlist,
'NBOUND', this%input_mempath)
784 call mem_setptr(settings,
'SETTING', this%input_mempath)
787 if (
allocated(this%period_block_lines))
deallocate (this%period_block_lines)
788 allocate (this%period_block_lines(nlist))
790 this%period_block_lines(n) = settings(n)
805 real(DP),
dimension(:),
intent(in) :: hnew
806 real(DP),
dimension(:),
intent(inout) :: flowja
807 integer(I4B),
intent(in) :: imover
811 integer(I4B) :: idiag
815 if (this%nbound <= 0)
return
818 do i = 1, this%nbound
819 node = this%nodelist(i)
824 idiag = this%dis%con%ia(node)
825 rrate = this%rptm(i) * (
done /
delt)
826 flowja(idiag) = flowja(idiag) + rrate
830 this%simvals(i) = rrate
851 call this%obs%StoreObsType(
'prp', .true., indx)
856 call this%obs%StoreObsType(
'to-mvr', .true., indx)
871 character(len=LENVARNAME),
dimension(3) :: drytrack_method = &
872 &[character(len=LENVARNAME) ::
'DROP',
'STOP',
'STAY']
873 character(len=
lenvarname),
dimension(2) :: coorcheck_method = &
874 &[
character(len=LENVARNAME) ::
'NONE',
'EAGER']
875 character(len=LINELENGTH) :: trackfile, trackcsvfile, fname
877 character(len=*),
parameter :: fmtextolwrn = &
878 "('WARNING: EXIT_SOLVE_TOLERANCE is set to ',g10.3,' &
879 &which is much greater than the default value of ',g10.3,'. &
880 &The tolerance that strikes the best balance between accuracy &
881 &and runtime is problem-dependent. Since the variable being &
882 &solved varies from 0 to 1, tolerance values much less than 1 &
883 &typically give the best results.')"
886 call this%BndExtType%source_options()
889 call mem_set_value(this%stoptime,
'STOPTIME', this%input_mempath, &
892 this%input_mempath, found%stoptraveltime)
893 call mem_set_value(this%istopweaksink,
'ISTOPWEAKSINK', this%input_mempath, &
895 call mem_set_value(this%istopzone,
'ISTOPZONE', this%input_mempath, &
897 call mem_set_value(this%drape,
'DRAPE', this%input_mempath, &
899 call mem_set_value(this%idrymeth,
'IDRYMETH', this%input_mempath, &
900 drytrack_method, found%idrymeth)
901 call mem_set_value(trackfile,
'TRACKFILE', this%input_mempath, &
903 call mem_set_value(trackcsvfile,
'TRACKCSVFILE', this%input_mempath, &
905 call mem_set_value(this%localz,
'LOCALZ', this%input_mempath, &
907 call mem_set_value(this%extend,
'EXTEND', this%input_mempath, &
909 call mem_set_value(this%extol,
'EXTOL', this%input_mempath, &
911 call mem_set_value(this%rttol,
'RTTOL', this%input_mempath, &
913 call mem_set_value(this%rtfreq,
'RTFREQ', this%input_mempath, &
915 call mem_set_value(this%frctrn,
'FRCTRN', this%input_mempath, &
917 call mem_set_value(this%iexmeth,
'IEXMETH', this%input_mempath, &
919 call mem_set_value(this%ichkmeth,
'ICHKMETH', this%input_mempath, &
920 coorcheck_method, found%ichkmeth)
921 call mem_set_value(this%icycwin,
'ICYCWIN', this%input_mempath, found%icycwin)
924 if (found%idrymeth)
then
925 if (this%idrymeth == 0)
then
926 write (
errmsg,
'(a)')
'Unsupported dry tracking method. &
927 &DRY_TRACKING_METHOD must be "DROP", "STOP", or "STAY"'
931 this%idrymeth = this%idrymeth - 1
935 if (found%extol)
then
936 if (this%extol <=
dzero) &
937 call store_error(
'EXIT_SOLVE_TOLERANCE MUST BE POSITIVE')
938 if (this%extol > dem2)
then
939 write (
warnmsg, fmt=fmtextolwrn) &
945 if (found%rttol)
then
946 if (this%rttol <=
dzero) &
947 call store_error(
'RELEASE_TIME_TOLERANCE MUST BE POSITIVE')
950 if (found%rtfreq)
then
951 if (this%rtfreq <=
dzero) &
952 call store_error(
'RELEASE_TIME_FREQUENCY MUST BE POSITIVE')
955 if (found%iexmeth)
then
956 if (.not. (this%iexmeth /= 1 .or. this%iexmeth /= 2)) &
958 &1 (BRENT) OR 2 (CHANDRUPATLA)')
961 if (found%ichkmeth)
then
962 if (this%ichkmeth == 0)
then
963 write (
errmsg,
'(a)')
'Unsupported coordinate check method. &
964 &COORDINATE_CHECK_METHOD must be "NONE" or "EAGER"'
968 this%ichkmeth = this%ichkmeth - 1
972 if (found%icycwin)
then
973 if (this%icycwin < 0) &
974 call store_error(
'CYCLE_DETECTION_WINDOW MUST BE NON-NEGATIVE')
978 if (found%trackfile)
then
980 call openfile(this%itrkout, this%iout, trackfile,
'DATA(BINARY)', &
985 fname = trim(trackfile)//
'.hdr'
986 call openfile(this%itrkhdr, this%iout, fname,
'CSV', &
987 filstat_opt=
'REPLACE', mode_opt=
mnormal)
991 if (found%trackcsvfile)
then
993 call openfile(this%itrkcsv, this%iout, trackcsvfile,
'CSV', &
994 filstat_opt=
'REPLACE')
1004 call this%prp_log_options(found, trackfile, trackcsvfile)
1025 character(len=*),
intent(in) :: trackfile
1026 character(len=*),
intent(in) :: trackcsvfile
1029 character(len=*),
parameter :: fmttrkbin = &
1030 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
1031 &'OPENED ON UNIT: ', I0)"
1032 character(len=*),
parameter :: fmttrkcsv = &
1033 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
1034 &'OPENED ON UNIT: ', I0)"
1036 write (this%iout,
'(1x,a)')
'PROCESSING PARTICLE INPUT DIMENSIONS'
1038 if (found%frctrn)
then
1039 write (this%iout,
'(4x,a)') &
1040 'IF DISV, TRACKING WILL USE THE TERNARY METHOD REGARDLESS OF CELL TYPE'
1043 if (found%trackfile)
then
1044 write (this%iout, fmttrkbin) trim(adjustl(trackfile)), this%itrkout
1047 if (found%trackcsvfile)
then
1048 write (this%iout, fmttrkcsv) trim(adjustl(trackcsvfile)), this%itrkcsv
1051 write (this%iout,
'(1x,a)')
'END OF PARTICLE INPUT DIMENSIONS'
1064 call mem_set_value(this%nreleasepoints,
'NRELEASEPTS', this%input_mempath, &
1066 call mem_set_value(this%nreleasetimes,
'NRELEASETIMES', this%input_mempath, &
1067 found%nreleasetimes)
1069 write (this%iout,
'(1x,a)')
'PROCESSING PARTICLE INPUT DIMENSIONS'
1070 write (this%iout,
'(4x,a,i0)')
'NRELEASEPTS = ', this%nreleasepoints
1071 write (this%iout,
'(4x,a,i0)')
'NRELEASETIMES = ', this%nreleasetimes
1072 write (this%iout,
'(1x,a)')
'END OF PARTICLE INPUT DIMENSIONS'
1075 this%maxbound = this%nreleasepoints
1076 this%nbound = this%nreleasepoints
1078 call this%prp_allocate_arrays()
1079 call this%prp_packagedata()
1080 call this%prp_releasetimes()
1081 call this%prp_load_releasetimefrequency()
1089 this%nreleasepoints = 0
1090 this%nreleasetimes = 0
1094 call this%prp_allocate_arrays()
1106 integer(I4B),
dimension(:),
pointer,
contiguous :: irptno
1107 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellids
1108 real(DP),
dimension(:),
pointer,
contiguous :: xrpts, yrpts, zrpts
1110 contiguous :: boundnames
1111 character(len=LENBOUNDNAME) :: bndName, bndNameTemp
1112 character(len=9) :: cno
1113 character(len=20) :: cellidstr
1114 integer(I4B),
dimension(:),
allocatable :: nboundchk
1115 integer(I4B),
dimension(:),
pointer :: cellid
1116 integer(I4B) :: n, noder, nodeu, rptno
1119 call mem_setptr(irptno,
'IRPTNO', this%input_mempath)
1120 call mem_setptr(cellids,
'CELLID', this%input_mempath)
1121 call mem_setptr(xrpts,
'XRPT', this%input_mempath)
1122 call mem_setptr(yrpts,
'YRPT', this%input_mempath)
1123 call mem_setptr(zrpts,
'ZRPT', this%input_mempath)
1124 call mem_setptr(boundnames,
'BOUNDNAME', this%input_mempath)
1127 allocate (nboundchk(this%nreleasepoints))
1128 do n = 1, this%nreleasepoints
1132 write (this%iout,
'(/1x,a)')
'PROCESSING '//trim(adjustl(this%packName)) &
1135 do n = 1,
size(irptno)
1139 if (rptno < 1 .or. rptno > this%nreleasepoints)
then
1140 write (
errmsg,
'(a,i0,a,i0,a)') &
1141 'Expected ', this%nreleasepoints,
' release points. &
1142 &Points must be numbered from 1 to ', this%nreleasepoints,
'.'
1148 nboundchk(rptno) = nboundchk(rptno) + 1
1151 cellid => cellids(:, n)
1154 if (this%dis%ndim == 1)
then
1156 elseif (this%dis%ndim == 2)
then
1157 nodeu =
get_node(cellid(1), 1, cellid(2), &
1158 this%dis%mshape(1), 1, &
1161 nodeu =
get_node(cellid(1), cellid(2), cellid(3), &
1162 this%dis%mshape(1), &
1163 this%dis%mshape(2), &
1168 noder = this%dis%get_nodenumber(nodeu, 1)
1169 if (noder <= 0)
then
1170 call this%dis%nodeu_to_string(nodeu, cellidstr)
1172 'Particle release point configured for nonexistent cell: '// &
1173 trim(adjustl(cellidstr))//
'. This cell has IDOMAIN <= 0 and '&
1174 &
'therefore does not exist in the model grid.'
1178 this%rptnode(rptno) = noder
1181 if (this%localz .and. (zrpts(n) < 0 .or. zrpts(n) > 1))
then
1182 call store_error(
'Local z coordinate must fall in the interval [0, 1]')
1187 this%rptx(rptno) = xrpts(n)
1188 this%rpty(rptno) = yrpts(n)
1189 this%rptz(rptno) = zrpts(n)
1192 write (cno,
'(i9.9)') rptno
1193 bndname =
'PRP'//cno
1196 if (this%inamedbound /= 0)
then
1197 bndnametemp = boundnames(n)
1198 if (bndnametemp /=
'') bndname = bndnametemp
1204 this%rptname(rptno) = bndname
1207 write (this%iout,
'(1x,a)') &
1208 'END OF '//trim(adjustl(this%packName))//
' PACKAGEDATA'
1211 do n = 1, this%nreleasepoints
1212 if (nboundchk(n) == 0)
then
1213 write (
errmsg,
'(a,a,1x,i0,a)')
'No data specified for particle ', &
1214 'release point', n,
'.'
1216 else if (nboundchk(n) > 1)
then
1217 write (
errmsg,
'(a,1x,i0,1x,a,1x,i0,1x,a)') &
1218 'Data for particle release point', n,
'specified', nboundchk(n), &
1230 deallocate (nboundchk)
1246 real(DP),
dimension(:),
pointer,
contiguous :: time
1247 integer(I4B) :: n, isize
1248 real(DP),
allocatable :: times(:)
1250 if (this%nreleasetimes <= 0)
return
1253 allocate (times(this%nreleasetimes))
1256 call get_isize(
'TIME', this%input_mempath, isize)
1258 if (isize <= 0)
then
1259 errmsg =
"RELEASTIMES block expected when &
1260 &NRELEASETIMES dimension is non-zero."
1266 call mem_setptr(time,
'TIME', this%input_mempath)
1269 do n = 1,
size(time)
1274 call this%schedule%time_select%extend(times)
1277 if (.not. this%schedule%time_select%increasing())
then
1278 errmsg =
"RELEASTIMES block entries must strictly increase."
1294 real(DP),
allocatable :: times(:)
1297 if (this%rtfreq <=
dzero)
return
1306 call this%schedule%time_select%extend(times)
1309 if (.not. this%schedule%time_select%increasing())
then
1310 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
real(dp), parameter dem7
real constant 1e-7
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, tol)
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_commit(this)
Commit staged particle state to the "final" store.
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.