Scratch-file particle event buffer module.
|
| type | scratchfilebuffertype |
| | Scratch-file particle event buffer. Records are written to an unformatted sequential scratch file that is rewound on discard and read back sequentially on flush. More...
|
◆ scratch_append()
Definition at line 40 of file ScratchFileBuffer.f90.
41 class(ScratchFileBufferType) :: this
42 type(ParticleTrackRecordType), intent(in) :: rec
43 write (this%iun) rec
44 this%nrecords = this%nrecords + 1
◆ scratch_destroy()
Definition at line 72 of file ScratchFileBuffer.f90.
73 class(ScratchFileBufferType) :: this
74 if (this%iun > 0) then
75 close (this%iun)
76 this%iun = 0
77 end if
78 this%nrecords = 0
◆ scratch_discard()
Definition at line 66 of file ScratchFileBuffer.f90.
67 class(ScratchFileBufferType) :: this
68 rewind(this%iun)
69 this%nrecords = 0
◆ scratch_flush()
Definition at line 47 of file ScratchFileBuffer.f90.
48 class(ScratchFileBufferType) :: this
49 type(ParticleTrackFileType), intent(in) :: files(:)
50 integer(I4B) :: n, i
51 type(ParticleTrackRecordType) :: rec
52
53 rewind(this%iun)
54 do n = 1, this%nrecords
55 read (this%iun) rec
56 do i = 1, size(files)
57 if (files(i)%iun > 0 .and. &
58 (files(i)%iprp == -1 .or. files(i)%iprp == rec%iprp)) &
59 call save_record(files(i)%iun, rec, files(i)%csv)
60 end do
61 end do
62 rewind(this%iun)
63 this%nrecords = 0
◆ scratch_init()
Definition at line 31 of file ScratchFileBuffer.f90.
32 class(ScratchFileBufferType) :: this
33 integer(I4B) :: istat
34 open (newunit=this%iun, status='scratch', form='unformatted', &
35 access='sequential', iostat=istat)
36 if (istat /= 0) &
37 call pstop(1, 'failed to open scratch track buffer file')