Re: [fluka-discuss]: MGDRAW

From: Andrea Fontana <>
Date: Fri, 10 Feb 2017 21:44:46 +0100

Dear Viktor,
     the use of MGDRAW indeed gives access to many internal variables
stored in the FLUKA common blocks, as explained in the manual and
in many messages of the fluka-discuss list.

In your case:

1. It is a simple format problem in the WRITE statement: in FORTRAN77
    the number of variables to be written should match the output
    format that you specify in the character string '(1P,4G25.15)'.
    The meaning of this string is the following:
    1P: a shift to start the output by 10 characters
    4G25.15: 4 floating point fields of 25 figures with 15 decimals

    The 4 fields correspond to the variables XSCO, YSCO, ETRACK, WTRACK.
    If you add an extra variable you have 5 fields and you have to
    write 5G25.15 in the format string, for example.
    In this way you fix the shift in the output file.

2. Yes. It is possible to selectively kill particles that cross the
    boundary between two regions in USRMED.F. You should do the

    - enable the USRMED call with the card MAT-PROP, for example:

    - add your code to USRMED. For instance to kill all the photons
      going to region 3 to region 4 you can write:

      IF ( IJ .EQ. 7 ) THEN
          IF ( MREG .EQ. 3 .AND. NEWREG .EQ. 4 ) WEE = ZERZER
      END IF

      The variable WEE is the particle weight, to be set to zero to
      kill the particle.

Hope this helps.
Kind regards,

Il 10/02/2017 18:38, Віктор Родін ha scritto:
> Dear FLUKA users and experts,
> I'm looking for ways of detecting quantities of particles in the
> defined region and their coordinates of boundary crossing. I saw that
> MGDRAW subroutine gives a lot of usefull information about particles
> I searched how the MGDRAW subroutine works and found nice answer and
> MGDRAW file in the discuss :
> <>
> I'm newbie in FORTRAN77 and ask you to answer me on few questions from
> this topic:
> 1. Everything shifts in output file if I add third coordinate in this
> MGDRAW , How can this be repaired?
> 2. Can I kill each particle which cross boundary? Because some
> particles are registered twice. I read that it could be done only
> with help of the USRMED. Is it true?
> Thank you for attention. INP file and MGDRAW are attached.
> Best regards,
> Viktor

Dr. Andrea Fontana                    tel: +39 0382 987991
Istituto Nazionale                    fax: +39 0382 423241
di Fisica Nucleare
Sezione di Pavia                      e-mail:
Via Bassi 6                           web   :
27100 PAVIA, Italy
You can manage unsubscription from this mailing list at
Received on Fri Feb 10 2017 - 23:02:20 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 10 2017 - 23:02:29 CET