194 class(PrtOcType) :: this
196 character(len=LINELENGTH) :: keyword
197 character(len=LINELENGTH) :: keyword2
198 character(len=LINELENGTH) :: fname
199 character(len=:),
allocatable :: line
200 integer(I4B) :: ierr, ipos
201 logical(LGP) :: block_found, param_found, event_found, eob
202 type(OutputControlDataType),
pointer :: ocdobjptr
204 character(len=*),
parameter :: fmttrkbin = &
205 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
206 &'OPENED ON UNIT: ', I0)"
207 character(len=*),
parameter :: fmttrkcsv = &
208 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
209 &'OPENED ON UNIT: ', I0)"
212 call this%parser%GetBlock(
'OPTIONS', block_found, ierr, &
213 supportopenclose=.true., blockrequired=.false.)
216 if (block_found)
then
217 write (this%iout,
'(/,1x,a,/)')
'PROCESSING OC OPTIONS'
218 event_found = .false.
220 call this%parser%GetNextLine(eob)
222 call this%parser%GetStringCaps(keyword)
223 param_found = .false.
224 select case (keyword)
226 call this%parser%GetStringCaps(keyword2)
227 if (keyword2 /=
'FILEOUT')
then
228 errmsg =
"BUDGETCSV must be followed by FILEOUT and then budget &
229 &csv file name. Found '"//trim(keyword2)//
"'."
231 call this%parser%StoreErrorUnit()
233 call this%parser%GetString(fname)
235 call openfile(this%ibudcsv, this%iout, fname,
'CSV', &
236 filstat_opt=
'REPLACE')
239 call this%parser%GetStringCaps(keyword)
240 if (keyword ==
'FILEOUT')
then
242 call this%parser%GetString(fname)
245 call openfile(this%itrkout, this%iout, fname,
'DATA(BINARY)', &
248 write (this%iout, fmttrkbin) trim(adjustl(fname)), this%itrkout
251 fname = trim(fname)//
'.hdr'
252 call openfile(this%itrkhdr, this%iout, fname,
'CSV', &
253 filstat_opt=
'REPLACE', mode_opt=mnormal)
256 call store_error(
'OPTIONAL TRACK KEYWORD MUST BE '// &
257 'FOLLOWED BY FILEOUT')
261 call this%parser%GetStringCaps(keyword)
262 if (keyword ==
'FILEOUT')
then
264 call this%parser%GetString(fname)
267 call openfile(this%itrkcsv, this%iout, fname,
'CSV', &
268 filstat_opt=
'REPLACE')
269 write (this%iout, fmttrkcsv) trim(adjustl(fname)), this%itrkcsv
272 call store_error(
'OPTIONAL TRACKCSV KEYWORD MUST BE &
273 &FOLLOWED BY FILEOUT')
276 case (
'TRACK_RELEASE')
277 this%trackrelease = .true.
281 this%trackexit = .true.
284 case (
'TRACK_TIMESTEP')
285 this%tracktimestep = .true.
288 case (
'TRACK_TERMINATE')
289 this%trackterminate = .true.
292 case (
'TRACK_WEAKSINK')
293 this%trackweaksink = .true.
296 case (
'TRACK_USERTIME')
297 this%trackusertime = .true.
301 param_found = .false.
305 if (.not. param_found)
then
306 do ipos = 1,
size(this%ocds)
307 ocdobjptr => this%ocds(ipos)
308 if (keyword == trim(ocdobjptr%cname))
then
313 if (.not. param_found)
then
314 errmsg =
"UNKNOWN OC OPTION '"//trim(keyword)//
"'."
316 call this%parser%StoreErrorUnit()
318 call this%parser%GetRemainingLine(line)
319 call ocdobjptr%set_option(line, this%parser%iuactive, this%iout)
324 if (.not. event_found)
then
325 this%trackrelease = .true.
326 this%trackexit = .true.
327 this%tracktimestep = .true.
328 this%trackterminate = .true.
329 this%trackweaksink = .true.
330 this%trackusertime = .true.
334 write (this%iout,
'(1x,a)')
'END OF OC OPTIONS'
subroutine, public store_error_unit(iunit, terminate)
Store the file unit number.
character(len= *), parameter, public trackheader
character(len= *), parameter, public trackdtypes