The use of source_newgen.f

Dear Fluka experts,
I am using the source_newgen.f to sample the neutrino energy spectrum from the histogram. The program runs and outputs results normally; however, I defined the number of simulations as 100,000 in the .inp file, but the output only shows 6,532 simulations. When I do not use source_newgen.f , the simulation count defined in the .inp file is valid. Could you please help identify where the issue lies? Below are the .inp file and source_newgen.f that I am using.
neutrino.inp (1.4 KB)
source_newgen.f (18.9 KB)

Dear Dawei,

could you upload the file containing the neutrino spectrum as well?

Cheers,
David

Dear David,
This is the neutrino spectrum file I used. I generated the neutrino data containing three columns according to the specifications in the source_newgen.f file. Thank you very much for your reply.
Cheers,
Dawei
Num_Spectrum.dat (5.2 KB)

Hello @sdw21 ,

Running the input file, source routine and histogram as you provided them indeed prematurely ends the run. If you check the error file of the run, it ends with the following statement:

“Abort called from DEDX reason Exceeded upper dp/dx abscissa. Run stopped!
STOP Exceeded upper dp/dx abscissa.”

This means the FLUKA simulation was not properly setup. At run intialization, FLUKA will compute the (dE/dx) stopping power tables up to the energy specified in the BEAM card which for your input is 10 GeV. Now, your “Num_Spectrum.dat” histogram goes up to energies of 100 GeV, hence, when sampling a neutrino energy above 10 GeV from this histogram will create trouble.

An easy fix is to reset the energy in the BEAM card to any value well above 100 GeV to make sure your runs don’t end prematurely.

Let us know in case you run into other issues!
Cheers,

Andreas

Dear Andreas,
Thank you for your reply, the reason why the run ended early is indeed that the setting of the BEAM card do not match the upper limit of the histogram. Previously, the initial energy of the last event(and also the only event) of my output file exceeded 10GeV. Now that I have modified the energy in the BEAM card, the problem has been solved.

Cheers,
Dawei