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