205 class(PrtOcType) :: this
207 character(len=LINELENGTH) :: keyword
208 character(len=LINELENGTH) :: keyword2
209 character(len=LINELENGTH) :: fname
210 character(len=:),
allocatable :: line
211 integer(I4B) :: ierr, ipos
212 logical(LGP) :: block_found, param_found, event_found, eob
213 type(OutputControlDataType),
pointer :: ocdobjptr
215 character(len=*),
parameter :: fmttrkbin = &
216 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
217 &'OPENED ON UNIT: ', I0)"
218 character(len=*),
parameter :: fmttrkcsv = &
219 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
220 &'OPENED ON UNIT: ', I0)"
223 call this%parser%GetBlock(
'OPTIONS', block_found, ierr, &
224 supportopenclose=.true., blockrequired=.false.)
227 if (block_found)
then
228 write (this%iout,
'(/,1x,a,/)')
'PROCESSING OC OPTIONS'
229 event_found = .false.
231 call this%parser%GetNextLine(eob)
233 call this%parser%GetStringCaps(keyword)
234 param_found = .false.
235 select case (keyword)
237 call this%parser%GetStringCaps(keyword2)
238 if (keyword2 /=
'FILEOUT')
then
239 errmsg =
"BUDGETCSV must be followed by FILEOUT and then budget &
240 &csv file name. Found '"//trim(keyword2)//
"'."
242 call this%parser%StoreErrorUnit()
244 call this%parser%GetString(fname)
246 call openfile(this%ibudcsv, this%iout, fname,
'CSV', &
247 filstat_opt=
'REPLACE')
250 call this%parser%GetStringCaps(keyword)
251 if (keyword ==
'FILEOUT')
then
253 call this%parser%GetString(fname)
256 call openfile(this%itrkout, this%iout, fname,
'DATA(BINARY)', &
259 write (this%iout, fmttrkbin) trim(adjustl(fname)), this%itrkout
262 fname = trim(fname)//
'.hdr'
263 call openfile(this%itrkhdr, this%iout, fname,
'CSV', &
264 filstat_opt=
'REPLACE', mode_opt=mnormal)
267 call store_error(
'OPTIONAL TRACK KEYWORD MUST BE '// &
268 'FOLLOWED BY FILEOUT')
272 call this%parser%GetStringCaps(keyword)
273 if (keyword ==
'FILEOUT')
then
275 call this%parser%GetString(fname)
278 call openfile(this%itrkcsv, this%iout, fname,
'CSV', &
279 filstat_opt=
'REPLACE')
280 write (this%iout, fmttrkcsv) trim(adjustl(fname)), this%itrkcsv
283 call store_error(
'OPTIONAL TRACKCSV KEYWORD MUST BE &
284 &FOLLOWED BY FILEOUT')
287 case (
'TRACK_RELEASE')
288 this%trackrelease = .true.
292 this%trackfeatexit = .true.
295 case (
'TRACK_TIMESTEP')
296 this%tracktimestep = .true.
299 case (
'TRACK_TERMINATE')
300 this%trackterminate = .true.
303 case (
'TRACK_WEAKSINK')
304 this%trackweaksink = .true.
307 case (
'TRACK_USERTIME')
308 this%trackusertime = .true.
311 case (
'TRACK_SUBFEATURE_EXIT')
312 this%tracksubfexit = .true.
315 case (
'TRACK_DROPPED')
316 this%trackdropped = .true.
319 case (
'DEV_DUMP_EVENT_TRACE')
320 this%dump_event_trace = .true.
323 param_found = .false.
327 if (.not. param_found)
then
328 do ipos = 1,
size(this%ocds)
329 ocdobjptr => this%ocds(ipos)
330 if (keyword == trim(ocdobjptr%cname))
then
335 if (.not. param_found)
then
336 errmsg =
"UNKNOWN OC OPTION '"//trim(keyword)//
"'."
338 call this%parser%StoreErrorUnit()
340 call this%parser%GetRemainingLine(line)
341 call ocdobjptr%set_option(line, this%parser%iuactive, this%iout)
346 if (.not. event_found)
then
347 this%trackrelease = .true.
348 this%trackfeatexit = .true.
349 this%tracktimestep = .true.
350 this%trackterminate = .true.
351 this%trackweaksink = .true.
352 this%trackusertime = .true.
353 this%trackdropped = .true.
357 write (this%iout,
'(1x,a)')
'END OF OC OPTIONS'
Particle track output module.
character(len= *), parameter, public trackheader
character(len= *), parameter, public trackdtypes
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.