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)
138 if (isim_level >= vall) &
140 call write_message(line, iunit=iout, skipbefore=1, skipafter=1)
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
190 if (adaptiveperiod)
then
216 real(dp),
intent(in) :: deltnew
218 logical(LGP) :: adaptiveperiod
221 adaptiveperiod =
ats%isAdaptivePeriod(
kper)
228 if (adaptiveperiod)
then
275 integer(I4B),
intent(in) ::
iout
277 real(dp) :: cnv, delsec, totsec, persec, delmn, delhr, totmn, tothr, &
278 totdy, totyr, permn, perhr, perdy, peryr, deldy, delyr
280 character(len=*),
parameter :: fmttmsmry =
"(1X, ///9X, &
281 &'TIME SUMMARY AT END OF TIME STEP', I5,' IN STRESS PERIOD ', I4)"
282 character(len=*),
parameter :: fmttmstpmsg = &
283 &
"(21X, ' TIME STEP LENGTH =', G15.6 / &
284 & 21X, ' STRESS PERIOD TIME =', G15.6 / &
285 & 21X, 'TOTAL SIMULATION TIME =', G15.6)"
286 character(len=*),
parameter :: fmttottmmsg = &
287 &
"(19X, ' SECONDS MINUTES HOURS', 7X, &
288 &'DAYS YEARS'/20X, 59('-'))"
289 character(len=*),
parameter :: fmtdelttm = &
290 &
"(1X, ' TIME STEP LENGTH', 1P, 5G12.5)"
291 character(len=*),
parameter :: fmtpertm = &
292 &
"(1X, 'STRESS PERIOD TIME', 1P, 5G12.5)"
293 character(len=*),
parameter :: fmttottm = &
294 &
"(1X, ' TOTAL TIME', 1P, 5G12.5,/)"
308 if (cnv ==
dzero)
then
332 write (
iout, fmttottmmsg)
333 write (
iout, fmtdelttm) delsec, delmn, delhr, deldy, delyr
334 write (
iout, fmtpertm) persec, permn, perhr, perdy, peryr
335 write (
iout, fmttottm) totsec, totmn, tothr, totdy, totyr
393 character(len=LINELENGTH),
dimension(6) :: time_units = &
394 &[character(len=LINELENGTH) ::
'UNDEFINED',
'SECONDS',
'MINUTES',
'HOURS', &
396 character(len=LINELENGTH) :: fname
398 character(len=*),
parameter :: fmtitmuni = &
399 &
"(4x,'SIMULATION TIME UNIT IS ',A)"
400 character(len=*),
parameter :: fmtdatetime0 = &
401 &
"(4x,'SIMULATION STARTING DATE AND TIME IS ',A)"
410 found%start_date_time)
412 if (found%time_units)
then
414 call store_error(
'Unrecognized input value for TIME_UNITS option.')
431 write (
iout,
'(1x,a)')
'PROCESSING TDIS OPTIONS'
433 if (found%time_units)
then
436 write (
iout, fmtitmuni)
'UNDEFINED'
438 write (
iout, fmtitmuni)
'SECONDS'
440 write (
iout, fmtitmuni)
'MINUTES'
442 write (
iout, fmtitmuni)
'HOURS'
444 write (
iout, fmtitmuni)
'DAYS'
446 write (
iout, fmtitmuni)
'YEARS'
450 write (
iout, fmtitmuni)
'UNDEFINED'
453 if (found%start_date_time)
then
457 write (
iout,
'(1x,a)')
'END OF TDIS OPTIONS'
534 character(len=*),
parameter :: fmtnper = &
535 "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')"
541 write (
iout,
'(1x,a)')
'PROCESSING TDIS DIMENSIONS'
547 write (
iout,
'(1x,a)')
'END OF TDIS DIMENSIONS'
563 character(len=*),
parameter :: fmtheader = &
564 "(1X,//1X,'STRESS PERIOD LENGTH TIME STEPS', &
565 &' MULTIPLIER FOR DELT',/1X,76('-'))"
566 character(len=*),
parameter :: fmtrow = &
567 "(1X,I8,1PG21.7,I7,0PF25.3)"
583 write (
iout,
'(1x,a)')
'PROCESSING TDIS PERIODDATA'
584 write (
iout, fmtheader)
591 write (
iout,
'(1x,a)')
'END OF TDIS PERIODDATA'
605 integer(I4B),
intent(in) :: nper
606 real(DP),
dimension(:),
contiguous,
intent(in) :: perlen
607 integer(I4B),
dimension(:),
contiguous,
intent(in) :: nstp
608 real(DP),
dimension(:),
contiguous,
intent(in) :: tsmult
610 integer(I4B) :: kper, kstp
611 real(DP) :: tstart, tend, dt
612 character(len=LINELENGTH) :: errmsg
614 character(len=*),
parameter :: fmtpwarn = &
615 "(1X,/1X,'PERLEN is zero for stress period ', I0, &
616 &'. PERLEN must not be zero for transient periods.')"
617 character(len=*),
parameter :: fmtsperror = &
618 &
"(A,' for stress period ', I0)"
619 character(len=*),
parameter :: fmtdterror = &
620 "('Time step length of ', G0, ' is too small in period ', I0, &
621 &' and time step ', I0)"
630 if (nstp(kper) <= 0)
then
631 write (errmsg, fmtsperror)
'Number of time steps less than one ', kper
637 if (perlen(kper) ==
dzero)
then
638 write (
iout, fmtpwarn) 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 do kstp = 1, nstp(kper)
659 dt = perlen(kper) / float(nstp(kper))
660 if (tsmult(kper) /=
done) &
661 dt = perlen(kper) * (
done - tsmult(kper)) / &
662 (
done - tsmult(kper)**nstp(kper))
664 dt = dt * tsmult(kper)
669 if (tstart == tend)
then
670 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, 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