Re: 252Cf energy spectrum source

From: Alberto Fasso' <fasso_at_slac.stanford.edu>
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(FLRNDM.lt.3.09152E-10) then ENK = 4.14E-10
FLRNDM has a certain value. But when you say, in the next line:
          IF(FLRNDM.ge.3.09152E-10 .and. FLRNDM.lt.1.13788E-08) ENK =
1.00E-09
the value of FLRNDM is not the same anymore, and is different in
FLRNDM.ge.3.09152E-10 from that in FLRNDM.lt.1.13788E-08.
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
FLRNDM( ), or FLRNDM(DUMMY).
And the fortran IF must be written as
          IF(...) statement
or
          IF(...) THEN
             statement(s)
          END IF
It is not allowed to say IF(...) THEN statement on the same line.
Example:
          SAVRND = FLRNDM( )
          if(SAVRND.lt.3.09152E-10) ENK = 4.14E-10
          IF(SAVRND.ge.3.09152E-10 .and. SAVRND.lt.1.13788E-08) ENK = 1.00E-09
etc.
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.

Alberto

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
fasso_at_slac.stanford.edu

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