DART-Ray
Functions/Subroutines | Variables
io_routines Module Reference

Contains the all the routines for I/O. More...

Functions/Subroutines

subroutine make_dsetname_main_grid (dsetname, rank)
 This subroutine prepares the dsetname and rank for all the elements in grid_file(). More...
 
subroutine print_3d_grid_file
 This subroutine prints the main grid in grid_file(). More...
 
subroutine read_main_grid
 This subroutine reads the main grid from grid_file(). More...
 
subroutine read_lambda_grid
 This subroutine reads the lambda grid from grid_file_lambda(). In this code version, only the stellar emission luminosity array dens_stars_arr() is uploaded. The dust density array dens_arr() is derived later by scaling the reference dens() array in the main grid. More...
 
subroutine count_lines (id, num)
 Counts the lines of an input ASCII file. IMPORTANT: it works only if there are no blank lines at the end of files. Check that before using. More...
 
subroutine read_dir_out
 Reads the lines-of-sight theta and phi angles from file_dir_out(). More...
 
subroutine read_pos_obs
 This subroutine reads the internal observer positions from file_pos_obs(). More...
 
subroutine read_p_src
 This subroutine reads the stellar point source positions inside the model from file_p_src(). More...
 
subroutine make_csize_arr
 This subroutine prepares the arrays csize_arr(), carea_arr(), and cvol_arr(). It also sets modelsize() and pabs_max(). More...
 
subroutine make_dims (dsetname, rank)
 This subroutine prepares dims() array for reading or writing HDF5 files. More...
 
subroutine set_filenames
 This subroutine sets the output file names. It uses the labels specified in label_model_out() and label_wave_arr(). More...
 
subroutine reset_filenames
 Changes i_obs() array filename for i_obs RT algorithm. More...
 
subroutine allocate_filename_arr
 Allocates arrays containing the output filenames. More...
 
subroutine deallocate_filename_arr
 Deallocates arrays containing the output filenames. More...
 
subroutine write_file_info
 This subroutine prints the used RT parameters in file_info(). More...
 
subroutine check_files
 This routine checks for output file existence. If any of the final output file exists, the program exists with an error message. If all of the intermediate files exist, the program restores them if restore_file_mpi() = .TRUE.. Then, the program stars directly from the direct light processing or the scattering iterations. Note that this is used only for the stellar emission RT. In the case of the dust emission RT, this is more complicated because of the dust heating iterations and it is not implemented for the moment. More...
 
subroutine print_big_array (filename, dsetname, dims, rank)
 This subroutine is used to print the output files. More...
 
subroutine add_info_big_array (filename, dsetname_add, dims_add, rank_add)
 Adds extra info to printed big array. This works only for one dimensional arrays. More...
 
subroutine print_u_fest_arr
 Writes u_fest_arr() on files file_u_fest_part1_arr(). More...
 
subroutine read_u_fest_arr
 Reads u_fest_arr from previously written files. More...
 
subroutine print_ufield_arr
 Writes ufield_arr() on files file_ufield_part2_arr() and file_ufield_arr(). More...
 
subroutine read_ufield_arr
 Reads ufield_arr from the previously written files. More...
 
subroutine print_psel_av_arr
 Writes psel_av_arr() on file_psel_av_part2() and file_psel_av(). More...
 
subroutine read_psel_av_arr
 Reads psel_av_arr() from previously written files. More...
 
subroutine print_i_obs_arr
 Writes i_obs_arr() on file_i_obs_part2_arr() and file_i_obs_arr(). More...
 
subroutine read_i_obs_arr
 Reads i_obs_arr() from previously written files. More...
 
subroutine print_i_obs_in_arr
 Writes i_obs_in_arr() on file_i_obs_in_part2_arr() and file_i_obs_in_arr(). More...
 
subroutine read_i_obs_in_arr
 Reads i_obs_in_arr() from previously written files. More...
 
subroutine print_scaspe_arr
 Writes scaspe_arr() on file_scaspe_part2_arr(). More...
 
subroutine read_scaspe_arr
 Reads scaspe_arr() from previously written files. More...
 
subroutine print_scaspe_tot_arr
 Writes scaspe_tot_arr() on file_scaspe_tot_arr(). More...
 
subroutine read_scaspe_tot_arr
 Reads scaspe_tot_arr() from previously written files. More...
 
subroutine print_sed_arr_dir
 Writes sed_arr_dir() on file_sed_arr_dir(). More...
 
subroutine print_sed_arr
 Writes sed_arr() on file_sed_arr(). More...
 
subroutine print_map_arr_out (filename)
 Writes map_arr_out() on file_maps() and file_maps_part2(). More...
 
subroutine print_map_in_arr_out (filename)
 Writes map_in_arr_out() on file_maps_in() and file_maps_in_part2(). More...
 
