Re: illogical result

From: Alberto Fasso' (fasso@SLAC.Stanford.EDU)
Date: Tue Jan 16 2007 - 00:55:55 CET

  • Next message: Brandon Reddell: "Re: Infinite loop of error message"

    It is always difficult to help when user routines are involved, because
    it is not always clear what the user is doing.
    Anyway, I have spotted a number of possible causes of error in your source
    and input file, and in the linking command you have used.
    I will list them here, and I suggest that you correct accordingly, and try
    again. If the problem will be still there, let me know.

    Here are the "odd things" I have found:

    1) You have declared an array NORENE(0:13) which appears to be a cumulative
       distribution from which you want to sample energy. The distribution is
       initialized as
          DATA NORENE / 0.D0,
         & 0.14766E-02, 0.35102E-02, 0.23169E-01, 0.26918E-01, 0.35186E-01,
         & 0.78632E-01, 0.25713E+00, 0.57673E+00, 0.86827E+00, 0.97527E+00,
         & 0.99680E+00, 0.99952E+00, 0.10000E+01/
        But since the name begins with "N", and the Fortran default is not
        overridden by a declaration DOUBLE PRECISION NORENE, the compilers sees
        it as an array of integers. Since all numbers are < 1, they are
        interpreted all as zeros. Probably this is the main reason of your
        "illogical result": you keep sampling a zero energy.
    2) Your source contains a section
    * Decode Heavy ion particle ID for 100*A+Z FLUKA number
          IDpart = -1206
          IF (IDpart .LT. -402) THEN
             IJBEAM = -2
             IDpart = abs (IDpart)
             IPROA = IDpart / 100
             IPROZ = IDpart - 100 * IPROA
          END IF
       I don't know if it is correct or not, but certainly it is not necessary.
       And any non necessary piece of program increases the probability of
       introducing some bug, by itself, or by conflicting with other parts of the
       program: in fact the decoding is already done in the source template, a few
       lines below:
          ELSE IF ( IJBEAM .EQ. -2 ) THEN
             IJHION = IPROZ * 1000 + IPROA
             IJHION = IJHION * 100 + KXHEAV
             IONID = IJHION
             CALL DCDION ( IONID )
             CALL SETION ( IONID )
             ILOFLK (NPFLKA) = IJHION
       By the way, it looks strange to write IDpart = -1206 and to follow
       immediately with IF (IDpart .LT. -402). Of course if it is fixed as -1206
       it is always .LT. -402. Never mind, you only need to specify correctly
       a carbon ion in your input file (see below) and let FLUKA do the decoding.
    3) You define an isotropic angular distribution
          YI = FLRNDM(DUMMY)
          COSTH = ONEONE - 2.D0 * YI
             COSTH = ONEONE
             COSTH = -ONEONE
          END IF
          ZI = FLRNDM(DUMMY)
          ANG = TWOPIP * ZI
          WBEAM = COSTH
       Again, I don't know if it is correct or not, but again it is not necessary.
       To request an isotropic distribution, you only need a command BEAM in your
       input file, with WHAT(3) (beam divergence) > 6300 (see manual). Don't
       introduce unnecessary stuff, which could create more possibilities of
       error. For instance, you left commented out the normalization of cosines,
       but are you sure that as you defined them, UBEAM VBEAM and WBEAM are
       always properly normalized? You could have achieved that with the same
       number of time-expensive square roots
          WBEAM = COSTH
       But much better, let FLUKA provide its own isotropic distribution, which has
       been thoroughly tested.
    4) The particle starting point is defined as:
          XBEAM = 4E05
          YBEAM = 4E05
          ZBEAM = 4E05
       Use always D, not E (that applied also to NORENE values shown before):
          XBEAM = 4.D05
          YBEAM = 4.D05
          ZBEAM = 4.D05
    5) Input file:
       Not important, but why have a command GLOBAL followed by all zeros?
       The manual says for each of them that they are "ignored".
       You have a BEAM command
    BEAM -120.E+00 HEAVYION
       We have already seen how you can use WHAT(3) to ask for an isotropic source.
       But HEAVYION alone in general is not sufficient. You need a card HI-PROPE
       specifying the type of ion. However, in your case you may miss it, because
       the default is just what you want, 12C. So it's ok. But if you change
       type of ion, don't forget HI-PROPE.
    6) Linking command:
       $FLUPRO/flutil/lfluka -o myfluka -m fluka source.o links the default
       FLUKA library, which is not sufficient for heavy ions. You need to type:
       $FLUPRO/flutil/ldpm3qmd -o myfluka -m fluka source.o
       Otherwise you will get the carbon ion transported, but without nuclear

    Best regards,


    On Mon, 15 Jan 2007, h jalali wrote:

    > Hi Alberto
    > I had sent my source.f,input,*.out and the results in a zip format by last mail.
    > Anyway,my input and source.f are in attachment.
    > The commands that I used, were:
    > to compile and link to source.f
    > $FLUPRO/flutil/fff source.f
    > $FLUPRO/flutil/lfluka -o myfluka -m fluka source.o
    > and to run my input I gave this command:
    > $FLUPRO/flutil/rfluka -e myfluka -N0 -M1 carbon &
    > carbon is my input.
    > I also used usxsuw.f as FLUKA manual to get result from USRBDX output.
    > Thanks in advance for your help.
    > Best regards
    > Alberto Fasso' <> wrote:
    > Don't send executables, they are stripped out by the spam filter.
    > Anyway, it is not the executable which is needed, but:
    > - your input file
    > - your source file
    > - any other user routine yoiu may possibly have used
    > the command you typed to compile and link
    > Once we have all that (attached as text files) we can generate
    > the executable ourselves.
    > Alberto
    > PS your attachment, which has been removed by the antispam, had an
    > extension .rar. What is that? A mistyping for .tar?
    > On Sun, 14 Jan 2007, h jalali wrote:
    > > Dear FLUKA users
    > >
    > > I have a carbon source with distribution of energy and want to calculate
    > > dose in a shell of Al and score secondry particles .The results are completely
    > > illogical,it seems any particle does not move.I do not know the problem is
    > > because of my source.f or my input.
    > > Please help me.
    > >
    > > Best regards
    > >
    > >
    > > ---------------------------------
    > > Be a PS3 game guru.
    > > Get your game face on with the latest PS3 news and previews at Yahoo! Games.

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

  • Next message: Brandon Reddell: "Re: Infinite loop of error message"

    This archive was generated by hypermail 2.1.6 : Tue Jan 16 2007 - 09:36:57 CET