DART-Ray
Data Types | Functions/Subroutines | Variables
smooth_grid_routines Module Reference

Contains most of variables used to define the properties of the 3D grid as well as subroutines for creating the grid and finding neighbour cells. More...

Data Types

type  var_arr_1d
 Data type used to create variable length arrays. 1D version. More...
 
type  var_arr_2d
 Data type used to create variable length arrays. 2D version. More...
 

Functions/Subroutines

subroutine create_grid_arrays ()
 This subroutine allocates the 3D grid arrays and initialize the first elements. More...
 
subroutine calc_cellsize (cellsize, clvl)
 This subroutine derives the cellsize for a certain cell subdivision level. More...
 
subroutine set_base ()
 This subroutine sets the base() derived quantities basediv() and basemask(). More...
 
subroutine find_neighbours (isel, inc, cc, out)
 This routine finds the cell neighbour of the cell nc() along the main cell axis. More...
 
subroutine increment (ilvl, val, inc, ovr)
 This routine is used to increment the cell coordinates in the tree representation along a specific axis. In this way, one finds the coordinates of the next cell. More...
 
subroutine check_level_jump (cc, flag_jump)
 This subroutine is used by the grid creation program to compare the subdivision level of a cell neighbour to the cell ncurr() with the subdivision level that is or will be in the region of the cell ncurr(). Depending if the ncurr() cell will be further subdivided or not, the subroutine outputs a flag specifying if the neighbour cell has to be subdivided or not (see comment inside code to more precise explanations). More...
 
subroutine cindex_to_ccindd (nc, clvl, ccindd)
 This routines derives the cell tree coordinates from tree binary code in cindex(). More...
 
subroutine ccindd_to_cc (ccindd, cc, clvl, cell_found)
 This routine finds the cell ID number from its tree coordinates. More...
 
subroutine print_done
 Prints 'DONE' on the terminal. It also sets a barrier for MPI processes. More...
 
subroutine stop_prc
 Exits process. More...
 
subroutine error_stop (error)
 Exits the program if the input variable error is TRUE. More...
 
subroutine quick_sort_int (list, order)
 Sort integer array "list" and returns array of original positions (order). Wrapper to quick_sort(). More...
 
recursive subroutine quick_sort (list, order)
 Sort array "list" using quick sort algorithm. It also returns an array "order" containing the position of each element in the original array. This version works for real64 variables. To sort other types of variable arrays, use the appropriate wrapper (e.g. quick_sort_int). More...
 

Variables

real(kind=real64) modelsize
 
real(kind=real64) lambda
 
real(kind=real64) lambda_ref
 
real(kind=real64) lambda_ref_si
 
integer(kind=int32) max_ncell
 
integer(kind=int32) ncurr
 
integer(kind=int32) nlevel
 
integer(kind=int32) tot_ncell
 
integer(kind=int32) tot_ncell_p_src
 
integer(kind=int32) tot_ndir
 
integer(kind=int32) tot_ndir_in
 
integer(kind=int32) tot_p_src
 
integer(kind=int32) max_lvl
 
integer(kind=int32) min_lvl
 
integer(kind=int32) tot_spare_cells
 
integer(kind=int32) tot_ndir_scaspe
 
integer(kind=int32), dimension(:), allocatable ncell
 
integer(kind=int32), dimension(:), allocatable cchild
 
integer(kind=int32), dimension(:), allocatable lvl
 
integer(kind=int32), dimension(:), allocatable nstart
 
integer(kind=int32), dimension(:), allocatable cchild_or
 
integer(kind=int64), dimension(:), allocatable, target cindex
 
real(kind=real64), dimension(:,:), allocatable ccoord
 
real(kind=real64), dimension(:), allocatable csize
 
real(kind=real64), dimension(:), allocatable dens
 
real(kind=real64), dimension(:), allocatable dens_ref
 
real(kind=real64), dimension(:,:), allocatable dens_arr
 
real(kind=real64), dimension(:), allocatable dens_stars
 
real(kind=real64), dimension(:), allocatable dens_stars_ref
 
real(kind=real64), dimension(:,:), allocatable dens_stars_arr
 
real(kind=real64), dimension(:,:), allocatable dens_stars_arr_prev
 
integer, dimension(2) base
 
integer(kind=int64), dimension(2) basediv
 
integer, dimension(2) basemask
 
real(kind=real64), dimension(2) baseinv
 
real(kind=real64) max_dtau
 
real(kind=real64) max_dlum
 
real(kind=real64), dimension(:,:,:), allocatable psel_av_arr
 
real(kind=real64), dimension(:), allocatable lum_p_src
 
real(kind=real64), dimension(:), allocatable lum_p_src_ref
 
real(kind=real64), dimension(:,:), allocatable lum_p_src_arr
 
real(kind=real64), dimension(:), allocatable u_fest
 
real(kind=real64), dimension(:,:), allocatable u_fest_arr
 
real(kind=real64), dimension(:), allocatable u_final
 
real(kind=real64), dimension(:,:), allocatable u_final_arr
 
real(kind=real64), dimension(:,:), allocatable u_final_uv_opt
 
type(var_arr_2d), dimension(:), allocatable scaspe_arr
 
real(kind=real64), dimension(:,:), allocatable scaspe
 
type(var_arr_2d), dimension(:), allocatable scaspe_tot_arr
 
real(kind=real64), dimension(:,:), allocatable scaspe_tot
 
real(kind=real64), dimension(:,:), allocatable scaspe_prev
 
type(var_arr_2d), dimension(:), allocatable scaspe_prev_arr
 
real(kind=real64), dimension(:,:), allocatable i_obs
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_arr
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_arr_dir
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_arr_tot
 
real(kind=real64), dimension(:,:), allocatable dir_i_out
 
real(kind=real64), dimension(:,:), allocatable ccoord_obs
 
real(kind=real64), dimension(:,:), allocatable i_obs_in
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_in_arr
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_in_arr_dir
 
real(kind=real64), dimension(:,:,:), allocatable i_obs_in_arr_tot
 
real(kind=real64), dimension(:,:), allocatable ccoord_p_src
 
real(kind=real64), dimension(:,:), allocatable i_obs_dust
 
real(kind=real64), dimension(:), allocatable csize_arr
 
real(kind=real64), dimension(:), allocatable carea_arr
 
real(kind=real64), dimension(:), allocatable cvol_arr
 
integer(kind=int32), dimension(:), allocatable src_cell
 
integer(kind=int32), dimension(:), allocatable cell_src
 
real(kind=real64), dimension(:,:), allocatable lumcell
 
integer(kind=int32), dimension(:), allocatable lock_cell
 
integer, parameter lcar =200
 
real(kind=real64) kabs
 
real(kind=real64) ksca
 
real(kind=real64) kext
 
real(kind=real64) gsca
 
real(kind=real64) kext_ref
 
real(kind=real64) tau_nh
 
real(kind=real64) tau_nh_ref
 
real(kind=real64) tot_n_dust
 
real(kind=real64), dimension(:), allocatable kabs_arr
 
real(kind=real64), dimension(:), allocatable kext_arr
 
real(kind=real64), dimension(:), allocatable ksca_arr
 
real(kind=real64), dimension(:), allocatable gsca_arr
 
real(kind=real64), dimension(:), allocatable ksca_arr_norm
 
real(kind=real64), dimension(:,:,:), allocatable qabs_arr_in
 
real(kind=real64), dimension(:,:), allocatable qabs_ref_in
 
real(kind=real64), dimension(:,:,:), allocatable qsca_arr_in
 
real(kind=real64), dimension(:,:), allocatable qsca_ref_in
 
