MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
tdismodule Module Reference

Functions/Subroutines

subroutine, public tdis_cr (fname, inmempath)
 Create temporal discretization.
subroutine, public tdis_set_counters ()
 Set kstp and kper.
subroutine, public tdis_set_timestep ()
 Set time step length.
subroutine, public tdis_delt_reset (deltnew)
 Reset delt and update timing variables and indicators.
subroutine tdis_set_end_flags (adaptiveperiod)
 Set end of period and end of simulation indicators.
subroutine tdis_set_delt ()
 Set time step length.
subroutine, public tdis_ot (iout)
 Print simulation time.
subroutine, public tdis_da ()
 Deallocate memory.
subroutine tdis_source_options ()
 Source the timing discretization options.
subroutine tdis_allocate_scalars ()
 Allocate tdis scalars.
subroutine tdis_allocate_arrays ()
 Allocate tdis arrays.
subroutine tdis_source_dimensions ()
 Source dimension NPER.
subroutine tdis_source_timing ()
 Source timing information.
subroutine check_tdis_timing (nper, perlen, nstp, tsmult)
 Check the tdis timing information.

Variables

integer(i4b), pointer, public nper => null()
 number of stress period
integer(i4b), pointer, public itmuni => null()
 flag indicating time units
integer(i4b), pointer, public kper => null()
 current stress period number
integer(i4b), pointer, public kstp => null()
 current time step number
integer(i4b), pointer, public inats => null()
 flag indicating ats active for simulation
logical(lgp), pointer, public readnewdata => null()
 flag indicating time to read new data
logical(lgp), pointer, public endofperiod => null()
 flag indicating end of stress period
logical(lgp), pointer, public endofsimulation => null()
 flag indicating end of simulation
real(dp), pointer, public delt => null()
 length of the current time step
real(dp), pointer, public pertim => null()
 time relative to start of stress period
real(dp), pointer, public topertim => null()
 simulation time at start of stress period
real(dp), pointer, public totim => null()
 time relative to start of simulation
real(dp), pointer, public totimc => null()
 simulation time at start of time step
real(dp), pointer, public deltsav => null()
 saved value for delt, used for subtiming
real(dp), pointer, public totimsav => null()
 saved value for totim, used for subtiming
real(dp), pointer, public pertimsav => null()
 saved value for pertim, used for subtiming
real(dp), pointer, public totalsimtime => null()
 time at end of simulation
real(dp), dimension(:), pointer, public, contiguous perlen => null()
 length of each stress period
integer(i4b), dimension(:), pointer, public, contiguous nstp => null()
 number of time steps in each stress period
real(dp), dimension(:), pointer, public, contiguous tsmult => null()
 time step multiplier for each stress period
character(len=lendatetime), pointer, public datetime0 => null()
 starting date and time for the simulation
character(len=lenmempath), pointer input_mempath => null()
 input context mempath for tdis
character(len=linelength), pointer input_fname => null()
 input filename for tdis
class(atstype), pointer, public ats => null()

Function/Subroutine Documentation

◆ check_tdis_timing()

subroutine tdismodule::check_tdis_timing ( integer(i4b), intent(in) nper,
real(dp), dimension(:), intent(in), contiguous perlen,
integer(i4b), dimension(:), intent(in), contiguous nstp,
real(dp), dimension(:), intent(in), contiguous tsmult )
private

Check every stress period and store an error for each invalid one. The caller checks the error count afterward so the StoreErrorUnit routine can be called to assign the correct file name. Time step lengths are only checked for periods that pass the other checks and are not zero length.

Definition at line 604 of file tdis.f90.

