MODFLOW 6  version 6.7.0.dev3
USGS Modular Hydrologic Model
prt.f90
Go to the documentation of this file.
1 module prtmodule
2  use kindmodule, only: dp, i4b, lgp
3  use errorutilmodule, only: pstop
12  use dismodule, only: distype, dis_cr
13  use disvmodule, only: disvtype, disv_cr
14  use disumodule, only: disutype, disu_cr
15  use prtprpmodule, only: prtprptype
16  use prtfmimodule, only: prtfmitype
17  use prtmipmodule, only: prtmiptype
18  use prtocmodule, only: prtoctype
19  use budgetmodule, only: budgettype
20  use listmodule, only: listtype
29 
30  implicit none
31 
32  private
33  public :: prt_cr
34  public :: prtmodeltype
35  public :: prt_nbasepkg, prt_nmultipkg
36  public :: prt_basepkg, prt_multipkg
37 
38  integer(I4B), parameter :: nbditems = 1
39  character(len=LENBUDTXT), dimension(NBDITEMS) :: budtxt
40  data budtxt/' STORAGE'/
41 
42  !> @brief Particle tracking (PRT) model
43  type, extends(numericalmodeltype) :: prtmodeltype
44  type(prtfmitype), pointer :: fmi => null() ! flow model interface
45  type(prtmiptype), pointer :: mip => null() ! model input package
46  type(prtoctype), pointer :: oc => null() ! output control package
47  type(budgettype), pointer :: budget => null() ! budget object
48  class(methodtype), pointer :: method => null() ! tracking method
49  type(particleeventdispatchertype), pointer :: events => null() ! event dispatcher
50  class(particletrackstype), pointer :: tracks ! track output manager
51  integer(I4B), pointer :: infmi => null() ! unit number FMI
52  integer(I4B), pointer :: inmip => null() ! unit number MIP
53  integer(I4B), pointer :: inmvt => null() ! unit number MVT
54  integer(I4B), pointer :: inmst => null() ! unit number MST
55  integer(I4B), pointer :: inadv => null() ! unit number ADV
56  integer(I4B), pointer :: indsp => null() ! unit number DSP
57  integer(I4B), pointer :: inssm => null() ! unit number SSM
58  integer(I4B), pointer :: inoc => null() ! unit number OC
59  integer(I4B), pointer :: nprp => null() ! number of PRP packages in the model
60  real(dp), dimension(:), pointer, contiguous :: masssto => null() !< particle mass storage in cells, new value
61  real(dp), dimension(:), pointer, contiguous :: massstoold => null() !< particle mass storage in cells, old value
62  real(dp), dimension(:), pointer, contiguous :: ratesto => null() !< particle mass storage rate in cells
63  contains
64  ! Override BaseModelType procs
65  procedure :: model_df => prt_df
66  procedure :: model_ar => prt_ar
67  procedure :: model_rp => prt_rp
68  procedure :: model_ad => prt_ad
69  procedure :: model_cq => prt_cq
70  procedure :: model_bd => prt_bd
71  procedure :: model_ot => prt_ot
72  procedure :: model_da => prt_da
73  procedure :: model_solve => prt_solve
74 
75  ! Private utilities
76  procedure :: allocate_scalars
77  procedure :: allocate_arrays
78  procedure, private :: package_create
79  procedure, private :: ftype_check
80  procedure, private :: prt_ot_flow
81  procedure, private :: prt_ot_saveflow
82  procedure, private :: prt_ot_printflow
83  procedure, private :: prt_ot_dv
84  procedure, private :: prt_ot_bdsummary
85  procedure, private :: prt_cq_sto
86  procedure, private :: create_packages
87  procedure, private :: create_bndpkgs
88  procedure, private :: log_namfile_options
89 
90  end type prtmodeltype
91 
92  !> @brief PRT base package array descriptors
93  !!
94  !! PRT6 model base package types. Only listed packages are candidates
95  !! for input and these will be loaded in the order specified.
96  !<
97  integer(I4B), parameter :: prt_nbasepkg = 50
98  character(len=LENPACKAGETYPE), dimension(PRT_NBASEPKG) :: prt_basepkg
99  data prt_basepkg/'DIS6 ', 'DISV6', 'DISU6', 'IC6 ', 'MST6 ', & ! 5
100  &'ADV6 ', 'DSP6 ', 'SSM6 ', 'MIP6 ', 'CNC6 ', & ! 10
101  &'OC6 ', ' ', 'FMI6 ', ' ', 'IST6 ', & ! 15
102  &'LKT6 ', 'SFT6 ', 'MWT6 ', 'UZT6 ', 'MVT6 ', & ! 20
103  &'API6 ', ' ', ' ', ' ', ' ', & ! 25
104  25*' '/ ! 50
105 
106  !> @brief PRT multi package array descriptors
107  !!
108  !! PRT6 model multi-instance package types. Only listed packages are
109  !! candidates for input and these will be loaded in the order specified.
110  !<
111  integer(I4B), parameter :: prt_nmultipkg = 50
112  character(len=LENPACKAGETYPE), dimension(PRT_NMULTIPKG) :: prt_multipkg
113  data prt_multipkg/'PRP6 ', ' ', ' ', ' ', ' ', & ! 5
114  &45*' '/ ! 50
115 
116  ! size of supported model package arrays
117  integer(I4B), parameter :: niunit_prt = prt_nbasepkg + prt_nmultipkg
118 
119 contains
120 
121  !> @brief Create a new particle tracking model object
122  subroutine prt_cr(filename, id, modelname)
123  ! modules
124  use listsmodule, only: basemodellist
127  use compilerversion
132  ! dummy
133  character(len=*), intent(in) :: filename
134  integer(I4B), intent(in) :: id
135  character(len=*), intent(in) :: modelname
136  ! local
137  type(prtmodeltype), pointer :: this
138  class(basemodeltype), pointer :: model
139  character(len=LENMEMPATH) :: input_mempath
140  character(len=LINELENGTH) :: lst_fname
141  type(prtnamparamfoundtype) :: found
142 
143  ! Allocate a new PRT Model (this)
144  allocate (this)
145 
146  ! Set this before any allocs in the memory manager can be done
147  this%memoryPath = create_mem_path(modelname)
148 
149  ! Allocate event system and track output manager
150  allocate (this%events)
151  allocate (this%tracks)
152 
153  ! Allocate scalars and add model to basemodellist
154  call this%allocate_scalars(modelname)
155  model => this
156  call addbasemodeltolist(basemodellist, model)
157 
158  ! Assign variables
159  this%filename = filename
160  this%name = modelname
161  this%macronym = 'PRT'
162  this%id = id
163 
164  ! Set input model namfile memory path
165  input_mempath = create_mem_path(modelname, 'NAM', idm_context)
166 
167  ! Copy options from input context
168  call mem_set_value(this%iprpak, 'PRINT_INPUT', input_mempath, &
169  found%print_input)
170  call mem_set_value(this%iprflow, 'PRINT_FLOWS', input_mempath, &
171  found%print_flows)
172  call mem_set_value(this%ipakcb, 'SAVE_FLOWS', input_mempath, &
173  found%save_flows)
174 
175  ! Create the list file
176  call this%create_lstfile(lst_fname, filename, found%list, &
177  'PARTICLE TRACKING MODEL (PRT)')
178 
179  ! Activate save_flows if found
180  if (found%save_flows) then
181  this%ipakcb = -1
182  end if
183 
184  ! Create model packages
185  call this%create_packages()
186 
187  ! Log options
188  if (this%iout > 0) then
189  call this%log_namfile_options(found)
190  end if
191 
192  end subroutine prt_cr
193 
194  !> @brief Define packages
195  !!
196  !! (1) call df routines for each package
197  !! (2) set variables and pointers
198  !<
199  subroutine prt_df(this)
200  ! modules
201  use prtprpmodule, only: prtprptype
202  ! dummy
203  class(prtmodeltype) :: this
204  ! local
205  integer(I4B) :: ip
206  class(bndtype), pointer :: packobj
207 
208  ! Define packages and utility objects
209  call this%dis%dis_df()
210  call this%fmi%fmi_df(this%dis, 1)
211  call this%oc%oc_df()
212  call this%budget%budget_df(niunit_prt, 'MASS', 'M')
213 
214  ! Define packages and assign iout for time series managers
215  do ip = 1, this%bndlist%Count()
216  packobj => getbndfromlist(this%bndlist, ip)
217  call packobj%bnd_df(this%dis%nodes, this%dis)
218  packobj%TsManager%iout = this%iout
219  packobj%TasManager%iout = this%iout
220  end do
221 
222  ! Allocate model arrays
223  call this%allocate_arrays()
224 
225  end subroutine prt_df
226 
227  !> @brief Allocate and read
228  !!
229  !! (1) allocates and reads packages part of this model,
230  !! (2) allocates memory for arrays part of this model object
231  !<
232  subroutine prt_ar(this)
233  ! modules
234  use constantsmodule, only: dhnoflo
235  use prtprpmodule, only: prtprptype
236  use prtmipmodule, only: prtmiptype
238  ! dummy
239  class(prtmodeltype) :: this
240  ! locals
241  integer(I4B) :: ip, nprp
242  class(bndtype), pointer :: packobj
243 
244  ! Set up basic packages
245  call this%fmi%fmi_ar(this%ibound)
246  if (this%inmip > 0) call this%mip%mip_ar()
247 
248  ! Set up output control and budget
249  call this%oc%oc_ar(this%dis, dhnoflo)
250  call this%budget%set_ibudcsv(this%oc%ibudcsv)
251 
252  ! Select tracking events
253  call this%tracks%select_events( &
254  this%oc%trackrelease, &
255  this%oc%trackfeatexit, &
256  this%oc%tracktimestep, &
257  this%oc%trackterminate, &
258  this%oc%trackweaksink, &
259  this%oc%trackusertime, &
260  this%oc%tracksubfexit, &
261  this%oc%trackdropped)
262 
263  ! Set up boundary pkgs and pkg-scoped track files
264  nprp = 0
265  do ip = 1, this%bndlist%Count()
266  packobj => getbndfromlist(this%bndlist, ip)
267  select type (packobj)
268  type is (prtprptype)
269  nprp = nprp + 1
270  call packobj%prp_set_pointers(this%ibound, this%mip%izone)
271  call packobj%bnd_ar()
272  call packobj%bnd_ar()
273  if (packobj%itrkout > 0) then
274  call this%tracks%init_file( &
275  packobj%itrkout, &
276  iprp=nprp)
277  end if
278  if (packobj%itrkcsv > 0) then
279  call this%tracks%init_file( &
280  packobj%itrkcsv, &
281  csv=.true., &
282  iprp=nprp)
283  end if
284  class default
285  call packobj%bnd_ar()
286  end select
287  end do
288 
289  ! Set up model-scoped track files
290  if (this%oc%itrkout > 0) &
291  call this%tracks%init_file(this%oc%itrkout)
292  if (this%oc%itrkcsv > 0) &
293  call this%tracks%init_file(this%oc%itrkcsv, csv=.true.)
294 
295  ! Set up the tracking method
296  select type (dis => this%dis)
297  type is (distype)
298  call method_dis%init( &
299  fmi=this%fmi, &
300  events=this%events, &
301  izone=this%mip%izone, &
302  flowja=this%flowja, &
303  porosity=this%mip%porosity, &
304  retfactor=this%mip%retfactor, &
305  tracktimes=this%oc%tracktimes)
306  this%method => method_dis
307  type is (disvtype)
308  call method_disv%init( &
309  fmi=this%fmi, &
310  events=this%events, &
311  izone=this%mip%izone, &
312  flowja=this%flowja, &
313  porosity=this%mip%porosity, &
314  retfactor=this%mip%retfactor, &
315  tracktimes=this%oc%tracktimes)
316  this%method => method_disv
317  end select
318 
319  ! Subscribe track output manager to events
320  call this%events%subscribe(this%tracks)
321 
322  ! Set verbose tracing if requested
323  if (this%oc%dump_event_trace) this%tracks%iout = 0
324  end subroutine prt_ar
325 
326  !> @brief Read and prepare (calls package read and prepare routines)
327  subroutine prt_rp(this)
328  use tdismodule, only: readnewdata
329  ! dummy
330  class(prtmodeltype) :: this
331  ! local
332  class(bndtype), pointer :: packobj
333  integer(I4B) :: ip
334 
335  ! Check with TDIS on whether or not it is time to RP
336  if (.not. readnewdata) return
337 
338  ! Read and prepare
339  if (this%inoc > 0) call this%oc%oc_rp()
340  do ip = 1, this%bndlist%Count()
341  packobj => getbndfromlist(this%bndlist, ip)
342  call packobj%bnd_rp()
343  end do
344  end subroutine prt_rp
345 
346  !> @brief Time step advance (calls package advance subroutines)
347  subroutine prt_ad(this)
348  ! modules
350  ! dummy
351  class(prtmodeltype) :: this
352  class(bndtype), pointer :: packobj
353  ! local
354  integer(I4B) :: irestore
355  integer(I4B) :: ip, n, i
356 
357  ! Reset state variable
358  irestore = 0
359  if (ifailedstepretry > 0) irestore = 1
360 
361  ! Copy masssto into massstoold
362  do n = 1, this%dis%nodes
363  this%massstoold(n) = this%masssto(n)
364  end do
365 
366  ! Advance fmi
367  call this%fmi%fmi_ad()
368 
369  ! Advance
370  do ip = 1, this%bndlist%Count()
371  packobj => getbndfromlist(this%bndlist, ip)
372  call packobj%bnd_ad()
373  if (isimcheck > 0) then
374  call packobj%bnd_ck()
375  end if
376  end do
377  !
378  ! Initialize the flowja array. Flowja is calculated each time,
379  ! even if output is suppressed. (Flowja represents flow of particle
380  ! mass and is positive into a cell. Currently, each particle is assigned
381  ! unit mass.) Flowja is updated continually as particles are tracked
382  ! over the time step and at the end of the time step. The diagonal
383  ! position of the flowja array will contain the flow residual.
384  do i = 1, this%dis%nja
385  this%flowja(i) = dzero
386  end do
387  end subroutine prt_ad
388 
389  !> @brief Calculate intercell flow (flowja)
390  subroutine prt_cq(this, icnvg, isuppress_output)
391  ! modules
392  use sparsemodule, only: csr_diagsum
393  use tdismodule, only: delt
394  use prtprpmodule, only: prtprptype
395  ! dummy
396  class(prtmodeltype) :: this
397  integer(I4B), intent(in) :: icnvg
398  integer(I4B), intent(in) :: isuppress_output
399  ! local
400  integer(I4B) :: i
401  integer(I4B) :: ip
402  class(bndtype), pointer :: packobj
403  real(DP) :: tled
404 
405  ! Flowja is calculated each time, even if output is suppressed.
406  ! Flowja represents flow of particle mass and is positive into a cell.
407  ! Currently, each particle is assigned unit mass.
408  !
409  ! Reciprocal of time step size.
410  tled = done / delt
411  !
412  ! Flowja was updated continually as particles were tracked over the
413  ! time step. At this point, flowja contains the net particle mass
414  ! exchanged between cells during the time step. To convert these to
415  ! flow rates (particle mass per time), divide by the time step size.
416  do i = 1, this%dis%nja
417  this%flowja(i) = this%flowja(i) * tled
418  end do
419 
420  ! Particle mass storage
421  call this%prt_cq_sto()
422 
423  ! Go through packages and call cq routines. Just a formality.
424  do ip = 1, this%bndlist%Count()
425  packobj => getbndfromlist(this%bndlist, ip)
426  call packobj%bnd_cq(this%masssto, this%flowja)
427  end do
428 
429  ! Finalize calculation of flowja by adding face flows to the diagonal.
430  ! This results in the flow residual being stored in the diagonal
431  ! position for each cell.
432  call csr_diagsum(this%dis%con%ia, this%flowja)
433  end subroutine prt_cq
434 
435  !> @brief Calculate particle mass storage
436  subroutine prt_cq_sto(this)
437  ! modules
438  use tdismodule, only: delt
439  use prtprpmodule, only: prtprptype
440  ! dummy
441  class(prtmodeltype) :: this
442  ! local
443  integer(I4B) :: ip
444  class(bndtype), pointer :: packobj
445  integer(I4B) :: n
446  integer(I4B) :: np
447  integer(I4B) :: idiag
448  integer(I4B) :: istatus
449  real(DP) :: tled
450  real(DP) :: rate
451 
452  ! Reciprocal of time step size.
453  tled = done / delt
454 
455  ! Particle mass storage rate
456  do n = 1, this%dis%nodes
457  this%masssto(n) = dzero
458  this%ratesto(n) = dzero
459  end do
460  do ip = 1, this%bndlist%Count()
461  packobj => getbndfromlist(this%bndlist, ip)
462  select type (packobj)
463  type is (prtprptype)
464  do np = 1, packobj%nparticles
465  istatus = packobj%particles%istatus(np)
466  ! this may need to change if istatus flags change
467  if ((istatus > 0) .and. (istatus /= term_unreleased)) then
468  n = packobj%particles%itrdomain(np, level_feature)
469  ! Each particle currently assigned unit mass
470  this%masssto(n) = this%masssto(n) + done
471  end if
472  end do
473  end select
474  end do
475  do n = 1, this%dis%nodes
476  rate = -(this%masssto(n) - this%massstoold(n)) * tled
477  this%ratesto(n) = rate
478  idiag = this%dis%con%ia(n)
479  this%flowja(idiag) = this%flowja(idiag) + rate
480  end do
481  end subroutine prt_cq_sto
482 
483  !> @brief Calculate flows and budget
484  !!
485  !! (1) Calculate intercell flows (flowja)
486  !! (2) Calculate package contributions to model budget
487  !!
488  !<
489  subroutine prt_bd(this, icnvg, isuppress_output)
490  ! modules
491  use tdismodule, only: delt
492  use budgetmodule, only: rate_accumulator
493  ! dummy
494  class(prtmodeltype) :: this
495  integer(I4B), intent(in) :: icnvg
496  integer(I4B), intent(in) :: isuppress_output
497  ! local
498  integer(I4B) :: ip
499  class(bndtype), pointer :: packobj
500  real(DP) :: rin
501  real(DP) :: rout
502 
503  ! Budget routines (start by resetting). Sole purpose of this section
504  ! is to add in and outs to model budget. All ins and out for a model
505  ! should be added here to this%budget. In a subsequent exchange call,
506  ! exchange flows might also be added.
507  call this%budget%reset()
508  call rate_accumulator(this%ratesto, rin, rout)
509  call this%budget%addentry(rin, rout, delt, budtxt(1), &
510  isuppress_output, ' PRT')
511  do ip = 1, this%bndlist%Count()
512  packobj => getbndfromlist(this%bndlist, ip)
513  call packobj%bnd_bd(this%budget)
514  end do
515  end subroutine prt_bd
516 
517  !> @brief Print and/or save model output
518  subroutine prt_ot(this)
519  use tdismodule, only: tdis_ot, endofperiod
520  ! dummy
521  class(prtmodeltype) :: this
522  ! local
523  integer(I4B) :: idvsave
524  integer(I4B) :: idvprint
525  integer(I4B) :: icbcfl
526  integer(I4B) :: icbcun
527  integer(I4B) :: ibudfl
528  integer(I4B) :: ipflag
529 
530  ! Note: particle tracking output is handled elsewhere
531 
532  ! Set write and print flags
533  idvsave = 0
534  idvprint = 0
535  icbcfl = 0
536  ibudfl = 0
537  if (this%oc%oc_save('CONCENTRATION')) idvsave = 1
538  if (this%oc%oc_print('CONCENTRATION')) idvprint = 1
539  if (this%oc%oc_save('BUDGET')) icbcfl = 1
540  if (this%oc%oc_print('BUDGET')) ibudfl = 1
541  icbcun = this%oc%oc_save_unit('BUDGET')
542 
543  ! Override ibudfl and idvprint flags for nonconvergence
544  ! and end of period
545  ibudfl = this%oc%set_print_flag('BUDGET', 1, endofperiod)
546  idvprint = this%oc%set_print_flag('CONCENTRATION', 1, endofperiod)
547 
548  ! Save and print flows
549  call this%prt_ot_flow(icbcfl, ibudfl, icbcun)
550 
551  ! Save and print dependent variables
552  call this%prt_ot_dv(idvsave, idvprint, ipflag)
553 
554  ! Print budget summaries
555  call this%prt_ot_bdsummary(ibudfl, ipflag)
556 
557  ! Timing Output; if any dependent variables or budgets
558  ! are printed, then ipflag is set to 1.
559  if (ipflag == 1) call tdis_ot(this%iout)
560  end subroutine prt_ot
561 
562  !> @brief Save flows
563  subroutine prt_ot_flow(this, icbcfl, ibudfl, icbcun)
564  use prtprpmodule, only: prtprptype
565  class(prtmodeltype) :: this
566  integer(I4B), intent(in) :: icbcfl
567  integer(I4B), intent(in) :: ibudfl
568  integer(I4B), intent(in) :: icbcun
569  class(bndtype), pointer :: packobj
570  integer(I4B) :: ip
571 
572  ! Save PRT flows
573  call this%prt_ot_saveflow(this%dis%nja, this%flowja, icbcfl, icbcun)
574  do ip = 1, this%bndlist%Count()
575  packobj => getbndfromlist(this%bndlist, ip)
576  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=0, icbcun=icbcun)
577  end do
578 
579  ! Save advanced package flows
580  do ip = 1, this%bndlist%Count()
581  packobj => getbndfromlist(this%bndlist, ip)
582  call packobj%bnd_ot_package_flows(icbcfl=icbcfl, ibudfl=0)
583  end do
584 
585  ! Print PRT flows
586  call this%prt_ot_printflow(ibudfl, this%flowja)
587  do ip = 1, this%bndlist%Count()
588  packobj => getbndfromlist(this%bndlist, ip)
589  call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=ibudfl, icbcun=0)
590  end do
591 
592  ! Print advanced package flows
593  do ip = 1, this%bndlist%Count()
594  packobj => getbndfromlist(this%bndlist, ip)
595  call packobj%bnd_ot_package_flows(icbcfl=0, ibudfl=ibudfl)
596  end do
597  end subroutine prt_ot_flow
598 
599  !> @brief Save intercell flows
600  subroutine prt_ot_saveflow(this, nja, flowja, icbcfl, icbcun)
601  ! dummy
602  class(prtmodeltype) :: this
603  integer(I4B), intent(in) :: nja
604  real(DP), dimension(nja), intent(in) :: flowja
605  integer(I4B), intent(in) :: icbcfl
606  integer(I4B), intent(in) :: icbcun
607  ! local
608  integer(I4B) :: ibinun
609 
610  ! Set unit number for binary output
611  if (this%ipakcb < 0) then
612  ibinun = icbcun
613  elseif (this%ipakcb == 0) then
614  ibinun = 0
615  else
616  ibinun = this%ipakcb
617  end if
618  if (icbcfl == 0) ibinun = 0
619 
620  ! Write the face flows if requested
621  if (ibinun /= 0) then
622  call this%dis%record_connection_array(flowja, ibinun, this%iout)
623  end if
624  end subroutine prt_ot_saveflow
625 
626  !> @brief Print intercell flows
627  subroutine prt_ot_printflow(this, ibudfl, flowja)
628  ! modules
629  use tdismodule, only: kper, kstp
630  use constantsmodule, only: lenbigline
631  ! dummy
632  class(prtmodeltype) :: this
633  integer(I4B), intent(in) :: ibudfl
634  real(DP), intent(inout), dimension(:) :: flowja
635  ! local
636  character(len=LENBIGLINE) :: line
637  character(len=30) :: tempstr
638  integer(I4B) :: n, ipos, m
639  real(DP) :: qnm
640  ! formats
641  character(len=*), parameter :: fmtiprflow = &
642  "(/,4x,'CALCULATED INTERCELL FLOW &
643  &FOR PERIOD ', i0, ' STEP ', i0)"
644 
645  ! Write flowja to list file if requested
646  if (ibudfl /= 0 .and. this%iprflow > 0) then
647  write (this%iout, fmtiprflow) kper, kstp
648  do n = 1, this%dis%nodes
649  line = ''
650  call this%dis%noder_to_string(n, tempstr)
651  line = trim(tempstr)//':'
652  do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
653  m = this%dis%con%ja(ipos)
654  call this%dis%noder_to_string(m, tempstr)
655  line = trim(line)//' '//trim(tempstr)
656  qnm = flowja(ipos)
657  write (tempstr, '(1pg15.6)') qnm
658  line = trim(line)//' '//trim(adjustl(tempstr))
659  end do
660  write (this%iout, '(a)') trim(line)
661  end do
662  end if
663  end subroutine prt_ot_printflow
664 
665  !> @brief Print dependent variables
666  subroutine prt_ot_dv(this, idvsave, idvprint, ipflag)
667  ! dummy
668  class(prtmodeltype) :: this
669  integer(I4B), intent(in) :: idvsave
670  integer(I4B), intent(in) :: idvprint
671  integer(I4B), intent(inout) :: ipflag
672  ! local
673  class(bndtype), pointer :: packobj
674  integer(I4B) :: ip
675 
676  ! Print advanced package dependent variables
677  do ip = 1, this%bndlist%Count()
678  packobj => getbndfromlist(this%bndlist, ip)
679  call packobj%bnd_ot_dv(idvsave, idvprint)
680  end do
681 
682  ! save head and print head
683  call this%oc%oc_ot(ipflag)
684  end subroutine prt_ot_dv
685 
686  !> @brief Print budget summary
687  subroutine prt_ot_bdsummary(this, ibudfl, ipflag)
688  ! modules
689  use tdismodule, only: kstp, kper, totim, delt
690  ! dummy
691  class(prtmodeltype) :: this
692  integer(I4B), intent(in) :: ibudfl
693  integer(I4B), intent(inout) :: ipflag
694  ! local
695  class(bndtype), pointer :: packobj
696  integer(I4B) :: ip
697 
698  ! Package budget summary
699  do ip = 1, this%bndlist%Count()
700  packobj => getbndfromlist(this%bndlist, ip)
701  call packobj%bnd_ot_bdsummary(kstp, kper, this%iout, ibudfl)
702  end do
703 
704  ! model budget summary
705  call this%budget%finalize_step(delt)
706  if (ibudfl /= 0) then
707  ipflag = 1
708  ! model budget summary
709  call this%budget%budget_ot(kstp, kper, this%iout)
710  end if
711 
712  ! Write to budget csv
713  call this%budget%writecsv(totim)
714  end subroutine prt_ot_bdsummary
715 
716  !> @brief Deallocate
717  subroutine prt_da(this)
718  ! modules
725  ! dummy
726  class(prtmodeltype) :: this
727  ! local
728  integer(I4B) :: ip
729  class(bndtype), pointer :: packobj
730 
731  ! Deallocate idm memory
732  call memorystore_remove(this%name, 'NAM', idm_context)
733  call memorystore_remove(component=this%name, context=idm_context)
734 
735  ! Internal packages
736  call this%dis%dis_da()
737  call this%fmi%fmi_da()
738  call this%mip%mip_da()
739  call this%budget%budget_da()
740  call this%oc%oc_da()
741  deallocate (this%dis)
742  deallocate (this%fmi)
743  deallocate (this%mip)
744  deallocate (this%budget)
745  deallocate (this%oc)
746 
747  ! Method objects
750  call destroy_method_pool()
751 
752  ! Boundary packages
753  do ip = 1, this%bndlist%Count()
754  packobj => getbndfromlist(this%bndlist, ip)
755  call packobj%bnd_da()
756  deallocate (packobj)
757  end do
758 
759  ! Scalars
760  call mem_deallocate(this%infmi)
761  call mem_deallocate(this%inmip)
762  call mem_deallocate(this%inadv)
763  call mem_deallocate(this%indsp)
764  call mem_deallocate(this%inssm)
765  call mem_deallocate(this%inmst)
766  call mem_deallocate(this%inmvt)
767  call mem_deallocate(this%inoc)
768 
769  ! Arrays
770  call mem_deallocate(this%masssto)
771  call mem_deallocate(this%massstoold)
772  call mem_deallocate(this%ratesto)
773 
774  call this%tracks%destroy()
775  deallocate (this%events)
776  deallocate (this%tracks)
777 
778  call this%NumericalModelType%model_da()
779  end subroutine prt_da
780 
781  !> @brief Allocate memory for scalars
782  subroutine allocate_scalars(this, modelname)
783  ! dummy
784  class(prtmodeltype) :: this
785  character(len=*), intent(in) :: modelname
786 
787  ! allocate members from parent class
788  call this%NumericalModelType%allocate_scalars(modelname)
789 
790  ! allocate members that are part of model class
791  call mem_allocate(this%infmi, 'INFMI', this%memoryPath)
792  call mem_allocate(this%inmip, 'INMIP', this%memoryPath)
793  call mem_allocate(this%inmvt, 'INMVT', this%memoryPath)
794  call mem_allocate(this%inmst, 'INMST', this%memoryPath)
795  call mem_allocate(this%inadv, 'INADV', this%memoryPath)
796  call mem_allocate(this%indsp, 'INDSP', this%memoryPath)
797  call mem_allocate(this%inssm, 'INSSM', this%memoryPath)
798  call mem_allocate(this%inoc, 'INOC ', this%memoryPath)
799 
800  this%infmi = 0
801  this%inmip = 0
802  this%inmvt = 0
803  this%inmst = 0
804  this%inadv = 0
805  this%indsp = 0
806  this%inssm = 0
807  this%inoc = 0
808  end subroutine allocate_scalars
809 
810  !> @brief Allocate arrays
811  subroutine allocate_arrays(this)
813  class(prtmodeltype) :: this
814  integer(I4B) :: n
815 
816  ! Allocate arrays in parent type
817  this%nja = this%dis%nja
818  call this%NumericalModelType%allocate_arrays()
819 
820  ! Allocate and initialize arrays
821  call mem_allocate(this%masssto, this%dis%nodes, &
822  'MASSSTO', this%memoryPath)
823  call mem_allocate(this%massstoold, this%dis%nodes, &
824  'MASSSTOOLD', this%memoryPath)
825  call mem_allocate(this%ratesto, this%dis%nodes, &
826  'RATESTO', this%memoryPath)
827  ! explicit model, so these must be manually allocated
828  call mem_allocate(this%x, this%dis%nodes, 'X', this%memoryPath)
829  call mem_allocate(this%rhs, this%dis%nodes, 'RHS', this%memoryPath)
830  call mem_allocate(this%ibound, this%dis%nodes, 'IBOUND', this%memoryPath)
831  do n = 1, this%dis%nodes
832  this%masssto(n) = dzero
833  this%massstoold(n) = dzero
834  this%ratesto(n) = dzero
835  this%x(n) = dzero
836  this%rhs(n) = dzero
837  this%ibound(n) = 1
838  end do
839  end subroutine allocate_arrays
840 
841  !> @brief Create boundary condition packages for this model
842  subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, &
843  inunit, iout)
844  ! modules
845  use constantsmodule, only: linelength
846  use prtprpmodule, only: prp_create
847  use apimodule, only: api_create
848  ! dummy
849  class(prtmodeltype) :: this
850  character(len=*), intent(in) :: filtyp
851  character(len=LINELENGTH) :: errmsg
852  integer(I4B), intent(in) :: ipakid
853  integer(I4B), intent(in) :: ipaknum
854  character(len=*), intent(in) :: pakname
855  character(len=*), intent(in) :: mempath
856  integer(I4B), intent(in) :: inunit
857  integer(I4B), intent(in) :: iout
858  ! local
859  class(bndtype), pointer :: packobj
860  class(bndtype), pointer :: packobj2
861  integer(I4B) :: ip
862 
863  ! This part creates the package object
864  select case (filtyp)
865  case ('PRP6')
866  call prp_create(packobj, ipakid, ipaknum, inunit, iout, &
867  this%name, pakname, mempath, this%fmi)
868  case ('API6')
869  call api_create(packobj, ipakid, ipaknum, inunit, iout, &
870  this%name, pakname, mempath)
871  case default
872  write (errmsg, *) 'Invalid package type: ', filtyp
873  call store_error(errmsg, terminate=.true.)
874  end select
875 
876  ! Packages is the bndlist that is associated with the parent model
877  ! The following statement puts a pointer to this package in the ipakid
878  ! position of packages.
879  do ip = 1, this%bndlist%Count()
880  packobj2 => getbndfromlist(this%bndlist, ip)
881  if (packobj2%packName == pakname) then
882  write (errmsg, '(a,a)') 'Cannot create package. Package name '// &
883  'already exists: ', trim(pakname)
884  call store_error(errmsg, terminate=.true.)
885  end if
886  end do
887  call addbndtolist(this%bndlist, packobj)
888  end subroutine package_create
889 
890  !> @brief Check to make sure required input files have been specified
891  subroutine ftype_check(this, indis)
892  ! dummy
893  class(prtmodeltype) :: this
894  integer(I4B), intent(in) :: indis
895  ! local
896  character(len=LINELENGTH) :: errmsg
897 
898  ! Check for DIS(u) and MIP. Stop if not present.
899  if (indis == 0) then
900  write (errmsg, '(1x,a)') &
901  'Discretization (DIS6, DISV6, or DISU6) package not specified.'
902  call store_error(errmsg)
903  end if
904  if (this%inmip == 0) then
905  write (errmsg, '(1x,a)') &
906  'Model input (MIP6) package not specified.'
907  call store_error(errmsg)
908  end if
909 
910  if (count_errors() > 0) then
911  write (errmsg, '(1x,a)') 'One or more required package(s) not specified.'
912  call store_error(errmsg)
913  call store_error_filename(this%filename)
914  end if
915  end subroutine ftype_check
916 
917  !> @brief Solve the model
918  subroutine prt_solve(this)
920  use prtprpmodule, only: prtprptype
923  ! dummy
924  class(prtmodeltype) :: this
925  ! local
926  integer(I4B) :: np, ip
927  class(bndtype), pointer :: packobj
928  type(particletype), pointer :: particle
929  real(DP) :: tmax
930  integer(I4B) :: iprp
931 
932  ! A single particle is reused in the tracking loops
933  ! to avoid allocating and deallocating it each time.
934  ! get() and put() retrieve and store particle state.
935  call create_particle(particle)
936  ! Loop over PRP packages and particles within them.
937  iprp = 0
938  do ip = 1, this%bndlist%Count()
939  packobj => getbndfromlist(this%bndlist, ip)
940  select type (packobj)
941  type is (prtprptype)
942  iprp = iprp + 1
943  do np = 1, packobj%nparticles
944  ! Get the particle from the store
945  call packobj%particles%get(particle, this%id, iprp, np)
946  ! If particle is permanently unreleased, cycle.
947  ! Raise a termination event if we haven't yet.
948  ! TODO: when we have generic dynamic vectors,
949  ! consider terminating permanently unreleased
950  ! in PRP instead of here. For now, status -8
951  ! indicates the permanently unreleased event
952  ! is not yet recorded, status 8 it has been.
953  if (particle%istatus == (-1 * term_unreleased)) then
954  call this%method%terminate(particle, status=term_unreleased)
955  call packobj%particles%put(particle, np)
956  end if
957  if (particle%istatus > active) cycle ! Skip terminated particles
958  particle%istatus = active ! Set active status in case of release
959  ! If the particle was released this time step, emit a release event
960  if (particle%trelease >= totimc) call this%method%release(particle)
961  ! Maximum time is the end of the time step or the particle
962  ! stop time, whichever comes first, unless it's the final
963  ! time step and the extend option is on, in which case
964  ! it's just the particle stop time.
965  if (endofsimulation .and. particle%extend) then
966  tmax = particle%tstop
967  else
968  tmax = min(totimc + delt, particle%tstop)
969  end if
970  ! Apply the tracking method until the maximum time.
971  call this%method%apply(particle, tmax)
972  ! If the particle timed out, terminate it.
973  ! "Timed out" means it's still active but
974  ! - it reached its stop time, or
975  ! - the simulation is over and not extended.
976  ! We can't detect timeout within the tracking
977  ! method because the method just receives the
978  ! maximum time with no context on what it is.
979  ! TODO maybe think about changing that?
980  if (particle%istatus <= active .and. &
981  (particle%ttrack == particle%tstop .or. &
982  (endofsimulation .and. .not. particle%extend))) &
983  call this%method%terminate(particle, status=term_timeout)
984  ! Return the particle to the store
985  call packobj%particles%put(particle, np)
986  end do
987  end select
988  end do
989  call particle%destroy()
990  deallocate (particle)
991  end subroutine prt_solve
992 
993  !> @brief Source package info and begin to process
994  subroutine create_bndpkgs(this, bndpkgs, pkgtypes, pkgnames, &
995  mempaths, inunits)
996  ! modules
999  ! dummy
1000  class(prtmodeltype) :: this
1001  integer(I4B), dimension(:), allocatable, intent(inout) :: bndpkgs
1002  type(characterstringtype), dimension(:), contiguous, &
1003  pointer, intent(inout) :: pkgtypes
1004  type(characterstringtype), dimension(:), contiguous, &
1005  pointer, intent(inout) :: pkgnames
1006  type(characterstringtype), dimension(:), contiguous, &
1007  pointer, intent(inout) :: mempaths
1008  integer(I4B), dimension(:), contiguous, &
1009  pointer, intent(inout) :: inunits
1010  ! local
1011  integer(I4B) :: ipakid, ipaknum
1012  character(len=LENFTYPE) :: pkgtype, bndptype
1013  character(len=LENPACKAGENAME) :: pkgname
1014  character(len=LENMEMPATH) :: mempath
1015  integer(I4B), pointer :: inunit
1016  integer(I4B) :: n
1017 
1018  if (allocated(bndpkgs)) then
1019  ! create stress packages
1020  ipakid = 1
1021  bndptype = ''
1022  do n = 1, size(bndpkgs)
1023  pkgtype = pkgtypes(bndpkgs(n))
1024  pkgname = pkgnames(bndpkgs(n))
1025  mempath = mempaths(bndpkgs(n))
1026  inunit => inunits(bndpkgs(n))
1027 
1028  if (bndptype /= pkgtype) then
1029  ipaknum = 1
1030  bndptype = pkgtype
1031  end if
1032 
1033  call this%package_create(pkgtype, ipakid, ipaknum, pkgname, mempath, &
1034  inunit, this%iout)
1035  ipakid = ipakid + 1
1036  ipaknum = ipaknum + 1
1037  end do
1038 
1039  ! cleanup
1040  deallocate (bndpkgs)
1041  end if
1042 
1043  end subroutine create_bndpkgs
1044 
1045  !> @brief Source package info and begin to process
1046  subroutine create_packages(this)
1047  ! modules
1050  use arrayhandlersmodule, only: expandarray
1051  use memorymanagermodule, only: mem_setptr
1053  use simvariablesmodule, only: idm_context
1054  use budgetmodule, only: budget_cr
1058  use prtmipmodule, only: mip_cr
1059  use prtfmimodule, only: fmi_cr
1060  use prtocmodule, only: oc_cr
1061  ! dummy
1062  class(prtmodeltype) :: this
1063  ! local
1064  type(characterstringtype), dimension(:), contiguous, &
1065  pointer :: pkgtypes => null()
1066  type(characterstringtype), dimension(:), contiguous, &
1067  pointer :: pkgnames => null()
1068  type(characterstringtype), dimension(:), contiguous, &
1069  pointer :: mempaths => null()
1070  integer(I4B), dimension(:), contiguous, &
1071  pointer :: inunits => null()
1072  character(len=LENMEMPATH) :: model_mempath
1073  character(len=LENFTYPE) :: pkgtype
1074  character(len=LENPACKAGENAME) :: pkgname
1075  character(len=LENMEMPATH) :: mempath
1076  integer(I4B), pointer :: inunit
1077  integer(I4B), dimension(:), allocatable :: bndpkgs
1078  integer(I4B) :: n
1079  integer(I4B) :: indis = 0 ! DIS enabled flag
1080  character(len=LENMEMPATH) :: mempathmip = ''
1081  character(len=LENMEMPATH) :: mempathfmi = ''
1082 
1083  ! set input memory paths, input/model and input/model/namfile
1084  model_mempath = create_mem_path(component=this%name, context=idm_context)
1085 
1086  ! set pointers to model path package info
1087  call mem_setptr(pkgtypes, 'PKGTYPES', model_mempath)
1088  call mem_setptr(pkgnames, 'PKGNAMES', model_mempath)
1089  call mem_setptr(mempaths, 'MEMPATHS', model_mempath)
1090  call mem_setptr(inunits, 'INUNITS', model_mempath)
1091 
1092  do n = 1, size(pkgtypes)
1093  ! attributes for this input package
1094  pkgtype = pkgtypes(n)
1095  pkgname = pkgnames(n)
1096  mempath = mempaths(n)
1097  inunit => inunits(n)
1098 
1099  ! create dis package first as it is a prerequisite for other packages
1100  select case (pkgtype)
1101  case ('DIS6')
1102  indis = 1
1103  call dis_cr(this%dis, this%name, mempath, indis, this%iout)
1104  case ('DISV6')
1105  indis = 1
1106  call disv_cr(this%dis, this%name, mempath, indis, this%iout)
1107  case ('DISU6')
1108  indis = 1
1109  call disu_cr(this%dis, this%name, mempath, indis, this%iout)
1110  case ('MIP6')
1111  this%inmip = 1
1112  mempathmip = mempath
1113  case ('FMI6')
1114  this%infmi = 1
1115  mempathfmi = mempath
1116  case ('OC6')
1117  this%inoc = inunit
1118  case ('PRP6')
1119  call expandarray(bndpkgs)
1120  bndpkgs(size(bndpkgs)) = n
1121  case default
1122  call pstop(1, "Unrecognized package type: "//pkgtype)
1123  end select
1124  end do
1125 
1126  ! Create budget manager
1127  call budget_cr(this%budget, this%name)
1128 
1129  ! Create tracking method pools
1130  call create_method_pool()
1133 
1134  ! Create packages that are tied directly to model
1135  call mip_cr(this%mip, this%name, mempathmip, this%inmip, this%iout, this%dis)
1136  call fmi_cr(this%fmi, this%name, mempathfmi, this%infmi, this%iout)
1137  call oc_cr(this%oc, this%name, this%inoc, this%iout)
1138 
1139  ! Check to make sure that required ftype's have been specified
1140  call this%ftype_check(indis)
1141 
1142  ! Create boundary packages
1143  call this%create_bndpkgs(bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
1144  end subroutine create_packages
1145 
1146  !> @brief Write model namfile options to list file
1147  subroutine log_namfile_options(this, found)
1149  class(prtmodeltype) :: this
1150  type(prtnamparamfoundtype), intent(in) :: found
1151 
1152  write (this%iout, '(1x,a)') 'NAMEFILE OPTIONS:'
1153 
1154  if (found%print_input) then
1155  write (this%iout, '(4x,a)') 'STRESS PACKAGE INPUT WILL BE PRINTED '// &
1156  'FOR ALL MODEL STRESS PACKAGES'
1157  end if
1158 
1159  if (found%print_flows) then
1160  write (this%iout, '(4x,a)') 'PACKAGE FLOWS WILL BE PRINTED '// &
1161  'FOR ALL MODEL PACKAGES'
1162  end if
1163 
1164  if (found%save_flows) then
1165  write (this%iout, '(4x,a)') &
1166  'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL'
1167  end if
1168 
1169  write (this%iout, '(1x,a)') 'END NAMEFILE OPTIONS:'
1170  end subroutine log_namfile_options
1171 
1172 end module prtmodule
This module contains the API package methods.
Definition: gwf-api.f90:12
subroutine, public api_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
@ brief Create a new package object
Definition: gwf-api.f90:51
subroutine, public addbasemodeltolist(list, model)
Definition: BaseModel.f90:161
This module contains the base boundary package.
subroutine, public addbndtolist(list, bnd)
Add boundary to package list.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
This module contains the BudgetModule.
Definition: Budget.f90:20
subroutine, public budget_cr(this, name_model)
@ brief Create a new budget object
Definition: Budget.f90:84
subroutine, public rate_accumulator(flow, rin, rout)
@ brief Rate accumulator subroutine
Definition: Budget.f90:632
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition: Constants.f90:45
@ mnormal
normal output mode
Definition: Constants.f90:206
integer(i4b), parameter lenpackagename
maximum length of the package name
Definition: Constants.f90:23
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
Definition: Constants.f90:38
integer(i4b), parameter lenbigline
maximum length of a big line
Definition: Constants.f90:15
real(dp), parameter dhnoflo
real no flow constant
Definition: Constants.f90:93
integer(i4b), parameter lenpakloc
maximum length of a package location
Definition: Constants.f90:50
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
Definition: Constants.f90:39
real(dp), parameter dzero
real constant zero
Definition: Constants.f90:65
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
Definition: Constants.f90:37
integer(i4b), parameter lenmempath
maximum length of the memory path
Definition: Constants.f90:27
real(dp), parameter done
real constant 1
Definition: Constants.f90:76
Definition: Dis.f90:1
subroutine, public dis_cr(dis, name_model, input_mempath, inunit, iout)
Create a new structured discretization object.
Definition: Dis.f90:99
subroutine, public disu_cr(dis, name_model, input_mempath, inunit, iout)
Create a new unstructured discretization object.
Definition: Disu.f90:127
subroutine, public disv_cr(dis, name_model, input_mempath, inunit, iout)
Create a new discretization by vertices object.
Definition: Disv.f90:111
subroutine pstop(status, message)
Stop the program, optionally specifying an error status code.
Definition: ErrorUtil.f90:24
subroutine, public lowcase(word)
Convert to lower case.
subroutine, public parseline(line, nwords, words, inunit, filename)
Parse a line into words.
subroutine, public upcase(word)
Convert to upper case.
This module defines variable data types.
Definition: kind.f90:8
type(listtype), public basemodellist
Definition: mf6lists.f90:16
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_remove(component, subcomponent, context)
Cell-level tracking methods.
subroutine, public create_method_cell_pool()
Create the cell method pool.
subroutine, public destroy_method_cell_pool()
Destroy the cell method pool.
Particle tracking strategies.
Definition: Method.f90:2
@, public level_feature
Definition: Method.f90:41
Model-level tracking methods.
Definition: MethodPool.f90:2
type(methoddisvtype), pointer, public method_disv
Definition: MethodPool.f90:12
type(methoddistype), pointer, public method_dis
Definition: MethodPool.f90:11
subroutine, public create_method_pool()
Create the method pool.
Definition: MethodPool.f90:18
subroutine, public destroy_method_pool()
Destroy the method pool.
Definition: MethodPool.f90:24
Subcell-level tracking methods.
subroutine, public create_method_subcell_pool()
Create the subcell method pool.
subroutine, public destroy_method_subcell_pool()
Destroy the subcell method pool.
@, public release
particle was released
@, public terminate
particle terminated
@ term_timeout
terminated at stop time or end of simulation
Definition: Particle.f90:37
@ term_unreleased
terminated permanently unreleased
Definition: Particle.f90:35
subroutine create_particle(particle)
Create a new particle.
Definition: Particle.f90:143
Particle track output module.
subroutine, public fmi_cr(fmiobj, name_model, input_mempath, inunit, iout)
Create a new PrtFmi object.
Definition: prt-fmi.f90:44
subroutine, public mip_cr(mip, name_model, input_mempath, inunit, iout, dis)
Create a model input object.
Definition: prt-mip.f90:34
Definition: prt.f90:1
integer(i4b), parameter niunit_prt
Definition: prt.f90:117
subroutine prt_ot(this)
Print and/or save model output.
Definition: prt.f90:519
subroutine prt_rp(this)
Read and prepare (calls package read and prepare routines)
Definition: prt.f90:328
subroutine create_bndpkgs(this, bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
Source package info and begin to process.
Definition: prt.f90:996
subroutine prt_ar(this)
Allocate and read.
Definition: prt.f90:233
subroutine ftype_check(this, indis)
Check to make sure required input files have been specified.
Definition: prt.f90:892
subroutine prt_ot_saveflow(this, nja, flowja, icbcfl, icbcun)
Save intercell flows.
Definition: prt.f90:601
subroutine prt_ad(this)
Time step advance (calls package advance subroutines)
Definition: prt.f90:348
subroutine prt_cq(this, icnvg, isuppress_output)
Calculate intercell flow (flowja)
Definition: prt.f90:391
subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, inunit, iout)
Create boundary condition packages for this model.
Definition: prt.f90:844
subroutine prt_ot_flow(this, icbcfl, ibudfl, icbcun)
Save flows.
Definition: prt.f90:564
subroutine allocate_scalars(this, modelname)
Allocate memory for scalars.
Definition: prt.f90:783
subroutine prt_ot_bdsummary(this, ibudfl, ipflag)
Print budget summary.
Definition: prt.f90:688
character(len=lenpackagetype), dimension(prt_nmultipkg), public prt_multipkg
Definition: prt.f90:112
subroutine create_packages(this)
Source package info and begin to process.
Definition: prt.f90:1047
character(len=lenpackagetype), dimension(prt_nbasepkg), public prt_basepkg
Definition: prt.f90:98
integer(i4b), parameter, public prt_nmultipkg
PRT multi package array descriptors.
Definition: prt.f90:111
character(len=lenbudtxt), dimension(nbditems) budtxt
Definition: prt.f90:39
subroutine prt_da(this)
Deallocate.
Definition: prt.f90:718
subroutine prt_cq_sto(this)
Calculate particle mass storage.
Definition: prt.f90:437
subroutine, public prt_cr(filename, id, modelname)
Create a new particle tracking model object.
Definition: prt.f90:123
subroutine prt_ot_printflow(this, ibudfl, flowja)
Print intercell flows.
Definition: prt.f90:628
subroutine prt_bd(this, icnvg, isuppress_output)
Calculate flows and budget.
Definition: prt.f90:490
subroutine prt_df(this)
Define packages.
Definition: prt.f90:200
integer(i4b), parameter, public prt_nbasepkg
PRT base package array descriptors.
Definition: prt.f90:97
integer(i4b), parameter nbditems
Definition: prt.f90:38
subroutine allocate_arrays(this)
Allocate arrays.
Definition: prt.f90:812
subroutine log_namfile_options(this, found)
Write model namfile options to list file.
Definition: prt.f90:1148
subroutine prt_ot_dv(this, idvsave, idvprint, ipflag)
Print dependent variables.
Definition: prt.f90:667
subroutine prt_solve(this)
Solve the model.
Definition: prt.f90:919
subroutine, public oc_cr(ocobj, name_model, inunit, iout)
@ brief Create an output control object
Definition: prt-oc.f90:53
subroutine, public prp_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, input_mempath, fmi)
Create a new particle release point package.
Definition: prt-prp.f90:103
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=linelength) idm_context
integer(i4b) isimcheck
simulation input check flag (1) to check input, (0) to ignore checks
integer(i4b) ifailedstepretry
current retry for this time step
subroutine csr_diagsum(ia, flowja)
Definition: Sparse.f90:263
logical(lgp), pointer, public endofperiod
flag indicating end of stress period
Definition: tdis.f90:27
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
Definition: tdis.f90:28
subroutine, public tdis_ot(iout)
Print simulation time.
Definition: tdis.f90:274
real(dp), pointer, public totim
time relative to start of simulation
Definition: tdis.f90:32
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
Definition: tdis.f90:26
real(dp), pointer, public totimc
simulation time at start of time step
Definition: tdis.f90:33
integer(i4b), pointer, public kstp
current time step number
Definition: tdis.f90:24
integer(i4b), pointer, public kper
current stress period number
Definition: tdis.f90:23
real(dp), pointer, public delt
length of the current time step
Definition: tdis.f90:29
This module contains version information.
Definition: version.f90:7
subroutine write_listfile_header(iout, cmodel_type, write_sys_command, write_kind_info)
@ brief Write program header
Definition: version.f90:98
Highest level model type. All models extend this parent type.
Definition: BaseModel.f90:13
@ brief BndType
Derived type for the Budget object.
Definition: Budget.f90:39
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Structured grid discretization.
Definition: Dis.f90:23
Unstructured grid discretization.
Definition: Disu.f90:28
Vertex grid discretization.
Definition: Disv.f90:24
A generic heterogeneous doubly-linked list.
Definition: List.f90:14
Base type for particle tracking methods.
Definition: Method.f90:58
Particle tracked by the PRT model.
Definition: Particle.f90:56
Output file containing all or some particle pathlines.
Manages particle track output (logging/writing).
Particle tracking (PRT) model.
Definition: prt.f90:43
@ brief Output control for particle tracking models
Definition: prt-oc.f90:22
Particle release point (PRP) package.
Definition: prt-prp.f90:38