In-memory particle event buffer module.
|
| type | memorybuffertype |
| | In-memory particle event buffer. Records are held in a dynamically growing array that doubles in capacity as needed. More...
|
| |
◆ memory_append()
Definition at line 28 of file MemoryBuffer.f90.
29 class(MemoryBufferType) :: this
30 type(ParticleTrackRecordType),
intent(in) :: rec
31 type(ParticleTrackRecordType),
allocatable :: tmp(:)
33 if (.not.
allocated(this%records))
then
34 allocate (this%records(64))
35 else if (this%nrecords ==
size(this%records))
then
36 allocate (tmp(
size(this%records) * 2))
37 tmp(1:this%nrecords) = this%records
38 call move_alloc(tmp, this%records)
40 this%nrecords = this%nrecords + 1
41 this%records(this%nrecords) = rec
◆ memory_destroy()
Definition at line 66 of file MemoryBuffer.f90.
67 class(MemoryBufferType) :: this
68 if (
allocated(this%records))
deallocate (this%records)
◆ memory_discard()
◆ memory_flush()
Definition at line 44 of file MemoryBuffer.f90.
45 class(MemoryBufferType) :: this
46 type(ParticleTrackFileType),
intent(in) :: files(:)
48 type(ParticleTrackRecordType) :: rec
50 do n = 1, this%nrecords
53 if (files(i)%iun > 0 .and. &
54 (files(i)%iprp == -1 .or. files(i)%iprp == rec%iprp)) &
55 call save_record(files(i)%iun, rec, files(i)%csv)