605 ! -- modules
607 use simmodule, only: store_error
608 ! -- dummy
609 integer(I4B), intent(in) :: nper
610 real(DP), dimension(:), contiguous, intent(in) :: perlen
611 integer(I4B), dimension(:), contiguous, intent(in) :: nstp
612 real(DP), dimension(:), contiguous, intent(in) :: tsmult
613 ! -- local
614 integer(I4B) :: kper, kstp
615 real(DP) :: tstart, tend, dt
616 logical(LGP) :: valid
617 character(len=LINELENGTH) :: errmsg
618 ! -- formats
619 character(len=*), parameter :: fmtpwarn = &
620 "(1X,/1X,'PERLEN is zero for stress period ', I0, &
621 &'. PERLEN must not be zero for transient periods.')"
622 character(len=*), parameter :: fmtsperror = &
623 &"(A,' for stress period ', I0)"
624 character(len=*), parameter :: fmtdterror = &
625 "('Time step length of ', G0, ' is too small in period ', I0, &
626 &' and time step ', I0)"
627 !
628 ! -- Initialize
629 tstart = dzero
630 !
631 ! -- Go through and check each stress period
632 do kper = 1, nper
633 valid = .true.
634 !
635 ! -- Error if nstp less than or equal to zero
636 if (nstp(kper) <= 0) then
637 write (errmsg, fmtsperror) 'Number of time steps less than one ', kper
638 call store_error(errmsg)
639 valid = .false.
640 end if
641 !
642 ! -- Error if tsmult is less than zero
643 if (tsmult(kper) <= dzero) then
644 write (errmsg, fmtsperror) 'TSMULT must be greater than 0.0 ', kper
645 call store_error(errmsg)
646 valid = .false.
647 end if
648 !
649 ! -- Error if negative period length
650 if (perlen(kper) < dzero) then
651 write (errmsg, fmtsperror) 'PERLEN cannot be less than 0.0 ', kper
652 call store_error(errmsg)
653 valid = .false.
654 end if
655 !
656 ! -- Skip the time step checks for an invalid period
657 if (.not. valid) cycle
658 !
659 ! -- Warn if perlen is zero, and skip the time step checks
660 if (perlen(kper) == dzero) then
661 write (iout, fmtpwarn) kper
662 cycle
663 end if
664 !
665 ! -- Go through all time step lengths and make sure they are valid
666 do kstp = 1, nstp(kper)
667 if (kstp == 1) then
668 dt = perlen(kper) / float(nstp(kper))
669 if (tsmult(kper) /= done) &
670 dt = perlen(kper) * (done - tsmult(kper)) / &
671 (done - tsmult(kper)**nstp(kper))
672 else
673 dt = dt * tsmult(kper)
674 end if
675 tend = tstart + dt
676 !
677 ! -- Error condition if tstart == tend
678 if (tstart == tend) then
679 write (errmsg, fmtdterror) dt, kper, kstp
680 call store_error(errmsg)
681 exit
682 end if
683 end do
684 !
685 ! -- reset tstart = tend
686 tstart = tend
687 !
688 end do
This module contains simulation constants.
Definition Constants.f90:9
integer(i4b), parameter linelength
maximum length of a standard line
Definition Constants.f90:45
real(dp), parameter dzero
real constant zero
Definition Constants.f90:65
real(dp), parameter done
real constant 1
Definition Constants.f90:76
This module contains simulation methods.
Definition Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition Sim.f90:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_allocate_arrays()

subroutine tdismodule::tdis_allocate_arrays
private

Definition at line 517 of file tdis.f90.

518 ! -- modules
520 !
521 call mem_allocate(perlen, nper, 'PERLEN', 'TDIS')
522 call mem_allocate(nstp, nper, 'NSTP', 'TDIS')
523 call mem_allocate(tsmult, nper, 'TSMULT', 'TDIS')
Here is the caller graph for this function:

◆ tdis_allocate_scalars()

subroutine tdismodule::tdis_allocate_scalars
private

Definition at line 465 of file tdis.f90.

