18 use mo_kind,
only : i4, dp
30 integer(i4) :: ntimesteps
46 integer(i4),
private :: prev_day
47 integer(i4),
private :: prev_month
48 integer(i4),
private :: prev_year
52 logical :: is_new_month
53 logical :: is_new_year
59 integer(i4) :: tindex_out
73 use mo_julian,
only : caldat
75 integer(i4),
intent(in) :: iDomain
85 this%newTime = real(
simper(idomain)%julStart, dp)
87 call caldat(int(this%newTime), yy = this%year, mm = this%month, dd = this%day)
89 this%is_new_day = .true.
90 this%is_new_month = .true.
91 this%is_new_year = .true.
94 this%yId =
lcyearid(this%year, idomain)
99 this%prev_day = this%day
100 this%prev_month = this%month
101 this%prev_year = this%year
107 use mo_julian,
only : caldat, julday
113 this%prev_day = this%day
114 this%prev_month = this%month
115 this%prev_year = this%year
117 this%is_new_day = .false.
118 this%is_new_month = .false.
119 this%is_new_year = .false.
123 this%newTime = julday(this%day, this%month, this%year) + real(this%hour, dp) / 24._dp
125 this%hour = mod(this%hour, 24)
128 call caldat(int(this%newTime), yy = this%year, mm = this%month, dd = this%day)
130 if (this%prev_day /= this%day) this%is_new_day = .true.
131 if (this%prev_month /= this%month) this%is_new_month = .true.
132 if (this%prev_year /= this%year) this%is_new_year = .true.
141 this%iLAI = this%month
143 if (this%is_new_day)
then
144 this%iLAI = this%iLAI + 1
147 if (this%is_new_month)
then
148 this%iLAI = this%iLAI + 1
151 if (this%is_new_year)
then
152 this%iLAI = this%iLAI + 1
159 integer(i4),
intent(in) :: timestep_model_outputs
160 integer(i4),
intent(in) :: tt
165 if (timestep_model_outputs > 0)
then
166 if ((mod(this%tIndex_out, timestep_model_outputs) == 0) &
167 .or. (tt == this%nTimeSteps)) writeout = .true.
169 select case(timestep_model_outputs)
171 if (tt == this%nTimeSteps) writeout = .true.
173 if (((this%tIndex_out > 0) .and. this%is_new_day) .or. &
174 (tt == this%nTimeSteps)) writeout = .true.
176 if (((this%tIndex_out > 0) .and. this%is_new_month) .or.&
177 (tt == this%nTimeSteps)) writeout = .true.
179 if (((this%tIndex_out > 0) .and. this%is_new_year) .or. &
180 (tt == this%nTimeSteps)) writeout = .true.
type for date time information with an increment subroutine
logical function datetimeinfo_writeout(this, timestep_model_outputs, tt)
subroutine datetimeinfo_init(this, idomain)
subroutine datetimeinfo_increment(this)
subroutine datetimeinfo_update_lai_timestep(this)
Provides structures needed by mHM, mRM and/or mpr.
integer(i4), public ntstepday
integer(i4), dimension(:, :), allocatable, public lcyearid
type(period), dimension(:), allocatable, public simper
integer(i4), public timestep
Global variables for mpr only.
integer(i4), public timestep_lai_input