DART-Ray
Modules | Functions/Subroutines | Variables
io_routines.f90 File Reference

Modules

module  io_routines
 Contains the all the routines for I/O.
 

Functions/Subroutines

subroutine io_routines::make_dsetname_main_grid (dsetname, rank)
 This subroutine prepares the dsetname and rank for all the elements in grid_file(). More...
 
subroutine io_routines::print_3d_grid_file
 This subroutine prints the main grid in grid_file(). More...
 
subroutine io_routines::read_main_grid
 This subroutine reads the main grid from grid_file(). More...
 
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. More...
 
subroutine io_routines::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 io_routines::read_dir_out
 Reads the lines-of-sight theta and phi angles from file_dir_out(). More...
 
subroutine io_routines::read_pos_obs
 This subroutine reads the internal observer positions from file_pos_obs(). More...
 
subroutine io_routines::read_p_src
 This subroutine reads the stellar point source positions inside the model from file_p_src(). More...
 
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(). More...
 
subroutine io_routines::make_dims (dsetname, rank)
 This subroutine prepares dims() array for reading or writing HDF5 files. More...
 
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(). More...
 
subroutine io_routines::reset_filenames
 Changes i_obs() array filename for i_obs RT algorithm. More...
 
subroutine io_routines::allocate_filename_arr
 Allocates arrays containing the output filenames. More...
 
subroutine io_routines::deallocate_filename_arr
 Deallocates arrays containing the output filenames. More...
 
subroutine io_routines::write_file_info
 This subroutine prints the used RT parameters in file_info(). More...
 
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. More...
 
subroutine io_routines::print_big_array (filename, dsetname, dims, rank)
 This subroutine is used to print the output files. More...
 
subroutine io_routines::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 io_routines::print_u_fest_arr
 Writes u_fest_arr() on files file_u_fest_part1_arr(). More...
 
subroutine io_routines::read_u_fest_arr
 Reads u_fest_arr from previously written files. More...
 
subroutine io_routines::print_ufield_arr
 Writes ufield_arr() on files file_ufield_part2_arr() and file_ufield_arr(). More...
 
subroutine io_routines::read_ufield_arr
 Reads ufield_arr from the previously written files. More...
 
subroutine io_routines::print_psel_av_arr
 Writes psel_av_arr() on file_psel_av_part2() and file_psel_av(). More...
 
subroutine io_routines::read_psel_av_arr
 Reads psel_av_arr() from previously written files. More...
 
subroutine io_routines::print_i_obs_arr
 Writes i_obs_arr() on file_i_obs_part2_arr() and file_i_obs_arr(). More...
 
subroutine io_routines::read_i_obs_arr
 Reads i_obs_arr() from previously written files. More...
 
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(). More...
 
subroutine io_routines::read_i_obs_in_arr
 Reads i_obs_in_arr() from previously written files. More...
 
subroutine io_routines::print_scaspe_arr
 Writes scaspe_arr() on file_scaspe_part2_arr(). More...
 
subroutine io_routines::read_scaspe_arr
 Reads scaspe_arr() from previously written files. More...
 
subroutine io_routines::print_scaspe_tot_arr
 Writes scaspe_tot_arr() on file_scaspe_tot_arr(). More...
 
subroutine io_routines::read_scaspe_tot_arr
 Reads scaspe_tot_arr() from previously written files. More...
 
subroutine io_routines::print_sed_arr_dir
 Writes sed_arr_dir() on file_sed_arr_dir(). More...
 
subroutine io_routines::print_sed_arr
 Writes sed_arr() on file_sed_arr(). More...
 
subroutine io_routines::print_map_arr_out (filename)
 Writes map_arr_out() on file_maps() and file_maps_part2(). More...
 
subroutine io_routines::print_map_in_arr_out (filename)
 Writes map_in_arr_out() on file_maps_in() and file_maps_in_part2(). More...
 
subroutine io_routines::make_output
 This routine decides whith output files to write depening on rt_type(). More...
 
subroutine io_routines::read_output
 This routine decides which arrays to read depending on the value of rt_type(). More...
 
subroutine io_routines::read_big_array (filename, dsetname, dims)
 This routine reads previously printed arrays. More...
 
subroutine io_routines::read_info_big_array (filename, dsetname_add, dims_add, rank_add)
 Reads additional info from output files. More...
 
subroutine io_routines::print_lum_lost
 Writes lost luminosity files file_lum_lost_part2() and file_lum_lost() More...
 
subroutine io_routines::read_lum_lost
 Reads lum_lost() from previously written files. More...
 
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(). More...
 
subroutine io_routines::print_lambda_grid
 This routine prints the lambda grids in grid_file_lambda(). More...
 
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.). More...
 
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(). More...
 
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. More...
 
subroutine io_routines::check_input_dust_model
 Checks that the input regarding the input dust model is correct. More...
 
subroutine io_routines::check_file_existence (dir, filename)
 This subroutine checks that the input file exists. More...
 
subroutine io_routines::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 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() More...
 
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. More...
 
subroutine io_routines::initialize_mpi
 Initialises MPI environment. More...
 
subroutine io_routines::terminate_mpi
 Exits the MPI environment. More...
 
subroutine io_routines::rt_mpi
 Handles all the collective MPI operations at the end of each RT step. More...
 
subroutine io_routines::reduce_u_fest_arr
 Reduces u_fest_arr() stored in all MPI processes. More...
 
subroutine io_routines::reduce_u_final_arr
 Reduces u_final_arr() stored in all MPI processes. More...
 
subroutine io_routines::reduce_dens_stars_arr
 Reduces dens_stars_arr() stored in all MPI processes. Used only in dust RT algorithms. More...
 
subroutine io_routines::reduce_tot_dust_em_sed
 Reduces tot_dust_em_sed() stored in all MPI processes. Used only in dust RT algorithms. More...
 
subroutine io_routines::reduce_scaspe_arr
 Reduces scaspe_arr() stored in all MPI processes. More...
 
subroutine io_routines::reduce_lum_lost
 Reduces lum_lost() stored in all MPI processes. More...
 
subroutine io_routines::reduce_psel_av_arr
 Reduces psel_av_arr() stored in all MPI processes. More...
 
subroutine io_routines::reduce_i_obs_arr
 Reduces i_obs_arr() stored in all MPI processes. NOT used for the moment. More...
 
subroutine io_routines::reduce_i_obs_in_arr
 Reduces i_obs_in_arr() stored in all MPI processes. NOT used for the moment. More...
 
subroutine io_routines::reduce_map_arr_out
 Reduces map_arr_out() stored in all MPI processes. More...
 
subroutine io_routines::reduce_map_in_arr_out
 Reduces map_in_arr_out() stored in all MPI processes. More...
 
subroutine io_routines::read_input_file
 Reads input file for RT calculation. The input file has follow the dartray command on the terminal prompt. More...
 
subroutine io_routines::read_nbody_sph_simulation
 Reads an Nbody-SPH simulation file ( file_nbody_sph()). More...
 
subroutine io_routines::read_stellar_library
 reads the input stellar library (see file_stellar_library()). More...
 

Variables

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