466 ! -- modules
468 use constantsmodule, only: dzero
469 !
470 ! -- memory manager variables
471 call mem_allocate(nper, 'NPER', 'TDIS')
472 call mem_allocate(itmuni, 'ITMUNI', 'TDIS')
473 call mem_allocate(kper, 'KPER', 'TDIS')
474 call mem_allocate(kstp, 'KSTP', 'TDIS')
475 call mem_allocate(inats, 'INATS', 'TDIS')
476 call mem_allocate(readnewdata, 'READNEWDATA', 'TDIS')
477 call mem_allocate(endofperiod, 'ENDOFPERIOD', 'TDIS')
478 call mem_allocate(endofsimulation, 'ENDOFSIMULATION', 'TDIS')
479 call mem_allocate(delt, 'DELT', 'TDIS')
480 call mem_allocate(pertim, 'PERTIM', 'TDIS')
481 call mem_allocate(topertim, 'TOPERTIM', 'TDIS')
482 call mem_allocate(totim, 'TOTIM', 'TDIS')
483 call mem_allocate(totimc, 'TOTIMC', 'TDIS')
484 call mem_allocate(deltsav, 'DELTSAV', 'TDIS')
485 call mem_allocate(totimsav, 'TOTIMSAV', 'TDIS')
486 call mem_allocate(pertimsav, 'PERTIMSAV', 'TDIS')
487 call mem_allocate(totalsimtime, 'TOTALSIMTIME', 'TDIS')
488 !
489 ! -- strings
490 allocate (datetime0)
491 allocate (input_mempath)
492 allocate (input_fname)
493 !
494 ! -- Initialize variables
495 nper = 0
496 itmuni = 0
497 kper = 0
498 kstp = 0
499 inats = 0
500 readnewdata = .true.
501 endofperiod = .true.
502 endofsimulation = .false.
503 delt = dzero
504 pertim = dzero
505 topertim = dzero
506 totim = dzero
507 totimc = dzero
508 deltsav = dzero
509 totimsav = dzero
510 pertimsav = dzero
511 totalsimtime = dzero
512 datetime0 = ''
Here is the caller graph for this function:

◆ tdis_cr()

subroutine, public tdismodule::tdis_cr ( character(len=*), intent(in) fname,
character(len=*), intent(in) inmempath )

Definition at line 54 of file tdis.f90.

55 ! -- modules
58 ! -- dummy
59 character(len=*), intent(in) :: fname
60 character(len=*), intent(in) :: inmempath
61 ! -- local
62 ! -- formats
63 character(len=*), parameter :: fmtheader = &
64 "(1X,/1X,'TDIS -- TEMPORAL DISCRETIZATION PACKAGE,', / &
65 &' VERSION 1 : 11/13/2014 - INPUT READ FROM MEMPATH: ', A)"
66 !
67 ! -- Allocate the scalar variables
68 call tdis_allocate_scalars()
69 !
70 ! -- set input context and fname
71 input_fname = fname
72 input_mempath = inmempath
73 !
74 ! -- Identify package
75 write (iout, fmtheader) input_mempath
76 !
77 ! -- Source options
78 call tdis_source_options()
79 !
80 ! -- Source dimensions and then allocate arrays
81 call tdis_source_dimensions()
82 call tdis_allocate_arrays()
83 !
84 ! -- Source timing
85 call tdis_source_timing()
86 !
87 ats => create_ats()
88 if (inats > 0) then
89 call ats%ats_init(inats, nper)
90 end if
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public openfile(iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt)
Open a file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_da()

subroutine, public tdismodule::tdis_da

Definition at line 344 of file tdis.f90.

345 ! -- modules
347 !
348 ! -- ats
349 if (inats > 0) then
350 call ats%ats_da()
351 end if
352 deallocate (ats)
353 !
354 ! -- Scalars
355 call mem_deallocate(nper)
356 call mem_deallocate(itmuni)
357 call mem_deallocate(kper)
358 call mem_deallocate(kstp)
359 call mem_deallocate(inats)
360 call mem_deallocate(readnewdata)
361 call mem_deallocate(endofperiod)
362 call mem_deallocate(endofsimulation)
363 call mem_deallocate(delt)
364 call mem_deallocate(pertim)
365 call mem_deallocate(topertim)
366 call mem_deallocate(totim)
367 call mem_deallocate(totimc)
368 call mem_deallocate(deltsav)
369 call mem_deallocate(totimsav)
370 call mem_deallocate(pertimsav)
371 call mem_deallocate(totalsimtime)
372 !
373 ! -- strings
374 deallocate (datetime0)
375 deallocate (input_mempath)
376 deallocate (input_fname)
377 !
378 ! -- Arrays
379 call mem_deallocate(perlen)
380 call mem_deallocate(nstp)
381 call mem_deallocate(tsmult)
Here is the caller graph for this function:

