sdf initializer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sdf), | intent(inout) | :: | lhs | |||
class(sdf_base), | intent(in) | :: | rhs |
subroutine sdf_assign(lhs, rhs) !! sdf initializer class(sdf), intent(inout) :: lhs class(sdf_base), intent(in) :: rhs if (allocated(lhs%value))deallocate(lhs%value) ! Prevent nested derived type select type (rhsT=>rhs) class is (sdf) if(allocated(rhsT%value))allocate(lhs%value,source=rhsT%value) class default allocate(lhs%value,source=rhsT) end select end subroutine sdf_assign