uom_symbol64 = uom_symbol32 assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(uom_symbol64), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom_symbol32), | intent(in) | :: | rhs | Right hand side. |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine uom_symbol64_assign_uom_symbol32(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< `uom_symbol64 = uom_symbol32` assignment.
!---------------------------------------------------------------------------------------------------------------------------------
type(uom_symbol64), 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_, R8P), offset_=real(offset_, R8P), &
convert_=convert_)
else
call lhs%set(symbol_=symbol_%chars(), exponent_=exponent_, factor_=real(factor_, R8P), offset_=real(offset_, R8P))
endif
else
write(stderr, "(A)") 'error: cannot assign between "'//lhs%stringify()//'" and "'//rhs%stringify()//'"'
stop
endif
endif
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine uom_symbol64_assign_uom_symbol32