◆ tdis_delt_reset()

subroutine, public tdismodule::tdis_delt_reset ( real(dp), intent(in) deltnew)

This routine is called when a timestep fails to converge, and so it is retried using a smaller time step (deltnew).

Definition at line 200 of file tdis.f90.

201 ! -- modules
202 use constantsmodule, only: done, dzero
203 ! -- dummy
204 real(DP), intent(in) :: deltnew
205 ! -- local
206 logical(LGP) :: adaptivePeriod
207 !
208 ! -- Set values
209 adaptiveperiod = ats%isAdaptivePeriod(kper)
210 delt = deltnew
211 totim = totimsav + delt
212 pertim = pertimsav + delt
213 !
214 ! -- Reevaluate end of period and simulation indicators, since
215 ! the failed step may have set them
216 call tdis_set_end_flags(adaptiveperiod)
217 if (endofsimulation) then
218 totim = totalsimtime
219 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_ot()

subroutine, public tdismodule::tdis_ot ( integer(i4b), intent(in) iout)

Definition at line 273 of file tdis.f90.

274 ! -- modules
277 ! -- dummy
278 integer(I4B), intent(in) :: iout
279 ! -- local
280 real(DP) :: cnv, delsec, totsec, persec, delmn, delhr, totmn, tothr, &
281 totdy, totyr, permn, perhr, perdy, peryr, deldy, delyr
282 ! -- format
283 character(len=*), parameter :: fmttmsmry = "(1X, ///9X, &
284 &'TIME SUMMARY AT END OF TIME STEP', I5,' IN STRESS PERIOD ', I4)"
285 character(len=*), parameter :: fmttmstpmsg = &
286 &"(21X, ' TIME STEP LENGTH =', G15.6 / &
287 & 21X, ' STRESS PERIOD TIME =', G15.6 / &
288 & 21X, 'TOTAL SIMULATION TIME =', G15.6)"
289 character(len=*), parameter :: fmttottmmsg = &
290 &"(19X, ' SECONDS MINUTES HOURS', 7X, &
291 &'DAYS YEARS'/20X, 59('-'))"
292 character(len=*), parameter :: fmtdelttm = &
293 &"(1X, ' TIME STEP LENGTH', 1P, 5G12.5)"
294 character(len=*), parameter :: fmtpertm = &
295 &"(1X, 'STRESS PERIOD TIME', 1P, 5G12.5)"
296 character(len=*), parameter :: fmttottm = &
297 &"(1X, ' TOTAL TIME', 1P, 5G12.5,/)"
298 !
299 ! -- Write header message for the information that follows
300 write (iout, fmttmsmry) kstp, kper
301 !
302 ! -- Use time unit indicator to get factor to convert to seconds
303 cnv = dzero
304 if (itmuni == 1) cnv = done
305 if (itmuni == 2) cnv = dsixty
306 if (itmuni == 3) cnv = dsecperhr
307 if (itmuni == 4) cnv = dsecperdy
308 if (itmuni == 5) cnv = dsecperyr
309 !
310 ! -- If FACTOR=0 then time units are non-standard
311 if (cnv == dzero) then
312 ! -- Print times in non-standard time units
313 write (iout, fmttmstpmsg) delt, pertim, totim
314 else
315 ! -- Calculate length of time step & elapsed time in seconds
316 delsec = cnv * delt
317 totsec = cnv * totim
318 persec = cnv * pertim
319 !
320 ! -- Calculate times in minutes, hours, days, and years
321 delmn = delsec / dsixty
322 delhr = delmn / dsixty
323 deldy = delhr / dhrperday
324 delyr = deldy / ddyperyr
325 totmn = totsec / dsixty
326 tothr = totmn / dsixty
327 totdy = tothr / dhrperday
328 totyr = totdy / ddyperyr
329 permn = persec / dsixty
330 perhr = permn / dsixty
331 perdy = perhr / dhrperday
332 peryr = perdy / ddyperyr
333 !
334 ! -- Print time step length and elapsed times in all time units
335 write (iout, fmttottmmsg)
336 write (iout, fmtdelttm) delsec, delmn, delhr, deldy, delyr
337 write (iout, fmtpertm) persec, permn, perhr, perdy, peryr
338 write (iout, fmttottm) totsec, totmn, tothr, totdy, totyr
339 end if
real(dp), parameter dsixty
real constant 60
Definition Constants.f90:85
real(dp), parameter dsecperdy
real constant representing the number of seconds per day (used in tdis)
real(dp), parameter dsecperyr
real constant representing the average number of seconds per year (used in tdis)
real(dp), parameter dsecperhr
real constant representing number of seconds per hour (used in tdis)
Definition Constants.f90:97
real(dp), parameter ddyperyr
real constant representing the average number of days per year (used in tdis)
Definition Constants.f90:99
real(dp), parameter dhrperday
real constant representing number of hours per day (used in tdis)
Definition Constants.f90:98
Here is the caller graph for this function:

