append_Z Subroutine

public subroutine append_Z(vec, val)

Arguments

Type IntentOptional Attributes Name
complex(kind=8), intent(inout), dimension(:), allocatable :: vec
complex(kind=8), intent(in) :: val

Called by

proc~~append_z~~CalledByGraph proc~append_z append_Z interface~append append interface~append->proc~append_z none~insert sparse_dmatrix_csr%insert none~insert->interface~append none~insert~2 sparse_zmatrix_csr%insert none~insert~2->interface~append none~insert~3 sparse_dmatrix_csc%insert none~insert~3->interface~append none~insert~4 sparse_zmatrix_csc%insert none~insert~4->interface~append proc~dmatmul_csc_csc dmatmul_csc_csc proc~dmatmul_csc_csc->none~insert~3 proc~dmatmul_csc_csr_2csc dmatmul_csc_csr_2csc proc~dmatmul_csc_csr_2csc->none~insert~3 proc~dmatmul_csc_csr_2csr dmatmul_csc_csr_2csr proc~dmatmul_csc_csr_2csr->none~insert proc~dmatmul_csr_csr dmatmul_csr_csr proc~dmatmul_csr_csr->none~insert proc~zmatmul_csc_csc zmatmul_csc_csc proc~zmatmul_csc_csc->none~insert~4 proc~zmatmul_csc_csr_2csc zmatmul_csc_csr_2csc proc~zmatmul_csc_csr_2csc->none~insert~4 proc~zmatmul_csc_csr_2csr zmatmul_csc_csr_2csr proc~zmatmul_csc_csr_2csr->none~insert~2 proc~zmatmul_csr_csr zmatmul_csr_csr proc~zmatmul_csr_csr->none~insert~2 interface~matmul~2 matmul interface~matmul~2->proc~dmatmul_csc_csc interface~matmul~2->proc~dmatmul_csc_csr_2csc interface~matmul~2->proc~dmatmul_csc_csr_2csr interface~matmul~2->proc~dmatmul_csr_csr interface~matmul~2->proc~zmatmul_csc_csc interface~matmul~2->proc~zmatmul_csc_csr_2csc interface~matmul~2->proc~zmatmul_csc_csr_2csr interface~matmul~2->proc~zmatmul_csr_csr

Source Code

  subroutine append_Z(vec,val)
    complex(8),dimension(:),allocatable,intent(inout) :: vec
    complex(8),intent(in)                             :: val  
    complex(8),dimension(:),allocatable               :: tmp
    integer                                           :: n
    !
    if (allocated(vec)) then
       n = size(vec)
       allocate(tmp(n+1))
       tmp(:n) = vec
       call move_alloc(tmp,vec)
       n = n + 1
    else
       n = 1
       allocate(vec(n))
    end if
    !
    !Put val as last entry:
    vec(n) = val
    !
    if(allocated(tmp))deallocate(tmp)
  end subroutine append_Z