Re: 252Cf energy spectrum source

From: Alberto Fasso' <>
Date: Sat, 14 Nov 2009 08:28:18 -0800 (PST)

Dear Zhang Weihua,

every time you refer to the random number function FLRNDM, its value
changes (randomly, of course).
So, when you say:
          if( then ENK = 4.14E-10
FLRNDM has a certain value. But when you say, in the next line:
          IF( .and. ENK =
the value of FLRNDM is not the same anymore, and is different in from that in
If you want to sample the energy in this way (that I DO NOT recommend),
you must save the value of FLRNDM the first time, and do the following
tests with the saved value, which does not change.
In addition, FLRNDM is a function, and must be written with parentheses
And the fortran IF must be written as
          IF(...) statement
          IF(...) THEN
          END IF
It is not allowed to say IF(...) THEN statement on the same line.
          SAVRND = FLRNDM( )
          if( ENK = 4.14E-10
          IF( .and. ENK = 1.00E-09
Anyway, there are much better ways to sample energy from a spectrum.
I attach a source routine that samples from a Cf or from an AmBe source
spectrum, depending on the value of the first WHAT in input command SOURCE.
The spectra used are those recommended by IAEA in a TECHPUB report (I write
from home and I do not have the reference handy).
In this routine, the sampling is done using a cumulative spectrum and
interpolating between the discrete energies.


On Sat, 14 Nov 2009, XuLijun wrote:

> Dear FLUKA experts,
> I want to compile the source.f to load the 252Cf energy spectrum
> neutron source.The ns.f is my source file and is compiled successfully,
> but it was finished so quickly when running that i thought it maybe
> wrong. Please check it and find the false, thank you in advance!
> Best Regards,
> Zhang Weihua

Alberto Fasso`
SLAC-RP, MS 48, 2575 Sand Hill Road, Menlo Park CA 94025
Phone: (1 650) 926 4762   Fax: (1 650) 926 3569

Received on Sat Nov 14 2009 - 18:34:43 CET

This archive was generated by hypermail 2.2.0 : Sat Nov 14 2009 - 18:34:43 CET