LCOV - code coverage report
Current view: top level - src - qs_interactions.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:2fce0f8) Lines: 344 362 95.0 %
Date: 2024-12-21 06:28:57 Functions: 9 9 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             : !> \brief Calculate the interaction radii for the operator matrix calculation.
      10             : !> \par History
      11             : !>      Joost VandeVondele : added exp_radius_very_extended
      12             : !>      24.09.2002 overloaded init_interaction_radii for KG use (gt)
      13             : !>      27.02.2004 integrated KG into QS version of init_interaction_radii (jgh)
      14             : !>      07.03.2006 new routine to extend kind interaction radius for semi-empiric (jgh)
      15             : !> \author MK (12.07.2000)
      16             : ! **************************************************************************************************
      17             : MODULE qs_interactions
      18             : 
      19             :    USE ao_util,                         ONLY: exp_radius
      20             :    USE atomic_kind_types,               ONLY: atomic_kind_type,&
      21             :                                               get_atomic_kind
      22             :    USE basis_set_types,                 ONLY: get_gto_basis_set,&
      23             :                                               gto_basis_set_type,&
      24             :                                               set_gto_basis_set
      25             :    USE cp_control_types,                ONLY: qs_control_type,&
      26             :                                               semi_empirical_control_type
      27             :    USE cp_log_handling,                 ONLY: cp_get_default_logger,&
      28             :                                               cp_logger_type
      29             :    USE cp_output_handling,              ONLY: cp_print_key_finished_output,&
      30             :                                               cp_print_key_unit_nr
      31             :    USE cp_units,                        ONLY: cp_unit_from_cp2k
      32             :    USE external_potential_types,        ONLY: all_potential_type,&
      33             :                                               get_potential,&
      34             :                                               gth_potential_type,&
      35             :                                               set_potential,&
      36             :                                               sgp_potential_type
      37             :    USE input_section_types,             ONLY: section_vals_type,&
      38             :                                               section_vals_val_get
      39             :    USE kinds,                           ONLY: default_string_length,&
      40             :                                               dp
      41             :    USE paw_proj_set_types,              ONLY: get_paw_proj_set,&
      42             :                                               paw_proj_set_type,&
      43             :                                               set_paw_proj_set
      44             :    USE qs_kind_types,                   ONLY: get_qs_kind,&
      45             :                                               qs_kind_type
      46             :    USE string_utilities,                ONLY: uppercase
      47             : #include "./base/base_uses.f90"
      48             : 
      49             :    IMPLICIT NONE
      50             : 
      51             :    PRIVATE
      52             : 
      53             : ! *** Global parameters (only in this module)
      54             : 
      55             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_interactions'
      56             : 
      57             : ! *** Public subroutines ***
      58             : 
      59             :    PUBLIC :: init_interaction_radii, init_se_nlradius, init_interaction_radii_orb_basis
      60             : 
      61             :    PUBLIC :: write_paw_radii, write_ppnl_radii, write_ppl_radii, write_core_charge_radii, &
      62             :              write_pgf_orb_radii
      63             : 
      64             : CONTAINS
      65             : 
      66             : ! **************************************************************************************************
      67             : !> \brief   Initialize all the atomic kind radii for a given threshold value.
      68             : !> \param qs_control ...
      69             : !> \param qs_kind_set ...
      70             : !> \date    24.09.2002
      71             : !> \author  GT
      72             : !> \version 1.0
      73             : ! **************************************************************************************************
      74        9520 :    SUBROUTINE init_interaction_radii(qs_control, qs_kind_set)
      75             : 
      76             :       TYPE(qs_control_type), INTENT(IN)                  :: qs_control
      77             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
      78             : 
      79             :       CHARACTER(len=*), PARAMETER :: routineN = 'init_interaction_radii'
      80             : 
      81             :       INTEGER :: handle, i, iexp_ppl, ikind, ip, iprj_ppnl, j, l, lppl, lppnl, lppsl, lprj, &
      82             :          lprj_ppnl, maxl, n_local, nexp_lpot, nexp_lsd, nexp_ppl, nkind, nloc
      83             :       INTEGER, DIMENSION(0:10)                           :: npot
      84             :       INTEGER, DIMENSION(1:10)                           :: nrloc
      85             :       INTEGER, DIMENSION(1:15, 0:10)                     :: nrpot
      86        9520 :       INTEGER, DIMENSION(:), POINTER                     :: nct_lpot, nct_lsd, nprj, nprj_ppnl
      87             :       LOGICAL                                            :: ecp_local, ecp_semi_local, llsd, lpot, &
      88             :                                                             paw_atom
      89             :       LOGICAL, DIMENSION(0:5)                            :: is_nonlocal
      90             :       REAL(KIND=dp) :: alpha_core_charge, alpha_ppl, ccore_charge, cerf_ppl, core_charge_radius, &
      91             :          cval, ppl_radius, ppnl_radius, rcprj, zeta
      92             :       REAL(KIND=dp), DIMENSION(1:10)                     :: aloc, bloc
      93             :       REAL(KIND=dp), DIMENSION(1:15, 0:10)               :: apot, bpot
      94        9520 :       REAL(KIND=dp), DIMENSION(:), POINTER               :: a_local, a_nonlocal, alpha_lpot, &
      95        9520 :                                                             alpha_lsd, alpha_ppnl, c_local, &
      96        9520 :                                                             cexp_ppl
      97        9520 :       REAL(KIND=dp), DIMENSION(:, :), POINTER            :: cprj_ppnl, cval_lpot, cval_lsd, rzetprj, &
      98        9520 :                                                             zet
      99        9520 :       REAL(KIND=dp), DIMENSION(:, :, :), POINTER         :: c_nonlocal
     100             :       TYPE(all_potential_type), POINTER                  :: all_potential
     101             :       TYPE(gth_potential_type), POINTER                  :: gth_potential
     102             :       TYPE(gto_basis_set_type), POINTER :: aux_basis_set, aux_fit_basis_set, aux_gw_basis, &
     103             :          aux_opt_basis_set, gapw_1c_basis, harris_basis, lri_basis, mao_basis, min_basis_set, &
     104             :          orb_basis_set, p_lri_basis, rhoin_basis, ri_aux_basis_set, ri_basis, ri_xas_basis, &
     105             :          soft_basis, tda_k_basis
     106             :       TYPE(paw_proj_set_type), POINTER                   :: paw_proj_set
     107             :       TYPE(sgp_potential_type), POINTER                  :: sgp_potential
     108             : 
     109        9520 :       CALL timeset(routineN, handle)
     110             : 
     111        9520 :       NULLIFY (all_potential, gth_potential, sgp_potential)
     112        9520 :       NULLIFY (aux_basis_set, aux_fit_basis_set, aux_gw_basis, tda_k_basis, &
     113        9520 :                harris_basis, lri_basis, mao_basis, orb_basis_set, p_lri_basis, ri_aux_basis_set, &
     114        9520 :                ri_basis, ri_xas_basis, soft_basis, gapw_1c_basis, aux_opt_basis_set, min_basis_set)
     115        9520 :       NULLIFY (nprj_ppnl, nprj)
     116        9520 :       NULLIFY (alpha_ppnl, cexp_ppl, cprj_ppnl, zet)
     117             : 
     118        9520 :       nkind = SIZE(qs_kind_set)
     119        9520 :       nexp_ppl = 0
     120             : 
     121       27626 :       DO ikind = 1, nkind
     122             : 
     123       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set, basis_type="ORB")
     124       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_basis_set, basis_type="AUX")
     125       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=min_basis_set, basis_type="MIN")
     126       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_fit_basis_set, basis_type="AUX_FIT")
     127       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_opt_basis_set, basis_type="AUX_OPT")
     128       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=lri_basis, basis_type="LRI_AUX")
     129       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=p_lri_basis, basis_type="P_LRI_AUX")
     130       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=ri_basis, basis_type="RI_HXC")
     131       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=ri_aux_basis_set, basis_type="RI_AUX")
     132       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=mao_basis, basis_type="MAO")
     133       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=harris_basis, basis_type="HARRIS")
     134       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_gw_basis, basis_type="AUX_GW")
     135       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=ri_xas_basis, basis_type="RI_XAS")
     136       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=soft_basis, basis_type="ORB_SOFT")
     137       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=gapw_1c_basis, basis_type="GAPW_1C")
     138       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=tda_k_basis, basis_type="TDA_HFX")
     139       18106 :          CALL get_qs_kind(qs_kind_set(ikind), basis_set=rhoin_basis, basis_type="RHOIN")
     140             :          CALL get_qs_kind(qs_kind_set(ikind), &
     141             :                           paw_proj_set=paw_proj_set, &
     142             :                           paw_atom=paw_atom, &
     143             :                           all_potential=all_potential, &
     144             :                           gth_potential=gth_potential, &
     145       18106 :                           sgp_potential=sgp_potential)
     146             : 
     147             :          ! Calculate the orbital basis function radii ***
     148             :          ! For ALL electron this has to come before the calculation of the
     149             :          ! radii used to calculate the 3c lists.
     150             :          ! Indeed, there the radii of the GTO primitives are needed
     151       18106 :          IF (ASSOCIATED(orb_basis_set)) THEN
     152             :             CALL init_interaction_radii_orb_basis(orb_basis_set, qs_control%eps_pgf_orb, &
     153       17624 :                                                   qs_control%eps_kg_orb)
     154             :          END IF
     155             : 
     156       18106 :          IF (ASSOCIATED(all_potential)) THEN
     157             : 
     158             :             CALL get_potential(potential=all_potential, &
     159             :                                alpha_core_charge=alpha_core_charge, &
     160        5778 :                                ccore_charge=ccore_charge)
     161             : 
     162             :             ! Calculate the radius of the core charge distribution
     163             : 
     164             :             core_charge_radius = exp_radius(0, alpha_core_charge, &
     165             :                                             qs_control%eps_core_charge, &
     166        5778 :                                             ccore_charge)
     167             : 
     168             :             CALL set_potential(potential=all_potential, &
     169        5778 :                                core_charge_radius=core_charge_radius)
     170             : 
     171       12328 :          ELSE IF (ASSOCIATED(gth_potential)) THEN
     172             : 
     173             :             CALL get_potential(potential=gth_potential, &
     174             :                                alpha_core_charge=alpha_core_charge, &
     175             :                                ccore_charge=ccore_charge, &
     176             :                                alpha_ppl=alpha_ppl, &
     177             :                                cerf_ppl=cerf_ppl, &
     178             :                                nexp_ppl=nexp_ppl, &
     179             :                                cexp_ppl=cexp_ppl, &
     180             :                                lpot_present=lpot, &
     181             :                                lsd_present=llsd, &
     182             :                                lppnl=lppnl, &
     183             :                                alpha_ppnl=alpha_ppnl, &
     184             :                                nprj_ppnl=nprj_ppnl, &
     185       12136 :                                cprj_ppnl=cprj_ppnl)
     186             : 
     187             :             ! Calculate the radius of the core charge distribution
     188             :             core_charge_radius = exp_radius(0, alpha_core_charge, &
     189             :                                             qs_control%eps_core_charge, &
     190       12136 :                                             ccore_charge)
     191             : 
     192             :             ! Calculate the radii of the local part
     193             :             ! of the Goedecker pseudopotential (GTH)
     194       12136 :             ppl_radius = exp_radius(0, alpha_ppl, qs_control%eps_ppl, cerf_ppl)
     195             : 
     196       35956 :             DO iexp_ppl = 1, nexp_ppl
     197       23820 :                lppl = 2*(iexp_ppl - 1)
     198             :                ppl_radius = MAX(ppl_radius, &
     199             :                                 exp_radius(lppl, alpha_ppl, &
     200             :                                            qs_control%eps_ppl, &
     201             :                                            cexp_ppl(iexp_ppl), &
     202       35956 :                                            rlow=ppl_radius))
     203             :             END DO
     204       12136 :             IF (lpot) THEN
     205             :                ! extended local potential
     206             :                CALL get_potential(potential=gth_potential, &
     207             :                                   nexp_lpot=nexp_lpot, &
     208             :                                   alpha_lpot=alpha_lpot, &
     209             :                                   nct_lpot=nct_lpot, &
     210           8 :                                   cval_lpot=cval_lpot)
     211          20 :                DO j = 1, nexp_lpot
     212          46 :                   DO i = 1, nct_lpot(j)
     213          26 :                      lppl = 2*(i - 1)
     214             :                      ppl_radius = MAX(ppl_radius, &
     215             :                                       exp_radius(lppl, alpha_lpot(j), qs_control%eps_ppl, &
     216          38 :                                                  cval_lpot(i, j), rlow=ppl_radius))
     217             :                   END DO
     218             :                END DO
     219             :             END IF
     220       12136 :             IF (llsd) THEN
     221             :                ! lsd local potential
     222             :                CALL get_potential(potential=gth_potential, &
     223             :                                   nexp_lsd=nexp_lsd, &
     224             :                                   alpha_lsd=alpha_lsd, &
     225             :                                   nct_lsd=nct_lsd, &
     226           0 :                                   cval_lsd=cval_lsd)
     227           0 :                DO j = 1, nexp_lsd
     228           0 :                   DO i = 1, nct_lsd(j)
     229           0 :                      lppl = 2*(i - 1)
     230             :                      ppl_radius = MAX(ppl_radius, &
     231             :                                       exp_radius(lppl, alpha_lsd(j), qs_control%eps_ppl, &
     232           0 :                                                  cval_lsd(i, j), rlow=ppl_radius))
     233             :                   END DO
     234             :                END DO
     235             :             END IF
     236             : 
     237             :             ! Calculate the radii of the non-local part
     238             :             ! of the Goedecker pseudopotential (GTH)
     239       12136 :             ppnl_radius = 0.0_dp
     240       23108 :             DO l = 0, lppnl
     241       30774 :                DO iprj_ppnl = 1, nprj_ppnl(l)
     242        7666 :                   lprj_ppnl = l + 2*(iprj_ppnl - 1)
     243             :                   ppnl_radius = MAX(ppnl_radius, &
     244             :                                     exp_radius(lprj_ppnl, alpha_ppnl(l), &
     245             :                                                qs_control%eps_pgf_orb, &
     246             :                                                cprj_ppnl(iprj_ppnl, l), &
     247       18638 :                                                rlow=ppnl_radius))
     248             :                END DO
     249             :             END DO
     250             :             CALL set_potential(potential=gth_potential, &
     251             :                                core_charge_radius=core_charge_radius, &
     252             :                                ppl_radius=ppl_radius, &
     253       12136 :                                ppnl_radius=ppnl_radius)
     254             : 
     255         192 :          ELSE IF (ASSOCIATED(sgp_potential)) THEN
     256             : 
     257             :             ! Calculate the radius of the core charge distribution
     258             :             CALL get_potential(potential=sgp_potential, &
     259             :                                alpha_core_charge=alpha_core_charge, &
     260          28 :                                ccore_charge=ccore_charge)
     261             :             core_charge_radius = exp_radius(0, alpha_core_charge, &
     262             :                                             qs_control%eps_core_charge, &
     263          28 :                                             ccore_charge)
     264             :             ! Calculate the radii of the local part
     265          28 :             ppl_radius = core_charge_radius
     266          28 :             CALL get_potential(potential=sgp_potential, ecp_local=ecp_local)
     267          28 :             IF (ecp_local) THEN
     268          16 :                CALL get_potential(potential=sgp_potential, nloc=nloc, nrloc=nrloc, aloc=aloc, bloc=bloc)
     269          64 :                DO i = 1, nloc
     270          48 :                   lppl = MAX(0, nrloc(i) - 2)
     271             :                   ppl_radius = MAX(ppl_radius, &
     272          64 :                                    exp_radius(lppl, bloc(i), qs_control%eps_ppl, aloc(i), rlow=ppl_radius))
     273             :                END DO
     274             :             ELSE
     275          12 :                CALL get_potential(potential=sgp_potential, n_local=n_local, a_local=a_local, c_local=c_local)
     276         156 :                DO i = 1, n_local
     277             :                   ppl_radius = MAX(ppl_radius, &
     278         156 :                                    exp_radius(0, a_local(i), qs_control%eps_ppl, c_local(i), rlow=ppl_radius))
     279             :                END DO
     280             :             END IF
     281             :             ! Calculate the radii of the semi-local part
     282          28 :             CALL get_potential(potential=sgp_potential, ecp_semi_local=ecp_semi_local)
     283          28 :             IF (ecp_semi_local) THEN
     284             :                CALL get_potential(potential=sgp_potential, sl_lmax=lppsl, npot=npot, nrpot=nrpot, &
     285          16 :                                   apot=apot, bpot=bpot)
     286          68 :                DO l = 0, lppsl
     287         228 :                   DO i = 1, npot(l)
     288         160 :                      lppl = MAX(0, nrpot(i, l) - 2)
     289             :                      ppl_radius = MAX(ppl_radius, &
     290             :                                       exp_radius(lppl, bpot(i, l), qs_control%eps_ppl, apot(i, l), &
     291         212 :                                                  rlow=ppl_radius))
     292             :                   END DO
     293             :                END DO
     294             :             END IF
     295             :             ! Calculate the radii of the non-local part
     296          28 :             ppnl_radius = 0.0_dp
     297          28 :             CALL get_potential(potential=sgp_potential, lmax=lppnl, n_nonlocal=nloc)
     298             :             CALL get_potential(potential=sgp_potential, is_nonlocal=is_nonlocal, &
     299          28 :                                a_nonlocal=a_nonlocal, c_nonlocal=c_nonlocal)
     300          34 :             DO l = 0, lppnl
     301          34 :                IF (is_nonlocal(l)) THEN
     302          54 :                   DO i = 1, nloc
     303         480 :                      cval = MAXVAL(ABS(c_nonlocal(i, :, l)))
     304             :                      ppnl_radius = MAX(ppnl_radius, &
     305          54 :                                        exp_radius(l, a_nonlocal(i), qs_control%eps_pgf_orb, cval, rlow=ppnl_radius))
     306             :                   END DO
     307             :                END IF
     308             :             END DO
     309             :             CALL set_potential(potential=sgp_potential, &
     310             :                                core_charge_radius=core_charge_radius, &
     311             :                                ppl_radius=ppl_radius, &
     312          28 :                                ppnl_radius=ppnl_radius)
     313             :          END IF
     314             : 
     315             :          ! Calculate the aux fit orbital basis function radii
     316       18106 :          IF (ASSOCIATED(aux_fit_basis_set)) THEN
     317             :             CALL init_interaction_radii_orb_basis(aux_fit_basis_set, qs_control%eps_pgf_orb, &
     318        1224 :                                                   qs_control%eps_kg_orb)
     319             :          END IF
     320             : 
     321             :          ! Calculate the aux opt orbital basis function radii
     322       18106 :          IF (ASSOCIATED(aux_opt_basis_set)) THEN
     323         420 :             CALL init_interaction_radii_orb_basis(aux_opt_basis_set, qs_control%eps_pgf_orb)
     324             :          END IF
     325             : 
     326             :          ! Calculate the minimal basis function radii
     327       18106 :          IF (ASSOCIATED(min_basis_set)) THEN
     328           4 :             CALL init_interaction_radii_orb_basis(min_basis_set, qs_control%eps_pgf_orb)
     329             :          END IF
     330             : 
     331             :          ! Calculate the aux orbital basis function radii
     332       18106 :          IF (ASSOCIATED(aux_basis_set)) THEN
     333           0 :             CALL init_interaction_radii_orb_basis(aux_basis_set, qs_control%eps_pgf_orb)
     334             :          END IF
     335             : 
     336             :          ! Calculate the RI aux orbital basis function radii
     337       18106 :          IF (ASSOCIATED(RI_aux_basis_set)) THEN
     338        4378 :             CALL init_interaction_radii_orb_basis(RI_aux_basis_set, qs_control%eps_pgf_orb)
     339             :          END IF
     340             : 
     341             :          ! Calculate the MAO orbital basis function radii
     342       18106 :          IF (ASSOCIATED(mao_basis)) THEN
     343          20 :             CALL init_interaction_radii_orb_basis(mao_basis, qs_control%eps_pgf_orb)
     344             :          END IF
     345             : 
     346             :          ! Calculate the HARRIS orbital basis function radii
     347       18106 :          IF (ASSOCIATED(harris_basis)) THEN
     348         132 :             CALL init_interaction_radii_orb_basis(harris_basis, qs_control%eps_pgf_orb)
     349             :          END IF
     350             : 
     351             :          ! Calculate the AUX_GW orbital basis function radii
     352       18106 :          IF (ASSOCIATED(aux_gw_basis)) THEN
     353          36 :             CALL init_interaction_radii_orb_basis(aux_gw_basis, qs_control%eps_pgf_orb)
     354             :          END IF
     355             : 
     356             :          ! Calculate the soft orbital basis function radii
     357       18106 :          IF (ASSOCIATED(soft_basis)) THEN
     358        1996 :             CALL init_interaction_radii_orb_basis(soft_basis, qs_control%eps_pgf_orb)
     359             :          END IF
     360             : 
     361             :          ! Calculate the GAPW 1 center basis function radii
     362       18106 :          IF (ASSOCIATED(gapw_1c_basis)) THEN
     363        1996 :             CALL init_interaction_radii_orb_basis(gapw_1c_basis, qs_control%eps_pgf_orb)
     364             :          END IF
     365             : 
     366             :          ! Calculate the HFX SR basis for TDA
     367       18106 :          IF (ASSOCIATED(tda_k_basis)) THEN
     368           0 :             CALL init_interaction_radii_orb_basis(tda_k_basis, qs_control%eps_pgf_orb)
     369             :          END IF
     370             : 
     371             :          ! Calculate the lri basis function radii
     372       18106 :          IF (ASSOCIATED(lri_basis)) THEN
     373          86 :             CALL init_interaction_radii_orb_basis(lri_basis, qs_control%eps_pgf_orb)
     374             :          END IF
     375       18106 :          IF (ASSOCIATED(ri_basis)) THEN
     376           0 :             CALL init_interaction_radii_orb_basis(ri_basis, qs_control%eps_pgf_orb)
     377             :          END IF
     378       18106 :          IF (ASSOCIATED(ri_xas_basis)) THEN
     379          78 :             CALL init_interaction_radii_orb_basis(ri_xas_basis, qs_control%eps_pgf_orb)
     380             :          END IF
     381       18106 :          IF (ASSOCIATED(p_lri_basis)) THEN
     382           8 :             CALL init_interaction_radii_orb_basis(p_lri_basis, qs_control%eps_pgf_orb)
     383             :          END IF
     384             : 
     385             :          ! Calculate the density input basis function radii
     386       18106 :          IF (ASSOCIATED(rhoin_basis)) THEN
     387          16 :             CALL init_interaction_radii_orb_basis(rhoin_basis, qs_control%eps_pgf_orb)
     388             :          END IF
     389             : 
     390             :          ! Calculate the paw projector basis function radii
     391       45732 :          IF (ASSOCIATED(paw_proj_set)) THEN
     392             :             CALL get_paw_proj_set(paw_proj_set=paw_proj_set, &
     393             :                                   nprj=nprj, &
     394             :                                   maxl=maxl, &
     395             :                                   zetprj=zet, &
     396        1684 :                                   rzetprj=rzetprj)
     397        1684 :             rcprj = 0.0_dp
     398       31808 :             rzetprj = 0.0_dp
     399        5628 :             DO lprj = 0, maxl
     400       22448 :                DO ip = 1, nprj(lprj)
     401       16820 :                   zeta = zet(ip, lprj)
     402             :                   rzetprj(ip, lprj) = MAX(rzetprj(ip, lprj), &
     403             :                                           exp_radius(lprj, zeta, qs_control%eps_pgf_orb, &
     404       16820 :                                                      1.0_dp, rlow=rzetprj(ip, lprj)))
     405       20764 :                   rcprj = MAX(rcprj, rzetprj(ip, lprj))
     406             :                END DO
     407             :             END DO
     408             :             CALL set_paw_proj_set(paw_proj_set=paw_proj_set, &
     409             :                                   rzetprj=rzetprj, &
     410        1684 :                                   rcprj=rcprj)
     411             : 
     412             :          END IF
     413             :       END DO ! ikind
     414             : 
     415        9520 :       CALL timestop(handle)
     416             : 
     417        9520 :    END SUBROUTINE init_interaction_radii
     418             : 
     419             : ! **************************************************************************************************
     420             : !> \brief ...
     421             : !> \param orb_basis_set ...
     422             : !> \param eps_pgf_orb ...
     423             : !> \param eps_pgf_short ...
     424             : ! **************************************************************************************************
     425       32288 :    SUBROUTINE init_interaction_radii_orb_basis(orb_basis_set, eps_pgf_orb, eps_pgf_short)
     426             : 
     427             :       TYPE(gto_basis_set_type), POINTER                  :: orb_basis_set
     428             :       REAL(KIND=dp), INTENT(IN)                          :: eps_pgf_orb
     429             :       REAL(KIND=dp), INTENT(IN), OPTIONAL                :: eps_pgf_short
     430             : 
     431             :       INTEGER                                            :: ipgf, iset, ishell, l, nset
     432       32288 :       INTEGER, DIMENSION(:), POINTER                     :: npgf, nshell
     433       32288 :       INTEGER, DIMENSION(:, :), POINTER                  :: lshell
     434             :       REAL(KIND=dp)                                      :: eps_short, gcca, kind_radius, &
     435             :                                                             short_radius, zeta
     436       32288 :       REAL(KIND=dp), DIMENSION(:), POINTER               :: set_radius
     437       32288 :       REAL(KIND=dp), DIMENSION(:, :), POINTER            :: pgf_radius, zet
     438       32288 :       REAL(KIND=dp), DIMENSION(:, :, :), POINTER         :: gcc
     439             : 
     440       64576 :       IF (ASSOCIATED(orb_basis_set)) THEN
     441             : 
     442       32288 :          IF (PRESENT(eps_pgf_short)) THEN
     443       18848 :             eps_short = eps_pgf_short
     444             :          ELSE
     445       13440 :             eps_short = eps_pgf_orb
     446             :          END IF
     447             : 
     448             :          CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     449             :                                 nset=nset, &
     450             :                                 nshell=nshell, &
     451             :                                 npgf=npgf, &
     452             :                                 l=lshell, &
     453             :                                 zet=zet, &
     454             :                                 gcc=gcc, &
     455             :                                 pgf_radius=pgf_radius, &
     456       32288 :                                 set_radius=set_radius)
     457             : 
     458       32288 :          kind_radius = 0.0_dp
     459       32288 :          short_radius = 0.0_dp
     460             : 
     461      152814 :          DO iset = 1, nset
     462      120526 :             set_radius(iset) = 0.0_dp
     463      365896 :             DO ipgf = 1, npgf(iset)
     464      245370 :                pgf_radius(ipgf, iset) = 0.0_dp
     465      790803 :                DO ishell = 1, nshell(iset)
     466      545433 :                   l = lshell(ishell, iset)
     467      545433 :                   gcca = gcc(ipgf, ishell, iset)
     468      545433 :                   zeta = zet(ipgf, iset)
     469             :                   pgf_radius(ipgf, iset) = MAX(pgf_radius(ipgf, iset), &
     470             :                                                exp_radius(l, zeta, eps_pgf_orb, gcca, &
     471      545433 :                                                           rlow=pgf_radius(ipgf, iset)))
     472             :                   short_radius = MAX(short_radius, &
     473             :                                      exp_radius(l, zeta, eps_short, gcca, &
     474      790803 :                                                 rlow=short_radius))
     475             :                END DO
     476      365896 :                set_radius(iset) = MAX(set_radius(iset), pgf_radius(ipgf, iset))
     477             :             END DO
     478      152814 :             kind_radius = MAX(kind_radius, set_radius(iset))
     479             :          END DO
     480             : 
     481             :          CALL set_gto_basis_set(gto_basis_set=orb_basis_set, &
     482             :                                 pgf_radius=pgf_radius, &
     483             :                                 set_radius=set_radius, &
     484             :                                 kind_radius=kind_radius, &
     485       32288 :                                 short_kind_radius=short_radius)
     486             : 
     487             :       END IF
     488             : 
     489       32288 :    END SUBROUTINE init_interaction_radii_orb_basis
     490             : 
     491             : ! **************************************************************************************************
     492             : !> \brief ...
     493             : !> \param se_control ...
     494             : !> \param atomic_kind_set ...
     495             : !> \param qs_kind_set ...
     496             : !> \param subsys_section ...
     497             : ! **************************************************************************************************
     498         996 :    SUBROUTINE init_se_nlradius(se_control, atomic_kind_set, qs_kind_set, &
     499             :                                subsys_section)
     500             : 
     501             :       TYPE(semi_empirical_control_type), POINTER         :: se_control
     502             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     503             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     504             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     505             : 
     506             :       INTEGER                                            :: ikind, nkind
     507             :       REAL(KIND=dp)                                      :: kind_radius
     508             :       TYPE(gto_basis_set_type), POINTER                  :: orb_basis_set
     509             :       TYPE(qs_kind_type), POINTER                        :: qs_kind
     510             : 
     511         996 :       NULLIFY (orb_basis_set, qs_kind)
     512             : 
     513         996 :       nkind = SIZE(qs_kind_set)
     514             : 
     515        3232 :       DO ikind = 1, nkind
     516             : 
     517        2236 :          qs_kind => qs_kind_set(ikind)
     518             : 
     519        2236 :          CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis_set)
     520             : 
     521        3232 :          IF (ASSOCIATED(orb_basis_set)) THEN
     522             : 
     523             :             CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     524        2236 :                                    kind_radius=kind_radius)
     525             : 
     526        2236 :             kind_radius = MAX(kind_radius, se_control%cutoff_exc)
     527             : 
     528             :             CALL set_gto_basis_set(gto_basis_set=orb_basis_set, &
     529        2236 :                                    kind_radius=kind_radius)
     530             : 
     531             :          END IF
     532             : 
     533             :       END DO
     534             : 
     535         996 :       CALL write_kind_radii(atomic_kind_set, qs_kind_set, subsys_section)
     536             : 
     537         996 :    END SUBROUTINE init_se_nlradius
     538             : 
     539             : ! **************************************************************************************************
     540             : !> \brief ...
     541             : !> \param atomic_kind_set ...
     542             : !> \param qs_kind_set ...
     543             : !> \param subsys_section ...
     544             : ! **************************************************************************************************
     545         996 :    SUBROUTINE write_kind_radii(atomic_kind_set, qs_kind_set, subsys_section)
     546             : 
     547             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     548             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     549             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     550             : 
     551             :       CHARACTER(LEN=10)                                  :: bas
     552             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     553             :       INTEGER                                            :: ikind, nkind, output_unit
     554             :       REAL(KIND=dp)                                      :: conv, kind_radius
     555             :       TYPE(cp_logger_type), POINTER                      :: logger
     556             :       TYPE(gto_basis_set_type), POINTER                  :: orb_basis_set
     557             : 
     558         996 :       NULLIFY (logger)
     559         996 :       logger => cp_get_default_logger()
     560         996 :       NULLIFY (orb_basis_set)
     561         996 :       bas = "ORBITAL   "
     562             : 
     563         996 :       nkind = SIZE(atomic_kind_set)
     564             : !   *** Print the kind radii ***
     565             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     566         996 :                                          "PRINT%RADII/KIND_RADII", extension=".Log")
     567         996 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     568         996 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     569         996 :       IF (output_unit > 0) THEN
     570             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T56,A,T63,A,T75,A)") &
     571           2 :             "RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_str), &
     572           4 :             "Kind", "Label", "Radius"
     573           8 :          DO ikind = 1, nkind
     574           6 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     575           6 :             CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
     576           8 :             IF (ASSOCIATED(orb_basis_set)) THEN
     577             :                CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     578           6 :                                       kind_radius=kind_radius)
     579             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     580           6 :                   ikind, name, kind_radius*conv
     581             :             ELSE
     582             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T72,A9)") &
     583           0 :                   ikind, name, "no basis"
     584             :             END IF
     585             :          END DO
     586             :       END IF
     587             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     588         996 :                                         "PRINT%RADII/KIND_RADII")
     589             : 
     590         996 :    END SUBROUTINE write_kind_radii
     591             : 
     592             : ! **************************************************************************************************
     593             : !> \brief  Write the radii of the core charge distributions to the output
     594             : !>         unit.
     595             : !> \param atomic_kind_set ...
     596             : !> \param qs_kind_set ...
     597             : !> \param subsys_section ...
     598             : !> \date    15.09.2000
     599             : !> \author  MK
     600             : !> \version 1.0
     601             : ! **************************************************************************************************
     602        7328 :    SUBROUTINE write_core_charge_radii(atomic_kind_set, qs_kind_set, subsys_section)
     603             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     604             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     605             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     606             : 
     607             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     608             :       INTEGER                                            :: ikind, nkind, output_unit
     609             :       REAL(KIND=dp)                                      :: conv, core_charge_radius
     610             :       TYPE(all_potential_type), POINTER                  :: all_potential
     611             :       TYPE(cp_logger_type), POINTER                      :: logger
     612             :       TYPE(gth_potential_type), POINTER                  :: gth_potential
     613             : 
     614        7328 :       NULLIFY (logger)
     615        7328 :       logger => cp_get_default_logger()
     616             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     617        7328 :                                          "PRINT%RADII/CORE_CHARGE_RADII", extension=".Log")
     618        7328 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     619        7328 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     620        7328 :       IF (output_unit > 0) THEN
     621          33 :          nkind = SIZE(atomic_kind_set)
     622             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T56,A,T63,A,T75,A)") &
     623             :             "RADII: CORE CHARGE DISTRIBUTIONS in "// &
     624          33 :             TRIM(unit_str), "Kind", "Label", "Radius"
     625          85 :          DO ikind = 1, nkind
     626          52 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     627             :             CALL get_qs_kind(qs_kind_set(ikind), &
     628          52 :                              all_potential=all_potential, gth_potential=gth_potential)
     629             : 
     630          85 :             IF (ASSOCIATED(all_potential)) THEN
     631             :                CALL get_potential(potential=all_potential, &
     632          22 :                                   core_charge_radius=core_charge_radius)
     633             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     634          22 :                   ikind, name, core_charge_radius*conv
     635          30 :             ELSE IF (ASSOCIATED(gth_potential)) THEN
     636             :                CALL get_potential(potential=gth_potential, &
     637          30 :                                   core_charge_radius=core_charge_radius)
     638             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     639          30 :                   ikind, name, core_charge_radius*conv
     640             :             END IF
     641             :          END DO
     642             :       END IF
     643             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     644        7328 :                                         "PRINT%RADII/CORE_CHARGE_RADII")
     645        7328 :    END SUBROUTINE write_core_charge_radii
     646             : 
     647             : ! **************************************************************************************************
     648             : !> \brief   Write the orbital basis function radii to the output unit.
     649             : !> \param basis ...
     650             : !> \param atomic_kind_set ...
     651             : !> \param qs_kind_set ...
     652             : !> \param subsys_section ...
     653             : !> \date    05.06.2000
     654             : !> \author  MK
     655             : !> \version 1.0
     656             : ! **************************************************************************************************
     657       21984 :    SUBROUTINE write_pgf_orb_radii(basis, atomic_kind_set, qs_kind_set, subsys_section)
     658             : 
     659             :       CHARACTER(len=*)                                   :: basis
     660             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     661             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     662             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     663             : 
     664             :       CHARACTER(LEN=10)                                  :: bas
     665             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     666             :       INTEGER                                            :: ikind, ipgf, iset, nkind, nset, &
     667             :                                                             output_unit
     668       21984 :       INTEGER, DIMENSION(:), POINTER                     :: npgf
     669             :       REAL(KIND=dp)                                      :: conv, kind_radius, short_kind_radius
     670       21984 :       REAL(KIND=dp), DIMENSION(:), POINTER               :: set_radius
     671       21984 :       REAL(KIND=dp), DIMENSION(:, :), POINTER            :: pgf_radius
     672             :       TYPE(cp_logger_type), POINTER                      :: logger
     673             :       TYPE(gto_basis_set_type), POINTER                  :: aux_basis_set, lri_basis_set, &
     674             :                                                             orb_basis_set
     675             : 
     676       21984 :       NULLIFY (logger)
     677       43968 :       logger => cp_get_default_logger()
     678       21984 :       NULLIFY (aux_basis_set, orb_basis_set, lri_basis_set)
     679       21984 :       bas = " "
     680       21984 :       bas(1:3) = basis(1:3)
     681       21984 :       CALL uppercase(bas)
     682       21984 :       IF (bas(1:3) == "ORB") THEN
     683        7328 :          bas = "ORBITAL   "
     684       14656 :       ELSE IF (bas(1:3) == "AUX") THEN
     685        7328 :          bas = "AUXILLIARY"
     686        7328 :       ELSE IF (bas(1:3) == "LRI") THEN
     687        7328 :          bas = "LOCAL RI"
     688             :       ELSE
     689           0 :          CPABORT("Undefined basis set type")
     690             :       END IF
     691             : 
     692       21984 :       nkind = SIZE(qs_kind_set)
     693             : 
     694             : !   *** Print the kind radii ***
     695             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     696       21984 :                                          "PRINT%RADII/KIND_RADII", extension=".Log")
     697       21984 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     698       21984 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     699       21984 :       IF (output_unit > 0) THEN
     700             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T46,A,T53,A,T63,A,T71,A)") &
     701          99 :             "RADII: "//TRIM(bas)//" BASIS in "//TRIM(unit_str), &
     702         198 :             "Kind", "Label", "Radius", "OCE Radius"
     703         255 :          DO ikind = 1, nkind
     704         156 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     705         156 :             IF (bas(1:3) == "ORB") THEN
     706          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
     707          52 :                IF (ASSOCIATED(orb_basis_set)) THEN
     708             :                   CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     709             :                                          kind_radius=kind_radius, &
     710          36 :                                          short_kind_radius=short_kind_radius)
     711             :                END IF
     712         104 :             ELSE IF (bas(1:3) == "AUX") THEN
     713          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_basis_set, basis_type="AUX")
     714          52 :                IF (ASSOCIATED(aux_basis_set)) THEN
     715             :                   CALL get_gto_basis_set(gto_basis_set=aux_basis_set, &
     716           0 :                                          kind_radius=kind_radius)
     717             :                END IF
     718          52 :             ELSE IF (bas(1:3) == "LOC") THEN
     719          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=lri_basis_set, basis_type="LRI_AUX")
     720          52 :                IF (ASSOCIATED(lri_basis_set)) THEN
     721             :                   CALL get_gto_basis_set(gto_basis_set=lri_basis_set, &
     722           2 :                                          kind_radius=kind_radius)
     723             :                END IF
     724             :             ELSE
     725           0 :                CPABORT("Undefined basis set type")
     726             :             END IF
     727         255 :             IF (ASSOCIATED(aux_basis_set) .OR. ASSOCIATED(orb_basis_set)) THEN
     728             :                WRITE (UNIT=output_unit, FMT="(T45,I5,T53,A5,T57,F12.6,T69,F12.6)") &
     729          36 :                   ikind, name, kind_radius*conv, short_kind_radius*conv
     730             :             ELSE
     731             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T72,A9)") &
     732         120 :                   ikind, name, "no basis"
     733             :             END IF
     734             :          END DO
     735             :       END IF
     736             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     737       21984 :                                         "PRINT%RADII/KIND_RADII")
     738             : 
     739             : !   *** Print the shell set radii ***
     740             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     741       21984 :                                          "PRINT%RADII/SET_RADII", extension=".Log")
     742       21984 :       IF (output_unit > 0) THEN
     743             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T51,A,T57,A,T65,A,T75,A)") &
     744             :             "RADII: SHELL SETS OF "//TRIM(bas)//" BASIS in "// &
     745          99 :             TRIM(unit_str), "Kind", "Label", "Set", "Radius"
     746         255 :          DO ikind = 1, nkind
     747         156 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     748         156 :             IF (bas(1:3) == "ORB") THEN
     749          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
     750          52 :                IF (ASSOCIATED(orb_basis_set)) THEN
     751             :                   CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     752             :                                          nset=nset, &
     753          36 :                                          set_radius=set_radius)
     754             :                END IF
     755         104 :             ELSE IF (bas(1:3) == "AUX") THEN
     756          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_basis_set, basis_type="AUX")
     757          52 :                IF (ASSOCIATED(aux_basis_set)) THEN
     758             :                   CALL get_gto_basis_set(gto_basis_set=aux_basis_set, &
     759             :                                          nset=nset, &
     760           0 :                                          set_radius=set_radius)
     761             :                END IF
     762          52 :             ELSE IF (bas(1:3) == "LOC") THEN
     763          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=lri_basis_set, basis_type="LRI_AUX")
     764          52 :                IF (ASSOCIATED(lri_basis_set)) THEN
     765             :                   CALL get_gto_basis_set(gto_basis_set=lri_basis_set, &
     766             :                                          nset=nset, &
     767           2 :                                          set_radius=set_radius)
     768             :                END IF
     769             :             ELSE
     770           0 :                CPABORT("Undefined basis set type")
     771             :             END IF
     772         255 :             IF (ASSOCIATED(aux_basis_set) .OR. ASSOCIATED(orb_basis_set)) THEN
     773             :                WRITE (UNIT=output_unit, FMT="(T50,I5,T57,A5,(T63,I5,T69,F12.6))") &
     774         150 :                   ikind, name, (iset, set_radius(iset)*conv, iset=1, nset)
     775             :             ELSE
     776             :                WRITE (UNIT=output_unit, FMT="(T50,I5,T58,A5,T73,A8)") &
     777         120 :                   ikind, name, "no basis"
     778             :             END IF
     779             :          END DO
     780             :       END IF
     781             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     782       21984 :                                         "PRINT%RADII/SET_RADII")
     783             : !   *** Print the primitive Gaussian function radii ***
     784             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     785       21984 :                                          "PRINT%RADII/PGF_RADII", extension=".Log")
     786       21984 :       IF (output_unit > 0) THEN
     787             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T51,A,T57,A,T65,A,T75,A)") &
     788             :             "RADII: PRIMITIVE GAUSSIANS OF "//TRIM(bas)//" BASIS in "// &
     789          99 :             TRIM(unit_str), "Kind", "Label", "Set", "Radius"
     790         255 :          DO ikind = 1, nkind
     791         156 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     792         156 :             IF (bas(1:3) == "ORB") THEN
     793          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=orb_basis_set)
     794          52 :                IF (ASSOCIATED(orb_basis_set)) THEN
     795             :                   CALL get_gto_basis_set(gto_basis_set=orb_basis_set, &
     796             :                                          nset=nset, &
     797             :                                          npgf=npgf, &
     798          36 :                                          pgf_radius=pgf_radius)
     799             :                END IF
     800         104 :             ELSE IF (bas(1:3) == "AUX") THEN
     801          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=aux_basis_set, basis_type="AUX")
     802          52 :                IF (ASSOCIATED(aux_basis_set)) THEN
     803             :                   CALL get_gto_basis_set(gto_basis_set=aux_basis_set, &
     804             :                                          nset=nset, &
     805             :                                          npgf=npgf, &
     806           0 :                                          pgf_radius=pgf_radius)
     807             :                END IF
     808          52 :             ELSE IF (bas(1:3) == "LOC") THEN
     809          52 :                CALL get_qs_kind(qs_kind_set(ikind), basis_set=lri_basis_set, basis_type="LRI_AUX")
     810          52 :                IF (ASSOCIATED(lri_basis_set)) THEN
     811             :                   CALL get_gto_basis_set(gto_basis_set=lri_basis_set, &
     812             :                                          nset=nset, &
     813             :                                          npgf=npgf, &
     814           2 :                                          pgf_radius=pgf_radius)
     815             :                END IF
     816             :             ELSE
     817           0 :                CPABORT("Undefined basis type")
     818             :             END IF
     819         156 :             IF (ASSOCIATED(aux_basis_set) .OR. ASSOCIATED(orb_basis_set) .OR. &
     820          99 :                 ASSOCIATED(lri_basis_set)) THEN
     821         177 :                DO iset = 1, nset
     822             :                   WRITE (UNIT=output_unit, FMT="(T50,I5,T57,A5,T63,I5,(T69,F12.6))") &
     823         139 :                      ikind, name, iset, &
     824         586 :                      (pgf_radius(ipgf, iset)*conv, ipgf=1, npgf(iset))
     825             :                END DO
     826             :             ELSE
     827             :                WRITE (UNIT=output_unit, FMT="(T50,I5,T58,A5,T73,A8)") &
     828         118 :                   ikind, name, "no basis"
     829             :             END IF
     830             :          END DO
     831             :       END IF
     832             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     833       21984 :                                         "PRINT%RADII/PGF_RADII")
     834       21984 :    END SUBROUTINE write_pgf_orb_radii
     835             : 
     836             : ! **************************************************************************************************
     837             : !> \brief   Write the radii of the exponential functions of the Goedecker
     838             : !>           pseudopotential (GTH, local part) to the logical unit number
     839             : !>          "output_unit".
     840             : !> \param atomic_kind_set ...
     841             : !> \param qs_kind_set ...
     842             : !> \param subsys_section ...
     843             : !> \date    06.10.2000
     844             : !> \author  MK
     845             : !> \version 1.0
     846             : ! **************************************************************************************************
     847        7328 :    SUBROUTINE write_ppl_radii(atomic_kind_set, qs_kind_set, subsys_section)
     848             : 
     849             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     850             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     851             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     852             : 
     853             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     854             :       INTEGER                                            :: ikind, nkind, output_unit
     855             :       REAL(KIND=dp)                                      :: conv, ppl_radius
     856             :       TYPE(cp_logger_type), POINTER                      :: logger
     857             :       TYPE(gth_potential_type), POINTER                  :: gth_potential
     858             : 
     859        7328 :       NULLIFY (logger)
     860        7328 :       logger => cp_get_default_logger()
     861             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     862        7328 :                                          "PRINT%RADII/PPL_RADII", extension=".Log")
     863        7328 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     864        7328 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     865        7328 :       IF (output_unit > 0) THEN
     866          33 :          nkind = SIZE(atomic_kind_set)
     867             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T56,A,T63,A,T75,A)") &
     868             :             "RADII: LOCAL PART OF GTH/ELP PP in "// &
     869          33 :             TRIM(unit_str), "Kind", "Label", "Radius"
     870          85 :          DO ikind = 1, nkind
     871          52 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     872          52 :             CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential)
     873          85 :             IF (ASSOCIATED(gth_potential)) THEN
     874             :                CALL get_potential(potential=gth_potential, &
     875          30 :                                   ppl_radius=ppl_radius)
     876             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     877          30 :                   ikind, name, ppl_radius*conv
     878             :             END IF
     879             :          END DO
     880             :       END IF
     881             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     882        7328 :                                         "PRINT%RADII/PPL_RADII")
     883        7328 :    END SUBROUTINE write_ppl_radii
     884             : 
     885             : ! **************************************************************************************************
     886             : !> \brief  Write the radii of the projector functions of the Goedecker
     887             : !>          pseudopotential (GTH, non-local part) to the logical unit number
     888             : !>          "output_unit".
     889             : !> \param atomic_kind_set ...
     890             : !> \param qs_kind_set ...
     891             : !> \param subsys_section ...
     892             : !> \date    06.10.2000
     893             : !> \author  MK
     894             : !> \version 1.0
     895             : ! **************************************************************************************************
     896        7328 :    SUBROUTINE write_ppnl_radii(atomic_kind_set, qs_kind_set, subsys_section)
     897             : 
     898             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     899             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     900             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     901             : 
     902             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     903             :       INTEGER                                            :: ikind, nkind, output_unit
     904             :       REAL(KIND=dp)                                      :: conv, ppnl_radius
     905             :       TYPE(cp_logger_type), POINTER                      :: logger
     906             :       TYPE(gth_potential_type), POINTER                  :: gth_potential
     907             : 
     908        7328 :       NULLIFY (logger)
     909        7328 :       logger => cp_get_default_logger()
     910             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     911        7328 :                                          "PRINT%RADII/PPNL_RADII", extension=".Log")
     912        7328 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     913        7328 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     914        7328 :       IF (output_unit > 0) THEN
     915          33 :          nkind = SIZE(atomic_kind_set)
     916             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T56,A,T63,A,T75,A)") &
     917             :             "RADII: NON-LOCAL PART OF GTH PP in "// &
     918          33 :             TRIM(unit_str), "Kind", "Label", "Radius"
     919          85 :          DO ikind = 1, nkind
     920          52 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     921          52 :             CALL get_qs_kind(qs_kind_set(ikind), gth_potential=gth_potential)
     922          85 :             IF (ASSOCIATED(gth_potential)) THEN
     923             :                CALL get_potential(potential=gth_potential, &
     924          30 :                                   ppnl_radius=ppnl_radius)
     925             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     926          30 :                   ikind, name, ppnl_radius*conv
     927             :             END IF
     928             :          END DO
     929             :       END IF
     930             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     931        7328 :                                         "PRINT%RADII/PPNL_RADII")
     932        7328 :    END SUBROUTINE write_ppnl_radii
     933             : 
     934             : ! **************************************************************************************************
     935             : !> \brief   Write the radii of the one center projector
     936             : !> \param atomic_kind_set ...
     937             : !> \param qs_kind_set ...
     938             : !> \param subsys_section ...
     939             : !> \version 1.0
     940             : ! **************************************************************************************************
     941        7328 :    SUBROUTINE write_paw_radii(atomic_kind_set, qs_kind_set, subsys_section)
     942             :       TYPE(atomic_kind_type), DIMENSION(:), POINTER      :: atomic_kind_set
     943             :       TYPE(qs_kind_type), DIMENSION(:), POINTER          :: qs_kind_set
     944             :       TYPE(section_vals_type), POINTER                   :: subsys_section
     945             : 
     946             :       CHARACTER(LEN=default_string_length)               :: name, unit_str
     947             :       INTEGER                                            :: ikind, nkind, output_unit
     948             :       LOGICAL                                            :: paw_atom
     949             :       REAL(KIND=dp)                                      :: conv, rcprj
     950             :       TYPE(cp_logger_type), POINTER                      :: logger
     951             :       TYPE(paw_proj_set_type), POINTER                   :: paw_proj_set
     952             : 
     953        7328 :       NULLIFY (logger)
     954        7328 :       logger => cp_get_default_logger()
     955             :       output_unit = cp_print_key_unit_nr(logger, subsys_section, &
     956        7328 :                                          "PRINT%RADII/GAPW_PRJ_RADII", extension=".Log")
     957        7328 :       CALL section_vals_val_get(subsys_section, "PRINT%RADII%UNIT", c_val=unit_str)
     958        7328 :       conv = cp_unit_from_cp2k(1.0_dp, TRIM(unit_str))
     959        7328 :       IF (output_unit > 0) THEN
     960          33 :          nkind = SIZE(qs_kind_set)
     961             :          WRITE (UNIT=output_unit, FMT="(/,T2,A,T56,A,T63,A,T75,A)") &
     962             :             "RADII: ONE CENTER PROJECTORS in "// &
     963          33 :             TRIM(unit_str), "Kind", "Label", "Radius"
     964          85 :          DO ikind = 1, nkind
     965          52 :             CALL get_atomic_kind(atomic_kind_set(ikind), name=name)
     966             :             CALL get_qs_kind(qs_kind_set(ikind), &
     967          52 :                              paw_atom=paw_atom, paw_proj_set=paw_proj_set)
     968          85 :             IF (paw_atom .AND. ASSOCIATED(paw_proj_set)) THEN
     969             :                CALL get_paw_proj_set(paw_proj_set=paw_proj_set, &
     970           0 :                                      rcprj=rcprj)
     971             :                WRITE (UNIT=output_unit, FMT="(T55,I5,T63,A5,T69,F12.6)") &
     972           0 :                   ikind, name, rcprj*conv
     973             :             END IF
     974             :          END DO
     975             :       END IF
     976             :       CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
     977        7328 :                                         "PRINT%RADII/GAPW_PRJ_RADII")
     978        7328 :    END SUBROUTINE write_paw_radii
     979             : 
     980             : END MODULE qs_interactions

Generated by: LCOV version 1.15