◆ tdis_set_counters()

subroutine, public tdismodule::tdis_set_counters

Definition at line 95 of file tdis.f90.

96 ! -- modules
100 ! -- local
101 character(len=LINELENGTH) :: line
102 character(len=4) :: cpref
103 character(len=10) :: cend
104 ! -- formats
105 character(len=*), parameter :: fmtspts = &
106 &"(a, 'Solving: Stress period: ',i5,4x, 'Time step: ',i5,4x, a)"
107 character(len=*), parameter :: fmtvspts = &
108 &"(' Validating: Stress period: ',i5,4x,'Time step: ',i5,4x)"
109 character(len=*), parameter :: fmtspi = &
110 "('1',/1X,'STRESS PERIOD NO. ',I0,', LENGTH =',G15.7,/ &
111 &1X,42('-'))"
112 character(len=*), parameter :: fmtspits = &
113 "(1X,'NUMBER OF TIME STEPS = ',I0,/ &
114 &1X,'MULTIPLIER FOR DELT =',F10.3)"
115 !
116 ! -- Initialize variables for this step
117 if (inats > 0) ats%dtstable = dnodata
118 readnewdata = .false.
119 cpref = ' '
120 cend = ''
121 !
122 ! -- Increment kstp and kper
123 if (endofperiod) then
124 kstp = 1
125 kper = kper + 1
126 readnewdata = .true.
127 else
128 kstp = kstp + 1
129 end if
130 !
131 ! -- Print stress period and time step to console
132 select case (isim_mode)
133 case (mvalidate)
134 write (line, fmtvspts) kper, kstp
135 case (mnormal)
136 write (line, fmtspts) cpref, kper, kstp, trim(cend)
137 end select
138 if (isim_level >= vall) &
139 call write_message(line)
140 call write_message(line, iunit=iout, skipbefore=1, skipafter=1)
141 !
142 ! -- Write message if first time step
143 if (kstp == 1) then
144 write (iout, fmtspi) kper, perlen(kper)
145 if (ats%isAdaptivePeriod(kper)) then
146 call ats%ats_period_message(kper)
147 else
148 write (iout, fmtspits) nstp(kper), tsmult(kper)
149 end if
150 end if
@ mvalidate
validation mode - do not run time steps
@ mnormal
normal output mode
real(dp), parameter dnodata
real no data constant
Definition Constants.f90:95
@ vall
write all simulation notes and warnings
Store and issue logging messages to output units.
Definition Message.f90:2
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
Definition Message.f90:212
This module contains simulation variables.
integer(i4b) isim_level
simulation output level
integer(i4b) iout
file unit number for simulation output
integer(i4b) isim_mode
simulation mode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_set_delt()

