How to run FLUKA on UNIX -------------------------------------------------------- UPDATED===10.12.2008.16.52.50 TITLE===How to run FLUKA on UNIX TYPE===delete --------------------------------------------------------

Note:

On Sun platforms, the extension of all Fluka *.f files must be replaced by *.F.

The lfluka script uses the Fortran compiler whose executable has a slightly different name on different Unix platforms. The lfluka script resides in the FLUPRO/flutil directory.

Content

Step 1 - Inputs
Step 2 - Electromagnetic Transport Inputs
Step 3 - FLUKA Execution
rfluka Options
Output
Customizing the Code

Step 1

Inputs:

The installed version of FLUKA is now ready-to-run.

First you specify your inputs for the FLUKA run. You do this by creating a *.inp file. The *.inp file is placed in the FLUPRO directory.

Look at the mu.inp in the FLUPRO directory to see an example of a *.inp file. A description of the used format for the *.inp file is given in the Online manual.

The *.inp file is a series of FORTRAN input sets called option cards, together with a START card to start FLUKA execution and a STOP card to stop execution. The option cards include options like MATERIAL, GEO(metry)BEGIN, GEOEND, SCORE, STEPSIZE and TITLE which you will want to use in most simulations. The full list of available option cards and their defaults and formats is given in the manual section on the FLUKA input options.

In the default mode, *.inp must be formatted into columns as described in the Fluka manual. Free format is evoked by the FREE option.

Some option cards must be immediately followed in *.inp by a data card. The data card must also be formatted into columns unless the FREE option is evoked. Full requirements for the data cards are given in the Fluka manual: Description of available input options

The physical units used in FLUKA input and output data are listed in the Fluka manual: General features of FLUKA input.

Step 2

Electromagnetic Transport Inputs:

If you want FLUKA to transport electromagnetic particles in detail (i.e. the EMF option), you will also need to create a *.pemf file before you run FLUKA. The *.pemf file preprocesses the electromagnetic cross-sections.

The *.pemf file is described in detail in the Fluka manual: PEMF: a preprocessor of electromagnetic cross sections for FLUKA and: Instructions for using PEMF.

To create the *.pemf file, you first set up an appropriate *.peg file in the directory FLUPRO/fluka/pemf. Specifications for the *.peg file are given in the Fluka manual: Instructions for using PEMF. Look at the marl.peg in the FLUPRO/pemf directory to see an example of a *.peg file.

Next, run the rpemf script in the FLUPRO/flutil directory to produce a (filename).pemf file from the (filename).pegfile. To do this, type

$rpemf (filename)

The .peg extension is omitted in the rpemf command line. rpemf creates the file (filename).pemf in the FLUPRO/fluka/pemf directory.

To run FLUKA with the EMF option, use a rfluka command line which includes the -p option and the (filename).pemf file eg.

$rfluka -p(filename) (input filename)

The .pemf extension is omitted in the rfluka command line.

Step 3

FLUKA Execution:

Once you have created the (input filename).inp file, and a *.pemf file if required, use the command line

$rfluka (input filename)

to run FLUKA. The rfluka options are listed below.

The output files are placed in the directory from which you call rfluka. You will probably want to create a new subdirectory for this purpose because the output can be extensive. Check your output directory is in the PATH.

The rfluka script can be used to run the code interactively or through a batch queue. The rfluka script is located in the FLUPRO/flutil directory and contains all relevant I/O file definitions.

Further information can also be found in README file in the FLUPRO directory.

rfluka Options:

$rfluka -e (executable filename)

-e followed by the filename of the Fluka executable without the file extension. The default is flukahp in the FLUPRO directory.

$rfluka -N (integer)

-N followed by an integer, the number of the last cycle of a previous Fluka run. Use this option to perform additional cycles of a previous run. The default is N=0.

$rfluka -M (integer)

-M followed by an integer, the number of cycles in the new run. The default is M=5.

$rfluka -h

-h lists the rfluka online help file

$rfluka -p (pemf filename)

-p followed by the filename of the *.pemf file without the file extension. Use this option to transport electromagnetic particles in detail. The default is FLUPRO/libec_thihecufealw_10t.pemf

Online help on the full list of rflukaoptions is available by typing:

$rfluka -h

Output:

Data Output Files
Standard Output Files

Each Fluka run generates two types of output files: user-generated Data Output Files and diagnostic Standard Output Files. The files are placed in the directory from which you called rfluka.

A full set of output files are written at the end of each cycle of a Fluka run.

Each Fluka run also creates a temporary directory called

fluka_XXXXX

This directory is automatically deleted at the end of the run, unless the run is terminated by an error.

Data Output Files:

The user-generated Data Output Files are the output data which you specified in the *.inp input file. A full description of user-generated output is found in the FLUKA manual: Description of FLUKA formatted output

If your rfluka input file was called (input filename).inp, the Data Output Files are named (input filename)QQQ_fort.XX, where QQQ is the integer number of the cycle and XX >78 is a Fortran unit number.

The Data Output Files may be formatted or unformatted. The output can be manipulated using the user routines in the FLUPRO/flutil directory or other user-written routines. See the README file in the FLUPRO directory for an introduction to auxiliary analysis routines.

The physical units used in Fluka output data are given in the Fluka manual: General features of FLUKA input

Standard Output Files:

The Standard Output Files are mainly diagnostic files. They are automatically generated each cycle.

If your rfluka input file was called (input filename).inp, the four Standard Output Files are:

RAN(input filename)QQQ
QQQ is the integer number of the cycle. The RAN file stores the random number seeds of the last iteration. If you want to run multiple runs, keep the RAN file of the last cycle. It will automatically be read at the start of the next Fluka run.
(input filename)QQQ.out
The *.out file is a running log of each cycle. It comprehensively lists the action taken by the code.
(input filename)QQQ.log
The *.log file is non-empty only if rfluka is run as a background or batch job. The file gives a brief summary of each cycle. During an interactive run, this information is displayed on the screen.
(input filename)QQQ.err
The *.err file is another log file giving a brief summary of each cycle during successful execution. In the case of an error, extensive diagnostics are written to this file.

How to Customize the Code:

How to optionally compile routines
How to optionally link FLUKA

How to optionally compile routines:

If you edit a routine, you will have to re-compile and then re-link the code before running FLUKA.

The fff script in the FLUPRO/flutil directory is used to compile an individual routine.

To compile a Fortran routine called (filename).f, type

$fff (filename)

without the .f extension. This creates the Fortran object file (filename).o in the same directory as the routine.

Note: the fff script uses the Fortran compiler f77. On some Linux platforms, you will need to replace f77 by g77 in the fff and lfluka scripts.

How to optionally link FLUKA:

If a routine has been editted and re-compiled, or you wish to link to optional object files or libraries, the FLUKA code will have to be re-linked before running FLUKA.

The lfluka script in the FLUPRO/flutil directory links all routines into an executable.

Online help on the lfluka parameters is available by typing

$lfluka -h

lfluka creates the Fluka executable flukahp and places it in the FLUPRO directory.

Note: the lfluka script uses the Fortran compiler f77. On some Linux platforms, you will need to replace f77 by g77 in the lfluka and fff scripts.