get_wavelength.f90 Source File


This file depends on

sourcefile~~get_wavelength.f90~~EfferentGraph sourcefile~get_wavelength.f90 get_wavelength.f90 sourcefile~kind_parameters.f90 kind_parameters.f90 sourcefile~get_wavelength.f90->sourcefile~kind_parameters.f90

Files dependent on this one

sourcefile~~get_wavelength.f90~~AfferentGraph sourcefile~get_wavelength.f90 get_wavelength.f90 sourcefile~get_wavelength_wrapper.f90 get_wavelength_wrapper.f90 sourcefile~get_wavelength_wrapper.f90->sourcefile~get_wavelength.f90

Contents

Source Code


Source Code

!> Get wavelength of light
!>
!> `!>` is for documentation that appears before the thing you're documenting
!> (https://forddocs.readthedocs.io/en/stable/user_guide/project_file_options.html#predocmark).
!> `!!` is for documentation that appears after the thing you're documenting
module m_get_wavelength

    use kind_parameters, only: dp

    implicit none (type, external)
    private

    real(kind=dp), parameter, public :: speed_of_light = 2.99792e8_dp
    !! Speed of light [m/s]

    public :: get_wavelength

contains

    pure function get_wavelength(frequency) result(wavelength)
        !! Get wavelength of light for a given frequency
        !
        ! Trying with FORD style docstrings for now
        ! see https://forddocs.readthedocs.io/en/stable/

        real(kind=dp), intent(in) :: frequency
        !! Frequency

        real(kind=dp) :: wavelength
        !! Corresponding wavelength

        wavelength = speed_of_light / frequency

    end function get_wavelength

end module m_get_wavelength