LCOV - code coverage report
Current view: top level - src/common - linear_systems.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4c33f95) Lines: 8 9 88.9 %
Date: 2025-01-30 06:53:08 Functions: 1 1 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2025 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief Provides interfaces to LAPACK routines for factorisation and
      10             : !>      linear system solving
      11             : !> \par History
      12             : !>      none
      13             : !> \author JGH (30-5-2001)
      14             : ! **************************************************************************************************
      15             : MODULE linear_systems
      16             : 
      17             :    USE kinds,                           ONLY: dp
      18             : #include "../base/base_uses.f90"
      19             : 
      20             :    IMPLICIT NONE
      21             : 
      22             :    PRIVATE
      23             : 
      24             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'linear_systems'
      25             : 
      26             :    PUBLIC :: solve_system
      27             : 
      28             : CONTAINS
      29             : 
      30             : ! **************************************************************************************************
      31             : !> \brief ...
      32             : !> \param matrix ...
      33             : !> \param mysize ...
      34             : !> \param eigenvectors ...
      35             : ! **************************************************************************************************
      36      659034 :    SUBROUTINE solve_system(matrix, mysize, eigenvectors)
      37             : 
      38             :       REAL(KIND=dp), INTENT(INOUT)                       :: matrix(:, :)
      39             :       INTEGER, INTENT(IN)                                :: mysize
      40             :       REAL(KIND=dp), INTENT(INOUT)                       :: eigenvectors(:, :)
      41             : 
      42     1318068 :       INTEGER                                            :: info, lda, ldb, nrhs, ipiv(mysize)
      43             : 
      44      659034 :       lda = SIZE(matrix, 1)
      45      659034 :       ldb = SIZE(eigenvectors, 1)
      46      659034 :       nrhs = SIZE(eigenvectors, 2)
      47             : 
      48             :       CALL dgesv(mysize, nrhs, matrix, lda, ipiv, &
      49      659034 :                  eigenvectors, ldb, info)
      50      659034 :       IF (info /= 0) THEN
      51           0 :          CPABORT("Error in inversion")
      52             :       END IF
      53             : 
      54      659034 :    END SUBROUTINE solve_system
      55             : 
      56             : END MODULE linear_systems
      57             : 

Generated by: LCOV version 1.15