kinds.f90 Source File


Files dependent on this one

sourcefile~~kinds.f90~~AfferentGraph sourcefile~kinds.f90 kinds.f90 sourcefile~bench_main.f90 bench_main.f90 sourcefile~bench_main.f90->sourcefile~kinds.f90 sourcefile~benchmark.f90 benchmark.f90 sourcefile~bench_main.f90->sourcefile~benchmark.f90 sourcefile~benchmark.f90->sourcefile~kinds.f90 sourcefile~globals.f90 globals.f90 sourcefile~benchmark.f90->sourcefile~globals.f90 sourcefile~vsh.f90 vsh.f90 sourcefile~benchmark.f90->sourcefile~vsh.f90 sourcefile~convergence_main.f90 convergence_main.f90 sourcefile~convergence_main.f90->sourcefile~kinds.f90 sourcefile~convergence_main.f90->sourcefile~globals.f90 sourcefile~tests.f90 tests.f90 sourcefile~convergence_main.f90->sourcefile~tests.f90 sourcefile~convergence_main.f90->sourcefile~vsh.f90 sourcefile~dipole_flux_expulsion.f90 dipole_flux_expulsion.f90 sourcefile~dipole_flux_expulsion.f90->sourcefile~kinds.f90 sourcefile~dipole_flux_expulsion.f90->sourcefile~globals.f90 sourcefile~dipole_flux_expulsion.f90->sourcefile~vsh.f90 sourcefile~dipole_synthesis.f90 dipole_synthesis.f90 sourcefile~dipole_synthesis.f90->sourcefile~kinds.f90 sourcefile~dipole_synthesis.f90->sourcefile~globals.f90 sourcefile~dipole_synthesis.f90->sourcefile~vsh.f90 sourcefile~dipole_uniform_sphere.f90 dipole_uniform_sphere.f90 sourcefile~dipole_uniform_sphere.f90->sourcefile~kinds.f90 sourcefile~dipole_uniform_sphere.f90->sourcefile~globals.f90 sourcefile~dipole_uniform_sphere.f90->sourcefile~vsh.f90 sourcefile~globals.f90->sourcefile~kinds.f90 sourcefile~gwi_gwj_sweep.f90 gwi_gwj_sweep.f90 sourcefile~gwi_gwj_sweep.f90->sourcefile~kinds.f90 sourcefile~gwi_gwj_sweep.f90->sourcefile~globals.f90 sourcefile~gwi_gwj_sweep.f90->sourcefile~vsh.f90 sourcefile~main.f90 main.f90 sourcefile~main.f90->sourcefile~kinds.f90 sourcefile~main.f90->sourcefile~globals.f90 sourcefile~main.f90->sourcefile~tests.f90 sourcefile~stability_main.f90 stability_main.f90 sourcefile~stability_main.f90->sourcefile~kinds.f90 sourcefile~stability_main.f90->sourcefile~globals.f90 sourcefile~stability_main.f90->sourcefile~vsh.f90 sourcefile~tests.f90->sourcefile~kinds.f90 sourcefile~tests.f90->sourcefile~globals.f90 sourcefile~tests.f90->sourcefile~vsh.f90 sourcefile~unnorm_stability_main.f90 unnorm_stability_main.f90 sourcefile~unnorm_stability_main.f90->sourcefile~kinds.f90 sourcefile~unnorm_stability_main.f90->sourcefile~globals.f90 sourcefile~unnorm_stability_main.f90->sourcefile~vsh.f90 sourcefile~vsh.f90->sourcefile~kinds.f90 sourcefile~vsh.f90->sourcefile~globals.f90 sourcefile~vsh_decomposition.f90 vsh_decomposition.f90 sourcefile~vsh_decomposition.f90->sourcefile~kinds.f90 sourcefile~vsh_decomposition.f90->sourcefile~globals.f90 sourcefile~vsh_decomposition.f90->sourcefile~vsh.f90 sourcefile~vsh_decomposition_tor.f90 vsh_decomposition_tor.f90 sourcefile~vsh_decomposition_tor.f90->sourcefile~kinds.f90 sourcefile~vsh_decomposition_tor.f90->sourcefile~globals.f90 sourcefile~vsh_decomposition_tor.f90->sourcefile~vsh.f90

Source Code

!> Numerical storage size parameters for real and integer values
!> https://fortran-lang.org/en/learn/best_practices/floating_point/

MODULE KINDS
  IMPLICIT NONE
  PRIVATE
  PUBLIC :: sp, dp, qp, i1, i2, i4, i8

  !> Single precision real numbers, 6 digits, range 10⁻³⁷ to 10³⁷-1; 32 bits
  integer, parameter :: sp = selected_real_kind(6, 37)
  !> Double precision real numbers, 15 digits, range 10⁻³⁰⁷ to 10³⁰⁷-1; 64 bits
  integer, parameter :: dp = selected_real_kind(15, 307)
  !> Quadruple precision real numbers, 33 digits, range 10⁻⁴⁹³¹ to 10⁴⁹³¹-1; 128 bits
  integer, parameter :: qp = selected_real_kind(33, 4931)

  !> Char length for integers, range -2⁷ to 2⁷-1; 8 bits
  integer, parameter :: i1 = selected_int_kind(2)
  !> Short length for integers, range -2¹⁵ to 2¹⁵-1; 16 bits
  integer, parameter :: i2 = selected_int_kind(4)
  !> Length of default integers, range -2³¹ to 2³¹-1; 32 bits
  integer, parameter :: i4 = selected_int_kind(9)
  !> Long length for integers, range -2⁶³ to 2⁶³-1; 64 bits
  integer, parameter :: i8 = selected_int_kind(18)

END MODULE KINDS