Re: [fluka-discuss]: [Fwd: Error generated while reading x,y,z,energy,u,v,w from a file using source.f]

From: Paola Sala <paola.sala_at_mi.infn.it>
Date: Mon, 17 Aug 2020 09:01:03 +0200

Hello
First of all, It would be better to place the reading of your file inside
the IF-block starting with "IF (LFIRST)" , so that it is read only once.
As it is now, it is re-read at each primary.

Then, I do not know how the txt file is formatted, but I suppose that you
have one line for each (x,y,z,E,wt,u,v,w) set? If yess, the read statement
is not correct: at each READ, one record will be load , I mean one line,
and only one quantity will be read in from this record, the first one, and
assigned to A(i). Thus, the code will try to read 1946728 LINES, not
1946728 values.
Again, if my assumption is correct, you can do two things:
A loop on 243341 lines, reading 8 separate vectors (which will make things
much easier) : read (30,*) x(i),y(i),z(i),E(i),wt(i),u(i),v(i),w(i)
A single read, without loop : read(30,*)A
I suggest in both cases to add prinout lines to check that everything is
working correctly.
regards
Paola
> Dear experts,
>
> I am resending this mail since in the previous mail, there was one
> attachment (fluence.txt) which has large mb size and thus I received the
> following instruction
> Sorry, but your message was blocked by the system with the message:
> "Message too long (>10000000 chars)"
>
> I hope, with out this file, still my issue can be addressed.
>
>
>
>
>
> ---------------------------- Original Message ----------------------------
> Subject: Error generated while reading x,y,z,energy,u,v,w from a file
> using source.f
> From: riyadey_at_barc.gov.in
> Date: Fri, August 14, 2020 4:28 pm
> To: fluka-discuss_at_fluka.org
> --------------------------------------------------------------------------
>
> Dear experts,
>
> I am trying to read position coordinates, energy, weight and directional
> cosines from a file (see the attached fluence.txt file). Total number of
> data are 1946728 and if we consider (x,y,z,E,wt,u,v,w) as a set, then this
> number will be 243341 (=1946728/8). I want to store these data in an array
> A and subsequently I have used this A to assign XFLK (NPFLKA) and other
> variables.
>
> Although there is no error in the compilation, the timed out error is
> appearing and in the log file the following errors are generated.
>
> At line 61 of file source1.f (unit = 30, file = '../fluence.txt')
> Fortran runtime error: End of file
>
> Error termination. Backtrace:
> #0 0x7f1b456e6aed in ???
> #1 0x7f1b456e7605 in ???
> #2 0x7f1b456e82ab in ???
> #3 0x7f1b459280a3 in ???
> #4 0x7f1b45921316 in ???
> #5 0x7f1b459222b1 in ???
> #6 0x55f34f7cc910 in source_
>
> Can you please guide me to solve this issue ?


Paola Sala
INFN Milano
tel. Milano +39-0250317374
tel. CERN +41-227679148

__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Mon Aug 17 2020 - 11:35:13 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 17 2020 - 11:35:18 CEST