Re: use of CERNLIB with Fluka (source)

From: Giuseppe Battistoni <Giuseppe.Battistoni@mi.infn.it>
Date: Thu Mar 27 2008 - 15:22:33 CET

Dear Noemi
as far as CERNLIB is concerned, you lflukac might not work, depending
where your cern library in installed. You have to edit leflukac and adjust
the CERNPATH variable.
Much better: you can avoid to use cern library if you are just using
DGAUSS. Probably you do not know, but FLUKA contains its own mathematical
routines and in particular there is the DGAUSF function already in!

      DOUBLE PRECISION FUNCTION DGAUSF ( FINTEG, XA, XB, EPSEPS )

Where the first variables are the same as those of DGAUSS
 FINTEG is the function to be integrated.

Description:
* This is a new adaptive gaussian quadrature routine, written from *
* scratch using the abscissae and weights in: *
* M. Abramowitz "Handbook of mathematical functions", p. 916 *
* It is intended to substitute the previous dgauss from the CERN *
* library, so the adaptive scheme and precision checking is simi- *
* lar in order to ensure similar accuracy *
*
        Ciao

        Giuseppe

 On Wed, 26 Mar 2008, Finetti Noemi wrote:

> Dear Fluka users,
> Some questions about the use of the user written routine source:
> 1) I would like to use the function subprogram
> DGAUSS(fu,emin,emax,0.001) - CERNLIB (MATHLIB) - in my source subroutine
> (see the attached file source_prot_min_new.f). I declared the function
> "fu" as external (it is reported at the end of the source subroutine). I
> used the lflukac script in order to link Fluka with CERN Library but at
> the end of the procedure I obtained the following error message:
> "source_prot_min_new.f:130: undefined reference to `dgauss_'
> collect2: ld returned 1 exit status". Can you find out where is the error?
> 2) In source.f the sum
> (TXFLK(NPFLKA))**2+(TYFLK(NPFLKA))**2+(TXFLK(NPFLKA))**2 must be exactly
> equal 1 (double precision). In my source_prot_min_new.f I set
> TXFLK(NPFLKA)=costx and TYFLK(NPFLKA)=costy (where costx and costy were
> read from an external data file) and I obtained TZFLK(NPFLKA) from the
> algorithm (which was commented on the original source.f in usermvax)
> reported at line 228 TZFLK(NPFLKA) = SQRT(ONEONE - TXFLK(NPFLKA)**2-
> TYFLK(NPFLKA)**2 ) but sometime it happen that the argument of SQRT is
> negative , moreover by using this algorithm TZFLK(NPFLKA) is always
> positive while I need also negative values in order to simulate an
> isotropic particle flux. How can I solve these problems?
> Thanks in advance,
> noemi
>
>
Received on Thu Mar 27 15:25:56 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 27 2008 - 16:02:57 CET