real(kind=real64), dimension(:,:,:), allocatable qext_arr_in
 
real(kind=real64), dimension(:,:), allocatable qext_ref_in
 
real(kind=real64), dimension(:,:,:), allocatable gsca_arr_in
 
real(kind=real64), dimension(:,:), allocatable gsca_ref_in
 
real(kind=real64), dimension(:,:), allocatable dust_size_qabs
 
real(kind=real64), dimension(:,:), allocatable dust_size_fa
 
real(kind=real64), dimension(:,:), allocatable dust_fa
 
real(kind=real64), dimension(:,:,:), allocatable qabs_arr_fa
 
real(kind=real64), dimension(:,:,:), allocatable qabs_arr_planck
 
integer, parameter n_temp_planck = 100
 
real(kind=real64), dimension(:), allocatable t_arr_planck
 
real(kind=real64), dimension(:,:), allocatable qabs_ref_fa
 
real(kind=real64), dimension(:,:,:), allocatable qsca_arr_fa
 
real(kind=real64), dimension(:,:), allocatable qsca_ref_fa
 
real(kind=real64), dimension(:,:,:), allocatable qext_arr_fa
 
real(kind=real64), dimension(:,:), allocatable qext_ref_fa
 
real(kind=real64), dimension(:,:,:), allocatable gsca_arr_fa
 
real(kind=real64), dimension(:,:), allocatable gsca_ref_fa
 
real(kind=real64), dimension(:,:), allocatable delta_dust_size
 
integer n_dust_comp
 
integer n_dust_wave_qabs
 
integer n_dust_maxsize_qabs
 
integer n_dust_maxsize_fa
 
integer, dimension(:), allocatable n_dust_size
 
