LCOV - code coverage report
Current view: top level - src/aobasis - paw_basis_types.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 28 28 100.0 %
Date: 2024-11-21 06:45:46 Functions: 1 1 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \par History
      10             : !>      none
      11             : !> \author JGH (9.2022)
      12             : ! **************************************************************************************************
      13             : MODULE paw_basis_types
      14             : 
      15             :    USE basis_set_types,                 ONLY: get_gto_basis_set,&
      16             :                                               gto_basis_set_type
      17             :    USE orbital_pointers,                ONLY: nso,&
      18             :                                               nsoset
      19             : #include "../base/base_uses.f90"
      20             : 
      21             :    IMPLICIT NONE
      22             : 
      23             :    PRIVATE
      24             : 
      25             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'paw_basis_types'
      26             : 
      27             :    PUBLIC :: get_paw_basis_info
      28             : 
      29             : CONTAINS
      30             : 
      31             : ! **************************************************************************************************
      32             : !> \brief Return some info on the PAW basis derived from a GTO basis set
      33             : !> \param basis_1c The parent GTO basis set
      34             : !> \param o2nindex ...
      35             : !> \param n2oindex ...
      36             : !> \param nsatbas ...
      37             : !> \version 1.0
      38             : ! **************************************************************************************************
      39     1332262 :    SUBROUTINE get_paw_basis_info(basis_1c, o2nindex, n2oindex, nsatbas)
      40             : 
      41             :       TYPE(gto_basis_set_type), INTENT(IN)               :: basis_1c
      42             :       INTEGER, DIMENSION(:), OPTIONAL, POINTER           :: o2nindex, n2oindex
      43             :       INTEGER, INTENT(OUT), OPTIONAL                     :: nsatbas
      44             : 
      45             :       INTEGER                                            :: ico, ipgf, iset, iso, iso_pgf, iso_set, &
      46             :                                                             k, lx, maxso, nset, nsox
      47     1332262 :       INTEGER, DIMENSION(:), POINTER                     :: lmax, lmin, npgf
      48             :       LOGICAL                                            :: n2o, nsa, o2n
      49             : 
      50     1332262 :       o2n = PRESENT(o2nindex)
      51     1332262 :       n2o = PRESENT(n2oindex)
      52     1332262 :       nsa = PRESENT(nsatbas)
      53             : 
      54     1093206 :       IF (o2n .OR. n2o .OR. nsa) THEN
      55             :          CALL get_gto_basis_set(gto_basis_set=basis_1c, &
      56     1332262 :                                 nset=nset, lmax=lmax, lmin=lmin, npgf=npgf, maxso=maxso)
      57             : 
      58             :          ! Index transformation OLD-NEW
      59     1332262 :          IF (o2n) THEN
      60      136596 :             ALLOCATE (o2nindex(maxso*nset))
      61     1408380 :             o2nindex = 0
      62             :          END IF
      63     1332262 :          IF (n2o) THEN
      64      580572 :             ALLOCATE (n2oindex(maxso*nset))
      65     5378824 :             n2oindex = 0
      66             :          END IF
      67             : 
      68     1332262 :          ico = 1
      69     4917630 :          DO iset = 1, nset
      70     3585368 :             iso_set = (iset - 1)*maxso + 1
      71     3585368 :             nsox = nsoset(lmax(iset))
      72    13638562 :             DO ipgf = 1, npgf(iset)
      73     8720932 :                iso_pgf = iso_set + (ipgf - 1)*nsox
      74     8720932 :                iso = iso_pgf + nsoset(lmin(iset) - 1)
      75    24718013 :                DO lx = lmin(iset), lmax(iset)
      76    45545880 :                   DO k = 1, nso(lx)
      77    24413235 :                      IF (n2o) n2oindex(ico) = iso
      78    24413235 :                      IF (o2n) o2nindex(iso) = ico
      79    24413235 :                      iso = iso + 1
      80    36824948 :                      ico = ico + 1
      81             :                   END DO
      82             :                END DO
      83             :             END DO
      84             :          END DO
      85     1332262 :          IF (nsa) nsatbas = ico - 1
      86             :       END IF
      87             : 
      88     1332262 :    END SUBROUTINE get_paw_basis_info
      89             : 
      90             : END MODULE paw_basis_types

Generated by: LCOV version 1.15