uom_symbol128 = uom_symbol32 assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(uom_symbol128), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom_symbol32), | intent(in) | :: | rhs | Right hand side. |
subroutine uom_symbol128_assign_uom_symbol32(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< `uom_symbol128 = uom_symbol32` assignment.
!---------------------------------------------------------------------------------------------------------------------------------
type(uom_symbol128), intent(inout) :: lhs !< Left hand side.
type(uom_symbol32), intent(in) :: rhs !< Right hand side.
integer(I_P) :: exponent_ !< Exponent of the symbol, e.g. "-1" for Hertz, namely "s-1".
real(R4P) :: factor_ !< Symbol multiplicative scale factor (used only for converters).
real(R4P) :: offset_ !< Symbol additive offset (used only for converters).
type(string) :: symbol_ !< literal symbol, e.g. "m" for metres.
class(uom_converter), allocatable :: convert_ !< Generic conversion alias formula user-supplied.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (rhs%is_defined()) then
if (.not.lhs%is_defined()) then
exponent_ = rhs%get_exponent()
factor_ = rhs%get_factor()
offset_ = rhs%get_offset()
symbol_ = rhs%get_symbol()
call rhs%get_convert(convert_=convert_)
if (allocated(convert_)) then
call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, &
factor_=real(factor_, R16P), offset_=real(offset_, R16P), &
convert_=convert_)
else
call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R16P), offset_=real(offset_, R16P))
endif
else
write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
stop
endif
endif
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine uom_symbol128_assign_uom_symbol32