44 real(kind=
rp),
allocatable :: x(:)
46 integer,
private :: n = 0
62 generic ::
assignment(=) => assign
74 integer,
intent(in) :: size
77 call this%allocate(size)
78 call rzero(this%x, this%n)
88 if (
allocated(this%x))
deallocate(this%x)
97 integer,
intent(in) :: size
100 allocate(this%x(size))
111 if (.not. source%is_allocated())
then
114 else if (source%size() .ne. this%size())
then
116 call this%allocate(source%size())
119 call copy(this%x, source%x, this%n)
137 is_alloc =
allocated(this%x)
Module containing host-only array type.
subroutine host_array_assign(this, source)
Assignment with deep-copy ownership semantics.
subroutine host_array_allocate(this, size)
Allocate a host array (used by init and assignment).
subroutine host_array_free(this)
Free a host array.
pure integer function host_array_size(this)
Return the number of entries in the host array.
subroutine host_array_init(this, size)
Initialize a host array of size size.
pure logical function host_array_is_allocated(this)
Check whether the host array is allocated.
subroutine, public copy(a, b, n)
Copy a vector .
subroutine, public rzero(a, n)
Zero a real vector.
integer, parameter, public rp
Global precision used in computations.
Host-only temporary array.