precision_def.F90 Source File


Files dependent on this one

sourcefile~~precision_def.f90~~AfferentGraph sourcefile~precision_def.f90 precision_def.F90 sourcefile~ionz_data.f90 ionz_data.f90 sourcefile~ionz_data.f90->sourcefile~precision_def.f90 sourcefile~legacy_fft_lib.f90 legacy_fft_lib.F90 sourcefile~legacy_fft_lib.f90->sourcefile~precision_def.f90 sourcefile~grid_param.f90 grid_param.f90 sourcefile~grid_param.f90->sourcefile~precision_def.f90 sourcefile~struct_def.f90 struct_def.f90 sourcefile~grid_param.f90->sourcefile~struct_def.f90 sourcefile~struct_def.f90->sourcefile~precision_def.f90 sourcefile~common_param.f90 common_param.f90 sourcefile~common_param.f90->sourcefile~precision_def.f90 sourcefile~mpi_var.f90 mpi_var.f90 sourcefile~mpi_var.f90->sourcefile~precision_def.f90 sourcefile~fstruct_data.f90 fstruct_data.f90 sourcefile~fstruct_data.f90->sourcefile~precision_def.f90 sourcefile~pstruct_data.f90 pstruct_data.f90 sourcefile~pstruct_data.f90->sourcefile~precision_def.f90 sourcefile~pstruct_data.f90->sourcefile~struct_def.f90 sourcefile~phys_param.f90 phys_param.f90 sourcefile~phys_param.f90->sourcefile~precision_def.f90 sourcefile~code_util.f90 code_util.f90 sourcefile~code_util.f90->sourcefile~precision_def.f90 sourcefile~modern_fft_lib.f90 modern_fft_lib.F90 sourcefile~modern_fft_lib.f90->sourcefile~precision_def.f90 sourcefile~util.f90 util.f90 sourcefile~util.f90->sourcefile~precision_def.f90 sourcefile~util.f90->sourcefile~code_util.f90 sourcefile~control_bunch_input.f90 control_bunch_input.f90 sourcefile~control_bunch_input.f90->sourcefile~precision_def.f90 sourcefile~grid_part_connect.f90 grid_part_connect.f90 sourcefile~grid_part_connect.f90->sourcefile~fstruct_data.f90 sourcefile~grid_part_connect.f90->sourcefile~pstruct_data.f90 sourcefile~grid_part_lib.f90 grid_part_lib.f90 sourcefile~grid_part_connect.f90->sourcefile~grid_part_lib.f90 sourcefile~grid_part_util.f90 grid_part_util.f90 sourcefile~grid_part_util.f90->sourcefile~fstruct_data.f90 sourcefile~grid_part_util.f90->sourcefile~pstruct_data.f90 sourcefile~grid_part_util.f90->sourcefile~grid_part_lib.f90 sourcefile~mpi_field_interface.f90 mpi_field_interface.f90 sourcefile~mpi_field_interface.f90->sourcefile~grid_param.f90 sourcefile~mpi_field_interface.f90->sourcefile~fstruct_data.f90 sourcefile~mpi_field_interface.f90->sourcefile~pstruct_data.f90 sourcefile~parallel.f90 parallel.F90 sourcefile~mpi_field_interface.f90->sourcefile~parallel.f90 sourcefile~pic_dump.f90 pic_dump.f90 sourcefile~pic_dump.f90->sourcefile~grid_param.f90 sourcefile~pic_dump.f90->sourcefile~common_param.f90 sourcefile~pic_dump.f90->sourcefile~code_util.f90 sourcefile~pic_dump.f90->sourcefile~parallel.f90 sourcefile~array_alloc.f90 array_alloc.f90 sourcefile~pic_dump.f90->sourcefile~array_alloc.f90 sourcefile~set_grid_param.f90 set_grid_param.f90 sourcefile~set_grid_param.f90->sourcefile~grid_param.f90 sourcefile~set_grid_param.f90->sourcefile~common_param.f90 sourcefile~set_grid_param.f90->sourcefile~mpi_var.f90 sourcefile~stretched_grid.f90 stretched_grid.f90 sourcefile~stretched_grid.f90->sourcefile~grid_param.f90 sourcefile~stretched_grid.f90->sourcefile~common_param.f90 sourcefile~stretched_grid.f90->sourcefile~mpi_var.f90 sourcefile~init_beam_part_distrib.f90 init_beam_part_distrib.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~grid_param.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~phys_param.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~code_util.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~util.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~control_bunch_input.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~grid_part_util.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~mpi_field_interface.f90 sourcefile~psolve.f90 psolve.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~psolve.f90 sourcefile~init_grid_fields.f90 init_grid_fields.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~init_grid_fields.f90 sourcefile~mpi_curr_interface.f90 mpi_curr_interface.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~mpi_curr_interface.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~array_alloc.f90 sourcefile~prl_fft.f90 prl_fft.f90 sourcefile~prl_fft.f90->sourcefile~modern_fft_lib.f90 sourcefile~prl_fft.f90->sourcefile~parallel.f90 sourcefile~init_laser_field.f90 init_laser_field.f90 sourcefile~init_laser_field.f90->sourcefile~fstruct_data.f90 sourcefile~init_laser_field.f90->sourcefile~pstruct_data.f90 sourcefile~init_laser_field.f90->sourcefile~init_grid_fields.f90 sourcefile~grid_fields.f90 grid_fields.f90 sourcefile~init_laser_field.f90->sourcefile~grid_fields.f90 sourcefile~pic_out.f90 pic_out.f90 sourcefile~pic_out.f90->sourcefile~grid_param.f90 sourcefile~pic_out.f90->sourcefile~common_param.f90 sourcefile~pic_out.f90->sourcefile~fstruct_data.f90 sourcefile~pic_out.f90->sourcefile~pstruct_data.f90 sourcefile~pic_out.f90->sourcefile~code_util.f90 sourcefile~pic_out.f90->sourcefile~parallel.f90 sourcefile~psolve.f90->sourcefile~grid_param.f90 sourcefile~psolve.f90->sourcefile~common_param.f90 sourcefile~psolve.f90->sourcefile~fstruct_data.f90 sourcefile~psolve.f90->sourcefile~pstruct_data.f90 sourcefile~psolve.f90->sourcefile~prl_fft.f90 sourcefile~psolve.f90->sourcefile~grid_fields.f90 sourcefile~grid_part_lib.f90->sourcefile~grid_param.f90 sourcefile~grid_part_lib.f90->sourcefile~common_param.f90 sourcefile~grid_part_lib.f90->sourcefile~stretched_grid.f90 sourcefile~pic_out_util.f90 pic_out_util.f90 sourcefile~pic_out_util.f90->sourcefile~phys_param.f90 sourcefile~pic_out_util.f90->sourcefile~grid_part_util.f90 sourcefile~pic_out_util.f90->sourcefile~mpi_field_interface.f90 sourcefile~pic_out_util.f90->sourcefile~psolve.f90 sourcefile~pic_out_util.f90->sourcefile~mpi_curr_interface.f90 sourcefile~window.f90 window.f90 sourcefile~window.f90->sourcefile~grid_param.f90 sourcefile~window.f90->sourcefile~common_param.f90 sourcefile~window.f90->sourcefile~fstruct_data.f90 sourcefile~window.f90->sourcefile~pstruct_data.f90 sourcefile~window.f90->sourcefile~util.f90 sourcefile~window.f90->sourcefile~mpi_field_interface.f90 sourcefile~mpi_part_interface.f90 mpi_part_interface.f90 sourcefile~window.f90->sourcefile~mpi_part_interface.f90 sourcefile~run_data_info.f90 run_data_info.f90 sourcefile~window.f90->sourcefile~run_data_info.f90 sourcefile~init_part_distrib.f90 init_part_distrib.f90 sourcefile~init_part_distrib.f90->sourcefile~grid_param.f90 sourcefile~init_part_distrib.f90->sourcefile~common_param.f90 sourcefile~init_part_distrib.f90->sourcefile~mpi_var.f90 sourcefile~init_part_distrib.f90->sourcefile~phys_param.f90 sourcefile~init_part_distrib.f90->sourcefile~code_util.f90 sourcefile~init_part_distrib.f90->sourcefile~util.f90 sourcefile~init_part_distrib.f90->sourcefile~array_alloc.f90 sourcefile~env_evolve_in_time.f90 env_evolve_in_time.f90 sourcefile~env_evolve_in_time.f90->sourcefile~util.f90 sourcefile~env_evolve_in_time.f90->sourcefile~window.f90 sourcefile~env_evolve_in_time.f90->sourcefile~mpi_part_interface.f90 sourcefile~curr_and_fields_util.f90 curr_and_fields_util.f90 sourcefile~env_evolve_in_time.f90->sourcefile~curr_and_fields_util.f90 sourcefile~ionize.f90 ionize.f90 sourcefile~env_evolve_in_time.f90->sourcefile~ionize.f90 sourcefile~boris_push.f90 boris_push.f90 sourcefile~env_evolve_in_time.f90->sourcefile~boris_push.f90 sourcefile~fluid_density_momenta.f90 fluid_density_momenta.f90 sourcefile~env_evolve_in_time.f90->sourcefile~fluid_density_momenta.f90 sourcefile~system_utilities.f90 system_utilities.f90 sourcefile~system_utilities.f90->sourcefile~mpi_var.f90 sourcefile~mpi_part_interface.f90->sourcefile~grid_param.f90 sourcefile~mpi_part_interface.f90->sourcefile~code_util.f90 sourcefile~mpi_part_interface.f90->sourcefile~parallel.f90 sourcefile~mpi_part_interface.f90->sourcefile~array_alloc.f90 sourcefile~init_grid_fields.f90->sourcefile~fstruct_data.f90 sourcefile~init_grid_fields.f90->sourcefile~pstruct_data.f90 sourcefile~init_grid_fields.f90->sourcefile~phys_param.f90 sourcefile~grid_field_param.f90 grid_field_param.f90 sourcefile~init_grid_fields.f90->sourcefile~grid_field_param.f90 sourcefile~diag_part_and_fields.f90 diag_part_and_fields.f90 sourcefile~diag_part_and_fields.f90->sourcefile~grid_param.f90 sourcefile~diag_part_and_fields.f90->sourcefile~fstruct_data.f90 sourcefile~diag_part_and_fields.f90->sourcefile~pstruct_data.f90 sourcefile~diag_part_and_fields.f90->sourcefile~phys_param.f90 sourcefile~diag_part_and_fields.f90->sourcefile~code_util.f90 sourcefile~diag_part_and_fields.f90->sourcefile~control_bunch_input.f90 sourcefile~diag_part_and_fields.f90->sourcefile~parallel.f90 sourcefile~set_init_param.f90 set_init_param.f90 sourcefile~set_init_param.f90->sourcefile~ionz_data.f90 sourcefile~set_init_param.f90->sourcefile~grid_param.f90 sourcefile~set_init_param.f90->sourcefile~common_param.f90 sourcefile~set_init_param.f90->sourcefile~phys_param.f90 sourcefile~set_init_param.f90->sourcefile~code_util.f90 sourcefile~set_init_param.f90->sourcefile~control_bunch_input.f90 sourcefile~set_init_param.f90->sourcefile~set_grid_param.f90 sourcefile~mpi_curr_interface.f90->sourcefile~grid_param.f90 sourcefile~mpi_curr_interface.f90->sourcefile~fstruct_data.f90 sourcefile~mpi_curr_interface.f90->sourcefile~pstruct_data.f90 sourcefile~mpi_curr_interface.f90->sourcefile~parallel.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_param.f90 sourcefile~curr_and_fields_util.f90->sourcefile~fstruct_data.f90 sourcefile~curr_and_fields_util.f90->sourcefile~pstruct_data.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_part_connect.f90 sourcefile~curr_and_fields_util.f90->sourcefile~mpi_field_interface.f90 sourcefile~curr_and_fields_util.f90->sourcefile~init_grid_fields.f90 sourcefile~curr_and_fields_util.f90->sourcefile~mpi_curr_interface.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_fields.f90 sourcefile~ionize.f90->sourcefile~ionz_data.f90 sourcefile~ionize.f90->sourcefile~common_param.f90 sourcefile~ionize.f90->sourcefile~mpi_var.f90 sourcefile~ionize.f90->sourcefile~util.f90 sourcefile~ionize.f90->sourcefile~array_alloc.f90 sourcefile~grid_field_param.f90->sourcefile~grid_param.f90 sourcefile~grid_field_param.f90->sourcefile~common_param.f90 sourcefile~grid_field_param.f90->sourcefile~mpi_var.f90 sourcefile~parallel.f90->sourcefile~common_param.f90 sourcefile~parallel.f90->sourcefile~mpi_var.f90 sourcefile~parallel.f90->sourcefile~util.f90 sourcefile~boris_push.f90->sourcefile~common_param.f90 sourcefile~boris_push.f90->sourcefile~fstruct_data.f90 sourcefile~boris_push.f90->sourcefile~pstruct_data.f90 sourcefile~read_input.f90 read_input.f90 sourcefile~read_input.f90->sourcefile~common_param.f90 sourcefile~read_input.f90->sourcefile~mpi_var.f90 sourcefile~read_input.f90->sourcefile~code_util.f90 sourcefile~read_input.f90->sourcefile~control_bunch_input.f90 sourcefile~run_data_info.f90->sourcefile~ionz_data.f90 sourcefile~run_data_info.f90->sourcefile~grid_param.f90 sourcefile~run_data_info.f90->sourcefile~common_param.f90 sourcefile~run_data_info.f90->sourcefile~fstruct_data.f90 sourcefile~run_data_info.f90->sourcefile~pstruct_data.f90 sourcefile~run_data_info.f90->sourcefile~phys_param.f90 sourcefile~run_data_info.f90->sourcefile~code_util.f90 sourcefile~run_data_info.f90->sourcefile~control_bunch_input.f90 sourcefile~run_data_info.f90->sourcefile~parallel.f90 sourcefile~array_alloc.f90->sourcefile~fstruct_data.f90 sourcefile~array_alloc.f90->sourcefile~pstruct_data.f90 sourcefile~pic_evolve_in_time.f90 pic_evolve_in_time.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~window.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~mpi_part_interface.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~init_grid_fields.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~curr_and_fields_util.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~ionize.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~boris_push.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~fluid_density_momenta.f90 sourcefile~pic_in.f90 pic_in.f90 sourcefile~pic_in.f90->sourcefile~init_laser_field.f90 sourcefile~pic_in.f90->sourcefile~init_part_distrib.f90 sourcefile~fluid_density_momenta.f90->sourcefile~mpi_field_interface.f90 sourcefile~fluid_density_momenta.f90->sourcefile~grid_fields.f90 sourcefile~start_all.f90 start_all.F90 sourcefile~start_all.f90->sourcefile~pic_dump.f90 sourcefile~start_all.f90->sourcefile~set_grid_param.f90 sourcefile~start_all.f90->sourcefile~system_utilities.f90 sourcefile~start_all.f90->sourcefile~set_init_param.f90 sourcefile~start_all.f90->sourcefile~ionize.f90 sourcefile~start_all.f90->sourcefile~read_input.f90 sourcefile~start_all.f90->sourcefile~run_data_info.f90 sourcefile~start_all.f90->sourcefile~array_alloc.f90 sourcefile~start_all.f90->sourcefile~pic_in.f90 sourcefile~grid_fields.f90->sourcefile~grid_field_param.f90 sourcefile~grid_fields.f90->sourcefile~parallel.f90 sourcefile~aladyn.f90 ALaDyn.F90 sourcefile~aladyn.f90->sourcefile~init_beam_part_distrib.f90 sourcefile~aladyn.f90->sourcefile~pic_out.f90 sourcefile~aladyn.f90->sourcefile~pic_out_util.f90 sourcefile~aladyn.f90->sourcefile~env_evolve_in_time.f90 sourcefile~aladyn.f90->sourcefile~diag_part_and_fields.f90 sourcefile~aladyn.f90->sourcefile~run_data_info.f90 sourcefile~aladyn.f90->sourcefile~pic_evolve_in_time.f90 sourcefile~aladyn.f90->sourcefile~start_all.f90

