Re: How to output 'unformatted file'?

From: Giuseppe Battistoni <giuseppe.battistoni_at_mi.infn.it>
Date: Mon, 03 Aug 2009 17:16:03 +0200

Notice that mgdraw.f contains already a lot of WRITE statements. These
have been put there as examples, but you probably don't need them.
Identify those statements and delete (or comment) them.
    G.B.

Hantao Jing wrote:
> Dear Mr. Battistoni,
> As you said in mail, the fluka can work well and the unformatted
> file can be outputted. Thank you very much!
> But I have a problem about 'unformatted file': I find the
> unformatted file is almost the same size to the 'formatted file'.
> If I have primary number of 100000, the file size for unformatted file
> is 2.58M and 2.57M for formatted file. If I have a large number of
> primaries, for example 100000000, the file size will become very
> large. How can I deal with the output option to try my best to make
> output file size smaller. Thank you very much.
>
> Hantao Jing
> 2009-8-3
>
>
>
> Giuseppe Battistoni wrote:
>> Dear Hantao
>> this is a trivial fortran problem.
>> If you write in the code:
>> WRITE(60,200) XSCO,YSCO,ZSCO,TPPTRACK,WTRACK
>> ....
>> 200 format(3F8.3,E15.7,F6.2)
>> ...
>> you are asking to write using the format specified at label 200,
>> therefore you cannot
>> ask to open an unformatted file.
>> In order to write into an unformatted file, beyond opening the file
>> with FORM="UNFORMATTED" your code must be transformed into:
>>
>> WRITE(60) XSCO,YSCO,ZSCO,TPPTRACK,WTRACK
>>
>> dropping the FORMAT statement with label 200. Notice that after
>> WRITE there is only (60) instead of (60,200)
>>
>> Giuseppe Battistoni
>>
>> Hantao Jing wrote:
>>> Dear FLUKA experts,
>>>
>>> I want to output results in an unformatted file by employing
>>> the USERDUMP card. So I do the following things:
>>> firstly, I defined the USERDUMP card in my input file,
>>> *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
>>>
>>> USERDUMP 100.0 0.0 3.0 0.0
>>> ;
>>> Then, I add my user-code in the 'mgdraw.f' file,
>>>
>>>
>>> ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO )
>>>
>>> IF (.NOT. LFCOPE) THEN
>>> LFCOPE = .TRUE.
>>> OPEN(UNIT=60, FILE = 'Age.60',FORM = 'UNFORMATTED',
>>> & STATUS = 'NEW')
>>> END IF
>>>
>>> IF( JTRACK.EQ.1) THEN ! Select protons
>>> IF(ETRACK.GT.AM(JTRACK)) THEN ! Neutron has survived
>>> TPPTRACK = ETRACK - AM(JTRACK)
>>> IF(MREG.EQ.2 .AND. NEWREG.EQ.8) THEN ! Select the desired
>>> boundary
>>>
>>>
>>> * TPPTRACK is kinetic energy,PTRACK is the momentum; ETRACK, PTRACK AND
>>> * AM(JTRACK) satisfy the mass-energy relation E^2=m^2+p^2;
>>>
>>>
>>> WRITE(60,200) XSCO,YSCO,ZSCO,TPPTRACK,WTRACK
>>>
>>>
>>>
>>> ENDIF
>>>
>>> ENDIF
>>> ENDIF
>>>
>>> 200 format(3F8.3,E15.7,F6.2)
>>>
>>> RETURN
>>> ;
>>>
>>>
>>>
>>> When I run the fluka, the error apperars,
>>>
>>> [jinght_at_sns022 ~/TailEnd/collimators/NoJaw]$ $TARGET_MACHINE = Linux
>>> $FLUPRO = /home/jinght/fluka
>>> $PEMF = /home/jinght/fluka/libec_thihecufealw_10t.pemf
>>>
>>> Initial seed copied from /home/jinght/fluka
>>> Running fluka in /home/jinght/TailEnd/collimators/NoJaw/fluka_5998
>>>
>>> ======================= Running FLUKA for cycle # 1
>>> =======================
>>>
>>> [jinght_at_sns022 ~/TailEnd/collimators/NoJaw]$
>>> /home/jinght/fluka/flutil/rfluka: line 338: 6024 Aborted (core
>>> dumped) ${EXE} < $INPN 2> $LOGF > $LOGF
>>>
>>> [1]+ Exit 134 $FLUPRO/flutil/rfluka -e myfluka -N0
>>> -M1 NoJaw
>>> .
>>>
>>>
>>> But when I revise the FORM = 'UNFORMATTED' to FORM = 'FORMATTED',
>>> everything is ok. I can obtain the formatted the file. The fluka
>>> works well.
>>>
>>> My input file and mgdraw.f is in attachment.
>>>
>>> Please tell me how to output unformatted file correctly. Thank you
>>> in advance.
>>>
>>>
>>> Hantao Jing
>>> 2009-8-3
>>
>>
>>
>
Received on Mon Aug 03 2009 - 17:57:09 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 03 2009 - 17:57:39 CEST