subroutine make_output
 This routine decides whith output files to write depening on rt_type(). More...
 
subroutine read_output
 This routine decides which arrays to read depending on the value of rt_type(). More...
 
subroutine read_big_array (filename, dsetname, dims)
 This routine reads previously printed arrays. More...
 
subroutine read_info_big_array (filename, dsetname_add, dims_add, rank_add)
 Reads additional info from output files. More...
 
subroutine print_lum_lost
 Writes lost luminosity files file_lum_lost_part2() and file_lum_lost() More...
 
subroutine read_lum_lost
 Reads lum_lost() from previously written files. More...
 
subroutine read_lambda_list
 This routine reads file_lambda_list(). It has to be placed before check_input because the lambda grid files contain a label dependent on the wavelength. It assigns lnum_tot(), lnum_stars(), lnum_dust(). More...
 
subroutine print_lambda_grid
 This routine prints the lambda grids in grid_file_lambda(). More...
 
subroutine find_out_tot_ndir_scaspe
 This routines finds out the value of tot_ndir_scaspe needed in the i_obs algorithm (in this case this value differ from tot_ndir. This is so because in the i_obs algorithm you might want to use a different number of output directions compared to the one you used in the main RT run.). More...
 
subroutine input_initialize
 This routine initialize all the input variables, so it is possible to check whether all required input has been provided in check_input(). More...
 
subroutine check_input
 This routine checks that the required input has been provided and that the values are in the allowed range. It also checks that the file and directories actually exist. More...
 
subroutine check_input_dust_model
 Checks that the input regarding the input dust model is correct. More...
 
subroutine check_file_existence (dir, filename)
 This subroutine checks that the input file exists. More...
 
subroutine check_dir_existence (dir, create_it)
 This subroutine checks that a directory exists. If the logical create_it is set to TRUE, it creates the directory in case it not exists. Otherwise it output an error and stop the program. More...
 
subroutine set_chunk_size
 This subroutine sets the chuck size for the OPENMP loops in rt_loop(), rt_loop_2D(), rt_loop_i_obs() More...
 
subroutine check_memory
 Checks that the RAM memory of the machine is sufficient to host the big scaspe() arrays required in DART-Ray. WARNING: It assumes that all MPI processes run on different cluster nodes. More...
 
subroutine initialize_mpi
 Initialises MPI environment. More...
 
subroutine terminate_mpi
 Exits the MPI environment. More...
 
subroutine rt_mpi
 Handles all the collective MPI operations at the end of each RT step. More...
 
subroutine reduce_u_fest_arr
 Reduces u_fest_arr() stored in all MPI processes. More...
 
subroutine reduce_u_final_arr
 Reduces u_final_arr() stored in all MPI processes. More...
 
subroutine reduce_dens_stars_arr
 Reduces dens_stars_arr() stored in all MPI processes. Used only in dust RT algorithms. More...
 
subroutine reduce_tot_dust_em_sed
 Reduces tot_dust_em_sed() stored in all MPI processes. Used only in dust RT algorithms. More...
 
subroutine reduce_scaspe_arr
 Reduces scaspe_arr() stored in all MPI processes. More...
 
subroutine reduce_lum_lost
 Reduces lum_lost() stored in all MPI processes. More...
 
subroutine reduce_psel_av_arr
 Reduces psel_av_arr() stored in all MPI processes. More...
 
subroutine reduce_i_obs_arr
 Reduces i_obs_arr() stored in all MPI processes. NOT used for the moment. More...
 
subroutine reduce_i_obs_in_arr
 Reduces i_obs_in_arr() stored in all MPI processes. NOT used for the moment. More...
 
subroutine reduce_map_arr_out
 Reduces map_arr_out() stored in all MPI processes. More...
 
subroutine reduce_map_in_arr_out
 Reduces map_in_arr_out() stored in all MPI processes. More...
 
subroutine read_input_file
 Reads input file for RT calculation. The input file has follow the dartray command on the terminal prompt. More...
 
subroutine read_nbody_sph_simulation
 Reads an Nbody-SPH simulation file ( file_nbody_sph()). More...
 
subroutine read_stellar_library
 reads the input stellar library (see file_stellar_library()). More...
 

Variables

character(len=lcar) dir_grid
 
character(len=lcar) dir_runs
 
character(len=lcar) grid_file
 
character(len=lcar) grid_info_file
 
character(len=lcar) label_model
 
character(len=lcar) label_model_out
 
character(len=lcar) label_model_out_i_obs
 
character(len=lcar) label_model_lambda_grid
 
character(len=lcar) label_wave
 
character(len=lcar), dimension(:), allocatable label_wave_arr
 
character(len=lcar) grid_file_lambda
 
character(len=lcar), dimension(:), allocatable grid_file_lambda_arr
 
character(len=lcar) file_dir_out
 
character(len=lcar) file_pos_obs
 