subroutine tdismodule::tdis_set_delt
private

Definition at line 248 of file tdis.f90.

249 ! -- modules
250 use constantsmodule, only: done
251 !
252 if (kstp == 1) then
253 ! -- Calculate the first value of delt for this stress period
254 topertim = totim
255 if (tsmult(kper) /= done) then
256 ! -- Timestep length has a geometric progression
257 delt = perlen(kper) * (done - tsmult(kper)) / &
258 (done - tsmult(kper)**nstp(kper))
259 else
260 ! -- Timestep length is constant
261 delt = perlen(kper) / float(nstp(kper))
262 end if
263 elseif (kstp == nstp(kper)) then
264 ! -- Calculate exact last delt to avoid accumulation errors
265 delt = topertim + perlen(kper) - totim
266 else
267 delt = tsmult(kper) * delt
268 end if
Here is the caller graph for this function:

◆ tdis_set_end_flags()

subroutine tdismodule::tdis_set_end_flags ( logical(lgp), intent(in) adaptiveperiod)
private

Evaluate the indicators for the current time step. Called when a time step is set and when a failed time step is retried, so both evaluate the indicators the same way.

Definition at line 228 of file tdis.f90.

229 ! -- dummy
230 logical(LGP), intent(in) :: adaptivePeriod
231 !
232 ! -- Set end of period indicator
233 endofperiod = .false.
234 if (adaptiveperiod) then
235 call ats%ats_set_endofperiod(kper, pertim, perlen(kper), endofperiod)
236 else
237 if (kstp == nstp(kper)) then
238 endofperiod = .true.
239 end if
240 end if
241 !
242 ! -- Set end of simulation indicator
243 endofsimulation = endofperiod .and. kper == nper
Here is the caller graph for this function:

◆ tdis_set_timestep()

subroutine, public tdismodule::tdis_set_timestep

Definition at line 155 of file tdis.f90.

156 ! -- modules
157 use constantsmodule, only: done, dzero
158 ! -- local
159 logical(LGP) :: adaptivePeriod
160 ! -- format
161 character(len=*), parameter :: fmttsi = &
162 "(1X,'INITIAL TIME STEP SIZE =',G15.7)"
163 !
164 ! -- Initialize
165 adaptiveperiod = ats%isAdaptivePeriod(kper)
166 if (kstp == 1) then
167 pertim = dzero
168 topertim = dzero
169 end if
170 !
171 ! -- Set delt
172 if (adaptiveperiod) then
173 call ats%ats_set_delt(kstp, kper, pertim, perlen(kper), delt)
174 else
175 call tdis_set_delt()
176 if (kstp == 1) then
177 write (iout, fmttsi) delt
178 end if
179 end if
180 !
181 ! -- Advance timers and update totim and pertim based on delt
182 totimsav = totim
183 pertimsav = pertim
184 totimc = totimsav
185 totim = totimsav + delt
186 pertim = pertimsav + delt
187 !
188 ! -- Set end of period and simulation indicators
189 call tdis_set_end_flags(adaptiveperiod)
190 if (endofperiod) then
191 pertim = perlen(kper)
192 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_source_dimensions()

subroutine tdismodule::tdis_source_dimensions
private

Definition at line 528 of file tdis.f90.

529 ! -- modules
530 use constantsmodule, only: linelength
534 ! -- local
535 type(SimTdisParamFoundType) :: found
536 ! -- formats
537 character(len=*), parameter :: fmtnper = &
538 "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')"
539 !
540 ! -- source dimensions from input context
541 call mem_set_value(nper, 'NPER', input_mempath, found%nper)
542 !
543 ! -- log values to list file
544 write (iout, '(1x,a)') 'PROCESSING TDIS DIMENSIONS'
545 !
546 if (found%nper) then
547 write (iout, fmtnper) nper
548 end if
549 !
550 write (iout, '(1x,a)') 'END OF TDIS DIMENSIONS'
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_source_options()

