22 integer(I4B),
pointer :: itrkout => null()
23 integer(I4B),
pointer :: itrkhdr => null()
24 integer(I4B),
pointer :: itrkcsv => null()
25 integer(I4B),
pointer :: itrktls => null()
26 logical(LGP),
pointer :: trackrelease => null()
27 logical(LGP),
pointer :: trackfeatexit => null()
28 logical(LGP),
pointer :: tracktimestep => null()
29 logical(LGP),
pointer :: trackterminate => null()
30 logical(LGP),
pointer :: trackweaksink => null()
31 logical(LGP),
pointer :: trackusertime => null()
32 logical(LGP),
pointer :: tracksubfexit => null()
33 logical(LGP),
pointer :: trackdropped => null()
34 integer(I4B),
pointer :: ntracktimes => null()
35 logical(LGP),
pointer :: dump_event_trace => null()
36 logical(LGP),
pointer :: scratch_buffer => null()
52 subroutine oc_cr(ocobj, name_model, input_mempath, inunit, iout)
54 character(len=*),
intent(in) :: name_model
55 character(len=*),
intent(in) :: input_mempath
56 integer(I4B),
intent(in) :: inunit
57 integer(I4B),
intent(in) :: iout
63 call ocobj%allocate_scalars(name_model, input_mempath)
73 character(len=*),
intent(in) :: name_model
74 character(len=*),
intent(in) :: input_mempath
79 allocate (this%name_model)
80 allocate (this%input_fname)
81 call mem_allocate(this%dump_event_trace,
'DUMP_EVENT_TRACE', this%memoryPath)
82 call mem_allocate(this%scratch_buffer,
'SCRATCH_BUFFER', this%memoryPath)
83 call mem_allocate(this%inunit,
'INUNIT', this%memoryPath)
85 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
86 call mem_allocate(this%iperoc,
'IPEROC', this%memoryPath)
87 call mem_allocate(this%iocrep,
'IOCREP', this%memoryPath)
88 call mem_allocate(this%itrkout,
'ITRKOUT', this%memoryPath)
89 call mem_allocate(this%itrkhdr,
'ITRKHDR', this%memoryPath)
90 call mem_allocate(this%itrkcsv,
'ITRKCSV', this%memoryPath)
91 call mem_allocate(this%itrktls,
'ITRKTLS', this%memoryPath)
92 call mem_allocate(this%trackrelease,
'ITRACKRELEASE', this%memoryPath)
93 call mem_allocate(this%trackfeatexit,
'ITRACKFEATEXIT', this%memoryPath)
94 call mem_allocate(this%tracktimestep,
'ITRACKTIMESTEP', this%memoryPath)
95 call mem_allocate(this%trackterminate,
'ITRACKTERMINATE', this%memoryPath)
96 call mem_allocate(this%trackweaksink,
'ITRACKWEAKSINK', this%memoryPath)
97 call mem_allocate(this%trackusertime,
'ITRACKUSERTIME', this%memoryPath)
98 call mem_allocate(this%tracksubfexit,
'ITRACKSUBFEXIT', this%memoryPath)
99 call mem_allocate(this%trackdropped,
'ITRACKDROPPED', this%memoryPath)
100 call mem_allocate(this%ntracktimes,
'NTRACKTIMES', this%memoryPath)
102 this%name_model = name_model
103 this%input_mempath = input_mempath
104 this%input_fname =
''
105 this%dump_event_trace = .false.
106 this%scratch_buffer = .false.
116 this%trackrelease = .false.
117 this%trackfeatexit = .false.
118 this%tracktimestep = .false.
119 this%trackterminate = .false.
120 this%trackweaksink = .false.
121 this%trackusertime = .false.
122 this%tracksubfexit = .false.
123 this%trackdropped = .false.
126 if (this%input_mempath /=
'')
then
128 this%input_mempath, found)
133 subroutine oc_ar(this, dis, dnodata)
137 real(DP),
intent(in) :: dnodata
139 integer(I4B) :: i, nocdobj, inodata
141 real(DP),
dimension(:),
pointer,
contiguous :: nullvec => null()
144 allocate (this%tracktimes)
145 call this%tracktimes%init()
148 allocate (this%ocds(nocdobj))
153 call ocdobjptr%init_dbl(
'BUDGET', nullvec, dis,
'PRINT LAST ', &
154 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
157 this%ocds(i) = ocdobjptr
158 deallocate (ocdobjptr)
163 if (this%input_mempath ==
'')
return
164 call this%source_options()
165 call this%prt_oc_source_dimensions()
166 call this%prt_oc_source_tracktimes()
175 call this%tracktimes%deallocate()
177 do i = 1,
size(this%ocds)
178 call this%ocds(i)%ocd_da()
180 deallocate (this%ocds)
182 deallocate (this%name_model)
217 character(len=LINELENGTH) :: trackfile, trackcsv
219 integer(I4B),
pointer :: evinput
221 character(len=*),
parameter :: fmttrkbin = &
222 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
223 &'OPENED ON UNIT: ', I0)"
224 character(len=*),
parameter :: fmttrkcsv = &
225 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
226 &'OPENED ON UNIT: ', I0)"
230 write (this%iout,
'(/,1x,a,/)')
'PROCESSING OC OPTIONS'
233 call this%OutPutControlType%source_options()
236 call mem_set_value(trackfile,
'TRACKFILE', this%input_mempath, &
238 call mem_set_value(trackcsv,
'TRACKCSVFILE', this%input_mempath, &
240 call mem_set_value(evinput,
'TRACK_RELEASE', this%input_mempath, &
242 call mem_set_value(evinput,
'TRACK_EXIT', this%input_mempath, &
244 call mem_set_value(evinput,
'TRACK_SUBF_EXIT', this%input_mempath, &
245 found%track_subf_exit)
246 call mem_set_value(evinput,
'TRACK_DROPPED', this%input_mempath, &
248 call mem_set_value(evinput,
'TRACK_TIMESTEP', this%input_mempath, &
249 found%track_timestep)
250 call mem_set_value(evinput,
'TRACK_TERMINATE', this%input_mempath, &
251 found%track_terminate)
252 call mem_set_value(evinput,
'TRACK_WEAKSINK', this%input_mempath, &
253 found%track_weaksink)
254 call mem_set_value(evinput,
'TRACK_USERTIME', this%input_mempath, &
255 found%track_usertime)
256 call mem_set_value(evinput,
'DEV_DUMP_EVTRACE', this%input_mempath, &
257 found%dev_dump_evtrace)
258 call mem_set_value(evinput,
'SCRATCH_BUFFER', this%input_mempath, &
259 found%scratch_buffer)
261 if (found%track_release) this%trackrelease = .true.
262 if (found%track_exit) this%trackfeatexit = .true.
263 if (found%track_subf_exit) this%tracksubfexit = .true.
264 if (found%track_dropped) this%trackdropped = .true.
265 if (found%track_timestep) this%tracktimestep = .true.
266 if (found%track_terminate) this%trackterminate = .true.
267 if (found%track_weaksink) this%trackweaksink = .true.
268 if (found%track_usertime) this%trackusertime = .true.
269 if (found%dev_dump_evtrace) this%dump_event_trace = .true.
270 if (found%scratch_buffer) this%scratch_buffer = .true.
272 if (this%scratch_buffer)
then
273 write (this%iout,
'(4x,a)')
'TRACK EVENT BUFFER: SCRATCH FILE'
275 write (this%iout,
'(4x,a)')
'TRACK EVENT BUFFER: MEMORY'
279 if (.not. (found%track_release .or. &
280 found%track_exit .or. &
281 found%track_timestep .or. &
282 found%track_terminate .or. &
283 found%track_weaksink .or. &
284 found%track_usertime .or. &
285 found%track_dropped))
then
286 this%trackrelease = .true.
287 this%trackfeatexit = .true.
288 this%tracktimestep = .true.
289 this%trackterminate = .true.
290 this%trackweaksink = .true.
291 this%trackusertime = .true.
292 this%trackdropped = .true.
295 if (found%trackfile)
then
298 call openfile(this%itrkout, this%iout, trackfile,
'DATA(BINARY)', &
301 write (this%iout, fmttrkbin) trim(adjustl(trackfile)), this%itrkout
304 trackfile = trim(trackfile)//
'.hdr'
305 call openfile(this%itrkhdr, this%iout, trackfile,
'CSV', &
306 filstat_opt=
'REPLACE', mode_opt=mnormal)
310 if (found%trackcsvfile)
then
312 call openfile(this%itrkcsv, this%iout, trackcsv,
'CSV', &
313 filstat_opt=
'REPLACE')
314 write (this%iout, fmttrkcsv) trim(adjustl(trackcsv)), this%itrkcsv
318 write (this%iout,
'(1x,a)')
'END OF OC OPTIONS'
332 write (this%iout,
'(/1x,a)') &
333 'PROCESSING OUTPUT CONTROL DIMENSIONS'
334 call mem_set_value(this%ntracktimes,
'NTRACKTIMES', this%input_mempath, &
336 if (found%ntracktimes)
then
337 write (this%iout,
'(4x,a,i7)')
'NTRACKTIMES = ', this%ntracktimes
339 write (this%iout,
'(1x,a)') &
340 'END OF OUTPUT CONTROL DIMENSIONS'
342 if (this%ntracktimes < 0)
then
344 'NTRACKTIMES WAS NOT SPECIFIED OR WAS SPECIFIED INCORRECTLY.'
357 real(DP),
dimension(:),
pointer,
contiguous :: tracktimes
358 integer(I4B) :: n, asize
360 if (this%ntracktimes <= 0)
return
362 call get_isize(
'TIME', this%input_mempath, asize)
364 if (asize /= this%ntracktimes)
then
365 write (
errmsg,
'(a, i0)') &
366 "Expected TRACKTIMES with length ", this%ntracktimes
370 call mem_setptr(tracktimes,
'TIME', this%input_mempath)
373 call this%tracktimes%expand(this%ntracktimes)
375 do n = 1, this%ntracktimes
376 this%tracktimes%times(n) = tracktimes(n)
381 if (.not. this%tracktimes%increasing())
then
382 errmsg =
"TRACKTIMES must strictly increase"
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ mnormal
normal output mode
integer(i4b), parameter lenmodelname
maximum length of the model name
This module defines variable data types.
This module contains the LongLineReaderType.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_release(varname, memory_path)
Release a single variable from the memory store.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Output control data module.
subroutine, public ocd_cr(ocdobj)
@ brief Create a new output control data type.
Particle track output module.
character(len= *), parameter, public trackheader
character(len= *), parameter, public trackdtypes
subroutine oc_ar(this, dis, dnodata)
@ brief Setup output control variables.
subroutine prt_oc_source_dimensions(this)
source the dimensions block.
subroutine prt_oc_da(this)
subroutine prt_oc_source_tracktimes(this)
source the tracking times block.
subroutine prt_oc_source_options(this)
subroutine, public oc_cr(ocobj, name_model, input_mempath, inunit, iout)
@ brief Create an output control object
subroutine prt_oc_allocate_scalars(this, name_model, input_mempath)
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=maxcharlen) warnmsg
warning message string
Specify times for some event to occur.
Output control data type.
@ brief Controls model output. Overridden for each model type.
@ brief Output control for particle tracking models
Represents a series of instants at which some event should occur.