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()
51 subroutine oc_cr(ocobj, name_model, input_mempath, inunit, iout)
53 character(len=*),
intent(in) :: name_model
54 character(len=*),
intent(in) :: input_mempath
55 integer(I4B),
intent(in) :: inunit
56 integer(I4B),
intent(in) :: iout
62 call ocobj%allocate_scalars(name_model, input_mempath)
72 character(len=*),
intent(in) :: name_model
73 character(len=*),
intent(in) :: input_mempath
78 allocate (this%name_model)
79 allocate (this%input_fname)
80 call mem_allocate(this%dump_event_trace,
'DUMP_EVENT_TRACE', this%memoryPath)
81 call mem_allocate(this%inunit,
'INUNIT', this%memoryPath)
83 call mem_allocate(this%ibudcsv,
'IBUDCSV', this%memoryPath)
84 call mem_allocate(this%iperoc,
'IPEROC', this%memoryPath)
85 call mem_allocate(this%iocrep,
'IOCREP', this%memoryPath)
86 call mem_allocate(this%itrkout,
'ITRKOUT', this%memoryPath)
87 call mem_allocate(this%itrkhdr,
'ITRKHDR', this%memoryPath)
88 call mem_allocate(this%itrkcsv,
'ITRKCSV', this%memoryPath)
89 call mem_allocate(this%itrktls,
'ITRKTLS', this%memoryPath)
90 call mem_allocate(this%trackrelease,
'ITRACKRELEASE', this%memoryPath)
91 call mem_allocate(this%trackfeatexit,
'ITRACKFEATEXIT', this%memoryPath)
92 call mem_allocate(this%tracktimestep,
'ITRACKTIMESTEP', this%memoryPath)
93 call mem_allocate(this%trackterminate,
'ITRACKTERMINATE', this%memoryPath)
94 call mem_allocate(this%trackweaksink,
'ITRACKWEAKSINK', this%memoryPath)
95 call mem_allocate(this%trackusertime,
'ITRACKUSERTIME', this%memoryPath)
96 call mem_allocate(this%tracksubfexit,
'ITRACKSUBFEXIT', this%memoryPath)
97 call mem_allocate(this%trackdropped,
'ITRACKDROPPED', this%memoryPath)
98 call mem_allocate(this%ntracktimes,
'NTRACKTIMES', this%memoryPath)
100 this%name_model = name_model
101 this%input_mempath = input_mempath
102 this%input_fname =
''
103 this%dump_event_trace = .false.
113 this%trackrelease = .false.
114 this%trackfeatexit = .false.
115 this%tracktimestep = .false.
116 this%trackterminate = .false.
117 this%trackweaksink = .false.
118 this%trackusertime = .false.
119 this%tracksubfexit = .false.
120 this%trackdropped = .false.
123 if (this%input_mempath /=
'')
then
125 this%input_mempath, found)
130 subroutine oc_ar(this, dis, dnodata)
134 real(DP),
intent(in) :: dnodata
136 integer(I4B) :: i, nocdobj, inodata
138 real(DP),
dimension(:),
pointer,
contiguous :: nullvec => null()
141 allocate (this%tracktimes)
142 call this%tracktimes%init()
145 allocate (this%ocds(nocdobj))
150 call ocdobjptr%init_dbl(
'BUDGET', nullvec, dis,
'PRINT LAST ', &
151 'COLUMNS 10 WIDTH 11 DIGITS 4 GENERAL ', &
154 this%ocds(i) = ocdobjptr
155 deallocate (ocdobjptr)
160 if (this%input_mempath ==
'')
return
161 call this%source_options()
162 call this%prt_oc_source_dimensions()
163 call this%prt_oc_source_tracktimes()
172 call this%tracktimes%deallocate()
174 do i = 1,
size(this%ocds)
175 call this%ocds(i)%ocd_da()
177 deallocate (this%ocds)
179 deallocate (this%name_model)
213 character(len=LINELENGTH) :: trackfile, trackcsv
215 integer(I4B),
pointer :: evinput
217 character(len=*),
parameter :: fmttrkbin = &
218 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO BINARY FILE: ', a, /4x, &
219 &'OPENED ON UNIT: ', I0)"
220 character(len=*),
parameter :: fmttrkcsv = &
221 "(4x, 'PARTICLE TRACKS WILL BE SAVED TO CSV FILE: ', a, /4x, &
222 &'OPENED ON UNIT: ', I0)"
226 write (this%iout,
'(/,1x,a,/)')
'PROCESSING OC OPTIONS'
229 call this%OutPutControlType%source_options()
232 call mem_set_value(trackfile,
'TRACKFILE', this%input_mempath, &
234 call mem_set_value(trackcsv,
'TRACKCSVFILE', this%input_mempath, &
236 call mem_set_value(evinput,
'TRACK_RELEASE', this%input_mempath, &
238 call mem_set_value(evinput,
'TRACK_EXIT', this%input_mempath, &
240 call mem_set_value(evinput,
'TRACK_SUBF_EXIT', this%input_mempath, &
241 found%track_subf_exit)
242 call mem_set_value(evinput,
'TRACK_DROPPED', this%input_mempath, &
244 call mem_set_value(evinput,
'TRACK_TIMESTEP', this%input_mempath, &
245 found%track_timestep)
246 call mem_set_value(evinput,
'TRACK_TERMINATE', this%input_mempath, &
247 found%track_terminate)
248 call mem_set_value(evinput,
'TRACK_WEAKSINK', this%input_mempath, &
249 found%track_weaksink)
250 call mem_set_value(evinput,
'TRACK_USERTIME', this%input_mempath, &
251 found%track_usertime)
252 call mem_set_value(evinput,
'DEV_DUMP_EVTRACE', this%input_mempath, &
253 found%dev_dump_evtrace)
255 if (found%track_release) this%trackrelease = .true.
256 if (found%track_exit) this%trackfeatexit = .true.
257 if (found%track_subf_exit) this%tracksubfexit = .true.
258 if (found%track_dropped) this%trackdropped = .true.
259 if (found%track_timestep) this%tracktimestep = .true.
260 if (found%track_terminate) this%trackterminate = .true.
261 if (found%track_weaksink) this%trackweaksink = .true.
262 if (found%track_usertime) this%trackusertime = .true.
263 if (found%dev_dump_evtrace) this%dump_event_trace = .true.
266 if (.not. (found%track_release .or. &
267 found%track_exit .or. &
268 found%track_timestep .or. &
269 found%track_terminate .or. &
270 found%track_weaksink .or. &
271 found%track_usertime .or. &
272 found%track_dropped))
then
273 this%trackrelease = .true.
274 this%trackfeatexit = .true.
275 this%tracktimestep = .true.
276 this%trackterminate = .true.
277 this%trackweaksink = .true.
278 this%trackusertime = .true.
279 this%trackdropped = .true.
282 if (found%trackfile)
then
285 call openfile(this%itrkout, this%iout, trackfile,
'DATA(BINARY)', &
288 write (this%iout, fmttrkbin) trim(adjustl(trackfile)), this%itrkout
291 trackfile = trim(trackfile)//
'.hdr'
292 call openfile(this%itrkhdr, this%iout, trackfile,
'CSV', &
293 filstat_opt=
'REPLACE', mode_opt=mnormal)
297 if (found%trackcsvfile)
then
299 call openfile(this%itrkcsv, this%iout, trackcsv,
'CSV', &
300 filstat_opt=
'REPLACE')
301 write (this%iout, fmttrkcsv) trim(adjustl(trackcsv)), this%itrkcsv
305 write (this%iout,
'(1x,a)')
'END OF OC OPTIONS'
319 write (this%iout,
'(/1x,a)') &
320 'PROCESSING OUTPUT CONTROL DIMENSIONS'
321 call mem_set_value(this%ntracktimes,
'NTRACKTIMES', this%input_mempath, &
323 if (found%ntracktimes)
then
324 write (this%iout,
'(4x,a,i7)')
'NTRACKTIMES = ', this%ntracktimes
326 write (this%iout,
'(1x,a)') &
327 'END OF OUTPUT CONTROL DIMENSIONS'
329 if (this%ntracktimes < 0)
then
331 'NTRACKTIMES WAS NOT SPECIFIED OR WAS SPECIFIED INCORRECTLY.'
344 real(DP),
dimension(:),
pointer,
contiguous :: tracktimes
345 integer(I4B) :: n, asize
347 if (this%ntracktimes <= 0)
return
349 call get_isize(
'TIME', this%input_mempath, asize)
351 if (asize /= this%ntracktimes)
then
352 write (
errmsg,
'(a, i0)') &
353 "Expected TRACKTIMES with length ", this%ntracktimes
357 call mem_setptr(tracktimes,
'TIME', this%input_mempath)
360 call this%tracktimes%expand(this%ntracktimes)
362 do n = 1, this%ntracktimes
363 this%tracktimes%times(n) = tracktimes(n)
368 if (.not. this%tracktimes%increasing())
then
369 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 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.