character(len=lcar) file_p_src
 
character(len=lcar) file_u_fest_part1
 
character(len=lcar), dimension(:), allocatable file_u_fest_part1_arr
 
character(len=lcar) file_ufield_part2
 
character(len=lcar), dimension(:), allocatable file_ufield_part2_arr
 
character(len=lcar) file_ufield
 
character(len=lcar), dimension(:), allocatable file_ufield_arr
 
character(len=lcar) file_info
 
character(len=lcar) file_scaspe_part2
 
character(len=lcar), dimension(:), allocatable file_scaspe_part2_arr
 
character(len=lcar) file_i_obs
 
character(len=lcar), dimension(:), allocatable file_i_obs_arr
 
character(len=lcar) file_i_obs_part2
 
character(len=lcar), dimension(:), allocatable file_i_obs_part2_arr
 
character(len=lcar) file_lum_lost
 
character(len=lcar) file_lum_lost_part2
 
character(len=lcar) file_i_obs_in
 
character(len=lcar), dimension(:), allocatable file_i_obs_in_arr
 
character(len=lcar) file_i_obs_in_part2
 
character(len=lcar), dimension(:), allocatable file_i_obs_in_part2_arr
 
character(len=lcar) file_scaspe_tot
 
character(len=lcar), dimension(:), allocatable file_scaspe_tot_arr
 
character(len=lcar) file_psel_av_part2
 
character(len=lcar) file_psel_av
 
character(len=lcar) file_sed_arr_dir
 
character(len=lcar) file_sed_arr
 
character(len=lcar) file_sed_dust_part2
 
character(len=lcar) file_sed_dust
 
character(len=lcar) file_maps_part2
 
character(len=lcar) file_maps
 
character(len=lcar) file_maps_in_part2
 
character(len=lcar) file_maps_in
 
character(len=lcar) file_gra_fa
 
character(len=lcar) file_sil_fa
 
character(len=lcar) file_pah_neu_fa
 
character(len=lcar) file_pah_ion_fa
 
character(len=lcar) file_q_gra
 
character(len=lcar) file_q_sil
 
character(len=lcar) file_q_pah_neu
 
character(len=lcar) file_q_pah_ion
 
character(len=lcar) file_calorimetry_gra
 
character(len=lcar) file_calorimetry_sil
 
character(len=lcar) file_param_src
 
integer, parameter narr_grid =9
 
integer(hsize_t), dimension(:), allocatable dims
 
logical print_output_part1
 
logical print_output_part2
 
logical print_scaspe_part2
 
logical print_sed
 
logical restore_file_mpi
 
logical file_restore
 
logical file_restore_part1
 
logical input_av_opacities
 
character(len=lcar) file_av_opacities
 
logical no_dust_rt
 
character(len=lcar) file_nbody_sph
 
character(len=lcar) stellar_library
 
character(len=lcar) file_stellar_library
 
logical use_stellar_library
 
character(len=lcar) file_pcell
 

Detailed Description

Contains the all the routines for I/O.

Function/Subroutine Documentation

subroutine io_routines::add_info_big_array ( character(len=lcar)  filename,
character(len=lcar), dimension(0:)  dsetname_add,
integer(hsize_t), dimension(0:)  dims_add,
integer, dimension(0:)  rank_add 
)

Adds extra info to printed big array. This works only for one dimensional arrays.

Here is the caller graph for this function:

subroutine io_routines::allocate_filename_arr ( )

Allocates arrays containing the output filenames.

Here is the caller graph for this function:

subroutine io_routines::check_dir_existence ( character(len=lcar)  dir,
logical  create_it 
)

This subroutine checks that a directory exists. If the logical create_it is set to TRUE, it creates the directory in case it not exists. Otherwise it output an error and stop the program.

Parameters
dirdir Input directory.
create_itcreate_it Logical equal to TRUE if non existent directory has to be created.
Parameters
file_tmpTemporary file name used to store output linux commands.
inumCounter of lines in file_tmp.
isString index
unitfile unit number

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::check_file_existence ( character(len=lcar)  dir,
character(len=lcar)  filename 
)

This subroutine checks that the input file exists.

Parameters
filename[in] filename Input filename
dir[in] dir Directory containing the input file
Parameters
file_existsLogical equal to TRUE if the input file exists.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::check_files ( )

This routine checks for output file existence. If any of the final output file exists, the program exists with an error message. If all of the intermediate files exist, the program restores them if restore_file_mpi() = .TRUE.. Then, the program stars directly from the direct light processing or the scattering iterations. Note that this is used only for the stellar emission RT. In the case of the dust emission RT, this is more complicated because of the dust heating iterations and it is not implemented for the moment.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::check_input ( )

This routine checks that the required input has been provided and that the values are in the allowed range. It also checks that the file and directories actually exist.

