User-supplied conversion formulas from dBm to mW (and viceversa), float64.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=R8P), | intent(in) | :: | magnitude | Magnitude (of the quantity) to be converted. |
||
| logical, | intent(in), | optional | :: | inverse | Activate inverse conversion. |
Converted magnitude.
pure function convert_float64(magnitude, inverse) result(converted)
!---------------------------------------------------------------------------------------------------------------------------------
!< User-supplied conversion formulas from dBm to mW (and viceversa), float64.
!---------------------------------------------------------------------------------------------------------------------------------
real(R8P), intent(in) :: magnitude !< Magnitude (of the quantity) to be converted.
logical, intent(in), optional :: inverse !< Activate inverse conversion.
real(R8P) :: converted !< Converted magnitude.
logical :: inverse_ !< Activate inverse conversion, local variable.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
inverse_ = .false. ; if (present(inverse)) inverse_ = inverse
if (inverse_) then
converted = 10._R8P * log10(magnitude)
else
converted = 10._R8P ** (magnitude / 10._R8P)
endif
!---------------------------------------------------------------------------------------------------------------------------------
endfunction convert_float64