uom32 = uom64 assignment.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(uom32), | intent(inout) | :: | lhs | Left hand side. |
||
| type(uom64), | 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 uom32_assign_uom64(lhs, rhs)
!---------------------------------------------------------------------------------------------------------------------------------
!< `uom32 = uom64` assignment.
!---------------------------------------------------------------------------------------------------------------------------------
type(uom32), intent(inout) :: lhs !< Left hand side.
type(uom64), intent(in) :: rhs !< Right hand side.
type(uom_reference64), allocatable :: rhs_references(:) !< RHS references.
type(uom_reference64) :: 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_uom64