Re: Source routine creating bigsize files

From: Alberto Fasso' <>
Date: Mon, 20 May 2013 01:11:24 -0700 (PDT)

Dear Sahani,

Fluka is generating huge size file as XXXX_source, because you put in
your input a command USERDUMP requesting to dump on a file called
"source" all the source particles. With a run of 1.E7 particles, you get
a file of 10 million records. And, as you say: "This file size go on
increasing as we increase the histories".
I don't know why you you have that command in input: but the program
gives you exactly what you requested. Remove USERDUMP, and the file will

Having said this, I must warn you that there are errors of logics in
your source routine. These are not the cause of the huge file, but are
probably affecting the results.
1) the energies of the spectrum read by your source go from 4.E-6 to
9.8E-5, but you sample the energy between 1.E-6 and 2.E-4, therefore in
a wider interval. It is difficult to predict the effect of this.

2) you read EN(I), SPEC(I) (energies and spectral values) with I going
from 1 to 140. But you assign a weight to the sampled energy as follows:
        DO 3 I = 1, 140
           IF(ENERGY .GT. EN(I)) THEN
              WEIGHT = HLFHLF*(SPEC(I)+SPEC(I+1))
           END IF
     For I = 140, I+1 is = 141, and you have not read a value for SPEC(141).
     The program doesn't crash because you have dimensioned EN and SPEC
from 0 to 630, so SPEC(141) is a legal array member, but its value is


On Sun, 19 May 2013, P K SAHANI wrote:

> Dear Sir,
> I am sending this personally to you as I found no reply to my query in
> fluka discussion list. I am also attaching the input, source subroutine
> and spectrum file with this mail. Please guide me.
> Regards
> P K Sahani
> ____________________________________________________________________________
> From: P K SAHANI []
> Sent: 07 March 2013 07:49
> To:
> Subject: Souce routine creating bigsize files
> Dear Fluka users,
> I am using source routine for synchrotron radiation spectrum dose
> calculation This routine is the same as suggested by Mr. Alberto Fasso
> (ref:
> My spectrum has 140 energies and simulating for 1e7 histories. Fluka
> is generating huge size file as XXXX_source (720MB) for each cycle.
> This file size go on increasing as we increase the histories. I want
> to go for higher number of histories that too at minimum 5 cycle run.
> So please suggest me to reduce the file size otherwise its difficult
> to handle such big files in my PC.
> Regards
> P K Sahani
Received on Mon May 20 2013 - 13:07:58 CEST

This archive was generated by hypermail 2.3.0 : Mon May 20 2013 - 13:08:01 CEST