LCOV - code coverage report
Current view: top level - shared/common/src/28_numeric_noabirule - abi_xcopy.f90 (source / functions) Coverage Total Hit
Test: coverage.info Lines: 66.7 % 36 24
Test Date: 2026-09-20 15:27:41 Functions: 55.6 % 9 5

            Line data    Source code
       1              : !{\src2tex{textfont=tt}}
       2              : !!****f* m_abi_linalg/abi_xcopy
       3              : !! NAME
       4              : !!  abi_xcopy
       5              : !!
       6              : !! FUNCTION
       7              : !! abi_xcopy is the generic function for vector copy
       8              : !! It performs the data copy: dst(1:n:incdst) = src(1:n:incsrc)
       9              : !!
      10              : !! COPYRIGHT
      11              : !!  Copyright (C) 2001-2026 ABINIT group (LNguyen,FDahm (CS))
      12              : !!  This file is distributed under the terms of the
      13              : !!  GNU General Public License, see ~abinit/COPYING
      14              : !!  or http://www.gnu.org/copyleft/gpl.txt .
      15              : !!
      16              : !! SOURCE
      17              : 
      18              : !!***
      19              : 
      20              : !!****f* m_abi_linalg/abi_zcopy
      21              : !! NAME
      22              : !! abi_zcopy
      23              : !!
      24              : !! FUNCTION
      25              : !!
      26              : !! INPUTS
      27              : !!
      28              : !! SOURCE
      29              : !!
      30            0 : subroutine abi_zcopy(size,tsrc,incsrc,tdest,incdest)
      31              : 
      32              : !Arguments-------------------------------------
      33              :  integer, intent(in) :: size
      34              :  integer, intent(in) :: incsrc
      35              :  integer, intent(in) :: incdest
      36              :  complex(dp),intent(in) :: tsrc
      37              :  complex(dp),intent(inout) :: tdest
      38              : 
      39              :  !Local variables-------------------------------
      40              : #ifdef DEV_LINALG_TIMING
      41              :  real(dp) :: tsec(2)
      42              :  call timab(TIMAB_XCOPY,1,tsec)
      43              : #endif
      44              : 
      45            0 :  call zcopy(size,tsrc,incsrc,tdest,incdest)
      46              : 
      47              : #ifdef DEV_LINALG_TIMING
      48              :  call timab(TIMAB_XCOPY,2,tsec)
      49              : #endif
      50              : 
      51            0 : end subroutine abi_zcopy
      52              : !!***
      53              : 
      54              : !!****f* m_abi_linalg/abi_zcopy_1d
      55              : !! NAME
      56              : !! abi_zcopy_1d
      57              : !!
      58              : !! FUNCTION
      59              : !!
      60              : !! INPUTS
      61              : !!
      62              : !! SOURCE
      63              : 
      64            0 : subroutine abi_zcopy_1d(size,tsrc,incsrc,tdest,incdest)
      65              : 
      66              : !Arguments-------------------------------------
      67              :  integer, intent(in) :: size
      68              :  integer, intent(in) :: incsrc
      69              :  integer, intent(in) :: incdest
      70              :  complex(dp), intent(in) :: tsrc(*)
      71              :  complex(dp), intent(inout) :: tdest(*)
      72              : 
      73            0 :  call abi_zcopy(size,tsrc(1),incsrc,tdest(1),incdest)
      74              : 
      75            0 : end subroutine abi_zcopy_1d
      76              : !!***
      77              : 
      78              : !!****f* m_abi_linalg/abi_dcopy
      79              : !! NAME
      80              : !! abi_dcopy
      81              : !!
      82              : !! FUNCTION
      83              : !!
      84              : !! INPUTS
      85              : !!
      86              : !! SOURCE
      87              : 
      88      1729254 : subroutine abi_dcopy(size,tsrc,incsrc,tdest,incdest,x_cplx)
      89              : 
      90              : !Arguments-------------------------------------
      91              :  integer, intent(in) :: size
      92              :  integer, intent(in) :: incsrc
      93              :  integer, intent(in) :: incdest
      94              :  real(dp),intent(in) :: tsrc
      95              :  real(dp),intent(inout) :: tdest
      96              :  integer, intent(in), optional :: x_cplx
      97              : 
      98              : !Local variables-------------------------------
      99              :  integer  :: cplx_
     100              : 
     101              : #ifdef DEV_LINALG_TIMING
     102              :  real(dp) :: tsec(2)
     103              :  call timab(TIMAB_XCOPY,1,tsec)
     104              : #endif
     105              : 
     106      1729254 :  cplx_=1 ; if(PRESENT(x_cplx)) cplx_ = x_cplx
     107       714290 :  if(cplx_ == 2) then
     108       703153 :     call zcopy(size,tsrc,incsrc,tdest,incdest)
     109              :  else
     110      1026101 :     call dcopy(size,tsrc,incsrc,tdest,incdest)
     111              :  end if
     112              : 
     113              : #ifdef DEV_LINALG_TIMING
     114              :  call timab(TIMAB_XCOPY,2,tsec)
     115              : #endif
     116              : 
     117      1729254 : end subroutine abi_dcopy
     118              : !!***
     119              : 
     120              : !!****f* m_abi_linalg/abi_dcopy_1d
     121              : !! NAME
     122              : !! abi_dcopy_1d
     123              : !!
     124              : !! FUNCTION
     125              : !!
     126              : !! INPUTS
     127              : !!
     128              : !! SOURCE
     129              : 
     130        26700 : subroutine abi_dcopy_1d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     131              : 
     132              : !Arguments-------------------------------------
     133              :  integer, intent(in) :: size
     134              :  integer, intent(in) :: incsrc
     135              :  integer, intent(in) :: incdest
     136              :  real(dp), intent(in)  :: tsrc(*)
     137              :  real(dp), intent(inout) :: tdest(*)
     138              : !Only for lobpcgwf
     139              :  integer, intent(in), optional :: x_cplx
     140              : 
     141        26700 :  call abi_dcopy(size,tsrc(1),incsrc,tdest(1),incdest,x_cplx)
     142              : 
     143        26700 : end subroutine abi_dcopy_1d
     144              : !!***
     145              : 
     146              : !!****f* m_abi_linalg/abi_dcopy_2d
     147              : !! NAME
     148              : !! abi_dcopy_2d
     149              : !!
     150              : !! FUNCTION
     151              : !!
     152              : !! INPUTS
     153              : !!
     154              : !! SOURCE
     155              : 
     156            0 : subroutine abi_dcopy_2d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     157              : 
     158              : !Arguments-------------------------------------
     159              :  integer, intent(in) :: size
     160              :  integer, intent(in) :: incsrc
     161              :  integer, intent(in) :: incdest
     162              :  real(dp), DEV_CONTARRD intent(in) :: tsrc(:,:)
     163              :  real(dp), DEV_CONTARRD intent(inout) :: tdest(:,:)
     164              : !Only for lobpcgwf
     165              :  integer, intent(in), optional :: x_cplx
     166              : 
     167              :  ! write(*,*) "dcopy2D size=",size
     168            0 :  call abi_dcopy(size,tsrc(1,1),incsrc,tdest(1,1),incdest,x_cplx)
     169              : 
     170            0 : end subroutine abi_dcopy_2d
     171              : !!***
     172              : 
     173              : !!****f* m_abi_linalg/abi_dcopy_0d_1d
     174              : !! NAME
     175              : !! abi_dcopy_0d_1d
     176              : !!
     177              : !! FUNCTION
     178              : !!
     179              : !! INPUTS
     180              : !!
     181              : !! SOURCE
     182              : 
     183            0 : subroutine abi_dcopy_0d_1d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     184              : 
     185              : !Arguments-------------------------------------
     186              :  integer, intent(in) :: size
     187              :  integer, intent(in) :: incsrc
     188              :  integer, intent(in) :: incdest
     189              :  real(dp),intent(in) :: tsrc
     190              :  real(dp), intent(inout) :: tdest(*)
     191              :  integer,intent(in), optional :: x_cplx !only lobpcgwf
     192              : 
     193            0 :  call abi_dcopy(size,tsrc,incsrc,tdest(1),incdest,x_cplx)
     194              : 
     195            0 : end subroutine abi_dcopy_0d_1d
     196              : !!***
     197              : 
     198              : !!****f* m_abi_linalg/abi_dcopy_1d_0d
     199              : !! NAME
     200              : !! abi_dcopy_1d_0d
     201              : !!
     202              : !! FUNCTION
     203              : !!
     204              : !! INPUTS
     205              : !!
     206              : !! SOURCE
     207              : 
     208       163157 : subroutine abi_dcopy_1d_0d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     209              : 
     210              :  !Arguments-------------------------------------
     211              :  integer, intent(in) :: size
     212              :  integer, intent(in) :: incsrc
     213              :  integer, intent(in) :: incdest
     214              :  real(dp),intent(in) :: tsrc(*)
     215              :  real(dp),intent(inout) :: tdest
     216              :  integer,intent(in), optional :: x_cplx !only lobpcgwf
     217              : 
     218       163157 :  call abi_dcopy(size,tsrc(1),incsrc,tdest,incdest,x_cplx)
     219              : 
     220       163157 : end subroutine abi_dcopy_1d_0d
     221              : !!***
     222              : 
     223              : !!****f* m_abi_linalg/abi_d2zcopy_2d
     224              : !! NAME
     225              : !! abi_d2zcopy_2d
     226              : !!
     227              : !! FUNCTION
     228              : !!
     229              : !! INPUTS
     230              : !!
     231              : !! SOURCE
     232              : 
     233       129952 : subroutine abi_d2zcopy_2d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     234              : 
     235              :  !Arguments-------------------------------------
     236              :  integer, intent(in) :: size
     237              :  integer, intent(in) :: incsrc
     238              :  integer, intent(in) :: incdest
     239              :  real(dp),     DEV_CONTARRD intent(in) :: tsrc(:,:)
     240              :  complex(dp), DEV_CONTARRD intent(inout) :: tdest(:,:)
     241              :  !only in lobpcgwf
     242              :  integer, intent(in),optional :: x_cplx
     243              : 
     244              : !Local variables-------------------------------
     245              :  integer  :: cplx_
     246              : 
     247              : #ifdef DEV_LINALG_TIMING
     248              :  real(dp) :: tsec(2)
     249              :  call timab(TIMAB_XCOPY,1,tsec)
     250              : #endif
     251              : 
     252       129952 :  cplx_=1 ; if(PRESENT(x_cplx)) cplx_ = x_cplx
     253           64 :  if(cplx_ == 2) then
     254           64 :     call zcopy(size,tsrc,incsrc,tdest,incdest)
     255              :  else
     256       129888 :     call dcopy(size,tsrc,incsrc,tdest,incdest)
     257              :  end if
     258              : 
     259              : #ifdef DEV_LINALG_TIMING
     260              :  call timab(TIMAB_XCOPY,2,tsec)
     261              : #endif
     262              : 
     263       129952 : end subroutine abi_d2zcopy_2d
     264              : !!***
     265              : 
     266              : !!****f* m_abi_linalg/abi_z2dcopy_2d
     267              : !! NAME
     268              : !! abi_z2dcopy_2d
     269              : !!
     270              : !! FUNCTION
     271              : !!
     272              : !! INPUTS
     273              : !!
     274              : !! SOURCE
     275              : 
     276       129952 : subroutine abi_z2dcopy_2d(size,tsrc,incsrc,tdest,incdest,x_cplx)
     277              : 
     278              : !Arguments-------------------------------------
     279              :  integer, intent(in) :: size
     280              :  integer, intent(in) :: incsrc
     281              :  integer, intent(in) :: incdest
     282              :  complex(dp), DEV_CONTARRD intent(in) :: tsrc(:,:)
     283              :  real(dp),     DEV_CONTARRD intent(inout) :: tdest(:,:)
     284              :  !only in lobpcgwf
     285              :  integer,intent(in), optional :: x_cplx
     286              : 
     287              : !Local variables-------------------------------
     288              :  integer  :: cplx_
     289              : #ifdef DEV_LINALG_TIMING
     290              :  real(dp) :: tsec(2)
     291              :  call timab(TIMAB_XCOPY,1,tsec)
     292              : #endif
     293              : 
     294       129952 :  cplx_=1 ; if(PRESENT(x_cplx)) cplx_ = x_cplx
     295           64 :  if(cplx_ == 2) then
     296           64 :     call zcopy(size,tsrc,incsrc,tdest,incdest)
     297              :  else
     298       129888 :     call dcopy(size,tsrc,incsrc,tdest,incdest)
     299              :  end if
     300              : 
     301              : #ifdef DEV_LINALG_TIMING
     302              :  call timab(TIMAB_XCOPY,2,tsec)
     303              : #endif
     304              : 
     305       129952 : end subroutine abi_z2dcopy_2d
     306              : !!***
        

Generated by: LCOV version 2.3-1