Parameters
nproc_maxNumber of CPUs on the machine where DART-Ray is running. Found through linux command getconf _NPROCESSORS_ONLN.
inumCounter used to check directory existence.
file_existsLogical variable used to check file existence.
file_tmpTemporary file to store output linux commands
iDo loop counter
ierrMPI error argument

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::check_input_dust_model ( )

Checks that the input regarding the input dust model is correct.

Parameters
file_q_arrSet of input Q opacity files

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::check_memory ( )

Checks that the RAM memory of the machine is sufficient to host the big scaspe() arrays required in DART-Ray. WARNING: It assumes that all MPI processes run on different cluster nodes.

Parameters
file_tmpTemporary file to store output linux commands

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::count_lines ( integer  id,
integer  num 
)

Counts the lines of an input ASCII file. IMPORTANT: it works only if there are no blank lines at the end of files. Check that before using.

Parameters
[in]idFile unit number
[out]numNumber of lines

Here is the caller graph for this function:

subroutine io_routines::deallocate_filename_arr ( )

Deallocates arrays containing the output filenames.

Here is the caller graph for this function:

subroutine io_routines::find_out_tot_ndir_scaspe ( )

This routines finds out the value of tot_ndir_scaspe needed in the i_obs algorithm (in this case this value differ from tot_ndir. This is so because in the i_obs algorithm you might want to use a different number of output directions compared to the one you used in the main RT run.).

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::initialize_mpi ( )

Initialises MPI environment.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::input_initialize ( )

This routine initialize all the input variables, so it is possible to check whether all required input has been provided in check_input().

Here is the caller graph for this function:

subroutine io_routines::make_csize_arr ( )

This subroutine prepares the arrays csize_arr(), carea_arr(), and cvol_arr(). It also sets modelsize() and pabs_max().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::make_dims ( character (len=lcar)  dsetname,
integer  rank 
)

This subroutine prepares dims() array for reading or writing HDF5 files.

Parameters
[in]dsetnameDsetname of the array in the HDF5 file
[in]rankRank of the array in the HDF5 file

Here is the caller graph for this function:

subroutine io_routines::make_dsetname_main_grid ( character(len=lcar), dimension(0:)  dsetname,
integer, dimension(0:)  rank 
)

This subroutine prepares the dsetname and rank for all the elements in grid_file().

Here is the caller graph for this function:

subroutine io_routines::make_output ( )

This routine decides whith output files to write depening on rt_type().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_3d_grid_file ( )

This subroutine prints the main grid in grid_file().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_big_array ( character (len=lcar)  filename,
character (len=lcar)  dsetname,
integer(hsize_t), dimension(*)  dims,
integer  rank 
)

This subroutine is used to print the output files.

Parameters
[in]filenameFile name
[in]dsetnameDsetname of the array to be printed
[in]dimsArray or scalar with the array dimensions
[in]rankRank of the array to be written on the HDF5 file

Here is the caller graph for this function:

subroutine io_routines::print_i_obs_arr ( )

Writes i_obs_arr() on file_i_obs_part2_arr() and file_i_obs_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_i_obs_in_arr ( )

Writes i_obs_in_arr() on file_i_obs_in_part2_arr() and file_i_obs_in_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_lambda_grid ( )

This routine prints the lambda grids in grid_file_lambda().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_lum_lost ( )

Writes lost luminosity files file_lum_lost_part2() and file_lum_lost()

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_map_arr_out ( character (len=lcar)  filename)

Writes map_arr_out() on file_maps() and file_maps_part2().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_map_in_arr_out ( character (len=lcar)  filename)

Writes map_in_arr_out() on file_maps_in() and file_maps_in_part2().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_psel_av_arr ( )

Writes psel_av_arr() on file_psel_av_part2() and file_psel_av().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_scaspe_arr ( )

Writes scaspe_arr() on file_scaspe_part2_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_scaspe_tot_arr ( )

Writes scaspe_tot_arr() on file_scaspe_tot_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_sed_arr ( )

Writes sed_arr() on file_sed_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_sed_arr_dir ( )

Writes sed_arr_dir() on file_sed_arr_dir().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_u_fest_arr ( )

Writes u_fest_arr() on files file_u_fest_part1_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::print_ufield_arr ( )

Writes ufield_arr() on files file_ufield_part2_arr() and file_ufield_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_big_array ( character (len=lcar)  filename,
character (len=lcar)  dsetname,
integer(hsize_t), dimension(*)  dims 
)

This routine reads previously printed arrays.

Parameters
[in]filenameName of the file containing the arrays to be read
[in]dsetnameDsetname of the array to be read
[in]dimsArray of scalar speficying the dimensions of the arrays to be read

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_dir_out ( )

Reads the lines-of-sight theta and phi angles from file_dir_out().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_i_obs_arr ( )

Reads i_obs_arr() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_i_obs_in_arr ( )

