135
136 class(TimeSeriesManagerType) :: this
137
138 type(TimeSeriesLinkType), pointer :: tsLink => null()
139 type(TimeSeriesType), pointer :: timeseries => null()
140 integer(I4B) :: i, nlinks, nauxlinks
141 real(DP) :: begintime, endtime, tsendtime
142 character(len=LENPACKAGENAME + 2) :: pkgID
143
144 character(len=*), parameter :: fmt5 = &
145 "(/,'Time-series controlled values in stress period: ', i0, &
146 &', time step ', i0, ':')"
14710 format(a, ' package: Boundary ', i0, ', entry ', i0, &
148 ' value from time series "', a, '" = ', g12.5)
14915 format(a, ' package: Boundary ', i0, ', entry ', i0, &
150 ' value from time series "', a, '" = ', g12.5, ' (', a, ')')
15120 format(a, ' package: Boundary ', i0, ', ', a, &
152 ' value from time series "', a, '" = ', g12.5)
15325 format(a, ' package: Boundary ', i0, ', ', a, &
154 ' value from time series "', a, '" = ', g12.5, ' (', a, ')')
155
156
157 begintime = totimc
158 endtime = begintime + delt
159
160
161 nlinks = this%boundtslinks%Count()
162 nauxlinks = this%auxvartslinks%Count()
163
164
165
166
167
168 i = 1
169 do while (i <= nauxlinks)
170 tslink => gettimeserieslinkfromlist(this%auxvarTsLinks, i)
171 timeseries => tslink%timeSeries
172
173
174 if (this%removeTsLinksOnCompletion) then
175 tsendtime = timeseries%FindLatestTime(.true.)
176 if (tsendtime < begintime) then
177 call this%auxvarTsLinks%RemoveNode(i, .true.)
178 nauxlinks = this%auxvartslinks%Count()
179 cycle
180 end if
181 end if
182
183 if (i == 1) then
184 if (tslink%Iprpak == 1) then
185 write (this%iout, fmt5) kper, kstp
186 end if
187 end if
188 tslink%BndElement = timeseries%GetValue(begintime, endtime, &
189 this%extendTsToEndOfSimulation)
190
191
192 if (tslink%Iprpak == 1) then
193 pkgid = '"'//trim(tslink%PackageName)//'"'
194 if (tslink%Text == '') then
195 if (tslink%BndName == '') then
196 write (this%iout, 10) trim(pkgid), tslink%IRow, tslink%JCol, &
197 trim(tslink%timeSeries%Name), &
198 tslink%BndElement
199 else
200 write (this%iout, 15) trim(pkgid), tslink%IRow, tslink%JCol, &
201 trim(tslink%timeSeries%Name), &
202 tslink%BndElement, trim(tslink%BndName)
203 end if
204 else
205 if (tslink%BndName == '') then
206 write (this%iout, 20) trim(pkgid), tslink%IRow, trim(tslink%Text), &
207 trim(tslink%timeSeries%Name), &
208 tslink%BndElement
209 else
210 write (this%iout, 25) trim(pkgid), tslink%IRow, trim(tslink%Text), &
211 trim(tslink%timeSeries%Name), &
212 tslink%BndElement, trim(tslink%BndName)
213 end if
214 end if
215 end if
216
217 i = i + 1
218 end do
219
220
221
222
223 i = 1
224 do while (i <= nlinks)
225 tslink => gettimeserieslinkfromlist(this%boundTsLinks, i)
226 timeseries => tslink%timeSeries
227
228
229 if (this%removeTsLinksOnCompletion) then
230 tsendtime = timeseries%FindLatestTime(.true.)
231 if (tsendtime < begintime) then
232 call this%boundTsLinks%RemoveNode(i, .true.)
233 nlinks = this%boundTsLinks%Count()
234 cycle
235 end if
236 end if
237
238 if (i == 1 .and. nauxlinks == 0) then
239 if (tslink%Iprpak == 1) then
240 write (this%iout, fmt5) kper, kstp
241 end if
242 end if
243
244
245
246 if (tslink%UseDefaultProc) then
247 timeseries => tslink%timeSeries
248 tslink%BndElement = timeseries%GetValue(begintime, endtime, &
249 this%extendTsToEndOfSimulation)
250
251
252
253
254 if (associated(tslink%RMultiplier)) then
255 tslink%BndElement = tslink%BndElement * tslink%RMultiplier
256 end if
257
258
259 if (tslink%Iprpak == 1) then
260 pkgid = '"'//trim(tslink%PackageName)//'"'
261 if (tslink%Text == '') then
262 if (tslink%BndName == '') then
263 write (this%iout, 10) trim(pkgid), tslink%IRow, tslink%JCol, &
264 trim(tslink%timeSeries%Name), &
265 tslink%BndElement
266 else
267 write (this%iout, 15) trim(pkgid), tslink%IRow, tslink%JCol, &
268 trim(tslink%timeSeries%Name), &
269 tslink%BndElement, trim(tslink%BndName)
270 end if
271 else
272 if (tslink%BndName == '') then
273 write (this%iout, 20) trim(pkgid), tslink%IRow, trim(tslink%Text), &
274 trim(tslink%timeSeries%Name), &
275 tslink%BndElement
276 else
277 write (this%iout, 25) trim(pkgid), tslink%IRow, trim(tslink%Text), &
278 trim(tslink%timeSeries%Name), &
279 tslink%BndElement, trim(tslink%BndName)
280 end if
281 end if
282 end if
283
284
285 if (tslink%ConvertFlux) then
286 tslink%BndElement = tslink%BndElement * tslink%CellArea
287 end if
288 end if
289
290 i = i + 1
291 end do
292
293
294 if (nlinks + nauxlinks > 0) then
295 if (tslink%Iprpak == 1) then
296 write (this%iout, '()')
297 end if
298 end if