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),
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)"
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)
165 logical(LGP) :: adaptiveperiod
167 character(len=*),
parameter :: fmttsi = &
168 "(1X,'INITIAL TIME STEP SIZE =',G15.7)"
178 if (adaptiveperiod)
then
196 if (adaptiveperiod)
then
228 real(dp),
intent(in) :: deltnew
230 logical(LGP) :: adaptiveperiod
240 if (adaptiveperiod)
then
353 integer(I4B),
intent(in) ::
iout
355 real(dp) :: cnv, delsec, totsec, persec, delmn, delhr, totmn, tothr, &
356 totdy, totyr, permn, perhr, perdy, peryr, deldy, delyr
358 character(len=*),
parameter :: fmttmsmry =
"(1X, ///9X, &
359 &'TIME SUMMARY AT END OF TIME STEP', I5,' IN STRESS PERIOD ', I4)"
360 character(len=*),
parameter :: fmttmstpmsg = &
361 &
"(21X, ' TIME STEP LENGTH =', G15.6 / &
362 & 21X, ' STRESS PERIOD TIME =', G15.6 / &
363 & 21X, 'TOTAL SIMULATION TIME =', G15.6)"
364 character(len=*),
parameter :: fmttottmmsg = &
365 &
"(19X, ' SECONDS MINUTES HOURS', 7X, &
366 &'DAYS YEARS'/20X, 59('-'))"
367 character(len=*),
parameter :: fmtdelttm = &
368 &
"(1X, ' TIME STEP LENGTH', 1P, 5G12.5)"
369 character(len=*),
parameter :: fmtpertm = &
370 &
"(1X, 'STRESS PERIOD TIME', 1P, 5G12.5)"
371 character(len=*),
parameter :: fmttottm = &
372 &
"(1X, ' TOTAL TIME', 1P, 5G12.5,/)"
386 if (cnv ==
dzero)
then
410 write (
iout, fmttottmmsg)
411 write (
iout, fmtdelttm) delsec, delmn, delhr, deldy, delyr
412 write (
iout, fmtpertm) persec, permn, perhr, perdy, peryr
413 write (
iout, fmttottm) totsec, totmn, tothr, totdy, totyr
474 character(len=LINELENGTH),
dimension(6) :: time_units = &
475 &[character(len=LINELENGTH) ::
'UNDEFINED',
'SECONDS',
'MINUTES',
'HOURS', &
477 character(len=LINELENGTH) :: fname
479 character(len=*),
parameter :: fmtitmuni = &
480 &
"(4x,'SIMULATION TIME UNIT IS ',A)"
481 character(len=*),
parameter :: fmtdatetime0 = &
482 &
"(4x,'SIMULATION STARTING DATE AND TIME IS ',A)"
491 found%start_date_time)
493 if (found%time_units)
then
507 write (
iout,
'(1x,a)')
'PROCESSING TDIS OPTIONS'
509 if (found%time_units)
then
512 write (
iout, fmtitmuni)
'UNDEFINED'
514 write (
iout, fmtitmuni)
'SECONDS'
516 write (
iout, fmtitmuni)
'MINUTES'
518 write (
iout, fmtitmuni)
'HOURS'
520 write (
iout, fmtitmuni)
'DAYS'
522 write (
iout, fmtitmuni)
'YEARS'
526 write (
iout, fmtitmuni)
'UNDEFINED'
529 if (found%start_date_time)
then
533 write (
iout,
'(1x,a)')
'END OF TDIS OPTIONS'
619 character(len=*),
parameter :: fmtnper = &
620 "(1X,I4,' STRESS PERIOD(S) IN SIMULATION')"
626 write (
iout,
'(1x,a)')
'PROCESSING TDIS DIMENSIONS'
632 write (
iout,
'(1x,a)')
'END OF TDIS DIMENSIONS'
651 character(len=*),
parameter :: fmtheader = &
652 "(1X,//1X,'STRESS PERIOD LENGTH TIME STEPS', &
653 &' MULTIPLIER FOR DELT',/1X,76('-'))"
654 character(len=*),
parameter :: fmtrow = &
655 "(1X,I8,1PG21.7,I7,0PF25.3)"
671 write (
iout,
'(1x,a)')
'PROCESSING TDIS PERIODDATA'
672 write (
iout, fmtheader)
679 write (
iout,
'(1x,a)')
'END OF TDIS PERIODDATA'
696 integer(I4B),
intent(in) :: nper
697 real(DP),
dimension(:),
contiguous,
intent(in) :: perlen
698 integer(I4B),
dimension(:),
contiguous,
intent(in) :: nstp
699 real(DP),
dimension(:),
contiguous,
intent(in) :: tsmult
701 integer(I4B) :: kper, kstp
702 real(DP) :: tstart, tend, dt
703 character(len=LINELENGTH) :: errmsg
705 character(len=*),
parameter :: fmtpwarn = &
706 "(1X,/1X,'PERLEN is zero for stress period ', I0, &
707 &'. PERLEN must not be zero for transient periods.')"
708 character(len=*),
parameter :: fmtsperror = &
709 &
"(A,' for stress period ', I0)"
710 character(len=*),
parameter :: fmtdterror = &
711 "('Time step length of ', G0, ' is too small in period ', I0, &
712 &' and time step ', I0)"
721 if (nstp(kper) <= 0)
then
722 write (errmsg, fmtsperror)
'Number of time steps less than one ', kper
728 if (perlen(kper) ==
dzero)
then
729 write (
iout, fmtpwarn) kper
734 if (tsmult(kper) <=
dzero)
then
735 write (errmsg, fmtsperror)
'TSMULT must be greater than 0.0 ', kper
741 if (perlen(kper) <
dzero)
then
742 write (errmsg, fmtsperror)
'PERLEN cannot be less than 0.0 ', kper
748 do kstp = 1, nstp(kper)
750 dt = perlen(kper) / float(nstp(kper))
751 if (tsmult(kper) /=
done) &
752 dt = perlen(kper) * (
done - tsmult(kper)) / &
753 (
done - tsmult(kper)**nstp(kper))
755 dt = dt * tsmult(kper)
760 if (tstart == tend)
then
761 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
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.
character(len=lendatetime), pointer datetime0
starting date and time for the simulation
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