19 real(dp),
allocatable :: times(:)
20 integer(I4B) :: selection(2)
35 deallocate (this%times)
41 integer(I4B),
optional,
intent(in) :: increment
43 this%selection = (/1,
size(this%times)/)
49 if (.not.
allocated(this%times))
allocate (this%times(0))
50 this%selection = (/0, 0/)
62 if (.not.
allocated(this%times))
return
63 do i = 1,
size(this%times)
92 subroutine select(this, t0, t1, changed)
95 real(DP),
intent(in) :: t0, t1
96 logical(LGP),
intent(inout),
optional :: changed
98 integer(I4B) :: i, i0, i1
99 integer(I4B) :: l, u, lp, up
104 i1 =
size(this%times)
111 lp = this%selection(1)
112 up = this%selection(2)
119 if (lp > 0 .and. up > 0)
then
121 if (this%times(lp - 1) < t0 .and. &
122 this%times(lp) >= t0)
then
127 if (up > 1 .and. up < i1)
then
128 if (this%times(up + 1) > t1 .and. &
129 this%times(up) <= t1)
then
134 if (l == lp .and. u == up)
then
135 this%selection = (/l, u/)
136 if (
present(changed)) changed = .false.
144 if (l < 0 .and. t >= t0 .and. t <= t1) l = i
145 if (l > 0 .and. t <= t1) u = i
147 this%selection = (/l, u/)
148 if (
present(changed)) changed = l /= lp .or. u /= up
160 l = minval(this%times)
161 u = maxval(this%times)
164 call this%select(l, u)
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
subroutine pstop(status, message)
Stop the program, optionally specifying an error status code.
This module defines variable data types.
integer(i4b), dimension(:), pointer, public, contiguous nstp
number of time steps in each stress period
real(dp), pointer, public totimc
simulation time at start of time step
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
integer(i4b), pointer, public nper
number of stress period
Specify times for some event(s) to occur.
logical(lgp) function increasing(this)
Determine if times strictly increase. Returns true if empty or not yet allocated.
subroutine destroy(this)
Destroy the time selection object.
subroutine try_advance(this)
Update the selection to match the current time step.
subroutine expand(this, increment)
Expand capacity by the given amount. Resets the current slice.
subroutine select(this, t0, t1, changed)
Select times between t0 and t1 (inclusive).
Represents a series of instants at which some event should occur.