|
| 1 | +module constants_mod |
| 2 | +!!============================================================================== |
| 3 | +! This module defines various mathematical constants |
| 4 | +! |
| 5 | +! |
| 6 | +! Last edited: November 27th 2020. |
| 7 | +!!============================================================================== |
| 8 | + |
| 9 | + !!==============!! |
| 10 | + ! Use statements ! |
| 11 | + !================!============================================================ |
| 12 | + use working_precision, only: wp |
| 13 | + |
| 14 | + implicit none |
| 15 | + |
| 16 | + |
| 17 | + !!=================================!! |
| 18 | + ! Public types/procedures/constants ! |
| 19 | + !===================================!========================================= |
| 20 | + |
| 21 | + ! Constants |
| 22 | + complex(wp), parameter, public :: I_IMAG = cmplx(0._wp, 1._wp) |
| 23 | + complex(wp), parameter, public :: ZERO_CMPLX = cmplx(0._wp, 0._wp) |
| 24 | + real(wp) , parameter, public :: PERMEABILITY_VACUUM = 1.25663706212e-6_wp |
| 25 | + real(wp) , parameter, public :: PERMITIVITY_VACUUM = 8.8541878128e-12_wp |
| 26 | + real(wp) , parameter, public :: LIGHTSPEED_VACUUM = 299792458._wp |
| 27 | + real(wp) , parameter, public :: PI = 4._wp*atan(1._wp) |
| 28 | + real(wp) , parameter, public :: PI4_INV = 1._wp/(4._wp*PI) |
| 29 | + real(wp) , parameter, public :: ZERO = 0._wp |
| 30 | + real(wp) , parameter, public :: UNITY = 1._wp |
| 31 | + |
| 32 | + !!==================================!! |
| 33 | + ! Private types/procedures/constants ! |
| 34 | + !====================================!======================================== |
| 35 | + private |
| 36 | + |
| 37 | + !!------------------------!! |
| 38 | + ! Derived type definitions ! |
| 39 | + !--------------------------!-------------------------------------------------- |
| 40 | + |
| 41 | + |
| 42 | + !=======!=========================!==========================================! |
| 43 | +contains ! /\/\/\/\/\/\/\/\/\/\/\/\!/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\! |
| 44 | + !=======!=========================!==========================================! |
| 45 | + |
| 46 | + |
| 47 | + !!=================!! |
| 48 | + ! Public procedures ! |
| 49 | + !===================!========================================================= |
| 50 | + |
| 51 | + |
| 52 | + !!------------!! |
| 53 | + ! Constructors ! |
| 54 | + !--------------!-------------------------------------------------------------- |
| 55 | + |
| 56 | + |
| 57 | + !!==================================!! |
| 58 | + ! RWG_basis_type internal procedures ! |
| 59 | + !====================================!======================================== |
| 60 | + !!------------!! |
| 61 | + ! Initialisers ! |
| 62 | + !--------------!-------------------------------------------------------------- |
| 63 | + |
| 64 | +end module constants_mod |
0 commit comments