-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_wavelength.f90
More file actions
36 lines (25 loc) · 1019 Bytes
/
get_wavelength.f90
File metadata and controls
36 lines (25 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
!> 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