21 integer(I4B),
public,
pointer ::
nper => null()
22 integer(I4B),
public,
pointer ::
itmuni => null()
23 integer(I4B),
public,
pointer ::
kper => null()
24 integer(I4B),
public,
pointer ::
kstp => null()
25 integer(I4B),
public,
pointer ::
inats => null()
29 real(dp),
public,
pointer ::
delt => null()
30 real(dp),
public,
pointer ::
pertim => null()
31 real(dp),
public,
pointer ::
topertim => null()
32 real(dp),
public,
pointer ::
totim => null()
33 real(dp),
public,
pointer ::
totimc => null()
34 real(dp),
public,
pointer ::
deltsav => null()
35 real(dp),
public,
pointer ::
totimsav => null()
38 real(dp),
public,
dimension(:),
pointer,
contiguous ::
perlen => null()
39 integer(I4B),
public,
dimension(:),
pointer,
contiguous ::
nstp => null()
40 real(dp),
public,
dimension(:),
pointer,
contiguous ::
tsmult => null()
41 character(len=LENDATETIME),
public,
pointer ::
datetime0 => null()
55 character(len=*),
intent(in) :: fname
56 character(len=*),
intent(in) :: inmempath
59 character(len=*),
parameter :: fmtheader = &
60 "(1X,/1X,'TDIS -- TEMPORAL DISCRETIZATION PACKAGE,', / &
61 &' VERSION 1 : 11/13/2014 - INPUT READ FROM MEMPATH: ', A)"
98 character(len=LINELENGTH) :: line
99 character(len=4) :: cpref
100 character(len=10) :: cend
102 character(len=*),
parameter :: fmtspts = &
103 &
"(a, 'Solving: Stress period: ',i5,4x, 'Time step: ',i5,4x, a)"
104 character(len=*),
parameter :: fmtvspts = &
105 &
"(' Validating: Stress period: ',i5,4x,'Time step: ',i5,4x)"
106 character(len=*),
parameter :: fmtspi = &
107 "('1',/1X,'STRESS PERIOD NO. ',I0,', LENGTH =',G15.7,/ &
109 character(len=*),
parameter :: fmtspits = &
110 "(1X,'NUMBER OF TIME STEPS = ',I0,/ &
111 &1X,'MULTIPLIER FOR DELT =',F10.3)"
133 write (line, fmtspts) cpref,
kper,
kstp, trim(cend)
135 if (isim_level >= vall) &
137 call write_message(line, iunit=iout, skipbefore=1, skipafter=1)
159 logical(LGP) :: adaptiveperiod
161 character(len=*),
parameter :: fmttsi = &
162 "(1X,'INITIAL TIME STEP SIZE =',G15.7)"
172 if (adaptiveperiod)
then
190 if (adaptiveperiod)
then
219 real(dp),
intent(in) :: deltnew
221 logical(LGP) :: adaptiveperiod
231 if (adaptiveperiod)
then
278 integer(I4B),
intent(in) ::
iout
280 real(dp) :: cnv, delsec, totsec, persec, delmn, delhr, totmn, tothr, &
281 totdy, totyr, permn, perhr, perdy, peryr, deldy, delyr
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,/)"
311 if (cnv ==
dzero)
then
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
394 character(len=LINELENGTH),
dimension(6) :: time_units = &
395 &[character(len=LINELENGTH) ::
'UNDEFINED',
'SECONDS',
'MINUTES',
'HOURS', &
397 character(len=LINELENGTH) :: fname
399 character(len=*),
parameter :: fmtitmuni = &
400 &
"(4x,'SIMULATION TIME UNIT IS ',A)"
401 character(len=*),
parameter :: fmtdatetime0 = &
402 &
"(4x,'SIMULATION STARTING DATE AND TIME IS ',A)"
411 found%start_date_time)
413 if (found%time_units)
then
415 call store_error(
'Unrecognized input value for TIME_UNITS option.')
432 write (
iout,
'(1x,a)')
'PROCESSING TDIS OPTIONS'
434 if (found%time_units)
then
437 write (
iout, fmtitmuni)
'UNDEFINED'
439 write (
iout, fmtitmuni)
'SECONDS'
441 write (
iout, fmtitmuni)
'MINUTES'
443 write (
iout, fmtitmuni)
'HOURS'
445 write (
iout, fmtitmuni)
'DAYS'
447 write (
iout, fmtitmuni)
'YEARS'
451 write (
iout, fmtitmuni)
'UNDEFINED'
454 if (found%start_date_time)
then
458 write (
iout,
'(1x,a)')
'END OF TDIS OPTIONS'
535 character(len=*),
parameter :: fmtnper = &
536 "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')"
542 write (
iout,
'(1x,a)')
'PROCESSING TDIS DIMENSIONS'
548 write (
iout,
'(1x,a)')
'END OF TDIS DIMENSIONS'
564 character(len=*),
parameter :: fmtheader = &
565 "(1X,//1X,'STRESS PERIOD LENGTH TIME STEPS', &
566 &' MULTIPLIER FOR DELT',/1X,76('-'))"
567 character(len=*),
parameter :: fmtrow = &
568 "(1X,I8,1PG21.7,I7,0PF25.3)"
584 write (
iout,
'(1x,a)')
'PROCESSING TDIS PERIODDATA'
585 write (
iout, fmtheader)
592 write (
iout,
'(1x,a)')
'END OF TDIS PERIODDATA'
606 integer(I4B),
intent(in) :: nper
607 real(DP),
dimension(:),
contiguous,
intent(in) :: perlen
608 integer(I4B),
dimension(:),
contiguous,
intent(in) :: nstp
609 real(DP),
dimension(:),
contiguous,
intent(in) :: tsmult
611 integer(I4B) :: kper, kstp
612 real(DP) :: tstart, tend, dt
613 character(len=LINELENGTH) :: errmsg
615 character(len=*),
parameter :: fmtpwarn = &
616 "(1X,/1X,'PERLEN is zero for stress period ', I0, &
617 &'. PERLEN must not be zero for transient periods.')"
618 character(len=*),
parameter :: fmtsperror = &
619 &
"(A,' for stress period ', I0)"
620 character(len=*),
parameter :: fmtdterror = &
621 "('Time step length of ', G0, ' is too small in period ', I0, &
622 &' and time step ', I0)"
631 if (nstp(kper) <= 0)
then
632 write (errmsg, fmtsperror)
'Number of time steps less than one ', kper
638 if (perlen(kper) ==
dzero)
then
639 write (
iout, fmtpwarn) kper
644 if (tsmult(kper) <=
dzero)
then
645 write (errmsg, fmtsperror)
'TSMULT must be greater than 0.0 ', kper
651 if (perlen(kper) <
dzero)
then
652 write (errmsg, fmtsperror)
'PERLEN cannot be less than 0.0 ', kper
658 do kstp = 1, nstp(kper)
660 dt = perlen(kper) / float(nstp(kper))
661 if (tsmult(kper) /=
done) &
662 dt = perlen(kper) * (
done - tsmult(kper)) / &
663 (
done - tsmult(kper)**nstp(kper))
665 dt = dt * tsmult(kper)
670 if (tstart == tend)
then
671 write (errmsg, fmtdterror) dt, kper, kstp
subroutine, public ats_set_delt(kstp, kper, pertim, perlencurrent, delt)
@ brief Set time step
subroutine, public ats_cr(inunit, nper_tdis)
@ brief Create ATS object
subroutine, public ats_set_endofperiod(kper, pertim, perlencurrent, endofperiod)
@ brief Set end of period indicator
logical(lgp) function, public isadaptiveperiod(kper)
@ brief Determine if period is adaptive
real(dp), pointer, public dtstable
delt value required for stability
subroutine, public ats_da()
@ brief Deallocate variables
subroutine, public ats_period_message(kper)
@ brief Write period message
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ mvalidate
validation mode - do not run time steps
@ mnormal
normal output mode
real(dp), parameter dsixty
real constant 60
real(dp), parameter dnodata
real no data constant
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)
integer(i4b), parameter lendatetime
maximum length of a date time string
real(dp), parameter dsecperhr
real constant representing number of seconds per hour (used in tdis)
real(dp), parameter ddyperyr
real constant representing the average number of days per year (used in tdis)
real(dp), parameter dzero
real constant zero
@ vall
write all simulation notes and warnings
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter dhrperday
real constant representing number of hours per day (used in tdis)
real(dp), parameter done
real constant 1
This module defines variable data types.
Store and issue logging messages to output units.
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
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
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
real(dp), dimension(:), pointer, public, contiguous tsmult
time step multiplier for each stress period
real(dp), pointer, public pertim
time relative to start of stress period
character(len=lenmempath), pointer input_mempath
input context mempath for tdis
logical(lgp), pointer, public endofperiod
flag indicating end of stress period
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
subroutine, public tdis_ot(iout)
Print simulation time.
integer(i4b), pointer, public itmuni
flag indicating time units
integer(i4b), dimension(:), pointer, public, contiguous nstp
number of time steps in each stress period
real(dp), dimension(:), pointer, public, contiguous perlen
length of each stress period
subroutine tdis_source_dimensions()
Source dimension NPER.
subroutine tdis_source_timing()
Source timing information.
real(dp), pointer, public totim
time relative to start of simulation
character(len=linelength), pointer input_fname
input filename for tdis
character(len=lendatetime), pointer, public datetime0
starting date and time for the simulation
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
real(dp), pointer, public pertimsav
saved value for pertim, used for subtiming
subroutine, public tdis_cr(fname, inmempath)
Create temporal discretization.
real(dp), pointer, public topertim
simulation time at start of stress period
subroutine tdis_allocate_arrays()
Allocate tdis arrays.
integer(i4b), pointer, public inats
flag indicating ats active for simulation
subroutine, public tdis_set_timestep()
Set time step length.
subroutine, public tdis_set_counters()
Set kstp and kper.
real(dp), pointer, public totimc
simulation time at start of time step
real(dp), pointer, public totalsimtime
time at end of simulation
integer(i4b), pointer, public kstp
current time step number
real(dp), pointer, public totimsav
saved value for totim, used for subtiming
subroutine, public tdis_da()
Deallocate memory.
subroutine tdis_set_delt()
Set time step length.
subroutine, public tdis_delt_reset(deltnew)
Reset delt and update timing variables and indicators.
subroutine tdis_source_options()
Source the timing discretization options.
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
subroutine check_tdis_timing(nper, perlen, nstp, tsmult)
Check the tdis timing information.
subroutine tdis_allocate_scalars()
Allocate tdis scalars.
real(dp), pointer, public deltsav
saved value for delt, used for subtiming
integer(i4b), pointer, public nper
number of stress period