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

Contains the subroutines to specify the stellar emission and dust density distribution for N-body/SPH galaxy simulations. More...

Data Types

type  irr_arr
 Data type used for pcell_index arrays (pcell_index_star() and pcell_index_gas()). More...
 

Functions/Subroutines

subroutine read_input_nbody_sph
 Reads input file for grid creation. More...
 
subroutine set_kext_gas (lambda_in)
 Sets extinction coefficient kext in units of parsec^2/Msun. More...
 
subroutine create_grid_index
 Creates a grid index for the stellar and gas particles so it is quicker to find particles in a certain region of space. More...
 
subroutine av_galaxy (x, y, z, cellsize, av_dust, av_stars, av_gas, av_st_mass, cc)
 
subroutine print_pcell
 Prints the pcell_star() and pcell_gas() arrays in an output file (file_pcell() ). More...
 
subroutine read_pcell
 Reads pcell_star() and pcell_gas() from file_pcell(). More...
 
subroutine make_pcell_index
 Creates an index array for each cell pointing to the particles contained in that cell. Using this index, the lambda grid creation is faster. More...
 
subroutine find_first_element (arr, i0)
 finds first non zero element of an integer array. More...
 
subroutine find_i_range (arr, i, i0, i1)
 Finds range of subscripts where an integer array has the value "i". It requires that the array is sorted and that i0 is the subscript of an element before the first with value "i". More...
 
subroutine assign_dens_to_parent
 This routine assigns the dens values to subdivided parent cells. This is necessary in the lambda grid creation because in that case only the leaf cells have the dens values already calculated. More...
 

Variables

real(kind=real64) lambda_min
 
real(kind=real64) lambda_max
 
integer, parameter, private nstep_g =10
 
type(var_arr_1d), dimension(:,:,:), allocatable sec_ind_star
 
type(var_arr_1d), dimension(:,:,:), allocatable sec_ind_gas
 
integer, dimension(:,:,:), allocatable k_sec_ind_star
 
integer, dimension(:,:,:), allocatable k_sec_ind_gas
 
real(kind=real64) gastemp_limit = 1E6
 
type(irr_arr), dimension(:), allocatable pcell_index_star
 
type(irr_arr), dimension(:), allocatable pcell_index_gas
 
character(len=lcar) subdivision_criteria
 

Detailed Description

Contains the subroutines to specify the stellar emission and dust density distribution for N-body/SPH galaxy simulations.

Function/Subroutine Documentation

subroutine user_routines_nbody_sph::assign_dens_to_parent ( )

This routine assigns the dens values to subdivided parent cells. This is necessary in the lambda grid creation because in that case only the leaf cells have the dens values already calculated.

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::av_galaxy ( real(kind=real64)  x,
real(kind=real64)  y,
real(kind=real64)  z,
real(kind=real64)  cellsize,
real(kind=real64)  av_dust,
real(kind=real64)  av_stars,
real(kind=real64)  av_gas,
real(kind=real64)  av_st_mass,
integer  cc 
)

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::create_grid_index ( )

Creates a grid index for the stellar and gas particles so it is quicker to find particles in a certain region of space.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::find_first_element ( integer, dimension(0:)  arr,
integer  i0 
)

finds first non zero element of an integer array.

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::find_i_range ( integer, dimension(0:)  arr,
integer  i,
integer  i0,
integer  i1 
)

Finds range of subscripts where an integer array has the value "i". It requires that the array is sorted and that i0 is the subscript of an element before the first with value "i".

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::make_pcell_index ( )

Creates an index array for each cell pointing to the particles contained in that cell. Using this index, the lambda grid creation is faster.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::print_pcell ( )

Prints the pcell_star() and pcell_gas() arrays in an output file (file_pcell() ).

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::read_input_nbody_sph ( )

Reads input file for grid creation.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::read_pcell ( )

Reads pcell_star() and pcell_gas() from file_pcell().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine user_routines_nbody_sph::set_kext_gas ( real(kind=real64)  lambda_in)

Sets extinction coefficient kext in units of parsec^2/Msun.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

real(kind=real64) user_routines_nbody_sph::gastemp_limit = 1E6
Parameters
gastemp_limitMax gas temperature for gas containing dust particles. Default value = 1E6 K.
integer, dimension(:,:,:), allocatable user_routines_nbody_sph::k_sec_ind_gas
Parameters
k_sec_ind_gas(0:nstep_g-1, 0:nstep_g-1, 0:nstep_g-1) Number of gas particles present in each model sector
integer, dimension(:,:,:), allocatable user_routines_nbody_sph::k_sec_ind_star
Parameters
k_sec_ind_star(0:nstep_g-1, 0:nstep_g-1, 0:nstep_g-1) Number of stellar particles present in each model sector
real(kind=real64) user_routines_nbody_sph::lambda_max
Parameters
lambda_maxMaximum wavelength [um] for which the lambda grid has to be calculated.
real(kind=real64) user_routines_nbody_sph::lambda_min
Parameters
lambda_minMinimum wavelength [um] for which the lambda grid has to be calculated.
integer, parameter, private user_routines_nbody_sph::nstep_g =10
private
Parameters
nstep_gNumber of grid elements per axis used to subdivide the entire RT model when calculating the grid index arrays sec_ind_star() and sec_ind_gas().
type(irr_arr), dimension(:), allocatable user_routines_nbody_sph::pcell_index_gas
Parameters
pcell_index_gasEach element contains the list of gas particles in the corresponding grid cell.
type(irr_arr), dimension(:), allocatable user_routines_nbody_sph::pcell_index_star
Parameters
pcell_index_starEach element contains the list of stellar particles in the corresponding grid cell.
type(var_arr_1d), dimension(:,:,:), allocatable user_routines_nbody_sph::sec_ind_gas
Parameters
sec_ind_gas(0:nstep_g-1, 0:nstep_g-1, 0:nstep_g-1)%(:) Contains subscripts of gas particles located within the sector ix,iy,iz of the model. Useful for quicker search of particles while calculating the main grid.
type(var_arr_1d), dimension(:,:,:), allocatable user_routines_nbody_sph::sec_ind_star
Parameters
sec_ind_star(0:nstep_g-1, 0:nstep_g-1, 0:nstep_g-1)%(:) Contains subscripts of stellar particles located within the sector ix,iy,iz of the model. Useful for quicker search of particles while calculating the main grid.
character(len=lcar) user_routines_nbody_sph::subdivision_criteria
Parameters
subdivision_criteriaSubdivision criteria to be used. Choices are:
  • 'standard': subdivision IF subdivision level < max_lvl() AND (cell optical depth > max_dtau()*optical depth averaged over entire model OR stellar luminosity > max_dlum()*total model luminosity OR subdivision level < min_lvl())