31 real(dp),
allocatable :: times(:)
32 integer(I4B) :: selection(2)
52 deallocate (this%times)
58 integer(I4B),
optional,
intent(in) :: increment
61 this%selection = (/1,
size(this%times)/)
68 if (
allocated(this%times))
deallocate (this%times)
69 allocate (this%times(0))
70 this%selection = (/0, 0/)
89 if (.not.
allocated(this%times))
return
90 do i = 1,
size(this%times)
103 subroutine log(this, iout, verb)
106 integer(I4B),
intent(in) :: iout
107 character(len=*),
intent(in) :: verb
109 character(len=*),
parameter :: fmt = &
110 &
"(6x,'THE FOLLOWING TIMES WILL BE ',A,': ',50(G0,' '))"
113 write (iout, fmt) verb, this%times(this%selection(1):this%selection(2))
115 write (iout,
"(a,1x,a)")
'NO TIMES WILL BE', verb
139 real(DP),
intent(in) :: t0, t1
140 logical(LGP),
intent(inout),
optional :: changed
142 integer(I4B) :: i, i0, i1
143 integer(I4B) :: l, u, lp, up
148 i1 =
size(this%times)
155 lp = this%selection(1)
156 up = this%selection(2)
163 if (lp > 0 .and. up > 0)
then
165 if (this%times(lp - 1) < t0 .and. &
166 this%times(lp) >= t0)
then
171 if (up > 1 .and. up < i1)
then
172 if (this%times(up + 1) > t1 .and. &
173 this%times(up) <= t1)
then
178 if (l == lp .and. u == up)
then
179 this%selection = (/l, u/)
180 if (
present(changed)) changed = .false.
188 if (l < 0 .and. t >= t0 .and. t <= t1) l = i
189 if (l > 0 .and. t <= t1) u = i
191 this%selection = (/l, u/)
192 if (
present(changed)) changed = l /= lp .or. u /= up
205 l = minval(this%times)
206 u = maxval(this%times)
209 call this%select(l, u)
221 function any(this)
result(a)
225 a = all(this%selection > 0)
241 n = this%selection(2) - this%selection(1)
254 integer(I4B),
allocatable :: indx(:)
256 allocate (indx(
size(this%times)))
257 call qsort(indx, this%times)
271 this%times = [this%times, a]
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 to occur.
logical(lgp) function increasing(this)
Determine if times strictly increase.
subroutine advance(this)
Update the selection to the current time step.
integer(i4b) function count(this)
Return the number of times currently selected.
subroutine log(this, iout, verb)
Show the current time selection, if any.
subroutine deallocate(this)
Deallocate the time selection object.
logical(lgp) function any(this)
Check if any times are currently selected.
subroutine sort(this)
Sort the time selection in increasing order.
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).
subroutine extend(this, a)
Extend the time selection with the given array.
Represents a series of instants at which some event should occur.