Time step selection module.
|
subroutine | deallocate (this) |
| Deallocate the time step selection object. More...
|
|
subroutine | init (this) |
| Initialize the time step selection object. More...
|
|
subroutine | log (this, iout, verb) |
|
subroutine | read (this, line) |
| Read a line of input and prepare the selection object. More...
|
|
logical function | is_selected (this, kstp, endofperiod) |
| Indicates whether the given time step is selected. More...
|
|
logical function | any (this) |
| Indicates whether any time steps are selected. More...
|
|
◆ any()
- Parameters
-
Definition at line 180 of file TimeStepSelect.f90.
181 class(TimeStepSelectType) :: this
186 size(this%steps) > 0)
◆ deallocate()
Definition at line 58 of file TimeStepSelect.f90.
59 class(TimeSTepSelectType) :: this
60 deallocate (this%steps)
◆ init()
- Parameters
-
Definition at line 64 of file TimeStepSelect.f90.
65 class(TimeStepSelectType) :: this
67 if (
allocated(this%steps))
deallocate (this%steps)
68 allocate (this%steps(0))
◆ is_selected()
logical function timestepselectmodule::is_selected |
( |
class(timestepselecttype) |
this, |
|
|
integer(i4b), intent(in) |
kstp, |
|
|
logical(lgp), intent(in), optional |
endofperiod |
|
) |
| |
|
private |
- Parameters
-
| this | this instance |
[in] | kstp | current time step |
[in] | endofperiod | whether last step of stress period |
Definition at line 146 of file TimeStepSelect.f90.
148 class(TimeStepSelectType) :: this
149 integer(I4B),
intent(in) :: kstp
150 logical(LGP),
intent(in),
optional :: endofperiod
155 if (
present(endofperiod))
then
161 is_selected = .false.
162 if (this%all) is_selected = .true.
163 if (kstp == 1 .and. this%first) is_selected = .true.
164 if (lend .and. this%last) is_selected = .true.
165 if (this%freq > 0)
then
166 if (mod(kstp, this%freq) == 0) is_selected = .true.
171 if (kstp == this%steps(i))
then
◆ log()
subroutine timestepselectmodule::log |
( |
class(timestepselecttype) |
this, |
|
|
integer(i4b), intent(in) |
iout, |
|
|
character(len=*), intent(in) |
verb |
|
) |
| |
|
private |
- Parameters
-
| this | this instance |
[in] | iout | output unit |
[in] | verb | selection name |
Definition at line 75 of file TimeStepSelect.f90.
77 class(TimeStepSelectType) :: this
78 integer(I4B),
intent(in) :: iout
79 character(len=*),
intent(in) :: verb
81 character(len=*),
parameter :: fmt_steps = &
82 &
"(6x,'THE FOLLOWING STEPS WILL BE ',A,': ',50(I0,' '))"
83 character(len=*),
parameter :: fmt_freq = &
84 &
"(6x,'THE FOLLOWING FREQUENCY WILL BE ',A,': ',I0)"
87 write (iout,
"(6x,a,a)")
'ALL TIME STEPS WILL BE ', verb
89 if (
size(this%steps) > 0)
then
90 write (iout, fmt_steps) verb, this%steps
92 if (this%freq > 0)
then
93 write (iout, fmt_freq) verb, this%freq
96 write (iout,
"(6x,a,a)")
'THE FIRST TIME STEP WILL BE ', verb
99 write (iout,
"(6x,a,a)")
'THE LAST TIME STEP WILL BE ', verb
◆ read()
subroutine timestepselectmodule::read |
( |
class(timestepselecttype) |
this, |
|
|
character(len=*), intent(in) |
line |
|
) |
| |
|
private |
- Parameters
-
| this | this instance |
[in] | line | input line |
Definition at line 104 of file TimeStepSelect.f90.
105 class(TimeStepSelectType) :: this
106 character(len=*),
intent(in) :: line
108 character(len=len(line)) :: l
109 integer(I4B) :: n, lloc, istart, istop, ival
115 call urword(l, lloc, istart, istop, 1, ival, rval, 0, 0)
116 select case (l(istart:istop))
121 call urword(l, lloc, istart, istop, 2, ival, rval, -1, 0)
124 call expandarray(this%steps)
125 this%steps(n + 1) = ival
131 call urword(l, lloc, istart, istop, 2, ival, rval, -1, 0)
138 write (errmsg,
'(2a)') &
139 'Looking for ALL, STEPS, FIRST, LAST, OR FREQUENCY. Found: ', &
141 call store_error(errmsg, terminate=.true.)