random_module.f90 Source File


This file depends on

sourcefile~~random_module.f90~~EfferentGraph sourcefile~random_module.f90 random_module.f90 sourcefile~kind_module.f90 kind_module.F90 sourcefile~random_module.f90->sourcefile~kind_module.f90

Files dependent on this one

sourcefile~~random_module.f90~~AfferentGraph sourcefile~random_module.f90 random_module.f90 sourcefile~fortran_astrodynamics_toolkit.f90 fortran_astrodynamics_toolkit.f90 sourcefile~fortran_astrodynamics_toolkit.f90->sourcefile~random_module.f90 sourcefile~geopotential_module.f90 geopotential_module.f90 sourcefile~fortran_astrodynamics_toolkit.f90->sourcefile~geopotential_module.f90 sourcefile~lambert_module.f90 lambert_module.f90 sourcefile~fortran_astrodynamics_toolkit.f90->sourcefile~lambert_module.f90 sourcefile~c_interface_module.f90 c_interface_module.f90 sourcefile~fortran_astrodynamics_toolkit.f90->sourcefile~c_interface_module.f90 sourcefile~geopotential_module.f90->sourcefile~random_module.f90 sourcefile~lambert_module.f90->sourcefile~random_module.f90 sourcefile~c_interface_module.f90->sourcefile~geopotential_module.f90

Source Code

!*****************************************************************************************
!> author: Jacob Williams
!
!  Random number generation.

    module random_module

    use kind_module,      only: wp

    implicit none

    private

    !public routines:
    public :: get_random_number

    contains
!*****************************************************************************************

!*****************************************************************************************
!> author: Jacob Williams
!
!  Returns a uniform random number `x`, such that: `a <= x < b`.

    function get_random_number(a,b) result(x)

    implicit none

    real(wp)            :: x
    real(wp),intent(in) :: a
    real(wp),intent(in) :: b

    call random_number(x)

    x = a + (b-a)*x

    end function get_random_number
!*****************************************************************************************

!*****************************************************************************************
    end module random_module
!*****************************************************************************************