[fluka-discuss]: EVENTBIN Readout code

From: Alex Metcalfe <Alex.Metcalfe_at_brunel.ac.uk>
Date: Thu, 13 Mar 2014 16:23:58 +0000

Dear FLUKA users and experts,
I'm trying to process the binary output from the EVENTBIN card, in order to get a DETECT style output from a lattice geometry, however i am running into an issue where i seem to be reading out past the end of an unformatted file every time. Is anyone able to provide a simple summary of the order in which i'd need to read things out of the file, when only reading non-zero cells.

my current understanding of it is, if im reading from unit 10 (i'm aware the code is hardly a complete compilable thing, but these key bits should show where my approach is in error hopefully)

READ(10)RUNTIT, RUNTIM

!a bunch of binning information, akin to usrbin, some other code i found suggests it is
READ (10) NB, TITUSB, ITUSBN,&
     & IDUSBN, &
     & XLOW,XHIGH,NXBIN, &
     & DXUSBN,YLOW, &
     & YHIGH,NYBIN,DYUSBN, &
     & ZLOW,ZHIGH,NZBIN, &
     & DZUSBN,LNTZER,BKUSBN, &
     & B2USBN,TCUSBN

!then it should just be the information for the hit cells, it seems to go out of file range in this loop
READ(10)nhits
READ(10) (ihelp(I), gmhelp(I), I = 1, nhits)

!and we loop over this last bit for the number of primaries.

clearly i've gone a bit wrong in my understanding of how this is all structured, or perhaps just how fortran likes to behave with unstructured files(i primarily know fortran 95, and im working from code written in 77 as a guide) , so some guidance would be most appreciated.

Regards
Alex Metcalfe
Received on Thu Mar 13 2014 - 18:20:17 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 13 2014 - 18:20:18 CET