subroutine tdismodule::tdis_source_options
private

Definition at line 386 of file tdis.f90.

387 ! -- modules
388 use constantsmodule, only: linelength
394 ! -- local
395 type(SimTdisParamFoundType) :: found
396 character(len=LINELENGTH), dimension(6) :: time_units = &
397 &[character(len=LINELENGTH) :: 'UNKNOWN', 'SECONDS', 'MINUTES', 'HOURS', &
398 'DAYS', 'YEARS']
399 character(len=LINELENGTH) :: fname
400 ! -- formats
401 character(len=*), parameter :: fmtitmuni = &
402 &"(4x,'SIMULATION TIME UNIT IS ',A)"
403 character(len=*), parameter :: fmtdatetime0 = &
404 &"(4x,'SIMULATION STARTING DATE AND TIME IS ',A)"
405 !
406 ! -- initialize time unit to undefined
407 itmuni = 0
408 !
409 ! -- source options from input context
410 call mem_set_value(itmuni, 'TIME_UNITS', input_mempath, time_units, &
411 found%time_units)
412 call mem_set_value(datetime0, 'START_DATE_TIME', input_mempath, &
413 found%start_date_time)
414 !
415 if (found%time_units) then
416 if (itmuni == 0) then
417 call store_error('Unrecognized input value for TIME_UNITS option.')
418 call store_error_filename(input_fname)
419 else
420 !
421 ! -- adjust to 0-based indexing for itmuni
422 itmuni = itmuni - 1
423 end if
424 end if
425 !
426 ! -- enforce 0 or 1 ATS6_FILENAME entries in option block
427 if (filein_fname(fname, 'ATS6_FILENAME', input_mempath, &
428 input_fname)) then
429 inats = getunit()
430 call openfile(inats, iout, fname, 'ATS')
431 end if
432 !
433 ! -- log values to list file
434 write (iout, '(1x,a)') 'PROCESSING TDIS OPTIONS'
435 !
436 if (found%time_units) then
437 select case (itmuni)
438 case (0)
439 write (iout, fmtitmuni) 'UNDEFINED'
440 case (1)
441 write (iout, fmtitmuni) 'SECONDS'
442 case (2)
443 write (iout, fmtitmuni) 'MINUTES'
444 case (3)
445 write (iout, fmtitmuni) 'HOURS'
446 case (4)
447 write (iout, fmtitmuni) 'DAYS'
448 case (5)
449 write (iout, fmtitmuni) 'YEARS'
450 case default
451 end select
452 else
453 write (iout, fmtitmuni) 'UNDEFINED'
454 end if
455 !
456 if (found%start_date_time) then
457 write (iout, fmtdatetime0) datetime0
458 end if
459 !
460 write (iout, '(1x,a)') 'END OF TDIS OPTIONS'
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition Sim.f90:208
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tdis_source_timing()

subroutine tdismodule::tdis_source_timing
private

Definition at line 555 of file tdis.f90.

