qreal64 = qreal128 assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(qreal64), | intent(inout) | :: | lhs | Left hand side. |
||
| type(qreal128), | intent(in) | :: | rhs | Right hand side. |
subroutine qreal64_assign_qreal128(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< `qreal64 = qreal128` assignment.
!---------------------------------------------------------------------------------------------------------------------------------
type(qreal64), intent(inout) :: lhs !< Left hand side.
type(qreal128), intent(in) :: rhs !< Right hand side.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (rhs%is_unit_defined()) then
lhs%magnitude = rhs%magnitude
if (allocated(rhs%name)) lhs%name = rhs%name
if (.not.lhs%is_unit_defined()) then
call lhs%allocate_unit
lhs%unit = rhs%unit
else
write(stderr, "(A)") 'error: cannot assign between "'//&
lhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//&
'" and "'//&
rhs%stringify(with_dimensions=.true., with_aliases=.true., with_name=.true., compact_reals=.true.)//'"'
stop
endif
endif
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine qreal64_assign_qreal128