uom32 = uom128 assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(uom32), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom128), | intent(in) | :: | rhs | Right hand side. |
subroutine uom32_assign_uom128(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< `uom32 = uom128` assignment.
!---------------------------------------------------------------------------------------------------------------------------------
type(uom32), intent(inout) :: lhs !< Left hand side.
type(uom128), intent(in) :: rhs !< Right hand side.
type(uom_reference128), allocatable :: rhs_references(:) !< RHS references.
type(uom_reference128) :: rhs_alias !< RHS alias.
type(uom_reference32), allocatable :: lhs_references(:) !< LHS references.
type(uom_reference32) :: lhs_alias !< LHS alias.
integer(I_P) :: r !< Counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (rhs%is_defined()) then
if (.not.lhs%is_defined()) then
if (allocated(rhs%name)) call lhs%set(name=rhs%name)
call rhs%get_references(references=rhs_references)
call rhs%get_alias(alias=rhs_alias)
if (allocated(rhs_references)) then
allocate(lhs_references(1:size(rhs_references, dim=1)))
do r=1, size(rhs_references, dim=1)
lhs_references(r) = rhs_references(r)
enddo
call lhs%set(references=lhs_references)
endif
if (rhs_alias%is_defined()) then
lhs_alias = rhs_alias
call lhs%set(alias=lhs_alias)
endif
else
write(stderr, "(A)") 'error: cannot assign between "'//&
lhs%stringify(with_dimensions=.true., with_aliases=.true.)//'" and "'//&
rhs%stringify(with_dimensions=.true., with_aliases=.true.)//'"'
stop
endif
endif
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine uom32_assign_uom128