556 ! -- modules
562 ! -- local
563 type(SimTdisParamFoundType) :: found
564 integer(I4B) :: n
565 ! -- formats
566 character(len=*), parameter :: fmtheader = &
567 "(1X,//1X,'STRESS PERIOD LENGTH TIME STEPS', &
568 &' MULTIPLIER FOR DELT',/1X,76('-'))"
569 character(len=*), parameter :: fmtrow = &
570 "(1X,I8,1PG21.7,I7,0PF25.3)"
571 !
572 ! -- source perioddata from input context
573 call mem_set_value(perlen, 'PERLEN', input_mempath, found%perlen)
574 call mem_set_value(nstp, 'NSTP', input_mempath, found%nstp)
575 call mem_set_value(tsmult, 'TSMULT', input_mempath, found%tsmult)
576 !
577 ! -- Check timing information
578 call check_tdis_timing(nper, perlen, nstp, tsmult)
579 !
580 ! -- Check for errors
581 if (count_errors() > 0) then
582 call store_error_filename(input_fname)
583 end if
584 !
585 ! -- log timing
586 write (iout, '(1x,a)') 'PROCESSING TDIS PERIODDATA'
587 write (iout, fmtheader)
588 !
589 do n = 1, size(perlen)
590 write (iout, fmtrow) n, perlen(n), nstp(n), tsmult(n)
591 totalsimtime = totalsimtime + perlen(n)
592 end do
593 !
594 write (iout, '(1x,a)') 'END OF TDIS PERIODDATA'
integer(i4b) function, public count_errors()
Return number of errors.
Definition Sim.f90:60
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ats

class(atstype), pointer, public tdismodule::ats => null()

Definition at line 48 of file tdis.f90.

◆ datetime0

character(len=lendatetime), pointer, public tdismodule::datetime0 => null()

Definition at line 44 of file tdis.f90.

◆ delt

real(dp), pointer, public tdismodule::delt => null()

Definition at line 32 of file tdis.f90.

◆ deltsav

real(dp), pointer, public tdismodule::deltsav => null()

Definition at line 37 of file tdis.f90.

◆ endofperiod

logical(lgp), pointer, public tdismodule::endofperiod => null()

Definition at line 30 of file tdis.f90.

◆ endofsimulation

logical(lgp), pointer, public tdismodule::endofsimulation => null()

Definition at line 31 of file tdis.f90.

◆ inats

integer(i4b), pointer, public tdismodule::inats => null()

Definition at line 28 of file tdis.f90.

◆ input_fname

character(len=linelength), pointer tdismodule::input_fname => null()
private

Definition at line 46 of file tdis.f90.

◆ input_mempath

character(len=lenmempath), pointer tdismodule::input_mempath => null()
private

Definition at line 45 of file tdis.f90.

◆ itmuni

integer(i4b), pointer, public tdismodule::itmuni => null()

Definition at line 25 of file tdis.f90.

◆ kper

integer(i4b), pointer, public tdismodule::kper => null()

Definition at line 26 of file tdis.f90.

◆ kstp

integer(i4b), pointer, public tdismodule::kstp => null()

Definition at line 27 of file tdis.f90.

◆ nper

integer(i4b), pointer, public tdismodule::nper => null()

Definition at line 24 of file tdis.f90.

◆ nstp

integer(i4b), dimension(:), pointer, public, contiguous tdismodule::nstp => null()

Definition at line 42 of file tdis.f90.

◆ perlen

real(dp), dimension(:), pointer, public, contiguous tdismodule::perlen => null()

Definition at line 41 of file tdis.f90.

◆ pertim

real(dp), pointer, public tdismodule::pertim => null()

Definition at line 33 of file tdis.f90.

◆ pertimsav

real(dp), pointer, public tdismodule::pertimsav => null()

Definition at line 39 of file tdis.f90.

◆ readnewdata

logical(lgp), pointer, public tdismodule::readnewdata => null()

Definition at line 29 of file tdis.f90.

◆ topertim

real(dp), pointer, public tdismodule::topertim => null()

Definition at line 34 of file tdis.f90.

◆ totalsimtime

real(dp), pointer, public tdismodule::totalsimtime => null()

Definition at line 40 of file tdis.f90.

◆ totim

real(dp), pointer, public tdismodule::totim => null()

Definition at line 35 of file tdis.f90.

◆ totimc

real(dp), pointer, public tdismodule::totimc => null()

Definition at line 36 of file tdis.f90.

◆ totimsav

real(dp), pointer, public tdismodule::totimsav => null()

Definition at line 38 of file tdis.f90.

◆ tsmult

real(dp), dimension(:), pointer, public, contiguous tdismodule::tsmult => null()

Definition at line 43 of file tdis.f90.