Re: [fluka-discuss]: How to Convert Data into Double Precision Format like "2.3D+00" For Fluka?

From: Alfredo Ferrari <alfredo.ferrari_at_cern.ch>
Date: Tue, 12 Nov 2013 21:16:10 +0100

... the error is obvious, you are passing unphysical cosines
(-0.2 -0.4 -0.9 are obviously unphysical since their squared values
summed are larger than one). The fix by Mina commenting the TZ
etc card is simply hiding the problem, in reality it does not fix the
issue. Correct you data file inputting physical numbers into the code and
everything will work

               Ciao
             Alfredo


+----------------------------------------------------------------------+
| Alfredo Ferrari || Tel.: +41.22.76.76119 |
| CERN-EN/STI || Fax.: +41.22.76.69474 |
| 1211 Geneva 23 || e-mail: Alfredo.Ferrari_at_cern.ch |
| Switzerland || |
+----------------------------------------------------------------------+

On Tue, 12 Nov 2013, Vahan Petrosyan wrote:

> HI,
> I have source routine that reads paticles data from file in form
> Part-ID X Y Z COSX COSY COSZ ENERGY
> 3 0.2 0.3 -0.9 -0.2 -0.4 -0.9 0.003
> I read data in my source routine using lik so......
> INTEGER PARTID(NLINES)
> DOUBLE PRECISION X(NLINES), Y(NLINES),
> & Z(NLINES), COSX(NLINES),
> & COSY(NLINES), COSZ(NLINES), ENERGMY(NLINES)
> OPEN(UNIT=88, FILE="../test.dat", STATUS="OLD")
> DO K=1, NLINES
> READ(88,*) PARTID(K), X(K), Y(K),
> & Z(K), COSX(K), COSY(K), COSZ(K), ENERGMY(K)
> END DO
> But when fluka runs it says crashes and says: -Floating point exception(core
> dumped).....
>
> I read lecture
> https://www.fluka.org/free_download/course/triumf2012/Lectures/AdvancedFluka2012.pdf
> -it says: .........."The code works under IMPLICIT DOUBLE PRECISION for
> variables in the range (A-H,O-Z). Donąt forget ..D+/-xx (eg
> 2.3D+00, 7.8D-03) in all numerical settings in user routines, and be careful
> in passing variables to/from Fluka or external packages (eg CERNLIB)
> routines"..........
>
> So I tried data file in form of
> 1 20D-01 1D-02 -1D+00 -1D-01 1D-01 1D-01 1D-04
> It started to work
>
> QUESTION:
> why my code doesn't work when data in form 3 0.2 0.3 -0.9 -0.2 -0.4 -0.9
> 0.003?
> How should I READ data from my file correctly?
>
> I am attcahing my data files and source routine.....
>
> Thank You!
>
Received on Tue Nov 12 2013 - 22:15:42 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 12 2013 - 22:15:43 CET