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

From: Vahan Petrosyan <vahan4033_at_gmail.com>
Date: Tue, 12 Nov 2013 17:52:07 +0400

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 - 16:18:57 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 12 2013 - 16:18:58 CET