Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(uniform_gradient_field), | intent(inout) | :: | this | |||
class(scalar_field), | intent(in) | :: | rhs |
impure elemental subroutine uniform_gradient_assign(this,rhs)
!* Author: Chris MacMackin
! Date: July 2017
!
! \({\rm field} = {\rm field}\)
!
class(uniform_gradient_field), intent(inout) :: this
class(scalar_field), intent(in) :: rhs
call rhs%guard_temp()
select type(rhs)
class is(uniform_gradient_field)
this%uniform_scalar_field = rhs%uniform_scalar_field
if (allocated(rhs%grad)) then
this%grad = rhs%grad
else if (allocated(this%grad)) then
deallocate(this%grad)
end if
call this%unset_temp()
class is(uniform_scalar_field)
this%uniform_scalar_field = rhs
if (allocated(this%grad)) deallocate(this%grad)
call this%unset_temp()
class default
error stop ('Assigning incompatible type to uniform_gradient_field')
end select
call rhs%clean_temp()
end subroutine uniform_gradient_assign