715 SUBROUTINE get_gth_potential(potential, name, aliases, alpha_core_charge, &
716 alpha_ppl, ccore_charge, cerf_ppl, &
717 core_charge_radius, ppl_radius, ppnl_radius, &
718 lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
719 nprj_ppnl_max, z, zeff, zeff_correction, &
720 ppl_present, ppnl_present, soc_present, &
721 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, &
722 cprj_ppnl, vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl, &
723 lpot_present, nexp_lpot, alpha_lpot, nct_lpot, cval_lpot, &
724 lsd_present, nexp_lsd, alpha_lsd, nct_lsd, cval_lsd, &
725 nlcc_present, nexp_nlcc, alpha_nlcc, nct_nlcc, cval_nlcc)
728 CHARACTER(LEN=default_string_length), &
729 INTENT(OUT),
OPTIONAL :: name, aliases
730 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
731 ccore_charge, cerf_ppl, &
732 core_charge_radius, ppl_radius, &
734 INTEGER,
INTENT(OUT),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
736 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction
737 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, soc_present
738 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
739 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
740 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
741 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
742 POINTER :: hprj_ppnl, kprj_ppnl
743 LOGICAL,
INTENT(OUT),
OPTIONAL :: lpot_present
744 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lpot
745 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lpot
746 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lpot
747 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lpot
748 LOGICAL,
INTENT(OUT),
OPTIONAL :: lsd_present
749 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lsd
750 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lsd
751 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lsd
752 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lsd
753 LOGICAL,
INTENT(OUT),
OPTIONAL :: nlcc_present
754 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_nlcc
755 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_nlcc
756 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_nlcc
757 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_nlcc
759 IF (
PRESENT(name)) name = potential%name
760 IF (
PRESENT(aliases)) aliases = potential%aliases
761 IF (
PRESENT(alpha_core_charge)) &
762 alpha_core_charge = potential%alpha_core_charge
763 IF (
PRESENT(alpha_ppl)) alpha_ppl = potential%alpha_ppl
764 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
765 IF (
PRESENT(cerf_ppl)) cerf_ppl = potential%cerf_ppl
766 IF (
PRESENT(core_charge_radius)) &
767 core_charge_radius = potential%core_charge_radius
768 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
769 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
770 IF (
PRESENT(soc_present)) soc_present = potential%soc
771 IF (
PRESENT(lppnl)) lppnl = potential%lppnl
772 IF (
PRESENT(lprj_ppnl_max)) lprj_ppnl_max = potential%lprj_ppnl_max
773 IF (
PRESENT(nexp_ppl)) nexp_ppl = potential%nexp_ppl
774 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
775 IF (
PRESENT(nprj_ppnl_max)) nprj_ppnl_max = potential%nprj_ppnl_max
776 IF (
PRESENT(z)) z = potential%z
777 IF (
PRESENT(zeff)) zeff = potential%zeff
778 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
779 IF (
PRESENT(ppl_present)) ppl_present = (potential%nexp_ppl > 0)
780 IF (
PRESENT(ppnl_present)) ppnl_present = (potential%nppnl > 0)
781 IF (
PRESENT(alpha_ppnl)) alpha_ppnl => potential%alpha_ppnl
782 IF (
PRESENT(cexp_ppl)) cexp_ppl => potential%cexp_ppl
783 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
784 IF (
PRESENT(nprj_ppnl)) nprj_ppnl => potential%nprj_ppnl
785 IF (
PRESENT(cprj)) cprj => potential%cprj
786 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
787 IF (
PRESENT(hprj_ppnl)) hprj_ppnl => potential%hprj_ppnl
788 IF (
PRESENT(kprj_ppnl)) kprj_ppnl => potential%kprj_ppnl
789 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
790 IF (
PRESENT(wprj_ppnl)) wprj_ppnl => potential%wprj_ppnl
792 IF (
PRESENT(lpot_present)) lpot_present = potential%lpotextended
793 IF (
PRESENT(nexp_lpot)) nexp_lpot = potential%nexp_lpot
794 IF (
PRESENT(alpha_lpot)) alpha_lpot => potential%alpha_lpot
795 IF (
PRESENT(nct_lpot)) nct_lpot => potential%nct_lpot
796 IF (
PRESENT(cval_lpot)) cval_lpot => potential%cval_lpot
798 IF (
PRESENT(lsd_present)) lsd_present = potential%lsdpot
799 IF (
PRESENT(nexp_lsd)) nexp_lsd = potential%nexp_lsd
800 IF (
PRESENT(alpha_lsd)) alpha_lsd => potential%alpha_lsd
801 IF (
PRESENT(nct_lsd)) nct_lsd => potential%nct_lsd
802 IF (
PRESENT(cval_lsd)) cval_lsd => potential%cval_lsd
804 IF (
PRESENT(nlcc_present)) nlcc_present = potential%nlcc
805 IF (
PRESENT(nexp_nlcc)) nexp_nlcc = potential%nexp_nlcc
806 IF (
PRESENT(alpha_nlcc)) alpha_nlcc => potential%alpha_nlcc
807 IF (
PRESENT(nct_nlcc)) nct_nlcc => potential%nct_nlcc
808 IF (
PRESENT(cval_nlcc)) cval_nlcc => potential%cval_nlcc
858 SUBROUTINE get_sgp_potential(potential, name, description, aliases, elec_conf, &
859 z, zeff, zeff_correction, alpha_core_charge, &
860 ccore_charge, core_charge_radius, &
861 ppl_radius, ppnl_radius, ppl_present, ppnl_present, ppsl_present, &
862 ecp_local, n_local, a_local, c_local, &
863 nloc, nrloc, aloc, bloc, &
864 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
865 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
866 cprj_ppnl, vprj_ppnl, has_nlcc, n_nlcc, a_nlcc, c_nlcc)
869 CHARACTER(LEN=default_string_length), &
870 INTENT(OUT),
OPTIONAL :: name
871 CHARACTER(LEN=default_string_length), &
872 DIMENSION(4),
INTENT(OUT),
OPTIONAL :: description
873 CHARACTER(LEN=default_string_length), &
874 INTENT(OUT),
OPTIONAL :: aliases
875 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
876 INTEGER,
INTENT(OUT),
OPTIONAL :: z
877 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction, &
878 alpha_core_charge, ccore_charge, &
879 core_charge_radius, ppl_radius, &
881 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, ppsl_present, &
883 INTEGER,
INTENT(OUT),
OPTIONAL :: n_local
884 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
885 INTEGER,
INTENT(OUT),
OPTIONAL :: nloc
886 INTEGER,
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: nrloc
887 REAL(
dp),
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: aloc, bloc
888 LOGICAL,
INTENT(OUT),
OPTIONAL :: ecp_semi_local
889 INTEGER,
INTENT(OUT),
OPTIONAL :: sl_lmax
890 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
891 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
892 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
893 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nonlocal, nppnl, lmax
894 LOGICAL,
DIMENSION(0:5),
OPTIONAL :: is_nonlocal
895 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
896 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
897 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
898 POINTER :: c_nonlocal
899 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj_ppnl
900 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: vprj_ppnl
901 LOGICAL,
INTENT(OUT),
OPTIONAL :: has_nlcc
902 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nlcc
903 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
905 IF (
PRESENT(name)) name = potential%name
906 IF (
PRESENT(aliases)) aliases = potential%aliases
907 IF (
PRESENT(description)) description = potential%description
909 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
911 IF (
PRESENT(z)) z = potential%z
912 IF (
PRESENT(zeff)) zeff = potential%zeff
913 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
914 IF (
PRESENT(alpha_core_charge)) alpha_core_charge = potential%alpha_core_charge
915 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
916 IF (
PRESENT(core_charge_radius)) core_charge_radius = potential%core_charge_radius
918 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
919 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
920 IF (
PRESENT(ppl_present))
THEN
921 ppl_present = (potential%nloc > 0 .OR. potential%n_local > 0)
923 IF (
PRESENT(ppnl_present))
THEN
924 ppnl_present = any(potential%is_nonlocal)
926 IF (
PRESENT(ppsl_present))
THEN
927 ppsl_present = potential%ecp_semi_local
930 IF (
PRESENT(ecp_local)) ecp_local = potential%ecp_local
931 IF (
PRESENT(n_local)) n_local = potential%n_local
932 IF (
PRESENT(a_local)) a_local => potential%a_local
933 IF (
PRESENT(c_local)) c_local => potential%c_local
935 IF (
PRESENT(nloc)) nloc = potential%nloc
936 IF (
PRESENT(nrloc)) nrloc = potential%nrloc
937 IF (
PRESENT(aloc)) aloc = potential%aloc
938 IF (
PRESENT(bloc)) bloc = potential%bloc
940 IF (
PRESENT(ecp_semi_local)) ecp_semi_local = potential%ecp_semi_local
941 IF (
PRESENT(sl_lmax)) sl_lmax = potential%sl_lmax
942 IF (
PRESENT(npot)) npot = potential%npot
943 IF (
PRESENT(nrpot)) nrpot = potential%nrpot
944 IF (
PRESENT(apot)) apot = potential%apot
945 IF (
PRESENT(bpot)) bpot = potential%bpot
947 IF (
PRESENT(n_nonlocal)) n_nonlocal = potential%n_nonlocal
948 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
949 IF (
PRESENT(lmax)) lmax = potential%lmax
950 IF (
PRESENT(is_nonlocal)) is_nonlocal(:) = potential%is_nonlocal(:)
951 IF (
PRESENT(a_nonlocal)) a_nonlocal => potential%a_nonlocal
952 IF (
PRESENT(c_nonlocal)) c_nonlocal => potential%c_nonlocal
953 IF (
PRESENT(h_nonlocal)) h_nonlocal => potential%h_nonlocal
954 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
955 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
957 IF (
PRESENT(has_nlcc)) has_nlcc = potential%has_nlcc
958 IF (
PRESENT(n_nlcc)) n_nlcc = potential%n_nlcc
959 IF (
PRESENT(a_nlcc)) a_nlcc => potential%a_nlcc
960 IF (
PRESENT(c_nlcc)) c_nlcc => potential%c_nlcc
1100 PURE SUBROUTINE init_all_potential(potential, itype, zeff, zeff_correction)
1103 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: itype
1104 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
1108 IF (.NOT.
ASSOCIATED(potential))
RETURN
1110 IF (
PRESENT(zeff)) potential%zeff = zeff
1111 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
1112 dz = potential%z - int(potential%zeff - potential%zeff_correction)
1116 potential%elec_conf(0) = potential%elec_conf(0) - 2
1118 potential%elec_conf(0) = potential%elec_conf(0) - 4
1119 potential%elec_conf(1) = potential%elec_conf(1) - 6
1121 potential%elec_conf(0) = potential%elec_conf(0) - 6
1122 potential%elec_conf(1) = potential%elec_conf(1) - 12
1124 potential%elec_conf(0) = potential%elec_conf(0) - 6
1125 potential%elec_conf(1) = potential%elec_conf(1) - 12
1126 potential%elec_conf(2) = potential%elec_conf(2) - 10
1128 potential%elec_conf(0) = potential%elec_conf(0) - 8
1129 potential%elec_conf(1) = potential%elec_conf(1) - 12
1130 potential%elec_conf(2) = potential%elec_conf(2) - 10
1132 potential%elec_conf(0) = potential%elec_conf(0) - 8
1133 potential%elec_conf(1) = potential%elec_conf(1) - 18
1134 potential%elec_conf(2) = potential%elec_conf(2) - 10
1136 potential%elec_conf(0) = potential%elec_conf(0) - 8
1137 potential%elec_conf(1) = potential%elec_conf(1) - 18
1138 potential%elec_conf(2) = potential%elec_conf(2) - 20
1140 potential%elec_conf(0) = potential%elec_conf(0) - 10
1141 potential%elec_conf(1) = potential%elec_conf(1) - 18
1142 potential%elec_conf(2) = potential%elec_conf(2) - 20
1144 potential%elec_conf(0) = potential%elec_conf(0) - 10
1145 potential%elec_conf(1) = potential%elec_conf(1) - 24
1146 potential%elec_conf(2) = potential%elec_conf(2) - 20
1148 potential%elec_conf(0) = potential%elec_conf(0) - 10
1149 potential%elec_conf(1) = potential%elec_conf(1) - 24
1150 potential%elec_conf(2) = potential%elec_conf(2) - 20
1151 potential%elec_conf(3) = potential%elec_conf(3) - 14
1153 potential%elec_conf(0) = potential%elec_conf(0) - 10
1154 potential%elec_conf(1) = potential%elec_conf(1) - 24
1155 potential%elec_conf(2) = potential%elec_conf(2) - 30
1156 potential%elec_conf(3) = potential%elec_conf(3) - 14
1158 potential%elec_conf(0) = potential%elec_conf(0) - 12
1159 potential%elec_conf(1) = potential%elec_conf(1) - 24
1160 potential%elec_conf(2) = potential%elec_conf(2) - 30
1161 potential%elec_conf(3) = potential%elec_conf(3) - 14
1163 potential%elec_conf(0) = potential%elec_conf(0) - 12
1164 potential%elec_conf(1) = potential%elec_conf(1) - 30
1165 potential%elec_conf(2) = potential%elec_conf(2) - 30
1166 potential%elec_conf(3) = potential%elec_conf(3) - 14
1168 potential%elec_conf(0) = potential%elec_conf(0) - 12
1169 potential%elec_conf(1) = potential%elec_conf(1) - 30
1170 potential%elec_conf(2) = potential%elec_conf(2) - 30
1171 potential%elec_conf(3) = potential%elec_conf(3) - 28
1174 IF (
PRESENT(itype))
THEN
1175 IF (itype ==
"BARE")
THEN
1176 potential%description(1) =
"Bare Coulomb Potential"
1178 potential%description(2) =
"Valence charge only"
1180 potential%description(2) =
"Full atomic charge"
1667 SUBROUTINE read_gth_potential(element_symbol, potential_name, potential, zeff_correction, &
1668 para_env, potential_file_name, potential_section, update_input)
1670 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, potential_name
1672 REAL(KIND=
dp),
INTENT(IN) :: zeff_correction
1674 CHARACTER(len=default_path_length),
INTENT(IN) :: potential_file_name
1676 LOGICAL,
INTENT(IN) :: update_input
1678 CHARACTER(LEN=240) :: line
1679 CHARACTER(LEN=242) :: line2
1680 CHARACTER(len=5*default_string_length) :: line_att
1681 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1682 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1683 CHARACTER(LEN=LEN(potential_name)) :: apname
1684 CHARACTER(LEN=LEN(potential_name)+2) :: apname2
1685 INTEGER :: i, ic, ipot, irep, istr, j, l, lppnl, &
1686 lprj_ppnl_max, maxlppl, n, nppnl, &
1687 nprj_ppnl, nprj_ppnl_max, strlen1, &
1689 INTEGER,
DIMENSION(:),
POINTER :: elec_conf
1690 LOGICAL :: found, is_ok, match, read_from_input
1691 REAL(KIND=
dp) :: alpha, ci, r, rc2
1692 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: tmp_vals
1693 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: hprj_ppnl, kprj_ppnl
1701 NULLIFY (parser, tmp_vals)
1706 potential%name = potential_name
1707 potential%aliases = potential_name
1708 read_from_input = .false.
1710 IF (.NOT. read_from_input)
THEN
1712 CALL parser_create(parser, potential_file_name, para_env=para_env)
1716 potential%lpotextended = .false.
1717 potential%nexp_lpot = 0
1718 potential%lsdpot = .false.
1719 potential%nexp_lsd = 0
1720 potential%nlcc = .false.
1721 potential%nexp_nlcc = 0
1725 apname = potential_name
1726 symbol = element_symbol
1729 IF (read_from_input)
THEN
1739 IF (read_from_input)
THEN
1745 line2 =
" "//line//
" "
1746 symbol2 =
" "//trim(symbol)//
" "
1747 apname2 =
" "//trim(apname)//
" "
1748 strlen1 = len_trim(symbol2) + 1
1749 strlen2 = len_trim(apname2) + 1
1750 i = index(line2, symbol2(:strlen1))
1751 j = index(line2, apname2(:strlen2))
1752 IF (i > 0 .AND. j > 0)
THEN
1754 i = i + 1 + index(line2(i + 1:),
" ")
1755 potential%aliases = line2(i:)
1763 IF (read_from_input)
THEN
1766 CALL cp_abort(__location__, &
1767 "Error while reading GTH potential from input file")
1768 CALL val_get(val, c_val=line_att)
1769 READ (line_att, *) elec_conf(l)
1771 DO WHILE (len_trim(line_att) /= 0)
1774 READ (line_att, *) elec_conf(l)
1785 IF (update_input)
THEN
1786 WRITE (unit=line_att, fmt=
"(T8,*(1X,I0))") elec_conf(:)
1788 c_val=trim(line_att))
1793 potential%elec_conf(:) = elec_conf(:)
1795 potential%zeff_correction = zeff_correction
1796 potential%zeff = real(sum(elec_conf),
dp) + zeff_correction
1798 DEALLOCATE (elec_conf)
1802 IF (read_from_input)
THEN
1805 CALL cp_abort(__location__, &
1806 "Error while reading GTH potential from input file")
1807 CALL val_get(val, c_val=line_att)
1808 READ (line_att, *) r
1813 istr = len_trim(line_att) + 1
1814 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3)") r
1816 alpha = 1.0_dp/(2.0_dp*r**2)
1818 potential%alpha_core_charge = alpha
1819 potential%ccore_charge = potential%zeff*sqrt((alpha/
pi)**3)
1821 potential%alpha_ppl = alpha
1822 potential%cerf_ppl = potential%zeff*sqrt((alpha/
pi)**3)
1825 IF (read_from_input)
THEN
1826 READ (line_att, *) n
1830 istr = len_trim(line_att) + 1
1831 WRITE (unit=line_att(istr:), fmt=
"(1X,I0)") n
1833 potential%nexp_ppl = n
1837 IF (read_from_input)
THEN
1838 READ (line_att, *) ci
1842 istr = len_trim(line_att) + 1
1843 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") ci
1845 rc2 = (2.0_dp*potential%alpha_ppl)
1846 potential%cexp_ppl(i) = rc2**(i - 1)*ci
1849 IF (.NOT. read_from_input)
THEN
1851 IF (update_input)
THEN
1853 c_val=trim(line_att))
1857 IF (len_trim(line_att) /= 0)
THEN
1858 CALL cp_abort(__location__, &
1859 "Error while reading GTH potential from input file")
1868 IF (read_from_input)
THEN
1869 read_keywords_from_input:
DO
1872 CALL val_get(val, c_val=line_att)
1873 IF (index(line_att,
"LPOT") /= 0)
THEN
1874 potential%lpotextended = .true.
1876 READ (line_att, *) potential%nexp_lpot
1877 n = potential%nexp_lpot
1880 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1883 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1884 DO ipot = 1, potential%nexp_lpot
1887 CALL val_get(val, c_val=line_att)
1888 READ (line_att, *) r
1889 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1891 READ (line_att, *) potential%nct_lpot(ipot)
1893 DO ic = 1, potential%nct_lpot(ipot)
1894 READ (line_att, *) ci
1895 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1896 potential%cval_lpot(ic, ipot) = ci*rc2
1900 ELSE IF (index(line_att,
"NLCC") /= 0)
THEN
1901 potential%nlcc = .true.
1903 READ (line_att, *) potential%nexp_nlcc
1904 n = potential%nexp_nlcc
1905 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
1908 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
1909 DO ipot = 1, potential%nexp_nlcc
1912 CALL val_get(val, c_val=line_att)
1913 READ (line_att, *) potential%alpha_nlcc(ipot)
1915 READ (line_att, *) potential%nct_nlcc(ipot)
1917 DO ic = 1, potential%nct_nlcc(ipot)
1918 READ (line_att, *) potential%cval_nlcc(ic, ipot)
1920 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
1924 ELSE IF (index(line_att,
"LSD") /= 0)
THEN
1925 potential%lsdpot = .true.
1927 READ (line_att, *) potential%nexp_lsd
1928 n = potential%nexp_lsd
1929 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
1932 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
1933 DO ipot = 1, potential%nexp_lsd
1936 CALL val_get(val, c_val=line_att)
1937 READ (line_att, *) r
1938 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
1940 READ (line_att, *) potential%nct_lsd(ipot)
1942 DO ic = 1, potential%nct_lsd(ipot)
1943 READ (line_att, *) ci
1944 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
1945 potential%cval_lsd(ic, ipot) = ci*rc2
1950 EXIT read_keywords_from_input
1952 END DO read_keywords_from_input
1960 IF (index(line,
"LPOT") /= 0)
THEN
1962 potential%lpotextended = .true.
1964 n = potential%nexp_lpot
1965 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1968 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1971 IF (update_input)
THEN
1972 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LPOT", n
1974 c_val=trim(line_att))
1976 DO ipot = 1, potential%nexp_lpot
1978 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1980 CALL reallocate(tmp_vals, 1, potential%nct_lpot(ipot))
1981 DO ic = 1, potential%nct_lpot(ipot)
1984 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1985 potential%cval_lpot(ic, ipot) = ci*rc2
1989 IF (update_input)
THEN
1990 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
1991 r, potential%nct_lpot(ipot), tmp_vals(1:potential%nct_lpot(ipot))
1993 c_val=trim(line_att))
1996 ELSE IF (index(line,
"NLCC") /= 0)
THEN
1998 potential%nlcc = .true.
2000 n = potential%nexp_nlcc
2001 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
2004 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
2006 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"NLCC", n
2009 c_val=trim(line_att))
2010 DO ipot = 1, potential%nexp_nlcc
2013 CALL reallocate(tmp_vals, 1, potential%nct_nlcc(ipot))
2014 DO ic = 1, potential%nct_nlcc(ipot)
2016 tmp_vals(ic) = potential%cval_nlcc(ic, ipot)
2018 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
2022 IF (update_input)
THEN
2023 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2024 potential%alpha_nlcc(ipot), potential%nct_nlcc(ipot), &
2025 tmp_vals(1:potential%nct_nlcc(ipot))
2027 c_val=trim(line_att))
2030 ELSE IF (index(line,
"LSD") /= 0)
THEN
2032 potential%lsdpot = .true.
2034 n = potential%nexp_lsd
2035 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
2038 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
2041 IF (update_input)
THEN
2042 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LSD", n
2044 c_val=trim(line_att))
2046 DO ipot = 1, potential%nexp_lsd
2048 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
2050 CALL reallocate(tmp_vals, 1, potential%nct_lsd(ipot))
2051 DO ic = 1, potential%nct_lsd(ipot)
2054 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
2055 potential%cval_lsd(ic, ipot) = ci*rc2
2059 IF (update_input)
THEN
2060 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") r, potential%nct_lsd(ipot), &
2061 tmp_vals(1:potential%nct_lsd(ipot))
2063 c_val=trim(line_att))
2067 CALL cp_abort(__location__, &
2068 "Syntax error for <"// &
2069 trim(element_symbol)// &
2070 "> in the atomic potential <"// &
2071 trim(potential_name)// &
2072 "> potential file <"// &
2073 trim(potential_file_name)//
">: "// &
2074 "Expected LPOT/NLCC/LSD keyword, got: <"// &
2079 CALL cp_abort(__location__, &
2080 "Syntax error for <"// &
2081 trim(element_symbol)// &
2082 "> in the atomic potential <"// &
2083 trim(potential_name)// &
2084 "> potential file <"// &
2085 trim(potential_file_name)//
">: "// &
2086 "Expected LPOT/NLCC/LSD keyword or INTEGER, got: <"// &
2089 END DO read_keywords
2093 IF (read_from_input)
THEN
2094 READ (line_att, *) n
2096 IF (index(line_att,
"SOC") /= 0)
THEN
2097 potential%soc = .true.
2104 IF (index(line,
"SOC") /= 0) potential%soc = .true.
2107 IF (update_input)
THEN
2108 IF (potential%soc)
THEN
2109 WRITE (unit=line_att, fmt=
"(T9,I0,2X,A)") n,
"SOC"
2111 WRITE (unit=line_att, fmt=
"(T9,I0)") n
2114 c_val=trim(line_att))
2117 potential%lppnl = n - 1
2120 potential%lprj_ppnl_max = n - 1
2121 potential%nprj_ppnl_max = 0
2125 lppnl = potential%lppnl
2126 nppnl = potential%nppnl
2130 NULLIFY (hprj_ppnl, kprj_ppnl)
2134 CALL reallocate(potential%alpha_ppnl, 0, lppnl)
2135 CALL reallocate(potential%nprj_ppnl, 0, lppnl)
2141 IF (read_from_input)
THEN
2144 CALL cp_abort(__location__, &
2145 "Error while reading GTH potential from input file")
2146 CALL val_get(val, c_val=line_att)
2147 READ (line_att, *) r
2149 READ (line_att, *) nprj_ppnl
2155 istr = len_trim(line_att) + 1
2156 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3,1X,I0)") r, nprj_ppnl
2158 IF (r == 0.0_dp .AND. nprj_ppnl /= 0)
THEN
2159 CALL cp_abort(__location__, &
2160 "An error was detected in the atomic potential <"// &
2161 trim(potential_name)// &
2162 "> potential file <"// &
2163 trim(potential_file_name)//
">")
2165 potential%alpha_ppnl(l) = 0.0_dp
2166 IF (r /= 0.0_dp .AND. n /= 0) potential%alpha_ppnl(l) = 1.0_dp/(2.0_dp*r**2)
2167 potential%nprj_ppnl(l) = nprj_ppnl
2168 nppnl = nppnl + nprj_ppnl*
nco(l)
2169 IF (nprj_ppnl > nprj_ppnl_max)
THEN
2170 nprj_ppnl_max = nprj_ppnl
2171 CALL reallocate(hprj_ppnl, 1, nprj_ppnl_max, &
2174 CALL reallocate(kprj_ppnl, 1, nprj_ppnl_max, &
2180 IF (read_from_input)
THEN
2181 READ (line_att, *) hprj_ppnl(i, i, l)
2185 istr = len_trim(line_att) + 1
2186 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, i, l)
2189 IF (read_from_input)
THEN
2190 IF (len_trim(line_att) /= 0) &
2191 CALL cp_abort(__location__, &
2192 "Error while reading GTH potential from input file")
2195 CALL cp_abort(__location__, &
2196 "Error while reading GTH potential from input file")
2197 CALL val_get(val, c_val=line_att)
2198 READ (line_att, *) hprj_ppnl(i, i, l)
2201 IF (update_input)
THEN
2204 c_val=trim(line_att))
2208 istr = len_trim(line_att) + 1
2209 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2210 repeat(
" ", 25*(i - 1)), hprj_ppnl(i, i, l)
2213 DO j = i + 1, nprj_ppnl
2214 IF (read_from_input)
THEN
2215 READ (line_att, *) hprj_ppnl(i, j, l)
2219 istr = len_trim(line_att) + 1
2220 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, j, l)
2224 IF (.NOT. read_from_input)
THEN
2225 IF (update_input)
THEN
2228 c_val=trim(line_att))
2232 IF (len_trim(line_att) /= 0)
THEN
2233 CALL cp_abort(__location__, &
2234 "Error while reading GTH potential from input file")
2237 IF (nprj_ppnl > 1)
THEN
2240 IF (potential%soc .AND. (l > 0))
THEN
2243 IF (read_from_input)
THEN
2244 IF (len_trim(line_att) /= 0) &
2245 CALL cp_abort(__location__, &
2246 "Error while reading GTH potential from input file")
2249 CALL cp_abort(__location__, &
2250 "Error while reading GTH potential from input file")
2251 CALL val_get(val, c_val=line_att)
2252 READ (line_att, *) kprj_ppnl(i, i, l)
2255 IF (i > 1 .AND. update_input)
THEN
2258 c_val=trim(line_att))
2262 istr = len_trim(line_att) + 1
2263 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2264 repeat(
" ", 25*(i - 1)), kprj_ppnl(i, i, l)
2266 DO j = i + 1, nprj_ppnl
2267 IF (read_from_input)
THEN
2268 READ (line_att, *) kprj_ppnl(i, j, l)
2272 istr = len_trim(line_att) + 1
2273 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") kprj_ppnl(i, j, l)
2277 IF (read_from_input)
THEN
2278 IF (len_trim(line_att) /= 0)
THEN
2279 CALL cp_abort(__location__, &
2280 "Error while reading GTH potential from input file")
2283 IF (update_input)
THEN
2286 c_val=trim(line_att))
2290 IF (nprj_ppnl > 1)
THEN
2294 lprj_ppnl_max = max(lprj_ppnl_max, l + 2*(nprj_ppnl - 1))
2297 potential%nppnl = nppnl
2300 potential%lprj_ppnl_max = lprj_ppnl_max
2301 potential%nprj_ppnl_max = nprj_ppnl_max
2302 CALL reallocate(potential%hprj_ppnl, 1, nprj_ppnl_max, &
2305 potential%hprj_ppnl(:, :, :) = hprj_ppnl(:, :, :)
2306 CALL reallocate(potential%kprj_ppnl, 1, nprj_ppnl_max, &
2309 potential%kprj_ppnl(:, :, :) = kprj_ppnl(:, :, :)
2312 CALL reallocate(potential%cprj_ppnl, 1, nprj_ppnl_max, 0, lppnl)
2313 CALL reallocate(potential%vprj_ppnl, 1, nppnl, 1, nppnl)
2314 CALL reallocate(potential%wprj_ppnl, 1, nppnl, 1, nppnl)
2316 DEALLOCATE (hprj_ppnl, kprj_ppnl)
2322 CALL cp_abort(__location__, &
2323 "The requested atomic potential <"// &
2324 trim(potential_name)// &
2325 "> for element <"// &
2327 "> was not found in the potential file <"// &
2328 trim(potential_file_name)//
">")
2332 IF (.NOT. read_from_input)
THEN
2334 IF (match .AND. update_input)
THEN
2336 WRITE (unit=line_att, fmt=
"(T9,A)") &
2337 "# Potential name: "//trim(adjustl(apname2(:strlen2)))// &
2338 " for element symbol: "//trim(adjustl(symbol2(:strlen1)))
2340 c_val=trim(line_att))
2342 WRITE (unit=line_att, fmt=
"(T9,A)") &
2343 "# Potential read from the potential filename: "//trim(adjustl(potential_file_name))
2345 c_val=trim(line_att))
2351 IF (
ASSOCIATED(tmp_vals))
DEALLOCATE (tmp_vals)
2535 SUBROUTINE set_gth_potential(potential, name, alpha_core_charge, alpha_ppl, &
2536 ccore_charge, cerf_ppl, core_charge_radius, &
2537 ppl_radius, ppnl_radius, lppnl, lprj_ppnl_max, &
2538 nexp_ppl, nppnl, nprj_ppnl_max, z, zeff, zeff_correction, &
2539 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, cprj_ppnl, &
2540 vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl)
2543 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2545 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
2546 ccore_charge, cerf_ppl, &
2547 core_charge_radius, ppl_radius, &
2549 INTEGER,
INTENT(IN),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
2551 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
2552 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
2553 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
2554 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
2555 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
2556 POINTER :: hprj_ppnl, kprj_ppnl
2558 IF (
PRESENT(name)) potential%name = name
2559 IF (
PRESENT(alpha_core_charge)) &
2560 potential%alpha_core_charge = alpha_core_charge
2561 IF (
PRESENT(alpha_ppl)) potential%alpha_ppl = alpha_ppl
2562 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2563 IF (
PRESENT(cerf_ppl)) potential%cerf_ppl = cerf_ppl
2564 IF (
PRESENT(core_charge_radius)) &
2565 potential%core_charge_radius = core_charge_radius
2566 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2567 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2568 IF (
PRESENT(lppnl)) potential%lppnl = lppnl
2569 IF (
PRESENT(lprj_ppnl_max)) potential%lprj_ppnl_max = lprj_ppnl_max
2570 IF (
PRESENT(nexp_ppl)) potential%nexp_ppl = nexp_ppl
2571 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2572 IF (
PRESENT(nprj_ppnl_max)) potential%nprj_ppnl_max = nprj_ppnl_max
2573 IF (
PRESENT(z)) potential%z = z
2574 IF (
PRESENT(zeff)) potential%zeff = zeff
2575 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2576 IF (
PRESENT(alpha_ppnl)) potential%alpha_ppnl => alpha_ppnl
2577 IF (
PRESENT(cexp_ppl)) potential%cexp_ppl => cexp_ppl
2578 IF (
PRESENT(elec_conf))
THEN
2579 IF (
ASSOCIATED(potential%elec_conf))
THEN
2580 DEALLOCATE (potential%elec_conf)
2582 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2583 potential%elec_conf(:) = elec_conf(:)
2585 IF (
PRESENT(nprj_ppnl)) potential%nprj_ppnl => nprj_ppnl
2586 IF (
PRESENT(cprj)) potential%cprj => cprj
2587 IF (
PRESENT(cprj_ppnl)) potential%cprj_ppnl => cprj_ppnl
2588 IF (
PRESENT(hprj_ppnl)) potential%hprj_ppnl => hprj_ppnl
2589 IF (
PRESENT(kprj_ppnl)) potential%kprj_ppnl => kprj_ppnl
2590 IF (
PRESENT(vprj_ppnl)) potential%vprj_ppnl => vprj_ppnl
2591 IF (
PRESENT(wprj_ppnl)) potential%wprj_ppnl => wprj_ppnl
2636 SUBROUTINE set_sgp_potential(potential, name, description, aliases, elec_conf, &
2637 z, zeff, zeff_correction, alpha_core_charge, &
2638 ccore_charge, core_charge_radius, &
2639 ppl_radius, ppnl_radius, &
2640 ecp_local, n_local, a_local, c_local, &
2641 nloc, nrloc, aloc, bloc, &
2642 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
2643 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
2644 has_nlcc, n_nlcc, a_nlcc, c_nlcc)
2647 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2649 CHARACTER(LEN=default_string_length), &
2650 DIMENSION(4),
INTENT(IN),
OPTIONAL :: description
2651 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2653 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
2654 INTEGER,
INTENT(IN),
OPTIONAL :: z
2655 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction, &
2656 alpha_core_charge, ccore_charge, &
2657 core_charge_radius, ppl_radius, &
2659 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_local
2660 INTEGER,
INTENT(IN),
OPTIONAL :: n_local
2661 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
2662 INTEGER,
INTENT(IN),
OPTIONAL :: nloc
2663 INTEGER,
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: nrloc
2664 REAL(
dp),
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: aloc, bloc
2665 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_semi_local
2666 INTEGER,
INTENT(IN),
OPTIONAL :: sl_lmax
2667 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
2668 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
2669 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
2670 INTEGER,
INTENT(IN),
OPTIONAL :: n_nonlocal, nppnl, lmax
2671 LOGICAL,
DIMENSION(0:5),
INTENT(IN),
OPTIONAL :: is_nonlocal
2672 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
2673 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
2674 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
2675 POINTER :: c_nonlocal
2676 LOGICAL,
INTENT(IN),
OPTIONAL :: has_nlcc
2677 INTEGER,
INTENT(IN),
OPTIONAL :: n_nlcc
2678 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
2680 IF (
PRESENT(name)) potential%name = name
2681 IF (
PRESENT(aliases)) potential%aliases = aliases
2682 IF (
PRESENT(description)) potential%description = description
2684 IF (
PRESENT(elec_conf))
THEN
2685 IF (
ASSOCIATED(potential%elec_conf))
THEN
2686 DEALLOCATE (potential%elec_conf)
2688 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2689 potential%elec_conf(:) = elec_conf(:)
2692 IF (
PRESENT(z)) potential%z = z
2693 IF (
PRESENT(zeff)) potential%zeff = zeff
2694 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2695 IF (
PRESENT(alpha_core_charge)) potential%alpha_core_charge = alpha_core_charge
2696 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2697 IF (
PRESENT(core_charge_radius)) potential%core_charge_radius = core_charge_radius
2699 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2700 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2702 IF (
PRESENT(ecp_local)) potential%ecp_local = ecp_local
2703 IF (
PRESENT(n_local)) potential%n_local = n_local
2704 IF (
PRESENT(a_local)) potential%a_local => a_local
2705 IF (
PRESENT(c_local)) potential%c_local => c_local
2707 IF (
PRESENT(nloc)) potential%nloc = nloc
2708 IF (
PRESENT(nrloc)) potential%nrloc = nrloc
2709 IF (
PRESENT(aloc)) potential%aloc = aloc
2710 IF (
PRESENT(bloc)) potential%bloc = bloc
2712 IF (
PRESENT(ecp_semi_local)) potential%ecp_semi_local = ecp_semi_local
2713 IF (
PRESENT(sl_lmax)) potential%sl_lmax = sl_lmax
2714 IF (
PRESENT(npot)) potential%npot = npot
2715 IF (
PRESENT(nrpot)) potential%nrpot = nrpot
2716 IF (
PRESENT(apot)) potential%apot = apot
2717 IF (
PRESENT(bpot)) potential%bpot = bpot
2719 IF (
PRESENT(n_nonlocal)) potential%n_nonlocal = n_nonlocal
2720 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2721 IF (
PRESENT(lmax)) potential%lmax = lmax
2722 IF (
PRESENT(is_nonlocal)) potential%is_nonlocal(:) = is_nonlocal(:)
2723 IF (
PRESENT(a_nonlocal)) potential%a_nonlocal => a_nonlocal
2724 IF (
PRESENT(c_nonlocal)) potential%c_nonlocal => c_nonlocal
2725 IF (
PRESENT(h_nonlocal)) potential%h_nonlocal => h_nonlocal
2727 IF (
PRESENT(has_nlcc)) potential%has_nlcc = has_nlcc
2728 IF (
PRESENT(n_nlcc)) potential%n_nlcc = n_nlcc
2729 IF (
PRESENT(a_nlcc)) potential%a_nlcc => a_nlcc
2730 IF (
PRESENT(c_nlcc)) potential%c_nlcc => c_nlcc
2981 SUBROUTINE copy_gth_potential(pot_in, pot_out)
2986 CALL allocate_gth_potential(pot_out)
2988 pot_out%name = pot_in%name
2989 pot_out%aliases = pot_in%aliases
2990 pot_out%alpha_core_charge = pot_in%alpha_core_charge
2991 pot_out%alpha_ppl = pot_in%alpha_ppl
2992 pot_out%ccore_charge = pot_in%ccore_charge
2993 pot_out%cerf_ppl = pot_in%cerf_ppl
2994 pot_out%zeff = pot_in%zeff
2995 pot_out%core_charge_radius = pot_in%core_charge_radius
2996 pot_out%ppl_radius = pot_in%ppl_radius
2997 pot_out%ppnl_radius = pot_in%ppnl_radius
2998 pot_out%zeff_correction = pot_in%zeff_correction
2999 pot_out%lppnl = pot_in%lppnl
3000 pot_out%lprj_ppnl_max = pot_in%lprj_ppnl_max
3001 pot_out%nexp_ppl = pot_in%nexp_ppl
3002 pot_out%nppnl = pot_in%nppnl
3003 pot_out%nprj_ppnl_max = pot_in%nprj_ppnl_max
3004 pot_out%z = pot_in%z
3005 pot_out%nlcc = pot_in%nlcc
3006 pot_out%nexp_nlcc = pot_in%nexp_nlcc
3007 pot_out%lsdpot = pot_in%lsdpot
3008 pot_out%nexp_lsd = pot_in%nexp_lsd
3009 pot_out%lpotextended = pot_in%lpotextended
3010 pot_out%nexp_lpot = pot_in%nexp_lpot
3012 IF (
ASSOCIATED(pot_in%alpha_ppnl))
THEN
3013 ALLOCATE (pot_out%alpha_ppnl(lbound(pot_in%alpha_ppnl, 1):ubound(pot_in%alpha_ppnl, 1)))
3014 pot_out%alpha_ppnl(:) = pot_in%alpha_ppnl(:)
3016 IF (
ASSOCIATED(pot_in%cexp_ppl))
THEN
3017 ALLOCATE (pot_out%cexp_ppl(lbound(pot_in%cexp_ppl, 1):ubound(pot_in%cexp_ppl, 1)))
3018 pot_out%cexp_ppl(:) = pot_in%cexp_ppl(:)
3020 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3021 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3022 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3024 IF (
ASSOCIATED(pot_in%nprj_ppnl))
THEN
3025 ALLOCATE (pot_out%nprj_ppnl(lbound(pot_in%nprj_ppnl, 1):ubound(pot_in%nprj_ppnl, 1)))
3026 pot_out%nprj_ppnl(:) = pot_in%nprj_ppnl(:)
3028 IF (
ASSOCIATED(pot_in%cprj))
THEN
3029 ALLOCATE (pot_out%cprj(lbound(pot_in%cprj, 1):ubound(pot_in%cprj, 1), &
3030 lbound(pot_in%cprj, 2):ubound(pot_in%cprj, 2)))
3031 pot_out%cprj(:, :) = pot_in%cprj(:, :)
3033 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3034 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3035 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3036 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3038 IF (
ASSOCIATED(pot_in%hprj_ppnl))
THEN
3039 ALLOCATE (pot_out%hprj_ppnl(lbound(pot_in%hprj_ppnl, 1):ubound(pot_in%hprj_ppnl, 1), &
3040 lbound(pot_in%hprj_ppnl, 2):ubound(pot_in%hprj_ppnl, 2), &
3041 lbound(pot_in%hprj_ppnl, 3):ubound(pot_in%hprj_ppnl, 3)))
3042 pot_out%hprj_ppnl(:, :, :) = pot_in%hprj_ppnl(:, :, :)
3044 IF (
ASSOCIATED(pot_in%kprj_ppnl))
THEN
3045 ALLOCATE (pot_out%kprj_ppnl(lbound(pot_in%kprj_ppnl, 1):ubound(pot_in%kprj_ppnl, 1), &
3046 lbound(pot_in%kprj_ppnl, 2):ubound(pot_in%kprj_ppnl, 2), &
3047 lbound(pot_in%kprj_ppnl, 3):ubound(pot_in%kprj_ppnl, 3)))
3048 pot_out%kprj_ppnl(:, :, :) = pot_in%kprj_ppnl(:, :, :)
3050 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3051 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1), &
3052 lbound(pot_in%vprj_ppnl, 2):ubound(pot_in%vprj_ppnl, 2)))
3053 pot_out%vprj_ppnl(:, :) = pot_in%vprj_ppnl(:, :)
3055 IF (
ASSOCIATED(pot_in%wprj_ppnl))
THEN
3056 ALLOCATE (pot_out%wprj_ppnl(lbound(pot_in%wprj_ppnl, 1):ubound(pot_in%wprj_ppnl, 1), &
3057 lbound(pot_in%wprj_ppnl, 2):ubound(pot_in%wprj_ppnl, 2)))
3058 pot_out%wprj_ppnl(:, :) = pot_in%wprj_ppnl(:, :)
3060 IF (
ASSOCIATED(pot_in%alpha_nlcc))
THEN
3061 ALLOCATE (pot_out%alpha_nlcc(lbound(pot_in%alpha_nlcc, 1):ubound(pot_in%alpha_nlcc, 1)))
3062 pot_out%alpha_nlcc(:) = pot_in%alpha_nlcc(:)
3064 IF (
ASSOCIATED(pot_in%nct_nlcc))
THEN
3065 ALLOCATE (pot_out%nct_nlcc(lbound(pot_in%nct_nlcc, 1):ubound(pot_in%nct_nlcc, 1)))
3066 pot_out%nct_nlcc(:) = pot_in%nct_nlcc(:)
3068 IF (
ASSOCIATED(pot_in%cval_nlcc))
THEN
3069 ALLOCATE (pot_out%cval_nlcc(lbound(pot_in%cval_nlcc, 1):ubound(pot_in%cval_nlcc, 1), &
3070 lbound(pot_in%cval_nlcc, 2):ubound(pot_in%cval_nlcc, 2)))
3071 pot_out%cval_nlcc(:, :) = pot_in%cval_nlcc(:, :)
3073 IF (
ASSOCIATED(pot_in%alpha_lsd))
THEN
3074 ALLOCATE (pot_out%alpha_lsd(lbound(pot_in%alpha_lsd, 1):ubound(pot_in%alpha_lsd, 1)))
3075 pot_out%alpha_lsd(:) = pot_in%alpha_lsd(:)
3077 IF (
ASSOCIATED(pot_in%nct_lsd))
THEN
3078 ALLOCATE (pot_out%nct_lsd(lbound(pot_in%nct_lsd, 1):ubound(pot_in%nct_lsd, 1)))
3079 pot_out%nct_lsd(:) = pot_in%nct_lsd(:)
3081 IF (
ASSOCIATED(pot_in%cval_lsd))
THEN
3082 ALLOCATE (pot_out%cval_lsd(lbound(pot_in%cval_lsd, 1):ubound(pot_in%cval_lsd, 1), &
3083 lbound(pot_in%cval_lsd, 2):ubound(pot_in%cval_lsd, 2)))
3084 pot_out%cval_lsd(:, :) = pot_in%cval_lsd(:, :)
3086 IF (
ASSOCIATED(pot_in%alpha_lpot))
THEN
3087 ALLOCATE (pot_out%alpha_lpot(lbound(pot_in%alpha_lpot, 1):ubound(pot_in%alpha_lpot, 1)))
3088 pot_out%alpha_lpot(:) = pot_in%alpha_lpot(:)
3090 IF (
ASSOCIATED(pot_in%nct_lpot))
THEN
3091 ALLOCATE (pot_out%nct_lpot(lbound(pot_in%nct_lpot, 1):ubound(pot_in%nct_lpot, 1)))
3092 pot_out%nct_lpot(:) = pot_in%nct_lpot(:)
3094 IF (
ASSOCIATED(pot_in%cval_lpot))
THEN
3095 ALLOCATE (pot_out%cval_lpot(lbound(pot_in%cval_lpot, 1):ubound(pot_in%cval_lpot, 1), &
3096 lbound(pot_in%cval_lpot, 2):ubound(pot_in%cval_lpot, 2)))
3097 pot_out%cval_lpot(:, :) = pot_in%cval_lpot(:, :)
3109 SUBROUTINE copy_sgp_potential(pot_in, pot_out)
3114 CALL allocate_sgp_potential(pot_out)
3116 pot_out%name = pot_in%name
3117 pot_out%aliases = pot_in%aliases
3118 pot_out%z = pot_in%z
3119 pot_out%zeff = pot_in%zeff
3120 pot_out%zeff_correction = pot_in%zeff_correction
3121 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3122 pot_out%ccore_charge = pot_in%ccore_charge
3123 pot_out%core_charge_radius = pot_in%core_charge_radius
3124 pot_out%ppl_radius = pot_in%ppl_radius
3125 pot_out%ppnl_radius = pot_in%ppnl_radius
3126 pot_out%ecp_local = pot_in%ecp_local
3127 pot_out%n_local = pot_in%n_local
3128 pot_out%nloc = pot_in%nloc
3129 pot_out%nrloc = pot_in%nrloc
3130 pot_out%aloc = pot_in%aloc
3131 pot_out%bloc = pot_in%bloc
3132 pot_out%ecp_semi_local = pot_in%ecp_semi_local
3133 pot_out%sl_lmax = pot_in%sl_lmax
3134 pot_out%npot = pot_in%npot
3135 pot_out%nrpot = pot_in%nrpot
3136 pot_out%apot = pot_in%apot
3137 pot_out%bpot = pot_in%bpot
3138 pot_out%n_nonlocal = pot_in%n_nonlocal
3139 pot_out%nppnl = pot_in%nppnl
3140 pot_out%lmax = pot_in%lmax
3141 pot_out%is_nonlocal = pot_in%is_nonlocal
3142 pot_out%has_nlcc = pot_in%has_nlcc
3143 pot_out%n_nlcc = pot_in%n_nlcc
3145 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3146 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3147 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3149 IF (
ASSOCIATED(pot_in%a_local))
THEN
3150 ALLOCATE (pot_out%a_local(lbound(pot_in%a_local, 1):ubound(pot_in%a_local, 1)))
3151 pot_out%a_local(:) = pot_in%a_local(:)
3153 IF (
ASSOCIATED(pot_in%c_local))
THEN
3154 ALLOCATE (pot_out%c_local(lbound(pot_in%c_local, 1):ubound(pot_in%c_local, 1)))
3155 pot_out%c_local(:) = pot_in%c_local(:)
3157 IF (
ASSOCIATED(pot_in%a_nonlocal))
THEN
3158 ALLOCATE (pot_out%a_nonlocal(lbound(pot_in%a_nonlocal, 1):ubound(pot_in%a_nonlocal, 1)))
3159 pot_out%a_nonlocal(:) = pot_in%a_nonlocal(:)
3161 IF (
ASSOCIATED(pot_in%h_nonlocal))
THEN
3162 ALLOCATE (pot_out%h_nonlocal(lbound(pot_in%h_nonlocal, 1):ubound(pot_in%h_nonlocal, 1), &
3163 lbound(pot_in%h_nonlocal, 2):ubound(pot_in%h_nonlocal, 2)))
3164 pot_out%h_nonlocal(:, :) = pot_in%h_nonlocal(:, :)
3166 IF (
ASSOCIATED(pot_in%c_nonlocal))
THEN
3167 ALLOCATE (pot_out%c_nonlocal(lbound(pot_in%c_nonlocal, 1):ubound(pot_in%c_nonlocal, 1), &
3168 lbound(pot_in%c_nonlocal, 2):ubound(pot_in%c_nonlocal, 2), &
3169 lbound(pot_in%c_nonlocal, 3):ubound(pot_in%c_nonlocal, 3)))
3170 pot_out%c_nonlocal(:, :, :) = pot_in%c_nonlocal(:, :, :)
3172 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3173 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3174 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3175 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3177 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3178 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1)))
3179 pot_out%vprj_ppnl(:) = pot_in%vprj_ppnl(:)
3181 IF (
ASSOCIATED(pot_in%a_nlcc))
THEN
3182 ALLOCATE (pot_out%a_nlcc(lbound(pot_in%a_nlcc, 1):ubound(pot_in%a_nlcc, 1)))
3183 pot_out%a_nlcc(:) = pot_in%a_nlcc(:)
3185 IF (
ASSOCIATED(pot_in%c_nlcc))
THEN
3186 ALLOCATE (pot_out%c_nlcc(lbound(pot_in%c_nlcc, 1):ubound(pot_in%c_nlcc, 1)))
3187 pot_out%c_nlcc(:) = pot_in%c_nlcc(:)