character(len=lcardust_model
 
character(len=lcardust_opacity_tables
 
integer, parameter max_n_dust_comp = 4
 
logical, dimension(0:max_n_dust_comp-1) iq_dust_model
 
integer, dimension(0:max_n_dust_comp-1) n_dust_size_qabs
 
integer, parameter max_n_dust_cal_type = 2
 
real(kind=real64), dimension(0:max_n_dust_cal_type-1) grain_density_arr
 
integer, dimension(0:max_n_dust_cal_type-1) n_dust_temp_cal
 
real(kind=real64), dimension(:,:), allocatable cal_temp
 
real(kind=real64), dimension(:,:), allocatable grain_enthalpy
 
real(kind=real64), dimension(:,:), allocatable grain_heat_capacity
 
integer, dimension(:), allocatable iq_ct_table
 
integer n_int_rf_bins
 
real(kind=real64), parameter halfpi =asin(1.)
 
real(kind=real64), parameter pi =2*halfpi
 
real(kind=real64), parameter twopi = 2*pi
 
real(kind=real64), parameter twothird =2./3.
 
character(len=lcarfile_lambda_list
 
real(kind=real64), dimension(:), allocatable lambda_arr
 
real(kind=real64), dimension(:), allocatable lambda_arr_maps
 
real(kind=real64), dimension(:), allocatable lambda_arr_si
 
real(kind=real64), dimension(:), allocatable lambda_arr_si_bin
 
real(kind=real64), dimension(:), allocatable delta_lambda_bin
 
real(kind=real64), dimension(:), allocatable delta_lambda_bin_stars
 
real(kind=real64), dimension(:), allocatable delta_lambda_bin_dust
 
integer lnum
 
real(kind=real64), dimension(:), allocatable lambda_arr_si_hd_dust
 
real(kind=real64), dimension(:), allocatable lambda_arr_si_hd_dust_bin
 
real(kind=real64), dimension(:), allocatable delta_lambda_bin_hd_dust
 
integer lnum_stars
 
integer lnum_dust
 
integer lnum_tot
 
real(kind=real64) max_lambda_stars
 
real(kind=real64) min_lambda_dust
 
integer, dimension(0:1) i_lambda_stars
 
integer, dimension(0:1) i_lambda_dust
 
character(len=20) units_i_obs
 
character(len=20) units_ufield
 
character(len=20) units_lambda
 
character(len=20) units_luminosity
 
character(len=20) units_csize
 
real(kind=real64), parameter parsec =3.08567758E16
 
real(kind=real64), parameter parsec_cgs =3.08567758E18
 
real(kind=real64), parameter cspeed =2.99792458E8
 
real(kind=real64) tot_gas_mass
 
real(kind=real64) tot_dust_mass
 
character(len=20) dust_heating_type
 
integer dust_heating_type_id
 
integer, parameter dt_none = -1
 
integer, parameter dt_eff = 0
 
integer, parameter dt_equ = 1
 
integer, parameter dt_sto = 2
 
integer, parameter dt_sto_lib = 3
 
real(kind=real64), dimension(:,:,:), allocatable tot_dust_em_sed
 
integer np_mpi
 
integer id_mpi
 
logical main_prc
 
logical use_lambda_grid
 
logical use_dir_out
 
logical use_pos_obs
 
logical use_p_src
 
logical grid_creation
 
logical grid_creation_lambda
 
real(kind=real64), parameter hplanck = 6.62606957E-34
 
real(kind=real64), parameter kboltz =1.3806488E-23
 
real(kind=real64), parameter sigmasb = 5.67036713E-8
 
real(kind=real64), parameter msun =1.9892000e+30
 
real(kind=real64), parameter m_h = 1.6605402e-27
 
integer npixel_maps
 
logical print_maps
 
real(kind=real64), dimension(:,:,:,:), allocatable map_arr_out
 
real(kind=real64) map_size_factor
 
integer kp_maps
 
logical print_maps_in
 
integer npix_maps
 
real(kind=real64), dimension(:,:,:), allocatable map_in_arr_out
 
real(kind=real64) size_map
 
integer tot_star_particles
 
real(kind=real64), dimension(:), allocatable mstar
 
real(kind=real64), dimension(:,:), allocatable starcoord
 
real(kind=real64), dimension(:), allocatable agestar
 
real(kind=real64), dimension(:), allocatable fehstar
 
integer tot_gas_particles
 
real(kind=real64), dimension(:), allocatable mgas
 
real(kind=real64), dimension(:,:), allocatable gascoord
 
real(kind=real64), dimension(:), allocatable gastemp
 
real(kind=real64), dimension(:), allocatable fehgas
 
real(kind=real64), dimension(:), allocatable ofegas
 
real(kind=real64), dimension(:), allocatable star_lum
 
real(kind=real64), dimension(:), allocatable lambda_lib
 
integer nlambda_lib
 
real(kind=real64), dimension(:), allocatable met_lib
 
integer nmet_lib
 
real(kind=real64), dimension(:), allocatable age_lib
 
integer nage_lib
 
real(kind=real64), dimension(:,:,:), allocatable lum_to_mass_lib
 
real(kind=real64), dimension(:,:,:), allocatable lum_to_mass_int
 
real(kind=real32) z_sun
 
integer, dimension(:), allocatable pcell_star
 
integer, dimension(:), allocatable pcell_gas
 
integer max_sca_iterations
 
logical limit_scattering_iterations
 

Detailed Description

Contains most of variables used to define the properties of the 3D grid as well as subroutines for creating the grid and finding neighbour cells.

Function/Subroutine Documentation

subroutine smooth_grid_routines::calc_cellsize ( real(kind=real64)  cellsize,
integer  clvl 
)

This subroutine derives the cellsize for a certain cell subdivision level.

Parameters
[in]clvlCell subdivision level
[out]cellsizeCell size

Here is the caller graph for this function:

subroutine smooth_grid_routines::ccindd_to_cc ( integer, dimension(:,:)  ccindd,
integer(kind=int32)  cc,
integer  clvl,
logical  cell_found 
)

This routine finds the cell ID number from its tree coordinates.

Parameters
[in]ccindd[3,max_lvl()] Array containing cell tree coordinates for each subdivision level.
[out]ccCell ID number
[out]clvlCell subdivision level
[out]cell_foundLogical variable equal to TRUE if the cell is found.

Here is the caller graph for this function:

subroutine smooth_grid_routines::check_level_jump ( integer  cc,
integer  flag_jump 
)

This subroutine is used by the grid creation program to compare the subdivision level of a cell neighbour to the cell ncurr() with the subdivision level that is or will be in the region of the cell ncurr(). Depending if the ncurr() cell will be further subdivided or not, the subroutine outputs a flag specifying if the neighbour cell has to be subdivided or not (see comment inside code to more precise explanations).

Parameters
[in]ccID number of the neighbour cell.
[out]flag_jumpFlag equal to 1 or 0 depending whether the neighbour cell has to be subdivided or not

Here is the caller graph for this function:

subroutine smooth_grid_routines::cindex_to_ccindd ( integer(kind=int32)  nc,
integer(kind=int32)  clvl,
integer, dimension(:,:)  ccindd 
)

This routines derives the cell tree coordinates from tree binary code in cindex().

Parameters
[in]ncID number of the cell
[in]clvlSubdivision level of the cell
[out]ccindd[3,max_lvl()] Array containing cell tree coordinates for each subdivision level.

Here is the caller graph for this function:

subroutine smooth_grid_routines::create_grid_arrays ( )

This subroutine allocates the 3D grid arrays and initialize the first elements.

Here is the caller graph for this function:

subroutine smooth_grid_routines::error_stop ( logical  error)

Exits the program if the input variable error is TRUE.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine smooth_grid_routines::find_neighbours ( integer  isel,
integer  inc,
integer(kind=int32)  cc,
integer(kind=int32)  out 
)

This routine finds the cell neighbour of the cell nc() along the main cell axis.

Parameters
[in]isel1=x-dir 2=y-dir 3=z-dir
[in]inc+1 or -1 depending if positive or negative direction.
[out]ccID number of the neighbour cell
[out]outIf = 1, the cell is at the border of RT model.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine smooth_grid_routines::increment ( integer  ilvl,
integer  val,
integer  inc,
integer  ovr 
)

This routine is used to increment the cell coordinates in the tree representation along a specific axis. In this way, one finds the coordinates of the next cell.

Parameters
[in]ilvlSubdivision level
valCoordinate value (between 0 and base()-1)
[in]incEqual to +1 or -1 depending if increment in the positive or negative direction.
[out]ovrFlag equal to zero if the new cell is within the same parent cell block. Otherwise it stores the increment value.

Here is the caller graph for this function:

subroutine smooth_grid_routines::print_done ( )

Prints 'DONE' on the terminal. It also sets a barrier for MPI processes.

Here is the caller graph for this function:

recursive subroutine smooth_grid_routines::quick_sort ( real(kind=real64), dimension (:), intent(inout)  list,
integer, dimension (:), intent(out)  order 
)

Sort array "list" using quick sort algorithm. It also returns an array "order" containing the position of each element in the original array. This version works for real64 variables. To sort other types of variable arrays, use the appropriate wrapper (e.g. quick_sort_int).

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine smooth_grid_routines::quick_sort_int ( integer, dimension (:), intent(inout)  list,
integer, dimension (:), intent(out)  order 
)

Sort integer array "list" and returns array of original positions (order). Wrapper to quick_sort().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine smooth_grid_routines::set_base ( )

This subroutine sets the base() derived quantities basediv() and basemask().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine smooth_grid_routines::stop_prc ( )

Exits process.

Here is the caller graph for this function:

Variable Documentation

real(kind=real64), dimension(:), allocatable smooth_grid_routines::age_lib
Parameters
age_libAges of stellar populations in the input stellar library file.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::agestar
Parameters
agestarAge of the stellar particles in the Nbody/SPH simulation file (file_nbody_sph() ).
integer, dimension(2) smooth_grid_routines::base
Parameters
base(2)This array contains only two elements. The first is the subdivision factor for the root cell and the second is the subdivision factor for all subsequent subdivisions.
integer (kind = int64), dimension(2) smooth_grid_routines::basediv
Parameters
basediv(2)This array contains two elements equal to the minimum power of two which is bigger than the corresponding values in base(). It is used to transform the binary code in cindex() in the explicit tree coordinate of a cell.
real(kind=real64), dimension(2) smooth_grid_routines::baseinv
Parameters
baseinvThis is equal to base()^-1. It is used when deriving the cell sizes.
integer, dimension(2) smooth_grid_routines::basemask
Parameters
basemask(2)This is equal to basediv()-1. It is used in the same routines as basediv.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::cal_temp
Parameters
cal_tempTemperature read from the input tables for the specific enthalpy / heat capacity.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::carea_arr
Parameters
carea_arr(0: max_lvl()) Array of precalculated cell areas depending on cell subdivision level.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::cchild
Parameters
cchild(0: tot_ncell()-1) For each element "i", this array gives the ID number of the first cell in the set of child cells derived from the cell "i". If the cell "i" is a leaf cell, cchild(i) = -1.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::cchild_or
Parameters
cchild_or(0: tot_ncell()-1) This is the cchild array of the grid before the reduction of grid resolution is applied.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::ccoord
Parameters
ccoord(3,0: tot_ncell()-1) Two dimensional array containing the 3D position (x,y,z) of the centre for each cell.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::ccoord_obs
Parameters
ccoord_obs(3,0tot_ndir_in()-1) Array containing the internal observer positions.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::ccoord_p_src
Parameters
ccoord_p_src(3,0: tot_p_src()-1) Array containing the positions of the point sources.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::cell_src
Parameters
cell_src(0: tot_p_src()-1) Array containing the ID number of the cells hosting each point source.
integer(kind=int64), dimension(:), allocatable, target smooth_grid_routines::cindex
Parameters
cindex(0: tot_ncell()-1) This array contains a binary code specifying the position of the cell in the cell tree
real(kind=real64), dimension(:), allocatable smooth_grid_routines::csize
Parameters
csize(0: tot_ncell()-1) This array contains the size of each cell.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::csize_arr
Parameters
csize_arr(0: max_lvl()) Array of precalculated cell sizes depending on cell subdivision level.
real(kind=real64), parameter smooth_grid_routines::cspeed =2.99792458E8
Parameters
cspeedLight speed in [m/s].
real(kind=real64), dimension(:), allocatable smooth_grid_routines::cvol_arr
Parameters
cvol_arr(0: max_lvl()) Array of precalculated cell volumes depending on cell subdivision level.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::delta_dust_size
Parameters
delta_dust_size(0: n_dust_comp()-1, 0:n_dust_maxsize_fa-1) Array containing the bin widths for integrations over the size distribution. Values for n_dust_comp chemical species and n_dust_maxsize_fa size distribution values.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::delta_lambda_bin
Parameters
delta_lambda_bin(0lnum()-1) Array containing the wavelength bin widths for integration over wavelength. Note that the bins are all containing the lambda_arr_SI() values, except the edges. In those cases the bins are either extending to the right of the lambda_arr_SI() value (for the lowest values of lambda_arr_SI()) or to the left (for the highest value). Look at the following ("|" are the wavelength grid points and "--", "__" denote a full bin. At the edges only the right or left part of the bin are considered): |-_|_-|-_|_-|-_|_-|. Note that the non-edge bin sizes are not necessarily the same. At the moment, they are the same in log space.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::delta_lambda_bin_dust
Parameters
delta_lambda_bin_dustSame as delta_lambda_bin() but only for the wavelength range covered by the dust emission (determined by lambda_arr() and min_lambda_dust()).
real(kind=real64), dimension(:), allocatable smooth_grid_routines::delta_lambda_bin_hd_dust
Parameters
delta_lambda_HD_dustWavelength bin sizes corresponding to lambda_arr_SI_HD_dust()
real(kind=real64), dimension(:), allocatable smooth_grid_routines::delta_lambda_bin_stars
Parameters
delta_lambda_bin_starsSame as delta_lambda_bin() but only for the wavelength range covered by the stellar emission (determined by lambda_arr() and max_lambda_stars()).
real(kind=real64), dimension(:), allocatable smooth_grid_routines::dens
Parameters
dens(0: tot_ncell()-1) This array contains the extinction coefficient for each cell (in units of length ^ -1).
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dens_arr
Parameters
dens_arr(0: lnum() -1, 0 : tot_ncell()-1) This array contains the extinction coefficient for each cell (in units of length ^ -1) and for all wavelengths.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::dens_ref
Parameters
dens_ref(0: tot_ncell()-1) This array contains the extinction coefficient for each cell (in units of length ^ -1) at a reference wavelength. WARNING: Just after reading the main grid (in read_main_grid()), dens_ref is equal to the dens() array in grid_file(). However, the values inside this array can be varied in the user defined routines if needed.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::dens_stars
Parameters
dens_stars(0: tot_ncell()-1) This array contains the radiation source volume emissivity (in units of luminosity/volume) for each grid cell at a single wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dens_stars_arr
Parameters
dens_stars_arr(0lnum() -1, 0 : tot_ncell()-1) This array contains the radiation source volume emissivity (in units of luminosity/volume) for each grid cell at all wavelengths. In the case of the dust RT algorithm, it contains only the luminosity still to be propagated through the RT model.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dens_stars_arr_prev
Parameters
dens_stars_arr_prev(0lnum() -1, 0 : tot_ncell()-1) Dust emission volume emissivity. It is used to store the total dust emissivity derived in the last dust heating iteration. When the emissivity does not differ more than a factor conv_en_lim() from the newly calculated dust emissivity, the dust heating iterations are stopped.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::dens_stars_ref
Parameters
dens_stars_ref(0: tot_ncell()-1) This array contains the radiation source volume emissivity (in units of luminosity/volume) for each grid cell at the reference wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dir_i_out
Parameters
dir_i_out(0tot_ndir()-1,2) Array containing the theta and phi angles specifying the line-of-sight directions towards the observers.
integer, parameter smooth_grid_routines::dt_eff = 0
Parameters
dt_effInteger variable corresponding to dust_heating_type() = 'eff'
integer, parameter smooth_grid_routines::dt_equ = 1
Parameters
dt_equInteger variable corresponding to dust_heating_type() = 'equ'
integer, parameter smooth_grid_routines::dt_none = -1
Parameters
dt_noneInteger variable corresponding to dust_heating_type() = 'not_provided'. In this case, no dust heating/emission calculation is performed.
integer, parameter smooth_grid_routines::dt_sto = 2
Parameters
dt_stoInteger variable corresponding to dust_heating_type() = 'sto'
integer, parameter smooth_grid_routines::dt_sto_lib = 3
Parameters
dt_sto_libInteger variable corresponding to dust_heating_type() = 'sto_lib'
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dust_fa
Parameters
dust_fa(0: n_dust_comp()-1,0:n_dust_maxsize_fa-1) Array containing the grain size distribution for n_dust_comp() chemical species and up to n_dust_maxsize_fa() sizes (different grain species might have grain size sampling).
character (len=20) smooth_grid_routines::dust_heating_type
Parameters
dust_heating_typeType of dust heating. Choices are: 'eff' (effective single grain. Equilibrium dust temperature/emission calculated for a single grain with average opacity parameters); 'equ' (Equilibrium dust temperature/emission calculated for each grain specified by the input grain size distributions); 'sto' (Full non-equilibrium dust temperature/emission calculation for all grains specified by the input grain size distributions); 'sto_lib' (As 'sto' but using the adaptive SED library approach of Natale et al. (2015)).
integer smooth_grid_routines::dust_heating_type_id
Parameters
dust_heating_type_IDInteger variable corresponding to the value of dust_heating_type().
character (len=lcar) smooth_grid_routines::dust_model
Parameters
dust_modelName of dust model to be used. Choices: 'TRUST' for TRUST benchmark project, 'DraineLi06' for dust model of Draine & Li (2006), 'user' for user defined chemical composition and size distributions. For the standard choices ('TRUST', 'DraineLi06') there is no need to specify dust_opacity_model().
character (len=lcar) smooth_grid_routines::dust_opacity_tables
Parameters
dust_opacity_tables$Q_\lambda$ opacity and $g_\lambda$ tables to be used. If a standard dust_model() is selected ('TRUST', 'DraineLi06'), there is no need to input this variable. If dust_model() = 'user', this variable is required. Choices are: 'DraineLi06' (same grain opacities as in the Draine & Li 2007 model); 'TRUST' (same opacities as in the TRUST benchmark project); 'user' (user-provided tables). In the latter case, specify the input tables in file_q_gra(), file_q_sil(), file_q_pah_neu() and file_q_pah_ion() (at least one table to be input). Also specify the corresponding size distributions in file_gra_fa(), file_sil_fa(), file_pah_neu_fa() and file_pah_ion_fa().
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dust_size_fa
Parameters
dust_size_fa(0: n_dust_comp()-1,0:n_dust_maxsize_fa-1) Array containing the grain sizes for the grain size distribution in dust_fa().
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::dust_size_qabs
Parameters
dust_size_qabs(0: n_dust_comp()-1,0:n_dust_maxsize_qabs-1) Array containing grain sizes for each value of qabs_arr_in().
real(kind=real64), dimension(:), allocatable smooth_grid_routines::fehgas
Parameters
fehgas[Fe/H] of the gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), dimension(:), allocatable smooth_grid_routines::fehstar
Parameters
fehstar[Fe/H] of the stellar particles in the Nbody/SPH simulation file (file_nbody_sph() ).
character(len=lcar) smooth_grid_routines::file_lambda_list
Parameters
file_lambda_listName of the file containing the wavelength list
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::gascoord
Parameters
gascoordCoordinates of the gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), dimension(:), allocatable smooth_grid_routines::gastemp
Parameters
gastempTemperature of the gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), dimension(0:max_n_dust_cal_type-1) smooth_grid_routines::grain_density_arr
Parameters
grain_density_arrGrain density in g/cm^3 in the input files for the grain specific enthalpy/ specific capacity (see file_calorimetry_Gra() and file_calorimetry_Sil()).
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::grain_enthalpy
Parameters
grain_enthalpySpecific enthalpy values read in the input files (either standard TRUST Calorimetry files or user provided).
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::grain_heat_capacity
Parameters
grain_heat_capacitySpecific heat capacity values read in the input files (either standard TRUST Calorimetry files or user provided).
logical smooth_grid_routines::grid_creation
Parameters
grid_creationTRUE when subroutines are used by the grid creation programs.
logical smooth_grid_routines::grid_creation_lambda
Parameters
grid_creation_lambdaTRUE when subroutines are used by the grid creation programs for the calculation of the lambda grids.
real (kind=real64) smooth_grid_routines::gsca
Parameters
gscaParameter of the Heney-Greeinstein function at a single wavelength.
real (kind=real64), dimension(:), allocatable smooth_grid_routines::gsca_arr
Parameters
gsca_arr(0: lnum()-1) Array containing gsca() at all wavelengths.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::gsca_arr_fa
Parameters
gsca_arr_faSame as qabs_arr_fa() but for gsca.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::gsca_arr_in
Parameters
gsca_arr_in(0: n_dust_comp()-1,0:n_dust_maxsize_qabs-1,0: lnum_tot()-1) Same as qabs_arr() but for gsca.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::gsca_ref_fa
Parameters
gsca_ref_faSame as gsca_arr_fa() but for reference wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::gsca_ref_in
Parameters
gsca_ref_inSame as gsca_arr_in() but for reference wavelength.
real(kind=real64), parameter smooth_grid_routines::halfpi =asin(1.)
Parameters
halfpiπ/2
real(kind=real64), parameter smooth_grid_routines::hplanck = 6.62606957E-34
Parameters
hplanckPlanck constant in [J s]
integer, dimension(0:1) smooth_grid_routines::i_lambda_dust
Parameters
i_lambda_dust(0:1)Initial and final indeces of the dust emission wavelength grid within lambda_arr().
integer, dimension(0:1) smooth_grid_routines::i_lambda_stars
Parameters
i_lambda_stars(0:1)Initial and final indeces of the stellar emission wavelength grid within lambda_arr().
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::i_obs
Parameters
i_obs(0:tot_sources-1,0tot_ndir()-1) with tot_sources = tot_ncell()+ tot_p_src(). Array containing, for each cell and point source, the monochromatic specific intensity received by the observers located outside and far-away from the model along the specified line-of-sight directions in file_dir_out().
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::i_obs_arr
Parameters
i_obs_arr(0lnum()-1, 0:tot_sources-1,0: tot_ndir()-1) with tot_sources = tot_ncell()+ tot_p_src(). Array containing, for each cell, wavelength and point source, the specific intensity received by the observers located outside and far-away from the model along the specified line-of-sight directions in file_dir_out().
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::i_obs_arr_dir
Parameters
i_obs_arr_dir(0lnum()-1, 0:tot_sources-1,0: tot_ndir()-1) with tot_sources = tot_ncell()+ tot_p_src(). Same as i_obs_arr() but containing only the direct light from the sources. Used in the dust RT algorithms to distinguish the direct and scattered light in the successive dust heating iterations.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::i_obs_arr_tot
Parameters
i_obs_arr_tot(0lnum()-1, 0:tot_sources-1,0: tot_ndir()-1) with tot_sources = tot_ncell()+ tot_p_src(). Same as i_obs_arr() but used in the dust RT algorithms to accumulate the values of i_obs_arr() from the different dust heating iterations
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::i_obs_dust
Parameters
i_obs_dust(nl,0: tot_ncell()-1) with nl=size[ ind_i_obs()]. Array containing the dust emission specific intensity reaching the observer. Dust emission is considered optically thin (for the moment), so the specific intensity is not direction dependent.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::i_obs_in
Parameters
i_obs_in(0:tot_sources-1,0tot_ndir_in()-1) with tot_sources = tot_ncell() + tot_p_src(). Array containing, for each cell and point source, the monochromatic specific intensity received by the internal observers.
real(kind=real64), dimension(:,:, :), allocatable smooth_grid_routines::i_obs_in_arr
Parameters
i_obs_in_arr(0: lnum() -1, 0:tot_sources-1,0: tot_ndir_in()-1) with tot_sources = tot_ncell() + tot_p_src(). Array containing, for each cell, wavelength and point source, the specific intensity received by the internal observers.
real(kind=real64), dimension(:,:, :), allocatable smooth_grid_routines::i_obs_in_arr_dir
Parameters
i_obs_in_arr_dir(0: lnum() -1, 0:tot_sources-1,0: tot_ndir_in()-1) with tot_sources = tot_ncell() + tot_p_src(). As i_obs_arr_dir() but for the internal observers.
real(kind=real64), dimension(:,:, :), allocatable smooth_grid_routines::i_obs_in_arr_tot
Parameters
i_obs_in_arr_tot(0: lnum() -1, 0:tot_sources-1,0: tot_ndir_in()-1) with tot_sources = tot_ncell() + tot_p_src(). As i_obs_arr_tot() but for the internal observers.
integer smooth_grid_routines::id_mpi
Parameters
id_mpiID number of the local MPI process.
integer, dimension(:), allocatable smooth_grid_routines::iq_ct_table
Parameters
iq_ct_tableIndices associating each grain species with the corresponding specific enthalpy/ heat capacity table.
logical, dimension(0:max_n_dust_comp-1) smooth_grid_routines::iq_dust_model
Parameters
iq_dust_modelElements equal to TRUE when the size distributions for the following grain species are used: Graphite, Silicates, neutral PAH molecules and ionized PAH molecules. Values set in check_input(). At least one element has to be TRUE for user defined grain size distribution.
real (kind=real64) smooth_grid_routines::kabs
Parameters
kabsDust absorption coefficient at a single wavelength.
real (kind=real64), dimension(:), allocatable smooth_grid_routines::kabs_arr
Parameters
kabs_arr(0: lnum()-1) Array containing kabs() at all wavelengths. During the calculation this is in the form of cross section per grain ([m^2]).
real(kind=real64), parameter smooth_grid_routines::kboltz =1.3806488E-23
Parameters
kboltzBoltzmann constant in [J/K]
real (kind=real64) smooth_grid_routines::kext
Parameters
kextDust extinction coefficient at a single wavelength.
real (kind=real64), dimension(:), allocatable smooth_grid_routines::kext_arr
Parameters
kext_arr(0: lnum()-1) Array containing kext() at all wavelengths. During the calculation this is in the form of cross section per grain ([m^2]).
real (kind=real64) smooth_grid_routines::kext_ref
Parameters
kext_refDust extinction coefficient at the reference wavelength.
integer smooth_grid_routines::kp_maps
Parameters
kp_mapsParameter determining the number of pixels npix_maps() on the internal observer surface brightness map. This is equal to 12*2**(2* kp_maps()).
real (kind=real64) smooth_grid_routines::ksca
Parameters
kscaDust scattering coefficient at a single wavelength.
real (kind=real64), dimension(:), allocatable smooth_grid_routines::ksca_arr
Parameters
ksca_arr(0: lnum()-1) Array containing ksca() at all wavelengths. During the calculation this is in the form of cross section per grain ([m^2]).
real (kind=real64), dimension(:), allocatable smooth_grid_routines::ksca_arr_norm
Parameters
ksca_arr_norm(0: lnum()-1) Array containing normalized ksca() (ksca()/kext, that is, the albedo) at all wavelengths.
real(kind=real64) smooth_grid_routines::lambda
Parameters
lambdaWavelength variable
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr
Parameters
lambda_arr(0: lnum()-1) Array containing the wavelength list read from file_lambda_list()
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr_maps
Parameters
lambda_arr_maps(0: lnum()-1) Array containing the wavelengths for which the surface brightness maps are calculated.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr_si
Parameters
lambda_arr_SI(0: lnum()-1) Array containing the wavelength list lambda_arr() transformed into SI units.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr_si_bin
Parameters
lambda_arr_SI_bin(0: lnum()-2) Array containing the wavelength bin average value for integration over wavelength. By "wavelength bins" it is meant the bins defined by the lambda_arr_SI() array.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr_si_hd_dust
Parameters
lambda_arr_SI_HD_dustFine wavelength grid in the infrared range. Used to calculate wavelength integrated quantities which are independent on the input wavelength grid.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_arr_si_hd_dust_bin
Parameters
lambda_arr_SI_HD_dust_binCentral wavelength of the bins determined by lambda_arr_SI_HD_dust().
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lambda_lib
Parameters
lambda_libWavelength array in the input stellar library file (in microns). See file_stellar_library() and stellar_library().
real(kind=real64) smooth_grid_routines::lambda_ref
Parameters
lambda_refReference wavelength. It is used to scale the dens array at each wavelength. In case use_lambda_grid() is set, the lambda grid corresponding to the reference wavelength should be included in the input.
real(kind=real64) smooth_grid_routines::lambda_ref_si
Parameters
lamdba_ref_SIReference wavelength in SI units [m].
integer, parameter smooth_grid_routines::lcar =200
Parameters
lcarParameter equal to the maximum number of characters for string variables.
logical smooth_grid_routines::limit_scattering_iterations
Parameters
limit_scattering_iterationsTRUE if a maximum number of iterations has to be set using max_sca_iterations()
integer smooth_grid_routines::lnum
Parameters
lnumNumber of wavelengths. Note that this value can change. For example, it is lnum_stars() during the RT calculation for the stellar emission and lnum_dust during the RT calculation for the dust emission.
integer smooth_grid_routines::lnum_dust
Parameters
lnum_dustNumber of wavelengths for dust emission wavelength grid.
integer smooth_grid_routines::lnum_stars
Parameters
lnum_starsNumber of wavelengths for stellar emissivity grids.
integer smooth_grid_routines::lnum_tot
Parameters
lnum_totTotal number of wavelengths in the input wavelength grid.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::lock_cell
Parameters
lock_cell(0: tot_ncell()-1) Array used to lock cells so there is no race condition happening in process_scatt_temp()
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lum_p_src
Parameters
lum_p_src(0: tot_p_src()-1) Array containing the luminosities of each point source at a single wavelength
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::lum_p_src_arr
Parameters
lum_p_src_arr(0: lnum() -1 , 0 : tot_p_src()-1) Array containing the luminosities of each point source for each wavelength.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::lum_p_src_ref
Parameters
lum_p_src_ref(0: tot_p_src()-1) Array containing the luminosities of each point source at the reference wavelength
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::lum_to_mass_int
Parameters
lum_to_mass_int(0lnum_tot()-1, 0: nages_lib()-1, 0: nmet_lib()-1) Stellar luminosity-to-mass ratio values loaded from the input stellar library file and interpolated at the same wavelengths as in lambda_arr().
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::lum_to_mass_lib
Parameters
lum_to_mass_lib(0:lambda_lib()-1,0:nages_lib-1,0:nmet_lib-1)Stellar luminosity-to-mass ratio values loaded from the input stellar library file.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::lumcell
Parameters
lumcell(0: lnum() -1 , 0 : tot_ncell()-1) Array containing the total luminosity of each cell and wavelength.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::lvl
Parameters
lvl(0: tot_ncell() -1) This array contains the subdivision level for each cell.
real(kind=real64), parameter smooth_grid_routines::m_h = 1.6605402e-27
Parameters
m_hAtomic mass unit in [kg]
logical smooth_grid_routines::main_prc
Parameters
main_prcEqual to TRUE if id_mpi = 0
real(kind=real64), dimension(:,:,:,:), allocatable smooth_grid_routines::map_arr_out
Parameters
map_arr_out(x,y,lambda,direction)External observer surface brightness maps at the stellar emission or dust emission wavelengths stored in the local i_obs_arr() for all observer line-of-sight.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::map_in_arr_out
Parameters
map_in_arr_out(line-of-sightID,lambda, observer) Internal observer surface brightness maps at the stellar emission or dust emission wavelengths stored in the local i_obs_in_arr() for all observer positions.
real(kind=real64) smooth_grid_routines::map_size_factor
Parameters
map_size_factorThe linear size of the external observer maps is equal to map_size_factor* modelsize(). Map_size_factor cannot be less than 0.2. However, a factor of at least 1.8 is suggested to avoid the possibility of cells not projected within the observer map. Note that if the i_obs array files are printed on disk, the maps can be recalculated using the 'sed' RT algorithm.
real(kind=real64) smooth_grid_routines::max_dlum
Parameters
max_dlumMaximum luminosity allowed for the leaf cells relative to the total grid luminosity (which is calculated in user defined routines).
real(kind=real64) smooth_grid_routines::max_dtau
Parameters
max_dtauMaximum optical depth allowed for the leaf cells in the grid creation program.
real(kind=real64) smooth_grid_routines::max_lambda_stars
Parameters
max_lambda_starsMaximum wavelength used for the stellar emission wavelength grid. If not input, the code will consider all wavelengths in the input wavelength grid for the stellar emission RT calculation.
integer (kind=int32) smooth_grid_routines::max_lvl
Parameters
max_lvlMaximum number of cell subdivisions
integer, parameter smooth_grid_routines::max_n_dust_cal_type = 2
Parameters
max_n_dust_cal_typeMaximum number of dust types for the input specific enthalphy files. At the moment there are only two types that can be specified: Graphite dust (including PAHs) and Silicates dust. See file_calorimetry_Gra(), file_calorimetry_Sil() and load_cT_hT_tables().
integer, parameter smooth_grid_routines::max_n_dust_comp = 4
Parameters
max_n_dust_compMaximum number of dust species allowed in the input (corresponding to Silicates, Graphite, Neutral PAH and ionized PAH).
integer (kind=int32) smooth_grid_routines::max_ncell
Parameters
max_ncellMaximum number of cells allowed in the grid creation program
integer smooth_grid_routines::max_sca_iterations
Parameters
max_sca_iterationsMaximum number of scattering iterations. It requires limit_scattering_iterations() = .TRUE.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::met_lib
Parameters
met_libMetallicity array in the input stellar library file. See file_stellar_library() and stellar_library().
real(kind=real64), dimension(:), allocatable smooth_grid_routines::mgas
Parameters
mgasMass of the gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64) smooth_grid_routines::min_lambda_dust
Parameters
min_lambda_dustMinimum wavelength in the dust emission wavelength grid. If not input, the code sets default value min_lambda_dust = 1 micron.
integer (kind=int32) smooth_grid_routines::min_lvl
Parameters
min_lvlMinimum number of cell subdivisions
real(kind=real64) smooth_grid_routines::modelsize
Parameters
modelsizeSize of the model (that is, size of the root cell)
real(kind=real64), dimension(:), allocatable smooth_grid_routines::mstar
Parameters
mstarMass of the stellar particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), parameter smooth_grid_routines::msun =1.9892000e+30
Parameters
msunSolar mass in [kg]
integer smooth_grid_routines::n_dust_comp
Parameters
n_dust_compNumber of dust chemical species in the assumed dust model.
integer smooth_grid_routines::n_dust_maxsize_fa
Parameters
n_dust_maxsize_faMaximum number of grain size distribution values in the input size distribution array for the assumed dust model. The actual number can vary depending on the grain chemical composition.
integer smooth_grid_routines::n_dust_maxsize_qabs
Parameters
n_dust_maxsize_qabsMaximum number of sizes in the input Qabs array for the assumed dust model. The actual number can vary depending on the grain chemical composition.
integer, dimension(:), allocatable smooth_grid_routines::n_dust_size
Parameters
n_dust_size(0n_dust_comp()-1) Array containing the number of grain sizes in the input size distribution arrays. Values for n_dust_comp chemical compositions.
integer, dimension(0:max_n_dust_comp-1) smooth_grid_routines::n_dust_size_qabs
Parameters
n_dust_size_qabs(0max_n_dust_comp()-1) Array containing the number of grain sizes in the input $Q_\lambda$, $g_\lambda$ tables. The values correspond to the following grain compositions (in order): Graphite, Silicates, neutral PAHs and ionized PAHs.
integer, dimension(0:max_n_dust_cal_type-1) smooth_grid_routines::n_dust_temp_cal
Parameters
n_dust_temp_calNumber of dust temperatures in the input files for the grain specific enthalpy/ specific capacity (see file_calorimetry_Gra() and file_calorimetry_Sil()).
integer smooth_grid_routines::n_dust_wave_qabs
Parameters
n_dust_wave_qabsNumber of wavelengths in the input $Q_\lambda $, $g_\lambda$ tables for the assumed dust_model() and dust_opacity_tables().
integer smooth_grid_routines::n_int_rf_bins
Parameters
n_int_rf_binsNumber of integrated UV (or optical) energy bins to be used in the SED adaptive approach for the calculation of the stochastically heated dust emission. Note that the total number of bins is equal to the square of this input variable.
integer, parameter smooth_grid_routines::n_temp_planck = 100
Parameters
n_temp_planckNumber of temperatures considered in the calculation of the Planck averaged Qabs (see qabs_arr_planck())
integer smooth_grid_routines::nage_lib
Parameters
nage_libNumber of stellar ages in the input stellar library file. See age_lib().
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::ncell
Parameters
ncell(0: tot_ncell() -1) Array of cell ID numbers
integer (kind=int32) smooth_grid_routines::ncurr
Parameters
ncurrCounter of cell number in grid creation program
integer smooth_grid_routines::nlambda_lib
Parameters
nlambda_libNumber of wavelengths in the input stellar library file (see lambda_lib().
integer (kind=int32) smooth_grid_routines::nlevel
Parameters
nlevelCounter of sudivision levels in grid creation program
integer smooth_grid_routines::nmet_lib
Parameters
nmet_libNumber of metallicities in the input stellar library file. See met_lib().
integer smooth_grid_routines::np_mpi
Parameters
np_mpiNumber of MPI processes.
integer smooth_grid_routines::npix_maps
Parameters
npix_mapsNumber of pixel on the internal observer surface brightness maps. npix_maps = 12*2**(2* kp_maps())
integer smooth_grid_routines::npixel_maps
Parameters
npixel_mapsNumber of pixels for each side of the external observer maps.
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::nstart
Parameters
nstart(0: max_lvl()+2) This array counts the number of cells for each subdivision loop in the grid creation program.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::ofegas
Parameters
ofegas[O/Fe] of the gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), parameter smooth_grid_routines::parsec =3.08567758E16
Parameters
parsecparsec in [m].
real(kind=real64), parameter smooth_grid_routines::parsec_cgs =3.08567758E18
Parameters
parsec_cgsparsec in [cm].
integer, dimension(:), allocatable smooth_grid_routines::pcell_gas
Parameters
pcell_gasID of the grid cell to which each gas particles belong.
integer, dimension(:), allocatable smooth_grid_routines::pcell_star
Parameters
pcell_starID of the grid cell to which each star particles belong.
real(kind=real64), parameter smooth_grid_routines::pi =2*halfpi
Parameters
piπ
logical smooth_grid_routines::print_maps
Parameters
print_mapsTRUE if surface brightness maps for the external observers have to be calculated and printed.
logical smooth_grid_routines::print_maps_in
Parameters
print_maps_inTRUE if surface brightness maps for the internal observers have to be calculated and printed.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::psel_av_arr
Parameters
psel_av_arr(0iterations_dustem-1, 0 : iterations() , 0 : tot_ncell() + tot_p_src()-1) Array containing the average ray path for each cell and for each direct light/scattered light iteration. Note that the array is expanded in expand_psel_av_arr().
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qabs_arr_fa
Parameters
qabs_arr_fa(0: n_dust_comp()-1,0:n_dust_maxsize_fa-1,0: lnum()-1) Array containing the Qabs values interpolated to the same grain sizes of the size distribution in dust_size_fa(). Although the array second dimension is n_dust_maxsize_fa, for each grain species "i" only n_dust_size(i) grain sizes are included in this array.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qabs_arr_in
Parameters
qabs_arr_in(0: n_dust_comp()-1,0:n_dust_maxsize_qabs-1,0: lnum_tot()-1) Array of Q_abs values for n_dust_comp dust() chemical species, n_dust_maxsize_qabs() dust sizes and lnum_tot() wavelengths. Note that these values are not interpolated at the same grain sizes of the input grain size distribution.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qabs_arr_planck
Parameters
qabs_arr_planck(0: n_dust_comp()-1,0:n_dust_maxsize_fa-1,0: n_temp()-1) Array containing the planck averaged Qabs values interpolated to the same grain sizes of the size distribution in dust_size_fa(). Although the array second dimension is n_dust_maxsize_fa, for each grain species "i" only n_dust_size(i) grain sizes are included in this array.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qabs_ref_fa
Parameters
qabs_ref_faSame as qabs_arr_fa() but for reference wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qabs_ref_in
Parameters
qabs_ref_inSame as qabs_arr_in() but for reference wavelength.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qext_arr_fa
Parameters
qext_arr_faSame as qabs_arr_fa() but for Qext.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qext_arr_in
Parameters
qext_arr_in(0: n_dust_comp()-1,0:n_dust_maxsize_qabs-1,0: lnum_tot()-1) Same as qabs_arr() but for Qext.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qext_ref_fa
Parameters
qext_ref_faSame as qext_arr_fa() but for reference wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qext_ref_in
Parameters
qext_ref_inSame as qext_arr_in() but for reference wavelength.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qsca_arr_fa
Parameters
qsca_arr_faSame as qabs_arr_fa() but for Qsca.
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::qsca_arr_in
Parameters
qsca_arr_in(0: n_dust_comp()-1,0:n_dust_maxsize_qabs-1,0: lnum_tot()-1) Same as qabs_arr() but for Qsca.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qsca_ref_fa
Parameters
qsca_ref_faSame as qsca_arr_fa() but for reference wavelength.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::qsca_ref_in
Parameters
qsca_ref_inSame as qsca_arr_in() but for reference wavelength.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::scaspe
Parameters
scaspe(0npix()-1, 0: tot_ncell()-1 ) with npix = max (npix_arr()), with npix_arr including only the values for the wavelength used in the RT calculation (it differs for the stellar and dust RT). Array containing the monochromatic scattered luminosity for each cell to be processed, propagating in a set of npix directions.
type(var_arr_2d), dimension(:), allocatable smooth_grid_routines::scaspe_arr
Parameters
scaspe_arr(0:lnum()-1). Array containing the scattered luminosity (for each cell and wavelength) to be processed, propagating in a set of npix_arr directions. This is a variable size array (see data type var_arr_2d() ). The dimension of each block depends on the wavelength through npix_arr().
real (kind=real64), dimension(:,:), allocatable smooth_grid_routines::scaspe_prev
Parameters
scaspe_prev(0:npix-1,0:tot_ncell-1)with npix=npix_arr(i). It stores the values of scaspe() before each scattering iteration. Used for 2D RT algorithm and sequential scattering mode.
type(var_arr_2d), dimension(:), allocatable smooth_grid_routines::scaspe_prev_arr
Parameters
scaspe_prev_arr(0:lnum-1).It stores the values of scaspe_arr() before each scattering iteration for all wavelengths. Used for 2D RT algorithm and sequential scattering mode.
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::scaspe_tot
Parameters
scaspe_tot(0: npix - 1, 0: tot_ncell()-1) with npix=12* nside_sca()^2+ tot_ndir_scaspe(). Array containing the total scattered radiation luminosity, for each cell and at a single wavelength, propagating in a set of directions. This array can be used to recover the scattered luminosity source function and make maps at arbitrary directions, including those not initially considered in the main RT calculation.
type(var_arr_2d), dimension(:), allocatable smooth_grid_routines::scaspe_tot_arr
Parameters
scaspe_tot_arr(0:lnum()-1)%a(0:npix_arr(i)-1,0:tot_ncell-1).Array containing the total scattered radiation luminosity, for each cell and wavelength, propagating in a set of directions. This array can be used to recover the scattered luminosity source function and make maps at arbitrary directions, including those not initially considered in the main RT calculation.
real(kind=real64), parameter smooth_grid_routines::sigmasb = 5.67036713E-8
Parameters
sigmaSBStefan-Boltzmann constant in [W/m^2/K^4]
real(kind=real64) smooth_grid_routines::size_map
Parameters
size_mapSize of each side of the output surface brightness maps for the external observer. This is map_size_factor() times modelsize(). Value saved in the output file_map().
integer (kind=int32), dimension(:), allocatable smooth_grid_routines::src_cell
Parameters
src_cell(0: tot_ncell()-1) Array containing the ID number of the point source hosted in each cell. If no sources are hosted by a cell, src_cell = -1.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::star_lum
Parameters
star_lumStellar particle luminosity in erg/s/Hz
real(kind=real64), dimension(:,:), allocatable smooth_grid_routines::starcoord
Parameters
starcoordCoordinates of the stellar particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), dimension(:), allocatable smooth_grid_routines::t_arr_planck
Parameters
T_arr_planckTemperature array used in the calculation of qabs_arr_planck()
real (kind=real64) smooth_grid_routines::tau_nh
Parameters
tau_nhOptical depth per unit Hydrogen column density (typically in units of tau*H/cm^2). Used when calculating dust emission.
real (kind=real64) smooth_grid_routines::tau_nh_ref
Parameters
tau_nh_refAs tau_nh but at a reference wavelength
real(kind=real64), dimension(:,:,:), allocatable smooth_grid_routines::tot_dust_em_sed
Parameters
tot_dust_em_sedDust emission sed library in [W/m/H] calculated during the SED adaptive library approach
real(kind=real64) smooth_grid_routines::tot_dust_mass
Parameters
tot_dust_massTotal dust mass in the RT model.
real(kind=real64) smooth_grid_routines::tot_gas_mass
Parameters
tot_gas_massTotal gas mass in the RT model.
integer smooth_grid_routines::tot_gas_particles
Parameters
tot_gas_particlesNumber of gas particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64) smooth_grid_routines::tot_n_dust
Parameters
tot_n_dustTotal number of dust grains in the assumed dust model. Needed to convert e.g. kext() from cross_section per grain to optical depth per hydrogen surface density (as e.g. tau_nh_ref()).
integer (kind=int32) smooth_grid_routines::tot_ncell
Parameters
tot_ncellTotal number of cells in the grid
integer (kind=int32) smooth_grid_routines::tot_ncell_p_src
Parameters
tot_ncell_p_srcTotal number of cells in the grid plus number of point sources
integer (kind=int32) smooth_grid_routines::tot_ndir
Parameters
tot_ndirTotal number of line-of-sight direction specified in the input file_dir_out
integer (kind=int32) smooth_grid_routines::tot_ndir_in
Parameters
tot_ndir_inTotal number of observer position within the RT model specified in the input file_pos_obs
integer (kind=int32) smooth_grid_routines::tot_ndir_scaspe
Parameters
tot_ndir_scaspeTotal number of line-of-sight direction elements included in the scaspe array
integer (kind=int32) smooth_grid_routines::tot_p_src
Parameters
tot_p_srcTotal numer of point sources specified in the input file_p_src
integer (kind=int32) smooth_grid_routines::tot_spare_cells
Parameters
tot_spare_cellsThis variable is equal to the difference between the total number of leaf cells in the original grid and the total number of leaf cells in the grid after the reduction in resolution has been applied. See reduce_grid_res().
integer smooth_grid_routines::tot_star_particles
Parameters
tot_star_particlesNumber of stellar particles in the Nbody/SPH simulation file (file_nbody_sph() ).
real(kind=real64), parameter smooth_grid_routines::twopi = 2*pi
Parameters
twopi
real(kind=real64), parameter smooth_grid_routines::twothird =2./3.
Parameters
twothird2./3.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::u_fest
Parameters
u_fest(0: tot_ncell()-1) This array contains the lower limit of the radiation field energy density for each cell and for a single wavelength.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::u_fest_arr
Parameters
u_fest_arr(0: lnum() -1, 0 : tot_ncell()-1) This array contains the lower limit of the radiation field energy density for each cell and for each wavelength.
real(kind=real64), dimension(:), allocatable smooth_grid_routines::u_final
Parameters
u_final(0: tot_ncell()-1) This array contains the radiation field energy density for each cell and for a single wavelength.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::u_final_arr
Parameters
u_final_arr(0: lnum() -1 , 0 : tot_ncell()-1) This array contains the radiation field energy density for each cell and for each wavelength.
real(kind=real64), dimension(:, :), allocatable smooth_grid_routines::u_final_uv_opt
Parameters
u_final_uv_opt(0: lnum_stars() -1 , 0 : tot_ncell()-1) This array contains the radiation field energy density for each cell and for each wavelengthproduced by the stellar emission. It is used in the dust emission RT calculation to derived the energy absorbed by the dust. Note that this array is transformed into the radiation field average intensity in calc_conv_ufield_ifield().
character (len=20) smooth_grid_routines::units_csize
Parameters
units_csizeUnits of grid cell sizes. The only possible choice is 'pc'. A reminder!
character (len=20) smooth_grid_routines::units_i_obs
Parameters
units_i_obsUnits of i_obs() arrays (used in sum_i_obs()).
character (len=20) smooth_grid_routines::units_lambda
Parameters
units_lambdaUnits for the input wavelength array. The only choice is 'um' (microns). This is more like a reminder than an input parameter.
character (len=20) smooth_grid_routines::units_luminosity
Parameters
units_luminosityUnits of input stellar emission luminosity. Choices are 'erg/s/Hz', 'W/Hz'.
character (len=20) smooth_grid_routines::units_ufield
Parameters
units_ufieldUnits of radiation field energy density array u_final_uv_opt() needed when calculating dust emission. Note that these units are only for the radiation field due to stellar radiation (NOT for that due to dust radiation which is always in J/m/pc^3).
logical smooth_grid_routines::use_dir_out
Parameters
use_dir_outLogical equal to TRUE if file_dir_out() has to be read.
logical smooth_grid_routines::use_lambda_grid
Parameters
use_lambda_gridLogical equal to TRUE if a lambda grid is used. If FALSE, input lambda_ref() is required.
logical smooth_grid_routines::use_p_src
Parameters
use_p_srcLogical equal to TRUE if file_p_src() has to be read.
logical smooth_grid_routines::use_pos_obs
Parameters
use_pos_obsLogical equal to TRUE if file_pos_obs() has to be read.
real(kind=real32) smooth_grid_routines::z_sun
Parameters
z_sunSolar metallicity value. The default value is 0.018, but it can be modified in the input if needed. Value checking is done within the routines that use this parameter.