Reads i_obs_in_arr() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_info_big_array ( character (len=lcar)  filename,
character (len=lcar), dimension(0:)  dsetname_add,
integer(hsize_t), dimension(0:)  dims_add,
integer, dimension(0:)  rank_add 
)

Reads additional info from output files.

Here is the call graph for this function:

subroutine io_routines::read_input_file ( )

Reads input file for RT calculation. The input file has follow the dartray command on the terminal prompt.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_lambda_grid ( )

This subroutine reads the lambda grid from grid_file_lambda(). In this code version, only the stellar emission luminosity array dens_stars_arr() is uploaded. The dust density array dens_arr() is derived later by scaling the reference dens() array in the main grid.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_lambda_list ( )

This routine reads file_lambda_list(). It has to be placed before check_input because the lambda grid files contain a label dependent on the wavelength. It assigns lnum_tot(), lnum_stars(), lnum_dust().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_lum_lost ( )

Reads lum_lost() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_main_grid ( )

This subroutine reads the main grid from grid_file().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_nbody_sph_simulation ( )

Reads an Nbody-SPH simulation file ( file_nbody_sph()).

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_output ( )

This routine decides which arrays to read depending on the value of rt_type().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_p_src ( )

This subroutine reads the stellar point source positions inside the model from file_p_src().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_pos_obs ( )

This subroutine reads the internal observer positions from file_pos_obs().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_psel_av_arr ( )

Reads psel_av_arr() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_scaspe_arr ( )

Reads scaspe_arr() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_scaspe_tot_arr ( )

Reads scaspe_tot_arr() from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_stellar_library ( )

reads the input stellar library (see file_stellar_library()).

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_u_fest_arr ( )

Reads u_fest_arr from previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::read_ufield_arr ( )

Reads ufield_arr from the previously written files.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::reduce_dens_stars_arr ( )

Reduces dens_stars_arr() stored in all MPI processes. Used only in dust RT algorithms.

Here is the caller graph for this function:

subroutine io_routines::reduce_i_obs_arr ( )

Reduces i_obs_arr() stored in all MPI processes. NOT used for the moment.

subroutine io_routines::reduce_i_obs_in_arr ( )

Reduces i_obs_in_arr() stored in all MPI processes. NOT used for the moment.

subroutine io_routines::reduce_lum_lost ( )

Reduces lum_lost() stored in all MPI processes.

Here is the caller graph for this function:

subroutine io_routines::reduce_map_arr_out ( )

Reduces map_arr_out() stored in all MPI processes.

subroutine io_routines::reduce_map_in_arr_out ( )

Reduces map_in_arr_out() stored in all MPI processes.

subroutine io_routines::reduce_psel_av_arr ( )

Reduces psel_av_arr() stored in all MPI processes.

Here is the caller graph for this function:

subroutine io_routines::reduce_scaspe_arr ( )

Reduces scaspe_arr() stored in all MPI processes.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::reduce_tot_dust_em_sed ( )

Reduces tot_dust_em_sed() stored in all MPI processes. Used only in dust RT algorithms.

Here is the caller graph for this function:

subroutine io_routines::reduce_u_fest_arr ( )

Reduces u_fest_arr() stored in all MPI processes.

Here is the caller graph for this function:

subroutine io_routines::reduce_u_final_arr ( )

Reduces u_final_arr() stored in all MPI processes.

Here is the caller graph for this function:

subroutine io_routines::reset_filenames ( )

Changes i_obs() array filename for i_obs RT algorithm.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::rt_mpi ( )

Handles all the collective MPI operations at the end of each RT step.

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::set_chunk_size ( )

This subroutine sets the chuck size for the OPENMP loops in rt_loop(), rt_loop_2D(), rt_loop_i_obs()

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::set_filenames ( )

This subroutine sets the output file names. It uses the labels specified in label_model_out() and label_wave_arr().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine io_routines::terminate_mpi ( )

Exits the MPI environment.

Here is the caller graph for this function:

subroutine io_routines::write_file_info ( )

This subroutine prints the used RT parameters in file_info().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

