Re: use of CERNLIB with Fluka (source)

From: Alberto Fasso' <fasso@SLAC.Stanford.EDU>
Date: Thu Mar 27 2008 - 19:06:03 CET

Dear Noemi,

it is planned to add a chapter in the manual with a list of the FLUKA
mathematical routines and instructions on how to call them. However, this
will take some time.


On Thu, 27 Mar 2008, Finetti Noemi wrote:

> Dear Giuseppe,
> you are right, I did not know about FLUKA mathematical routines and I will
> use DGAUSF function in the future (thanks!). Where can I find information
> about FLUKA mathematical routines? Anyway, in my previous e-mail I omited to
> remark that I modified lflukac adjusting the CERNPATH (the link to the
> cernlib seems to be correctly performed). Thanks a lot,
> noemi
> Giuseppe Battistoni wrote:
>> 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!
>> 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 19:20:33 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 27 2008 - 19:20:33 CET