Re: [fluka-discuss]: Writting SOURCE user routine generating from file with mixture of particles?

From: Vahan Petrosyan <vahan4033_at_gmail.com>
Date: Sat, 09 Nov 2013 18:36:42 +0400

Thanks for reply your answer helped me very much.
But I revised my source code and found many LOGICAL mistakes because of
which my source routine didn't work at all. Yes it run but it didn't
take beam from data file. So.... I corrected my mistakes and now it
works as I want.

But I have SMALL Problem! Can you help me please?
I have DATA FILE in this format: 3 0.2 0.3 -0.9 -0.2
-0.4 -0.9 0.003
but when I run it crashes with ERROR: "Floating point exception (core
dumped)"
I read the the lecture
https://www.fluka.org/free_download/course/triumf2012/Lectures/AdvancedFluka2012.pdf

Where 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"
ie passed number should be in this form "2.3D+00".
So...... I manually crated DATA FILE with this format: 1 20D-01
1D-02 -1D+00 -1D-01 1D-01 1D-01 1D-04
and my code worked as I expected.
       ..................
I tried to use DBLE() function in order to convert my array elements to
DOUBlE PRECISION when I assign it to the FLUKA variables but it doesn't
help...... again the same error appears.
           ....I do like this....
TXFLK (NPFLKA) = DBLE(COSX(I))
        .....................
When I use another DATA FILE where numbers are like this "2.3D+00"
format My code WORKS JUST FINE!!!

Now I try to convert data in form "2.3D+00" myself using this doc.
http://docs.oracle.com/cd/E19957-01/805-4939/z40007437a2e/index.html but
can't implement.... the same error appears.....
So question how can I convert my DATA file numbers to this "2.3D+00"
format using FORTRAN77?

Thank You!



On 11/8/2013 10:47 PM, nozarm_at_triumf.ca wrote:
> Hello Vahan,
>
> I just tried compiling and running the executable and it worked just fine.
> I defined a new run in your flair project, named testroutine-A with 1000
> primaries per cycle and 5 cycles.
>
>
> Cmd: /usr/bin/nohup /triumfcs/linux/fluka/fluka/default/flutil/rfluka -M 5
> testroutine-A
>
> produced:
>
>
> -rw-rw-r-- 1 nozarm nozarm 4000238 Nov 8 10:39stroutine-A001.log
> -rw-rw-r-- 1 nozarm nozarm 4000238 Nov 8 10:39 testroutine-A001_fort.32
> -rw-rw-r-- 1 nozarm nozarm 114352 Nov 8 10:39 testroutine-A001.out
> -rw-rw-r-- 1 nozarm nozarm 22470 Nov 8 10:39 testroutine-A001.err
>
> and similar files for A002 through A005.
>
> I even looked at your usrbin plot and it looks fine.
>
> I am attaching the flair project file with the run definition. I think
> your problem was with the way you were running fluka at the end.
>
> Best wishes,
> Mina
>
>
>> Hi everyone!
>> I am wrtitting a custom SOURCE routine that generates beam with mixture
>> of particles for example electrons and protons from DATA FILE.
>> I read the FLUKA help part 13.2.19 and fluka discuss thread from Alberto
>> Fasso
>> http://www.fluka.org/web_archive/earchive/new-fluka-discuss/2887.html.
>> I was able to write the routine and compile it with success!!! But when
>> I run FLUKA It starts to work in a moment and crashes with "Finished
>> with ERRORS".
>> In my source.f routine:
>> 1) I read file using OPEN command
>> 2) I use READ command inside DO loop in order to fill arrays of
>> particle-ID, coordinates, cosines and energy.
>> 3) I put particle intanialization from input file in DO loop.
>> DO 20 I = 1, NLINES
>> NPFLKA = NPFLKA + 1
>> WTFLK (NPFLKA) = ONEONE
>> WEIPRI = WEIPRI + WTFLK (NPFLKA)
>> IJBEAM = PARTID(I)
>> TXFLK (NPFLKA) = COSX(I)
>> TYFLK (NPFLKA) = COSX(I)
>>
>> ****** etc. ******
>> 20 CONTINUE
>> RETURN
>> CALL SOEVSV
>>
>> I can't undertand why it happens because in my nohup.out file there is
>> only one single line
>>
>> ======================= Running FLUKA for cycle # 1
>> =======================
>> /usr/local/fluka/flutil/rfluka: line 358: 1926 Aborted
>> (core dumped) "${EXE}" < "$INPN" 2> "$LOGF" > "$LOGF"
>>
>> If someone has time PLEASE take a look and say why my SOURCE doesn't
>> work.......
>> I am attached files that I got after run.
>>
>> Thank You.
>>
>>
>>




Received on Sat Nov 09 2013 - 16:42:48 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 09 2013 - 16:42:49 CET