Mgdraw.f, ENDRAW routing, quenching

Dear colleagues,
I am using a customize mgdraw.f code to score energy deposition in a material, considering quenching effects. I am using FLUKA version 4.3.0
I used the USERDUMP card with SDUM=UDQUENCH to set the first and second BIRKS coefficient for a material.
In the mgdraw.f code, ENDRAW routine, I have:

 ENTRY ENDRAW ( ICODE, MREG, RULL, XSCO, YSCO, ZSCO )
...   
      if (RULL.gt.0) then
*  +-------------------------------------------------------------------*
*  |  Quenching is activated : calculate quenching factor
*  |  and store quenched energy in DTQUEN(1, jbk)
      IF ( LQEMGD ) THEN
         RULLL = RULL
         PRINT *,'BEFORE ',RULL,DTQUEN(1,1),DTQUEN(1,2),DTQUEN(1,3)
         CALL QUENMG ( ICODE, MREG, RULLL, DTQUEN )
         PRINT *,'AFTER ',RULL,DTQUEN(1,1),DTQUEN(1,2),DTQUEN(1,3)
      END IF
*  |  end quenching
*  +-------------------------------------------------------------------*
CALL ANOTHER_ROUTINE(RULL,DTQUEN(1,1))
end if
...

where “another_routine” is defined in a different location.
After running the code, I get the following error (note that I get it even if I comment the call to ANOTHER_ROUTINE)

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x7f755c5b53ff in ???
#1  0x5b1d76 in fkbirk_
	at score/fkbirk.f:114
#2  0x496a09 in quenmg_
	at score/quenmg.f:167
#3  0x437d5a in master.0.mgdraw
	at /afs/cern.ch/user/a/acelenta/eos/work/simulations/fluka_KS/inpFiles/na64-fluka/mgdraw.f:308    ---> THIS IS WHERE QUENMG IS CALLED
#4  0x437f8a in endraw_
	at /afs/cern.ch/user/a/acelenta/eos/work/simulations/fluka_KS/inpFiles/na64-fluka/mgdraw.f:244
#5  0x61af02 in kaskad_
	at cascade/kaskad.f:6949
#6  0x4cc630 in feeder_
	at cascade/feeder.f:277
#7  0x43c440 in flukam_
	at main/flukam.f:2796
#8  0x42f020 in fluka
	at main/fluka.f:77
#9  0x42f020 in main
	at /shared/src/usflmd.inc:15

Unfortunately, I do not have access to QUENMG code, so that I cannot debug this error. May I ask you for your help?

Thanks,
Andrea Celentano

Hello Andrea,

Could you send us the necessary material to reproduce this crash (input file, any user routines, etc)?

We’d be happy to take a look.

Cesc

Dear Cesc,
sure!
I create a tar file with:

  • The input file I am using, na64_2021.inp
  • All the other files I am using to produce the executable “rootfluka”, that then I execute using $FLUPRO/bin/rfluka -e rootfluka -N 0 -M 1 na64_2021

To produce the executable, I am using the “Makefile” included in the tar file.

The tar file is attached.
fluka.tar.tgz (59.6 KB)

Thanks!
Andrea

Dear Andrea,

Thanks a lot for providing us with the relevant input. There was indeed a bug: the scoring was erroneously invoked after an unsuccessful (i.e. rejected) electronuclear interaction, leading to the reported crash.

This error will be fixed in an upcoming minor release, before the major holiday season.

With kind regards on behalf of the dev team,

Cesc