integer(hsize_t), dimension(:), allocatable io_routines::dims
Parameters
dimsDimensions of the arrays to be read or printed.
character(len=lcar) io_routines::dir_grid
Parameters
dir_gridDirectory where the grid files are located
character(len=lcar) io_routines::dir_runs
Parameters
dir_runsDirectory for the output files. If it does not exist, it is created automatically in check_input().
character (len=lcar) io_routines::file_av_opacities
Parameters
file_av_opacitiesFile containing the integrated/averaged opacity coefficients kext(), kabs(), kext(), gsca(). It is read only if keyword input_av_opacities is set TRUE in the input file.
character(len=lcar) io_routines::file_calorimetry_gra
Parameters
file_calorimetry_GraFile containing the grain density, specific enthalpy and specific heat capacity for Graphite and PAH grains
character(len=lcar) io_routines::file_calorimetry_sil
Parameters
file_calorimetry_SilFile containing the grain density, specific enthalpy and specific heat capacity for Silicates grains
character(len=lcar) io_routines::file_dir_out
Parameters
file_dir_outFile containing the angular directions $ \theta $ and $ \phi $ specifying the lines-of-sight of the far-away observers. The first line has to be a comment. The following lines have to be the list of $ \theta $ (first column) and $ \phi $ (second column) in radiants. Note that $ \theta $ is defined as the angle between the line-of-sight and the Z-axis. $ \phi $ is the line-of-sight position angle on the XY plane measured from the X-axis.
character(len=lcar) io_routines::file_gra_fa
Parameters
file_gra_faFile containing input grain size distribution for Graphite grains. To use input grain size distributions, set dust_model = 'user'.
character(len=lcar) io_routines::file_i_obs
Parameters
file_i_obsFile containing i_obs() as calculated at the end of the scattered light iterations.
character(len=lcar), dimension(:), allocatable io_routines::file_i_obs_arr
Parameters
file_i_obs_arrFile names of the output containing i_obs() as calculated at the end of the scattered light iterations for all wavelengths.
character(len=lcar) io_routines::file_i_obs_in
Parameters
file_i_obs_inFile containing i_obs_in() as calculated at the end of the scattering iterations.
character(len=lcar), dimension(:), allocatable io_routines::file_i_obs_in_arr
Parameters
file_i_obs_in_arrFile names of the output containing i_obs_in() as calculated at the end of the scattering iterations for all wavelengths.
character(len=lcar) io_routines::file_i_obs_in_part2
Parameters
file_i_obs_in_part2File containing i_obs_in() as calculated at the end of the direct light processing.
character(len=lcar), dimension(:), allocatable io_routines::file_i_obs_in_part2_arr
Parameters
file_i_obs_in_part2_arrFile names of the output containing i_obs_in() as calculated at the end of the direct light processing for all wavelengths.
character(len=lcar) io_routines::file_i_obs_part2
Parameters
file_i_obs_part2File containing i_obs() as calculated at the end of the direct light processing.
character(len=lcar), dimension(:), allocatable io_routines::file_i_obs_part2_arr
Parameters
file_i_obs_part2_arrFile names of the output containing i_obs() as calculated at the end of the direct light processing for all wavelengths.
character(len=lcar) io_routines::file_info
Parameters
file_infoFile where the input parameters of the RT calculation are stored.
character(len=lcar) io_routines::file_lum_lost
Parameters
file_lum_lostFile containing the percentage of luminosity lost during the entire RT calculation at each wavelength (the sum of the luminosity of the rays blocked because of the energy condition $ \delta U < f_U*U_{LL} $).
character(len=lcar) io_routines::file_lum_lost_part2
Parameters
file_lum_lost_part2File containing the percentage of luminosity lost during the direct light processing (the sum of the luminosity of the rays blocked because of the energy condition $ \delta U < f_U*U_{LL} $).
character(len=lcar) io_routines::file_maps
Parameters
file_mapsFile containing the surface brightness maps for the direct+scattered light obtained by an observer located far away from the model. Units in MJy/sr.
character(len=lcar) io_routines::file_maps_in
Parameters
file_maps_inFile containing the surface brightness maps for the direct+scattered light obtained by an observer located inside the model. Units in MJy/sr.
character(len=lcar) io_routines::file_maps_in_part2
Parameters
file_maps_in_part2File containing the surface brightness maps for the direct light obtained by an observer located inside the model. Units in MJy/sr.
character(len=lcar) io_routines::file_maps_part2
Parameters
file_maps_part2File containing the surface brightness maps for the direct light obtained by an observer located far away from the model. Units in MJy/sr.
character (len=lcar) io_routines::file_nbody_sph
Parameters
file_nbody_sphFile name of the imported Nbody-SPH simulation. This file contains the following arrays: 'agestar': the age of the stellar particles in Gyr; 'fehgas': [Fe/H] ratio of the gas particles; 'fehstar': [Fe/H] ratio of the stellar particles; 'gascoord': 3D coordinates of the gas particles; 'gastemp': Gas particle temperature [K]; 'mgas': Gas particle mass in M(sun); 'mstar': Star particle mass in M(sun); 'ofegas': [O/Fe] ratio for the gas particles; 'starcoord': 3D coordinates of the stellar particles. This file can be created from a tipsy file using the python script tipsy2dartray.py. Note that the gas metallicity is inferred from the O abundance, the stellar metallicity from the Fe abundance.
character(len=lcar) io_routines::file_p_src
Parameters
file_p_srcFile containing the 3D coordinates for the point sources within the RT model The first line has to be a comment. The following lines contain the X, Y,Z coordinates for each point source.
character(len=lcar) io_routines::file_pah_ion_fa
Parameters
file_pah_ion_faFile containing input grain size distribution for ionized PAH molecules. To use input grain size distributions, set dust_model = 'user'.
character(len=lcar) io_routines::file_pah_neu_fa
Parameters
file_pah_neu_faFile containing input grain size distribution for neutral PAH molecules. To use input grain size distributions, set dust_model = 'user'.
character(len=lcar) io_routines::file_param_src
Parameters
file_param_srcFile containing the properties used to define the spectra of the point sources. It can be arbitrarily structured since it is read in the "user_routines" modules.
character (len=lcar) io_routines::file_pcell
Parameters
file_pcellFile containing the pcell_star() and pcell_gas() arrays.
character(len=lcar) io_routines::file_pos_obs
Parameters
file_pos_obsFile containing the 3D coordinates of the internal observers within the RT model. The first line has to be a comment. The following lines contain the X, Y,Z coordinates for each internal observer.
character(len=lcar) io_routines::file_psel_av
Parameters
file_psel_avFile containing psel_av_arr() as derived at the end of the scattered light iterations.
character(len=lcar) io_routines::file_psel_av_part2
Parameters
file_psel_av_part2File containing psel_av_arr() as derived at the end of the direct light processing.
character(len=lcar) io_routines::file_q_gra
Parameters
file_q_graFile containing the $Q_\lambda$ opacity and $g_\lambda$ anisotropy coefficients for Graphite grains.
character(len=lcar) io_routines::file_q_pah_ion
Parameters
file_q_pah_ionFile containing the $Q_\lambda$ opacity and $g_\lambda$ anisotropy coefficients for ionized PAH molecules.
character(len=lcar) io_routines::file_q_pah_neu
Parameters
file_q_pah_neuFile containing the $Q_\lambda$ opacity and $g_\lambda$ anisotropy coefficients for neutral PAH molecules.
character(len=lcar) io_routines::file_q_sil
Parameters
file_q_silFile containing the $Q_\lambda$ opacity and $g_\lambda$ anisotropy coefficients for Silicates grains.
logical io_routines::file_restore
Parameters
file_restoreLogical variable equal to TRUE when all part 2 output files exists (that is the files printed at the end of the direct light processing). In this case the code can read them and start directly from the scattering iterations.
logical io_routines::file_restore_part1
Parameters
file_restore_part1TRUE when part1 output file already exists and file_restore = .FALSE. In this case the code can read this file and start from the direct light processing.
character(len=lcar) io_routines::file_scaspe_part2
Parameters
file_scaspe_part2File containing scaspe() as calculated at the end of the direct light processing. It can be restored but, usually, it should not be printed because it can be very large. Set print_scaspe_part2 = .TRUE. if you want this file to be printed.
character(len=lcar), dimension(:), allocatable io_routines::file_scaspe_part2_arr
Parameters
file_scaspe_part2_arrFile names of the output containing scaspe() as calculated at the end of the direct light processing for all wavelengths. It can be restored but, usually, it should not be printed because it can be very large. Set print_scaspe_part2 = .TRUE. if you want these files to be printed.
character(len=lcar) io_routines::file_scaspe_tot
Parameters
file_scaspe_totFile containing scaspe_tot().
character(len=lcar), dimension(:), allocatable io_routines::file_scaspe_tot_arr
Parameters
file_scaspe_tot_arrFile names of the output containing scaspe_tot() for all wavelengths.
character(len=lcar) io_routines::file_sed_arr
Parameters
file_sed_arrFile containing emission SEDs, for each observer line of sight, obtained at the end of scattered light processing.
character(len=lcar) io_routines::file_sed_arr_dir
Parameters
file_sed_arr_dirFile containing emission SEDs, for each observer line of sight, obtained at the end of direct light processing.
character(len=lcar) io_routines::file_sed_dust
Parameters
file_sed_dustFile containing dust emission SEDs, for each observer line of sight, obtained at the end of scattered light processing. Note that for the dust emission an additional iteration procedure is necessary to find temperature convergence.
character(len=lcar) io_routines::file_sed_dust_part2
Parameters
file_sed_dust_part2File containing dust emission SEDs, for each observer line of sight, obtained at the end of direct light processing. Note that for the dust emission an additional iteration procedure is necessary to find temperature convergence.
character(len=lcar) io_routines::file_sil_fa
Parameters
file_sil_faFile containing input grain size distribution for Silicate grains. To use input grain size distributions, set dust_model = 'user'.
character (len=lcar) io_routines::file_stellar_library
Parameters
file_stellar_libraryName of the HDF5 file containing the stellar library specified in stellar_library(). This is an input parameter only if stellar_library() = 'user'. This file contains three arrays: lambda_lib_arr (wavelength list in [um]), met_arr (metallicity), lum_to_mass_arr (stellar luminosity-to-mass ratio in erg/s/Hz/M(sun)). See e.g. STELLAR_LIBRARIES/starburst99/table_lum_mass_vs_age_met_starburst99.h5.
character(len=lcar) io_routines::file_u_fest_part1
Parameters
file_u_fest_part1File name of the output for part1.
character(len=lcar), dimension(:), allocatable io_routines::file_u_fest_part1_arr
Parameters
file_u_fest_part1_arrFile names of the output for part1 for all wavelengths.
character(len=lcar) io_routines::file_ufield
Parameters
file_ufieldFile containing u_final() as calculated at the end of the scattered light processing.
character(len=lcar), dimension(:), allocatable io_routines::file_ufield_arr
Parameters
file_ufield_arrFile names of the output containing u_final() as calculated at the end of the scattered light processing for all wavelengths.
character(len=lcar) io_routines::file_ufield_part2
Parameters
file_ufield_part2File containing u_final() as calculated at the end of the direct light processing.
character(len=lcar), dimension(:), allocatable io_routines::file_ufield_part2_arr
Parameters
file_ufield_part2_arrFile names of the output containing u_final() as calculated at the end of the direct light processing for all wavelengths.
character(len=lcar) io_routines::grid_file
Parameters
grid_fileMain grid file name
character(len=lcar) io_routines::grid_file_lambda
Parameters
grid_file_lambdaLambda grid file name
character(len=lcar), dimension(:), allocatable io_routines::grid_file_lambda_arr
Parameters
grid_file_lambda_arrLambda grid file name for all wavelengths.
character(len=lcar) io_routines::grid_info_file
Parameters
grid_info_fileGrid info file name
logical io_routines::input_av_opacities
Parameters
input_av_opacitiesTRUE if integrated/averaged opacity coefficients kext(), kabs(), kext(), gsca() have to be read from input file file_av_opacities
character(len=lcar) io_routines::label_model
Parameters
label_modelLabel model within grid_file()
character(len=lcar) io_routines::label_model_lambda_grid
Parameters
label_model_lambda_gridLabel model within grid_file_lambda()
character(len=lcar) io_routines::label_model_out
Parameters
label_model_outLabel contained in all the output file names.
character(len=lcar) io_routines::label_model_out_i_obs
Parameters
label_model_out_i_obsLabel contained in all the output file names for the i_obs and i_obs_dust RT algorithm. If not provided, it is set automatically to label_model_out().
character(len=lcar) io_routines::label_wave
Parameters
label_waveWavelength label for a single wavelength.
character(len=lcar), dimension(:), allocatable io_routines::label_wave_arr
Parameters
label_wave_arrWavelength labels for all wavelengths.
integer, parameter io_routines::narr_grid =9
Parameters
narr_gridNumber of arrays in the main grid file grid_file().
logical io_routines::no_dust_rt
Parameters
no_dust_rtTRUE if no dust emission RT has to be performed.
logical io_routines::print_output_part1
Parameters
print_output_part1Equal to TRUE if array u_fest() has to be printed at the end of precalculation phase (output file file_u_fest_part1()).
logical io_routines::print_output_part2
Parameters
print_output_part2Equal to TRUE if the output of part2 has to be written on disk (output files: file_ufield_part2(), file_i_obs_part2(), file_i_obs_in_part2()). This should be done if one needs the u_final(), i_obs() and i_obs_in() arrays due only to the direct light. Note that the scaspe() array is not printed by default. To print that as well at the end of the direct light processing, you need to set print_scaspe_part2() = .TRUE. If you print all the part 2 output, including the scaspe() array, you will be able later to restart the calculation from the scattering iterations.
logical io_routines::print_scaspe_part2
Parameters
print_scaspe_part2Equal to TRUE if scaspe() array has to be written on disk at the end of the direct light processing. This is not included by default in print_output_part2() because the scaspe() arrays can take a LOT of disk space. If you want to be able to restart the calculation from the scattering iterations, the scaspe()
logical io_routines::print_sed
Parameters
print_sedTRUE if file_sed() has to be printed.
logical io_routines::restore_file_mpi
Parameters
restore_file_mpiTRUE if previously written files have to be restored during runs with more than one MPI process. In case only one MPI process is present, choice is requested in the terminal.
character (len=lcar) io_routines::stellar_library
Parameters
stellar_libraryName of the stellar library that has to be used to convert mass into luminosity. Choices are: 'starburst99' (standard starburst99 Single age stellar population SED, Kroupa IMF), 'maraston05_kr_rhb' (Maraston et al.2005 SSP SEDs, Kroupa IMF, red horizontal branch), 'user' (user provided table, see file_stellar_library().
logical io_routines::use_stellar_library
Parameters
use_stellar_libraryTRUE if stellar library has to be loaded.