201 class(PrtOcType) :: this
203 character(len=LINELENGTH) :: keyword
204 character(len=LINELENGTH) :: keyword2
205 character(len=LINELENGTH) :: fname
206 character(len=:),
allocatable :: line
207 integer(I4B) :: ierr, ipos
208 logical(LGP) :: block_found, param_found, event_found, eob
209 type(OutputControlDataType),
pointer :: ocdobjptr
211 character(len=*),
parameter :: fmttrkbin = &
212 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
213 &'OPENED ON UNIT: ', I0)"
214 character(len=*),
parameter :: fmttrkcsv = &
215 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
216 &'OPENED ON UNIT: ', I0)"
219 call this%parser%GetBlock(
'OPTIONS', block_found, ierr, &
220 supportopenclose=.true., blockrequired=.false.)
223 if (block_found)
then
224 write (this%iout,
'(/,1x,a,/)')
'PROCESSING OC OPTIONS'
225 event_found = .false.
227 call this%parser%GetNextLine(eob)
229 call this%parser%GetStringCaps(keyword)
230 param_found = .false.
231 select case (keyword)
233 call this%parser%GetStringCaps(keyword2)
234 if (keyword2 /=
'FILEOUT')
then
235 errmsg =
"BUDGETCSV must be followed by FILEOUT and then budget &
236 &csv file name. Found '"//trim(keyword2)//
"'."
238 call this%parser%StoreErrorUnit()
240 call this%parser%GetString(fname)
242 call openfile(this%ibudcsv, this%iout, fname,
'CSV', &
243 filstat_opt=
'REPLACE')
246 call this%parser%GetStringCaps(keyword)
247 if (keyword ==
'FILEOUT')
then
249 call this%parser%GetString(fname)
252 call openfile(this%itrkout, this%iout, fname,
'DATA(BINARY)', &
255 write (this%iout, fmttrkbin) trim(adjustl(fname)), this%itrkout
258 fname = trim(fname)//
'.hdr'
259 call openfile(this%itrkhdr, this%iout, fname,
'CSV', &
260 filstat_opt=
'REPLACE', mode_opt=mnormal)
263 call store_error(
'OPTIONAL TRACK KEYWORD MUST BE '// &
264 'FOLLOWED BY FILEOUT')
268 call this%parser%GetStringCaps(keyword)
269 if (keyword ==
'FILEOUT')
then
271 call this%parser%GetString(fname)
274 call openfile(this%itrkcsv, this%iout, fname,
'CSV', &
275 filstat_opt=
'REPLACE')
276 write (this%iout, fmttrkcsv) trim(adjustl(fname)), this%itrkcsv
279 call store_error(
'OPTIONAL TRACKCSV KEYWORD MUST BE &
280 &FOLLOWED BY FILEOUT')
283 case (
'TRACK_RELEASE')
284 this%trackrelease = .true.
288 this%trackfeatexit = .true.
291 case (
'TRACK_TIMESTEP')
292 this%tracktimestep = .true.
295 case (
'TRACK_TERMINATE')
296 this%trackterminate = .true.
299 case (
'TRACK_WEAKSINK')
300 this%trackweaksink = .true.
303 case (
'TRACK_USERTIME')
304 this%trackusertime = .true.
307 case (
'TRACK_SUBFEATURE_EXIT')
308 this%tracksubfexit = .true.
311 case (
'DEV_DUMP_EVENT_TRACE')
312 this%dump_event_trace = .true.
315 param_found = .false.
319 if (.not. param_found)
then
320 do ipos = 1,
size(this%ocds)
321 ocdobjptr => this%ocds(ipos)
322 if (keyword == trim(ocdobjptr%cname))
then
327 if (.not. param_found)
then
328 errmsg =
"UNKNOWN OC OPTION '"//trim(keyword)//
"'."
330 call this%parser%StoreErrorUnit()
332 call this%parser%GetRemainingLine(line)
333 call ocdobjptr%set_option(line, this%parser%iuactive, this%iout)
338 if (.not. event_found)
then
339 this%trackrelease = .true.
340 this%trackfeatexit = .true.
341 this%tracktimestep = .true.
342 this%trackterminate = .true.
343 this%trackweaksink = .true.
344 this%trackusertime = .true.
348 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.