RE: [fluka-discuss]: USERDUMP: READING OUTPUT

From: Fasso, Alberto <fasso_at_slac.stanford.edu>
Date: Fri, 30 May 2014 06:06:49 -0700

Dear Jonathan,

you say that you don't know how to read the unformatted output of mgdraw: but you just need to look inside the routine to see how the output was written.
However, it is even easier that you rewrite yourself the routine, removing all existing writing statements and replacing them with your own (creating a formatted output if you prefer).
I attach an example which I used to write a collision file for a 2-step calculations. In this version, all ENTRYes are empty, except BXDRAW (called at boundary crossing).
Notice the following:
- I have added at the beginning a statement CHARACTER*8 MRGNAM, NRGNAM, in order to be able to use region names instead of numbers (see below)
- all the existing statements in the MGDRAW ENTRY (i.e. the main ENTRY) have been removed: there is just a RETURN (i.e.: do nothing)
- the same after the ENTRY EEDRAW, ENDRAW, SODRAW, USDRAW. Only ENTRY BXDRAW does something. Of course, this is a choice for this particular case: you can do the same
  for any other ENTRY.
- After ENTRY BXDRAW you find:
      ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )
      IF ( .NOT. LFCOPE ) THEN
         LFCOPE = .TRUE.
         OPEN ( UNIT = 88, FILE = "collfile", STATUS = 'UNKNOWN')
      END IF
  as you see, the first time the ENTRY is called (i.e. at the first boundary crossing) a formatted output file is open, with unit 88 and name "collfile". This is a user choice: as you see, none of
  this is like the default. It is a user routine: the user decides how to use it!
- Then you have:
      CALL GEOR2N ( MREG, MRGNAM, IERR1 )
      CALL GEOR2N ( NEWREG, NRGNAM, IERR2 )
      IF(IERR1 .NE. 0 .OR. IERR2 .NE. 0) STOP "Error in name conversion"
      IF(MRGNAM .EQ. "VpNEHaVa" .AND. nrgnam .EQ. "DummyC4d") THEN
         IF(JTRACK .EQ. 7) WRITE(88,'(1P,4G25.15)')
   & XSCO, YSCO, ETRACK, WTRACK
       END IF
   where GEOR2N is a FLUKA routine which converts the region numbers MREG and NEWREG (obtained as calling arguments) to the corresponding region names.
   The following IF statement checks if the two regions defining the boundary are those of interest, and if the particle is a photon writes the coordinates of the crossing point, the energy
   and the weight of the photon.

This is just an example: in the same way you can write the MGDRAW routine for any purpose you have. Remember only to leave the declaration statements at the beginning (perhaps adding some more, as in the case illustrated above) and don't modify the arguments in the calling list of each ENTRY.

Alberto
________________________________________
From: owner-fluka-discuss_at_mi.infn.it [owner-fluka-discuss_at_mi.infn.it] On Behalf Of Jonathan Derrien [jderrien_at_ulb.ac.be]
Sent: Wednesday, May 28, 2014 5:00 AM
To: fluka-discuss_at_fluka.org
Subject: [fluka-discuss]: USERDUMP: READING OUTPUT

Dear Users-Fluka,

I'm trying to use userdump-card but I can't read the output file. This card give output files in binary (unformatted), and I don't see how I'm supposed to read them: i added a plot in flair with dump type, I've selected one of the output file and when I clicked on "plot" I got an error. Of course I read the manual and all the topics of the Fluka-discuss about Userdump.

Best regards,

Jonathan

--
[http://polytech.ulb.ac.be/signature/img6.php?fname=Jonathan+Derrien&ftitle=Teaching+Assistant+-+PhD+Student&fservice=Nuclear+Metrology+Service&fcp=165/84&fext=2097&fax=&hasmail=true&fmail=jonathan.derrien&fmailext=%40ulb.ac.be&web=http://mywebsite.ulb.ac.be&x=46&y=10&]



Received on Fri May 30 2014 - 16:21:47 CEST

This archive was generated by hypermail 2.3.0 : Fri May 30 2014 - 16:21:49 CEST