Skip to content
README.txt 4.31 KiB
Newer Older
Ruben Farinelli's avatar
Ruben Farinelli committed
The code computes the polarization degree of radiation from a plane-parallel slab in the diffusion approximation for a pure scattering atmosphere.
You may use either numerical solution of the coupled system of radiative transfer
equations as defined in Pomraning (1973) or Monte Carlo method.

1) Library requirements

The following third-party libraries are required for compilation

1) Gnu Scientific Library
2) CFITIO library
3) MPI library


As these packages may be installed in non-default folders, it is necessary
to define some enviroment variables pointing to library headers and shared object.
These enviroment variables, read by the Makefile at compilation step, are:

LIB_CFITSIO
HEADERS_CFITSIO

LIB_GSL
HEADERS_GSL

LIB_MPI
HEADERS_MPI

2) Creation of the executable

From the local folder where the Makefile is located just type

$make

If everything worked well, you will see the executable which is called "start_iteration"
To remove object files

$make clean

3) Running the code

The executable is launched from the shell prompt with a list of parameters, with synopsis like

$start_iteration par1=value par2=value etc etc

======================================================================
3.1) Numerical solution
======================================================================

The parameter selecting this choice of the algorithm is "method=ode"

Three locations of the seed photons are possible, and are defined by the parameter "seed=N" where

N=1  photons at the center of the slab
N=2  photons uniformly distributed across the slab
N=3  photons at the base of the slab

The Thomson optical depth of the slab is defined with parameter "disktau=value"

The number of iteration is defined by the parameter "kiter=N", where N must be an integer greater than zero.
To obtain reliable results it is important to consider the optical depth of the slab.
For instance, if disktau=1 then kiter=20 could be enough, on the other hand for e.g. tau=5, kiter=100 at least
is recommended.

At the end of the simulation the following files are produced

intensity_ode_tauA_seedB.qdp
diffusion_ode_tauA_seedB.qdp

where A and B states for the value defined for parameters disktau and seed.
The file format for intensity_ode_tauA_seedB.qdp is the following:

Col1: u, the cosine with respect to the slab normal
Col2: Pdeg, namely Ir(u)-Il(u)/Ir(u)+Il(u)/
Col3: I(u)/I(u=1), specific intensity normalized at its value for u=1

Output file diffusion_ode_tauA_seedB.qdp has two columns instead:

Col1: k, namely number of scattering
Col2: F(k), namely the total flux emerging from the top of the slab for each order of scattering


======================================================================
3.2) Monte Carlo method
======================================================================

Here you must select from command line "method=mc"
While the slab optical depth must be defined as well, for Monte Carlo method the following parameters are required:

polardisk=y|n

which defines if seed photons are initilly polarized (default is no).

albedobase=A

where A must be defined between 0 and 1. The code assumes an energy-independent albedo at the base of the slab.
To perform tight comparison of the results with numerical method, you must set A=0.

nph=N

the number of photons for each core.
There are two additional optional parameters to be passed at the prompt, namely the BB seed photons and electron
temperature, respectively.
They can be passed simply as

ktbb=value kte=value

and their default values is 1 for both cases.

To run simulation with single core, you must define at shell prompt

$start_simulation  (plus parameter list)

Tu run multi-core simulation use instead

$mpirun -n Ncores start_simulation  (plus parameter list)

The output files are the following:

a) spectrum_mc_tauN_seedM_AQ.qdp

Energy spectra at the top of the slab with format:

Col1: E
Col2: Delta_E
Col3: I(E)
Col4-Col25: angle-dependent I(E)

b) integralpolar_mc_tauN_seedM_AQ.qdp

Total, energy-integrated, polarimetric results with format:

Col1: u
Col2: Pdeg (u)
Col3: Q(u)
Col4: U(u)
Col5: Itot(u)/I(1)*1/u

c) energypolar_mc_tauN_seedM_AQ.qdp

Energy-dependent polarimetric results with column description defined in the file

d) diffusion_mc_tauN_seedM_AQ.qdp

Col1: number of scatterings k
Col2: P(k) normalized photon distribution over number of scatterings