24 integer(I4B),
public,
pointer ::
nper => null()
25 integer(I4B),
public,
pointer ::
itmuni => null()
26 integer(I4B),
public,
pointer ::
kper => null()
27 integer(I4B),
public,
pointer ::
kstp => null()
28 integer(I4B),
public,
pointer ::
inats => null()
32 real(dp),
public,
pointer ::
delt => null()
33 real(dp),
public,
pointer ::
pertim => null()
34 real(dp),
public,
pointer ::
topertim => null()
35 real(dp),
public,
pointer ::
totim => null()
36 real(dp),
public,
pointer ::
totimc => null()
37 real(dp),
public,
pointer ::
deltsav => null()
38 real(dp),
public,
pointer ::
totimsav => null()
41 real(dp),
public,
dimension(:),
pointer,
contiguous ::
perlen => null()
42 integer(I4B),
public,
dimension(:),
pointer,
contiguous ::
nstp => null()
43 real(dp),
public,
dimension(:),
pointer,
contiguous ::
tsmult => null()
44 character(len=LENDATETIME),
public,
pointer ::
datetime0 => null()
59 character(len=*),
intent(in) :: fname
60 character(len=*),
intent(in) :: inmempath
63 character(len=*),
parameter :: fmtheader = &
64 "(1X,/1X,'TDIS -- TEMPORAL DISCRETIZATION PACKAGE,', / &
65 &' VERSION 1 : 11/13/2014 - INPUT READ FROM MEMPATH: ', A)"
101 character(len=LINELENGTH) :: line
102 character(len=4) :: cpref
103 character(len=10) :: cend
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,/ &
112 character(len=*),
parameter :: fmtspits = &
113 "(1X,'NUMBER OF TIME STEPS = ',I0,/ &
114 &1X,'MULTIPLIER FOR DELT =',F10.3)"
136 write (line, fmtspts) cpref,
kper,
kstp, trim(cend)
145 if (
ats%isAdaptivePeriod(
kper))
then
146 call ats%ats_period_message(
kper)
159 logical(LGP) :: adaptiveperiod
161 character(len=*),
parameter :: fmttsi = &
162 "(1X,'INITIAL TIME STEP SIZE =',G15.7)"
165 adaptiveperiod =
ats%isAdaptivePeriod(
kper)
172 if (adaptiveperiod)
then
177 write (iout, fmttsi)
delt
204 real(dp),
intent(in) :: deltnew
206 logical(LGP) :: adaptiveperiod
209 adaptiveperiod =
ats%isAdaptivePeriod(
kper)
230 logical(LGP),
intent(in) :: adaptivePeriod
234 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
396 character(len=LINELENGTH),
dimension(6) :: time_units = &
397 &[character(len=LINELENGTH) ::
'UNKNOWN',
'SECONDS',
'MINUTES',
'HOURS', &
399 character(len=LINELENGTH) :: fname
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)"
413 found%start_date_time)
415 if (found%time_units)
then
417 call store_error(
'Unrecognized input value for TIME_UNITS option.')
434 write (iout,
'(1x,a)')
'PROCESSING TDIS OPTIONS'
436 if (found%time_units)
then
439 write (iout, fmtitmuni)
'UNDEFINED'
441 write (iout, fmtitmuni)
'SECONDS'
443 write (iout, fmtitmuni)
'MINUTES'
445 write (iout, fmtitmuni)
'HOURS'
447 write (iout, fmtitmuni)
'DAYS'
449 write (iout, fmtitmuni)
'YEARS'
453 write (iout, fmtitmuni)
'UNDEFINED'
456 if (found%start_date_time)
then
460 write (iout,
'(1x,a)')
'END OF TDIS OPTIONS'
537 character(len=*),
parameter :: fmtnper = &
538 "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')"
544 write (iout,
'(1x,a)')
'PROCESSING TDIS DIMENSIONS'
547 write (iout, fmtnper)
nper
550 write (iout,
'(1x,a)')
'END OF TDIS DIMENSIONS'
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)"
586 write (iout,
'(1x,a)')
'PROCESSING TDIS PERIODDATA'
587 write (iout, fmtheader)
594 write (iout,
'(1x,a)')
'END OF TDIS PERIODDATA'
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
614 integer(I4B) :: kper, kstp
615 real(DP) :: tstart, tend, dt
616 logical(LGP) :: valid
617 character(len=LINELENGTH) :: errmsg
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)"
636 if (nstp(kper) <= 0)
then
637 write (errmsg, fmtsperror)
'Number of time steps less than one ', kper
643 if (tsmult(kper) <=
dzero)
then
644 write (errmsg, fmtsperror)
'TSMULT must be greater than 0.0 ', kper
650 if (perlen(kper) <
dzero)
then
651 write (errmsg, fmtsperror)
'PERLEN cannot be less than 0.0 ', kper
657 if (.not. valid) cycle
660 if (perlen(kper) ==
dzero)
then
661 write (iout, fmtpwarn) kper
666 do kstp = 1, nstp(kper)
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))
673 dt = dt * tsmult(kper)
678 if (tstart == tend)
then
679 write (errmsg, fmtdterror) dt, kper, kstp
class(atstype) function, pointer, public create_ats()
Factory method to create ATS object, to hide.
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 tdis_set_end_flags(adaptiveperiod)
Set end of period and end of simulation indicators.
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
class(atstype), pointer, public ats
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