Contents

Source Code


Source Code

!*****************************************************************************************************!
!                            Copyright 2008-2020  The ALaDyn Collaboration                            !
!*****************************************************************************************************!

!*****************************************************************************************************!
!  This file is part of ALaDyn.                                                                       !
!                                                                                                     !
!  ALaDyn is free software: you can redistribute it and/or modify                                     !
!  it under the terms of the GNU General Public License as published by                               !
!  the Free Software Foundation, either version 3 of the License, or                                  !
!  (at your option) any later version.                                                                !
!                                                                                                     !
!  ALaDyn is distributed in the hope that it will be useful,                                          !
!  but WITHOUT ANY WARRANTY; without even the implied warranty of                                     !
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                      !
!  GNU General Public License for more details.                                                       !
!                                                                                                     !
!  You should have received a copy of the GNU General Public License                                  !
!  along with ALaDyn.  If not, see <http://www.gnu.org/licenses/>.                                    !
!*****************************************************************************************************!

 module precision_def

  implicit none
  public

  integer, parameter :: sp = selected_real_kind(6, 37)
  integer, parameter :: dp = selected_real_kind(15, 307)
  integer, parameter :: dp_int = selected_int_kind(16)
  integer, parameter :: hp_int = selected_int_kind(4)
  integer, parameter :: qp = selected_real_kind(33, 4931)

  logical(kind=1), dimension(8) :: res_string
  real(dp) :: wgh_cmp
  real(sp) :: wgh
  integer(hp_int) :: charge
  integer(hp_int) :: part_ind

  equivalence(charge, res_string(1)), (part_ind, res_string(3)), &
   (wgh, res_string(5)), (wgh_cmp, res_string(1))

  real(dp), parameter :: zero_dp = 0.0
  real(sp), parameter :: zero_sp = real(0.0, sp)
  real(dp), parameter :: one_dp = 1.0
  real(sp), parameter :: one_sp = real(1.0, sp)
  integer, parameter :: zero = 0
  integer, parameter :: one = 1
  integer(hp_int), parameter :: one_int_hp = int(1, hp_int)

 contains

  function is_zero(value) result(check)
   real(dp), intent(in) :: value
   real(dp), parameter :: small_value = 0.1
   logical :: check

   check = (abs(value) < epsilon(small_value))

  end function

 end module