10 integer(I4B),
private :: size
11 real(dp),
dimension(:),
pointer,
contiguous :: array
34 character(len=*) :: name
35 character(len=*) :: mem_path
38 this%is_mem_managed = .true.
40 call this%zero_entries()
51 this%is_mem_managed = .false.
52 allocate (this%array(n))
53 call this%zero_entries()
62 if (this%is_mem_managed)
then
65 deallocate (this%array)
74 real(dp),
dimension(:),
pointer,
contiguous :: array
105 val = this%array(idx)
117 this%array(i) = dzero
129 this%array(idx) = val
138 class(vectorbasetype),
pointer :: vec_x
141 real(DP),
dimension(:),
pointer,
contiguous :: x_array
143 x_array => vec_x%get_array()
145 this%array(i) = alpha * x_array(i) + this%array(i)
160 n2 = n2 + this%array(i)**2
169 write (*, *) this%array
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
This module defines variable data types.
integer(i4b) function sqv_get_size(this)
subroutine sqv_destroy(this)
Clean up.
subroutine sqv_set_value_local(this, idx, val)
Set vector value at local index.
subroutine sqv_create_mm(this, n, name, mem_path)
Create a sequential vector: the classic MF6 version,.
subroutine sqv_get_ownership_range(this, start, end)
real(dp) function, dimension(:), pointer, contiguous sqv_get_array(this)
Get a pointer to the underlying data array.
real(dp) function sqv_get_value_local(this, idx)
Get value at local index.
subroutine sqv_zero_entries(this)
set all elements to zero
subroutine sqv_create(this, n)
Create a sequential vector: the classic MF6 version.
subroutine sqv_print(this)
subroutine sqv_axpy(this, alpha, vec_x)
Caculcates AXPY: y = a*x + y.
real(dp) function sqv_norm2(this)
Calculate the 2-norm.