From: Giuseppe Battistoni (Giuseppe.Battistoni@mi.infn.it)
Date: Thu Dec 01 2005 - 09:20:53 CET
Hi Konstantin,
I answer in part to your question.
There is a general utility routine in FLUKA that it can be very helpful
for users which is written to open files: OAUXFI (Open Auxiliary Files)
Usage:
CALL OAUXFI( FILE, IONUMB, CHSTTS, IERR )
file = file name
ionumb = logical unit number
chstts = status word (optional, def. old)
ierr = error flag (output)
It searches for FILE in 4 places:
1) First of all: try to open the file in the current directory
2) Second attempt: try to open the file in the original work directory
3) Third attempt: try to open the file in the FLUPRO directory
4) Last attempt: try to open the file in the user home directory
CHSTTS can be one of :
'OLD', 'NEW', 'UNKNOWN', 'UNFORMATTED', 'FORMATTED', 'DIRECT', 'APPEND',
'SEQUENTIAL'
IERR must be 0 if open is successful
Giuseppe
On Wed, 30 Nov 2005, Konstantin Batkov wrote:
> Date: Wed, 30 Nov 2005 19:08:28 +0300 (MSK)
> From: Konstantin Batkov <kbat@dec1.sinp.msu.ru>
> To: fluka-discuss@fluka.org
> Subject: failed to open a file in source.f
>
> Dear FLUKA users,
>
> I have a question about SOURCE card. Let's consider a simple example
> $FLUPRO/example.inp given in FLUKA tar-ball.
>
> I'd like to read some data on beam particles from a file. According
> to manual, I add a SOURCE card in .inp file and open the data file in
> source.f (this is just one line, so I show here the output of diff):
>
> kbat@tomcat:source_test$ diff source.f $FLUPRO/usermvax/source.f
> 59d58
> < open (21, FILE='data.txt', STATUS='OLD', FORM='FORMATTED')
>
> then I produce an executable:
> $FLUTIL/lfluka -o test -m fluka source.f
>
> and run it:
> kbat@tomcat:source_test$ $FLUTIL/rfluka -e test -M1 example
> $TARGET_MACHINE = Linux
> $FLUPRO = /usr/local/fluka
> /usr/local/fluka/libec_thihecufealw_10t.pemf
> 12815: old priority 0, new priority 19
>
> Initial seed copied from /usr/local/fluka
>
> Running fluka in /home/kbat/fluka/source_test/fluka_12815
>
> ================================ Running FLUKA for cycle # 1 =============================================
> /usr/local/fluka/flutil/rfluka: line 311: 12841 Aborted ${EXE} <$INPF 2>$LOGF >$LOGF
>
>
> FLUKA crushes without any complains. I've assumed that FLUKA cannot
> open the data file because it is trying to do it in temporary directory
> fluka_***, so I've changed it's name by
>
> open (21, FILE='../data.txt', STATUS='OLD', FORM='FORMATTED')
>
> and now FLUKA runs and opens it successfully!
>
> So, my first question is: Is there any way to open a file without
> these dots before it's name?
>
>
> OK, for the second step I was trying to set the name of data file in
> SOURCE card using SDUM as indicated on page 197 of the current manual.
>
> kbat@tomcat:source_test$ diff example.inp $FLUPRO/example.inp
> 7d6
> < SOURCE dat.txt
>
> kbat@tomcat:source_test$ diff source.f $FLUPRO/usermvax/source.f
> 59d58
> < open (21, FILE=SDUSOU, STATUS='OLD', FORM='FORMATTED')
>
> And again, I'm failed to open it. Moreover, I'm failed to open the file
> even if I put two dots before its name:
> SOURCE ../dat.txt
>
> Second question: How do I set the name of a file using SOURCE card?
> Is there something wrong in my code?
> I'm using fluka2005.6
>
> Best regards,
> Konstantin
>
This archive was generated by hypermail 2.1.6 : Thu Dec 01 2005 - 09:44:14 CET