DART-Ray
Data Types | Modules | Functions/Subroutines | Variables
smooth_grid_routines.f90 File Reference

Data Types

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

Modules

module  smooth_grid_routines
 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.
 

Functions/Subroutines

subroutine smooth_grid_routines::create_grid_arrays ()
 This subroutine allocates the 3D grid arrays and initialize the first elements. More...
 
subroutine smooth_grid_routines::calc_cellsize (cellsize, clvl)
 This subroutine derives the cellsize for a certain cell subdivision level. More...
 
subroutine smooth_grid_routines::set_base ()
 This subroutine sets the base() derived quantities basediv() and basemask(). More...
 
subroutine smooth_grid_routines::find_neighbours (isel, inc, cc, out)
 This routine finds the cell neighbour of the cell nc() along the main cell axis. More...
 
subroutine smooth_grid_routines::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 smooth_grid_routines::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 smooth_grid_routines::cindex_to_ccindd (nc, clvl, ccindd)
 This routines derives the cell tree coordinates from tree binary code in cindex(). More...
 
subroutine smooth_grid_routines::ccindd_to_cc (ccindd, cc, clvl, cell_found)
 This routine finds the cell ID number from its tree coordinates. More...
 
subroutine smooth_grid_routines::print_done
 Prints 'DONE' on the terminal. It also sets a barrier for MPI processes. More...
 
subroutine smooth_grid_routines::stop_prc
 Exits process. More...
 
subroutine smooth_grid_routines::error_stop (error)
 Exits the program if the input variable error is TRUE. More...
 
subroutine smooth_grid_routines::quick_sort_int (list, order)
 Sort integer array "list" and returns array of original positions (order). Wrapper to quick_sort(). More...
 
recursive subroutine smooth_grid_routines::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...
 
recursive subroutine quick_sort_1 (left_end, right_end)
 
subroutine interchange_sort (left_end, right_end)
 

Variables

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

Function/Subroutine Documentation

subroutine quick_sort::interchange_sort ( integer, intent(in)  left_end,
integer, intent(in)  right_end 
)

Here is the caller graph for this function:

recursive subroutine quick_sort::quick_sort_1 ( integer, intent(in)  left_end,
integer, intent(in)  right_end 
)

Here is the call graph for this function:

Here is the caller graph for this function: