714 SUBROUTINE get_gth_potential(potential, name, aliases, alpha_core_charge, &
715 alpha_ppl, ccore_charge, cerf_ppl, &
716 core_charge_radius, ppl_radius, ppnl_radius, &
717 lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
718 nprj_ppnl_max, z, zeff, zeff_correction, &
719 ppl_present, ppnl_present, &
720 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, &
721 cprj_ppnl, vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl, &
722 lpot_present, nexp_lpot, alpha_lpot, nct_lpot, cval_lpot, &
723 lsd_present, nexp_lsd, alpha_lsd, nct_lsd, cval_lsd, &
724 nlcc_present, nexp_nlcc, alpha_nlcc, nct_nlcc, cval_nlcc)
727 CHARACTER(LEN=default_string_length), &
728 INTENT(OUT),
OPTIONAL :: name, aliases
729 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
730 ccore_charge, cerf_ppl, &
731 core_charge_radius, ppl_radius, &
733 INTEGER,
INTENT(OUT),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
735 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction
736 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present
737 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
738 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
739 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
740 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
741 POINTER :: hprj_ppnl, kprj_ppnl
742 LOGICAL,
INTENT(OUT),
OPTIONAL :: lpot_present
743 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lpot
744 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lpot
745 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lpot
746 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lpot
747 LOGICAL,
INTENT(OUT),
OPTIONAL :: lsd_present
748 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lsd
749 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lsd
750 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lsd
751 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lsd
752 LOGICAL,
INTENT(OUT),
OPTIONAL :: nlcc_present
753 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_nlcc
754 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_nlcc
755 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_nlcc
756 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_nlcc
758 IF (
PRESENT(name)) name = potential%name
759 IF (
PRESENT(aliases)) aliases = potential%aliases
760 IF (
PRESENT(alpha_core_charge)) &
761 alpha_core_charge = potential%alpha_core_charge
762 IF (
PRESENT(alpha_ppl)) alpha_ppl = potential%alpha_ppl
763 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
764 IF (
PRESENT(cerf_ppl)) cerf_ppl = potential%cerf_ppl
765 IF (
PRESENT(core_charge_radius)) &
766 core_charge_radius = potential%core_charge_radius
767 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
768 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
769 IF (
PRESENT(lppnl)) lppnl = potential%lppnl
770 IF (
PRESENT(lprj_ppnl_max)) lprj_ppnl_max = potential%lprj_ppnl_max
771 IF (
PRESENT(nexp_ppl)) nexp_ppl = potential%nexp_ppl
772 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
773 IF (
PRESENT(nprj_ppnl_max)) nprj_ppnl_max = potential%nprj_ppnl_max
774 IF (
PRESENT(z)) z = potential%z
775 IF (
PRESENT(zeff)) zeff = potential%zeff
776 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
777 IF (
PRESENT(ppl_present)) ppl_present = (potential%nexp_ppl > 0)
778 IF (
PRESENT(ppnl_present)) ppnl_present = (potential%nppnl > 0)
779 IF (
PRESENT(alpha_ppnl)) alpha_ppnl => potential%alpha_ppnl
780 IF (
PRESENT(cexp_ppl)) cexp_ppl => potential%cexp_ppl
781 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
782 IF (
PRESENT(nprj_ppnl)) nprj_ppnl => potential%nprj_ppnl
783 IF (
PRESENT(cprj)) cprj => potential%cprj
784 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
785 IF (
PRESENT(hprj_ppnl)) hprj_ppnl => potential%hprj_ppnl
786 IF (
PRESENT(kprj_ppnl)) kprj_ppnl => potential%kprj_ppnl
787 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
788 IF (
PRESENT(wprj_ppnl)) wprj_ppnl => potential%wprj_ppnl
790 IF (
PRESENT(lpot_present)) lpot_present = potential%lpotextended
791 IF (
PRESENT(nexp_lpot)) nexp_lpot = potential%nexp_lpot
792 IF (
PRESENT(alpha_lpot)) alpha_lpot => potential%alpha_lpot
793 IF (
PRESENT(nct_lpot)) nct_lpot => potential%nct_lpot
794 IF (
PRESENT(cval_lpot)) cval_lpot => potential%cval_lpot
796 IF (
PRESENT(lsd_present)) lsd_present = potential%lsdpot
797 IF (
PRESENT(nexp_lsd)) nexp_lsd = potential%nexp_lsd
798 IF (
PRESENT(alpha_lsd)) alpha_lsd => potential%alpha_lsd
799 IF (
PRESENT(nct_lsd)) nct_lsd => potential%nct_lsd
800 IF (
PRESENT(cval_lsd)) cval_lsd => potential%cval_lsd
802 IF (
PRESENT(nlcc_present)) nlcc_present = potential%nlcc
803 IF (
PRESENT(nexp_nlcc)) nexp_nlcc = potential%nexp_nlcc
804 IF (
PRESENT(alpha_nlcc)) alpha_nlcc => potential%alpha_nlcc
805 IF (
PRESENT(nct_nlcc)) nct_nlcc => potential%nct_nlcc
806 IF (
PRESENT(cval_nlcc)) cval_nlcc => potential%cval_nlcc
856 SUBROUTINE get_sgp_potential(potential, name, description, aliases, elec_conf, &
857 z, zeff, zeff_correction, alpha_core_charge, &
858 ccore_charge, core_charge_radius, &
859 ppl_radius, ppnl_radius, ppl_present, ppnl_present, ppsl_present, &
860 ecp_local, n_local, a_local, c_local, &
861 nloc, nrloc, aloc, bloc, &
862 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
863 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
864 cprj_ppnl, vprj_ppnl, has_nlcc, n_nlcc, a_nlcc, c_nlcc)
867 CHARACTER(LEN=default_string_length), &
868 INTENT(OUT),
OPTIONAL :: name
869 CHARACTER(LEN=default_string_length), &
870 DIMENSION(4),
INTENT(OUT),
OPTIONAL :: description
871 CHARACTER(LEN=default_string_length), &
872 INTENT(OUT),
OPTIONAL :: aliases
873 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
874 INTEGER,
INTENT(OUT),
OPTIONAL :: z
875 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction, &
876 alpha_core_charge, ccore_charge, &
877 core_charge_radius, ppl_radius, &
879 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, ppsl_present, &
881 INTEGER,
INTENT(OUT),
OPTIONAL :: n_local
882 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
883 INTEGER,
INTENT(OUT),
OPTIONAL :: nloc
884 INTEGER,
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: nrloc
885 REAL(
dp),
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: aloc, bloc
886 LOGICAL,
INTENT(OUT),
OPTIONAL :: ecp_semi_local
887 INTEGER,
INTENT(OUT),
OPTIONAL :: sl_lmax
888 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
889 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
890 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
891 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nonlocal, nppnl, lmax
892 LOGICAL,
DIMENSION(0:5),
OPTIONAL :: is_nonlocal
893 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
894 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
895 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
896 POINTER :: c_nonlocal
897 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj_ppnl
898 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: vprj_ppnl
899 LOGICAL,
INTENT(OUT),
OPTIONAL :: has_nlcc
900 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nlcc
901 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
903 IF (
PRESENT(name)) name = potential%name
904 IF (
PRESENT(aliases)) aliases = potential%aliases
905 IF (
PRESENT(description)) description = potential%description
907 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
909 IF (
PRESENT(z)) z = potential%z
910 IF (
PRESENT(zeff)) zeff = potential%zeff
911 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
912 IF (
PRESENT(alpha_core_charge)) alpha_core_charge = potential%alpha_core_charge
913 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
914 IF (
PRESENT(core_charge_radius)) core_charge_radius = potential%core_charge_radius
916 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
917 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
918 IF (
PRESENT(ppl_present))
THEN
919 ppl_present = (potential%nloc > 0 .OR. potential%n_local > 0)
921 IF (
PRESENT(ppnl_present))
THEN
922 ppnl_present = any(potential%is_nonlocal)
924 IF (
PRESENT(ppsl_present))
THEN
925 ppsl_present = potential%ecp_semi_local
928 IF (
PRESENT(ecp_local)) ecp_local = potential%ecp_local
929 IF (
PRESENT(n_local)) n_local = potential%n_local
930 IF (
PRESENT(a_local)) a_local => potential%a_local
931 IF (
PRESENT(c_local)) c_local => potential%c_local
933 IF (
PRESENT(nloc)) nloc = potential%nloc
934 IF (
PRESENT(nrloc)) nrloc = potential%nrloc
935 IF (
PRESENT(aloc)) aloc = potential%aloc
936 IF (
PRESENT(bloc)) bloc = potential%bloc
938 IF (
PRESENT(ecp_semi_local)) ecp_semi_local = potential%ecp_semi_local
939 IF (
PRESENT(sl_lmax)) sl_lmax = potential%sl_lmax
940 IF (
PRESENT(npot)) npot = potential%npot
941 IF (
PRESENT(nrpot)) nrpot = potential%nrpot
942 IF (
PRESENT(apot)) apot = potential%apot
943 IF (
PRESENT(bpot)) bpot = potential%bpot
945 IF (
PRESENT(n_nonlocal)) n_nonlocal = potential%n_nonlocal
946 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
947 IF (
PRESENT(lmax)) lmax = potential%lmax
948 IF (
PRESENT(is_nonlocal)) is_nonlocal(:) = potential%is_nonlocal(:)
949 IF (
PRESENT(a_nonlocal)) a_nonlocal => potential%a_nonlocal
950 IF (
PRESENT(c_nonlocal)) c_nonlocal => potential%c_nonlocal
951 IF (
PRESENT(h_nonlocal)) h_nonlocal => potential%h_nonlocal
952 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
953 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
955 IF (
PRESENT(has_nlcc)) has_nlcc = potential%has_nlcc
956 IF (
PRESENT(n_nlcc)) n_nlcc = potential%n_nlcc
957 IF (
PRESENT(a_nlcc)) a_nlcc => potential%a_nlcc
958 IF (
PRESENT(c_nlcc)) c_nlcc => potential%c_nlcc
1098 PURE SUBROUTINE init_all_potential(potential, itype, zeff, zeff_correction)
1101 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: itype
1102 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
1106 IF (.NOT.
ASSOCIATED(potential))
RETURN
1108 IF (
PRESENT(zeff)) potential%zeff = zeff
1109 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
1110 dz = potential%z - int(potential%zeff - potential%zeff_correction)
1114 potential%elec_conf(0) = potential%elec_conf(0) - 2
1116 potential%elec_conf(0) = potential%elec_conf(0) - 4
1117 potential%elec_conf(1) = potential%elec_conf(1) - 6
1119 potential%elec_conf(0) = potential%elec_conf(0) - 6
1120 potential%elec_conf(1) = potential%elec_conf(1) - 12
1122 potential%elec_conf(0) = potential%elec_conf(0) - 6
1123 potential%elec_conf(1) = potential%elec_conf(1) - 12
1124 potential%elec_conf(2) = potential%elec_conf(2) - 10
1126 potential%elec_conf(0) = potential%elec_conf(0) - 8
1127 potential%elec_conf(1) = potential%elec_conf(1) - 12
1128 potential%elec_conf(2) = potential%elec_conf(2) - 10
1130 potential%elec_conf(0) = potential%elec_conf(0) - 8
1131 potential%elec_conf(1) = potential%elec_conf(1) - 18
1132 potential%elec_conf(2) = potential%elec_conf(2) - 10
1134 potential%elec_conf(0) = potential%elec_conf(0) - 8
1135 potential%elec_conf(1) = potential%elec_conf(1) - 18
1136 potential%elec_conf(2) = potential%elec_conf(2) - 20
1138 potential%elec_conf(0) = potential%elec_conf(0) - 10
1139 potential%elec_conf(1) = potential%elec_conf(1) - 18
1140 potential%elec_conf(2) = potential%elec_conf(2) - 20
1142 potential%elec_conf(0) = potential%elec_conf(0) - 10
1143 potential%elec_conf(1) = potential%elec_conf(1) - 24
1144 potential%elec_conf(2) = potential%elec_conf(2) - 20
1146 potential%elec_conf(0) = potential%elec_conf(0) - 10
1147 potential%elec_conf(1) = potential%elec_conf(1) - 24
1148 potential%elec_conf(2) = potential%elec_conf(2) - 20
1149 potential%elec_conf(3) = potential%elec_conf(3) - 14
1151 potential%elec_conf(0) = potential%elec_conf(0) - 10
1152 potential%elec_conf(1) = potential%elec_conf(1) - 24
1153 potential%elec_conf(2) = potential%elec_conf(2) - 30
1154 potential%elec_conf(3) = potential%elec_conf(3) - 14
1156 potential%elec_conf(0) = potential%elec_conf(0) - 12
1157 potential%elec_conf(1) = potential%elec_conf(1) - 24
1158 potential%elec_conf(2) = potential%elec_conf(2) - 30
1159 potential%elec_conf(3) = potential%elec_conf(3) - 14
1161 potential%elec_conf(0) = potential%elec_conf(0) - 12
1162 potential%elec_conf(1) = potential%elec_conf(1) - 30
1163 potential%elec_conf(2) = potential%elec_conf(2) - 30
1164 potential%elec_conf(3) = potential%elec_conf(3) - 14
1166 potential%elec_conf(0) = potential%elec_conf(0) - 12
1167 potential%elec_conf(1) = potential%elec_conf(1) - 30
1168 potential%elec_conf(2) = potential%elec_conf(2) - 30
1169 potential%elec_conf(3) = potential%elec_conf(3) - 28
1172 IF (
PRESENT(itype))
THEN
1173 IF (itype ==
"BARE")
THEN
1174 potential%description(1) =
"Bare Coulomb Potential"
1176 potential%description(2) =
"Valence charge only"
1178 potential%description(2) =
"Full atomic charge"
1665 SUBROUTINE read_gth_potential(element_symbol, potential_name, potential, zeff_correction, &
1666 para_env, potential_file_name, potential_section, update_input)
1668 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, potential_name
1670 REAL(KIND=
dp),
INTENT(IN) :: zeff_correction
1672 CHARACTER(len=default_path_length),
INTENT(IN) :: potential_file_name
1674 LOGICAL,
INTENT(IN) :: update_input
1676 CHARACTER(LEN=240) :: line
1677 CHARACTER(LEN=242) :: line2
1678 CHARACTER(len=5*default_string_length) :: line_att
1679 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1680 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1681 CHARACTER(LEN=LEN(potential_name)) :: apname
1682 CHARACTER(LEN=LEN(potential_name)+2) :: apname2
1683 INTEGER :: i, ic, ipot, irep, istr, j, l, lppnl, &
1684 lprj_ppnl_max, maxlppl, n, nppnl, &
1685 nprj_ppnl, nprj_ppnl_max, strlen1, &
1687 INTEGER,
DIMENSION(:),
POINTER :: elec_conf
1688 LOGICAL :: found, is_ok, match, read_from_input
1689 REAL(KIND=
dp) :: alpha, ci, r, rc2
1690 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: tmp_vals
1691 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: hprj_ppnl, kprj_ppnl
1699 NULLIFY (parser, tmp_vals)
1704 potential%name = potential_name
1705 potential%aliases = potential_name
1706 read_from_input = .false.
1708 IF (.NOT. read_from_input)
THEN
1710 CALL parser_create(parser, potential_file_name, para_env=para_env)
1714 potential%lpotextended = .false.
1715 potential%nexp_lpot = 0
1716 potential%lsdpot = .false.
1717 potential%nexp_lsd = 0
1718 potential%nlcc = .false.
1719 potential%nexp_nlcc = 0
1723 apname = potential_name
1724 symbol = element_symbol
1727 IF (read_from_input)
THEN
1737 IF (read_from_input)
THEN
1743 line2 =
" "//line//
" "
1744 symbol2 =
" "//trim(symbol)//
" "
1745 apname2 =
" "//trim(apname)//
" "
1746 strlen1 = len_trim(symbol2) + 1
1747 strlen2 = len_trim(apname2) + 1
1748 i = index(line2, symbol2(:strlen1))
1749 j = index(line2, apname2(:strlen2))
1750 IF (i > 0 .AND. j > 0)
THEN
1752 i = i + 1 + index(line2(i + 1:),
" ")
1753 potential%aliases = line2(i:)
1761 IF (read_from_input)
THEN
1764 CALL cp_abort(__location__, &
1765 "Error while reading GTH potential from input file")
1766 CALL val_get(val, c_val=line_att)
1767 READ (line_att, *) elec_conf(l)
1769 DO WHILE (len_trim(line_att) /= 0)
1772 READ (line_att, *) elec_conf(l)
1783 IF (update_input)
THEN
1784 WRITE (unit=line_att, fmt=
"(T8,*(1X,I0))") elec_conf(:)
1786 c_val=trim(line_att))
1791 potential%elec_conf(:) = elec_conf(:)
1793 potential%zeff_correction = zeff_correction
1794 potential%zeff = real(sum(elec_conf),
dp) + zeff_correction
1796 DEALLOCATE (elec_conf)
1800 IF (read_from_input)
THEN
1803 CALL cp_abort(__location__, &
1804 "Error while reading GTH potential from input file")
1805 CALL val_get(val, c_val=line_att)
1806 READ (line_att, *) r
1811 istr = len_trim(line_att) + 1
1812 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3)") r
1814 alpha = 1.0_dp/(2.0_dp*r**2)
1816 potential%alpha_core_charge = alpha
1817 potential%ccore_charge = potential%zeff*sqrt((alpha/
pi)**3)
1819 potential%alpha_ppl = alpha
1820 potential%cerf_ppl = potential%zeff*sqrt((alpha/
pi)**3)
1823 IF (read_from_input)
THEN
1824 READ (line_att, *) n
1828 istr = len_trim(line_att) + 1
1829 WRITE (unit=line_att(istr:), fmt=
"(1X,I0)") n
1831 potential%nexp_ppl = n
1835 IF (read_from_input)
THEN
1836 READ (line_att, *) ci
1840 istr = len_trim(line_att) + 1
1841 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") ci
1843 rc2 = (2.0_dp*potential%alpha_ppl)
1844 potential%cexp_ppl(i) = rc2**(i - 1)*ci
1847 IF (.NOT. read_from_input)
THEN
1849 IF (update_input)
THEN
1851 c_val=trim(line_att))
1855 IF (len_trim(line_att) /= 0)
THEN
1856 CALL cp_abort(__location__, &
1857 "Error while reading GTH potential from input file")
1866 IF (read_from_input)
THEN
1867 read_keywords_from_input:
DO
1870 CALL val_get(val, c_val=line_att)
1871 IF (index(line_att,
"LPOT") /= 0)
THEN
1872 potential%lpotextended = .true.
1874 READ (line_att, *) potential%nexp_lpot
1875 n = potential%nexp_lpot
1878 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1881 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1882 DO ipot = 1, potential%nexp_lpot
1885 CALL val_get(val, c_val=line_att)
1886 READ (line_att, *) r
1887 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1889 READ (line_att, *) potential%nct_lpot(ipot)
1891 DO ic = 1, potential%nct_lpot(ipot)
1892 READ (line_att, *) ci
1893 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1894 potential%cval_lpot(ic, ipot) = ci*rc2
1898 ELSE IF (index(line_att,
"NLCC") /= 0)
THEN
1899 potential%nlcc = .true.
1901 READ (line_att, *) potential%nexp_nlcc
1902 n = potential%nexp_nlcc
1903 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
1906 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
1907 DO ipot = 1, potential%nexp_nlcc
1910 CALL val_get(val, c_val=line_att)
1911 READ (line_att, *) potential%alpha_nlcc(ipot)
1913 READ (line_att, *) potential%nct_nlcc(ipot)
1915 DO ic = 1, potential%nct_nlcc(ipot)
1916 READ (line_att, *) potential%cval_nlcc(ic, ipot)
1918 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
1922 ELSE IF (index(line_att,
"LSD") /= 0)
THEN
1923 potential%lsdpot = .true.
1925 READ (line_att, *) potential%nexp_lsd
1926 n = potential%nexp_lsd
1927 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
1930 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
1931 DO ipot = 1, potential%nexp_lsd
1934 CALL val_get(val, c_val=line_att)
1935 READ (line_att, *) r
1936 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
1938 READ (line_att, *) potential%nct_lsd(ipot)
1940 DO ic = 1, potential%nct_lsd(ipot)
1941 READ (line_att, *) ci
1942 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
1943 potential%cval_lsd(ic, ipot) = ci*rc2
1948 EXIT read_keywords_from_input
1950 END DO read_keywords_from_input
1958 IF (index(line,
"LPOT") /= 0)
THEN
1960 potential%lpotextended = .true.
1962 n = potential%nexp_lpot
1963 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1966 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1969 IF (update_input)
THEN
1970 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LPOT", n
1972 c_val=trim(line_att))
1974 DO ipot = 1, potential%nexp_lpot
1976 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1978 CALL reallocate(tmp_vals, 1, potential%nct_lpot(ipot))
1979 DO ic = 1, potential%nct_lpot(ipot)
1982 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1983 potential%cval_lpot(ic, ipot) = ci*rc2
1987 IF (update_input)
THEN
1988 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
1989 r, potential%nct_lpot(ipot), tmp_vals(1:potential%nct_lpot(ipot))
1991 c_val=trim(line_att))
1994 ELSE IF (index(line,
"NLCC") /= 0)
THEN
1996 potential%nlcc = .true.
1998 n = potential%nexp_nlcc
1999 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
2002 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
2004 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"NLCC", n
2007 c_val=trim(line_att))
2008 DO ipot = 1, potential%nexp_nlcc
2011 CALL reallocate(tmp_vals, 1, potential%nct_nlcc(ipot))
2012 DO ic = 1, potential%nct_nlcc(ipot)
2014 tmp_vals(ic) = potential%cval_nlcc(ic, ipot)
2016 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
2020 IF (update_input)
THEN
2021 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2022 potential%alpha_nlcc(ipot), potential%nct_nlcc(ipot), &
2023 tmp_vals(1:potential%nct_nlcc(ipot))
2025 c_val=trim(line_att))
2028 ELSE IF (index(line,
"LSD") /= 0)
THEN
2030 potential%lsdpot = .true.
2032 n = potential%nexp_lsd
2033 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
2036 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
2039 IF (update_input)
THEN
2040 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LSD", n
2042 c_val=trim(line_att))
2044 DO ipot = 1, potential%nexp_lsd
2046 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
2048 CALL reallocate(tmp_vals, 1, potential%nct_lsd(ipot))
2049 DO ic = 1, potential%nct_lsd(ipot)
2052 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
2053 potential%cval_lsd(ic, ipot) = ci*rc2
2057 IF (update_input)
THEN
2058 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") r, potential%nct_lsd(ipot), &
2059 tmp_vals(1:potential%nct_lsd(ipot))
2061 c_val=trim(line_att))
2065 CALL cp_abort(__location__, &
2066 "Syntax error for <"// &
2067 trim(element_symbol)// &
2068 "> in the atomic potential <"// &
2069 trim(potential_name)// &
2070 "> potential file <"// &
2071 trim(potential_file_name)//
">: "// &
2072 "Expected LPOT/NLCC/LSD keyword, got: <"// &
2077 CALL cp_abort(__location__, &
2078 "Syntax error for <"// &
2079 trim(element_symbol)// &
2080 "> in the atomic potential <"// &
2081 trim(potential_name)// &
2082 "> potential file <"// &
2083 trim(potential_file_name)//
">: "// &
2084 "Expected LPOT/NLCC/LSD keyword or INTEGER, got: <"// &
2087 END DO read_keywords
2091 IF (read_from_input)
THEN
2092 READ (line_att, *) n
2094 IF (index(line_att,
"SOC") /= 0)
THEN
2095 potential%soc = .true.
2102 IF (index(line,
"SOC") /= 0) potential%soc = .true.
2105 IF (update_input)
THEN
2106 IF (potential%soc)
THEN
2107 WRITE (unit=line_att, fmt=
"(T9,I0,2X,A)") n,
"SOC"
2109 WRITE (unit=line_att, fmt=
"(T9,I0)") n
2112 c_val=trim(line_att))
2115 potential%lppnl = n - 1
2118 potential%lprj_ppnl_max = n - 1
2119 potential%nprj_ppnl_max = 0
2123 lppnl = potential%lppnl
2124 nppnl = potential%nppnl
2128 NULLIFY (hprj_ppnl, kprj_ppnl)
2132 CALL reallocate(potential%alpha_ppnl, 0, lppnl)
2133 CALL reallocate(potential%nprj_ppnl, 0, lppnl)
2139 IF (read_from_input)
THEN
2142 CALL cp_abort(__location__, &
2143 "Error while reading GTH potential from input file")
2144 CALL val_get(val, c_val=line_att)
2145 READ (line_att, *) r
2147 READ (line_att, *) nprj_ppnl
2153 istr = len_trim(line_att) + 1
2154 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3,1X,I0)") r, nprj_ppnl
2156 IF (r == 0.0_dp .AND. nprj_ppnl /= 0)
THEN
2157 CALL cp_abort(__location__, &
2158 "An error was detected in the atomic potential <"// &
2159 trim(potential_name)// &
2160 "> potential file <"// &
2161 trim(potential_file_name)//
">")
2163 potential%alpha_ppnl(l) = 0.0_dp
2164 IF (r /= 0.0_dp .AND. n /= 0) potential%alpha_ppnl(l) = 1.0_dp/(2.0_dp*r**2)
2165 potential%nprj_ppnl(l) = nprj_ppnl
2166 nppnl = nppnl + nprj_ppnl*
nco(l)
2167 IF (nprj_ppnl > nprj_ppnl_max)
THEN
2168 nprj_ppnl_max = nprj_ppnl
2169 CALL reallocate(hprj_ppnl, 1, nprj_ppnl_max, &
2172 CALL reallocate(kprj_ppnl, 1, nprj_ppnl_max, &
2178 IF (read_from_input)
THEN
2179 READ (line_att, *) hprj_ppnl(i, i, l)
2183 istr = len_trim(line_att) + 1
2184 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, i, l)
2187 IF (read_from_input)
THEN
2188 IF (len_trim(line_att) /= 0) &
2189 CALL cp_abort(__location__, &
2190 "Error while reading GTH potential from input file")
2193 CALL cp_abort(__location__, &
2194 "Error while reading GTH potential from input file")
2195 CALL val_get(val, c_val=line_att)
2196 READ (line_att, *) hprj_ppnl(i, i, l)
2199 IF (update_input)
THEN
2202 c_val=trim(line_att))
2206 istr = len_trim(line_att) + 1
2207 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2208 repeat(
" ", 25*(i - 1)), hprj_ppnl(i, i, l)
2211 DO j = i + 1, nprj_ppnl
2212 IF (read_from_input)
THEN
2213 READ (line_att, *) hprj_ppnl(i, j, l)
2217 istr = len_trim(line_att) + 1
2218 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, j, l)
2222 IF (.NOT. read_from_input)
THEN
2223 IF (update_input)
THEN
2226 c_val=trim(line_att))
2230 IF (len_trim(line_att) /= 0)
THEN
2231 CALL cp_abort(__location__, &
2232 "Error while reading GTH potential from input file")
2235 IF (nprj_ppnl > 1)
THEN
2238 IF (potential%soc .AND. (l > 0))
THEN
2241 IF (read_from_input)
THEN
2242 IF (len_trim(line_att) /= 0) &
2243 CALL cp_abort(__location__, &
2244 "Error while reading GTH potential from input file")
2247 CALL cp_abort(__location__, &
2248 "Error while reading GTH potential from input file")
2249 CALL val_get(val, c_val=line_att)
2250 READ (line_att, *) kprj_ppnl(i, i, l)
2253 IF (i > 1 .AND. update_input)
THEN
2256 c_val=trim(line_att))
2260 istr = len_trim(line_att) + 1
2261 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2262 repeat(
" ", 25*(i - 1)), kprj_ppnl(i, i, l)
2264 DO j = i + 1, nprj_ppnl
2265 IF (read_from_input)
THEN
2266 READ (line_att, *) kprj_ppnl(i, j, l)
2270 istr = len_trim(line_att) + 1
2271 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") kprj_ppnl(i, j, l)
2275 IF (read_from_input)
THEN
2276 IF (len_trim(line_att) /= 0)
THEN
2277 CALL cp_abort(__location__, &
2278 "Error while reading GTH potential from input file")
2281 IF (update_input)
THEN
2284 c_val=trim(line_att))
2288 IF (nprj_ppnl > 1)
THEN
2292 lprj_ppnl_max = max(lprj_ppnl_max, l + 2*(nprj_ppnl - 1))
2295 potential%nppnl = nppnl
2298 potential%lprj_ppnl_max = lprj_ppnl_max
2299 potential%nprj_ppnl_max = nprj_ppnl_max
2300 CALL reallocate(potential%hprj_ppnl, 1, nprj_ppnl_max, &
2303 potential%hprj_ppnl(:, :, :) = hprj_ppnl(:, :, :)
2304 CALL reallocate(potential%kprj_ppnl, 1, nprj_ppnl_max, &
2307 potential%kprj_ppnl(:, :, :) = kprj_ppnl(:, :, :)
2310 CALL reallocate(potential%cprj_ppnl, 1, nprj_ppnl_max, 0, lppnl)
2311 CALL reallocate(potential%vprj_ppnl, 1, nppnl, 1, nppnl)
2312 CALL reallocate(potential%wprj_ppnl, 1, nppnl, 1, nppnl)
2314 DEALLOCATE (hprj_ppnl, kprj_ppnl)
2320 CALL cp_abort(__location__, &
2321 "The requested atomic potential <"// &
2322 trim(potential_name)// &
2323 "> for element <"// &
2325 "> was not found in the potential file <"// &
2326 trim(potential_file_name)//
">")
2330 IF (.NOT. read_from_input)
THEN
2332 IF (match .AND. update_input)
THEN
2334 WRITE (unit=line_att, fmt=
"(T9,A)") &
2335 "# Potential name: "//trim(adjustl(apname2(:strlen2)))// &
2336 " for element symbol: "//trim(adjustl(symbol2(:strlen1)))
2338 c_val=trim(line_att))
2340 WRITE (unit=line_att, fmt=
"(T9,A)") &
2341 "# Potential read from the potential filename: "//trim(adjustl(potential_file_name))
2343 c_val=trim(line_att))
2349 IF (
ASSOCIATED(tmp_vals))
DEALLOCATE (tmp_vals)
2533 SUBROUTINE set_gth_potential(potential, name, alpha_core_charge, alpha_ppl, &
2534 ccore_charge, cerf_ppl, core_charge_radius, &
2535 ppl_radius, ppnl_radius, lppnl, lprj_ppnl_max, &
2536 nexp_ppl, nppnl, nprj_ppnl_max, z, zeff, zeff_correction, &
2537 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, cprj_ppnl, &
2538 vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl)
2541 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2543 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
2544 ccore_charge, cerf_ppl, &
2545 core_charge_radius, ppl_radius, &
2547 INTEGER,
INTENT(IN),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
2549 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
2550 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
2551 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
2552 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
2553 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
2554 POINTER :: hprj_ppnl, kprj_ppnl
2556 IF (
PRESENT(name)) potential%name = name
2557 IF (
PRESENT(alpha_core_charge)) &
2558 potential%alpha_core_charge = alpha_core_charge
2559 IF (
PRESENT(alpha_ppl)) potential%alpha_ppl = alpha_ppl
2560 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2561 IF (
PRESENT(cerf_ppl)) potential%cerf_ppl = cerf_ppl
2562 IF (
PRESENT(core_charge_radius)) &
2563 potential%core_charge_radius = core_charge_radius
2564 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2565 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2566 IF (
PRESENT(lppnl)) potential%lppnl = lppnl
2567 IF (
PRESENT(lprj_ppnl_max)) potential%lprj_ppnl_max = lprj_ppnl_max
2568 IF (
PRESENT(nexp_ppl)) potential%nexp_ppl = nexp_ppl
2569 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2570 IF (
PRESENT(nprj_ppnl_max)) potential%nprj_ppnl_max = nprj_ppnl_max
2571 IF (
PRESENT(z)) potential%z = z
2572 IF (
PRESENT(zeff)) potential%zeff = zeff
2573 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2574 IF (
PRESENT(alpha_ppnl)) potential%alpha_ppnl => alpha_ppnl
2575 IF (
PRESENT(cexp_ppl)) potential%cexp_ppl => cexp_ppl
2576 IF (
PRESENT(elec_conf))
THEN
2577 IF (
ASSOCIATED(potential%elec_conf))
THEN
2578 DEALLOCATE (potential%elec_conf)
2580 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2581 potential%elec_conf(:) = elec_conf(:)
2583 IF (
PRESENT(nprj_ppnl)) potential%nprj_ppnl => nprj_ppnl
2584 IF (
PRESENT(cprj)) potential%cprj => cprj
2585 IF (
PRESENT(cprj_ppnl)) potential%cprj_ppnl => cprj_ppnl
2586 IF (
PRESENT(hprj_ppnl)) potential%hprj_ppnl => hprj_ppnl
2587 IF (
PRESENT(kprj_ppnl)) potential%kprj_ppnl => kprj_ppnl
2588 IF (
PRESENT(vprj_ppnl)) potential%vprj_ppnl => vprj_ppnl
2589 IF (
PRESENT(wprj_ppnl)) potential%wprj_ppnl => wprj_ppnl
2634 SUBROUTINE set_sgp_potential(potential, name, description, aliases, elec_conf, &
2635 z, zeff, zeff_correction, alpha_core_charge, &
2636 ccore_charge, core_charge_radius, &
2637 ppl_radius, ppnl_radius, &
2638 ecp_local, n_local, a_local, c_local, &
2639 nloc, nrloc, aloc, bloc, &
2640 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
2641 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
2642 has_nlcc, n_nlcc, a_nlcc, c_nlcc)
2645 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2647 CHARACTER(LEN=default_string_length), &
2648 DIMENSION(4),
INTENT(IN),
OPTIONAL :: description
2649 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2651 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
2652 INTEGER,
INTENT(IN),
OPTIONAL :: z
2653 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction, &
2654 alpha_core_charge, ccore_charge, &
2655 core_charge_radius, ppl_radius, &
2657 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_local
2658 INTEGER,
INTENT(IN),
OPTIONAL :: n_local
2659 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
2660 INTEGER,
INTENT(IN),
OPTIONAL :: nloc
2661 INTEGER,
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: nrloc
2662 REAL(
dp),
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: aloc, bloc
2663 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_semi_local
2664 INTEGER,
INTENT(IN),
OPTIONAL :: sl_lmax
2665 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
2666 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
2667 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
2668 INTEGER,
INTENT(IN),
OPTIONAL :: n_nonlocal, nppnl, lmax
2669 LOGICAL,
DIMENSION(0:5),
INTENT(IN),
OPTIONAL :: is_nonlocal
2670 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
2671 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
2672 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
2673 POINTER :: c_nonlocal
2674 LOGICAL,
INTENT(IN),
OPTIONAL :: has_nlcc
2675 INTEGER,
INTENT(IN),
OPTIONAL :: n_nlcc
2676 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
2678 IF (
PRESENT(name)) potential%name = name
2679 IF (
PRESENT(aliases)) potential%aliases = aliases
2680 IF (
PRESENT(description)) potential%description = description
2682 IF (
PRESENT(elec_conf))
THEN
2683 IF (
ASSOCIATED(potential%elec_conf))
THEN
2684 DEALLOCATE (potential%elec_conf)
2686 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2687 potential%elec_conf(:) = elec_conf(:)
2690 IF (
PRESENT(z)) potential%z = z
2691 IF (
PRESENT(zeff)) potential%zeff = zeff
2692 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2693 IF (
PRESENT(alpha_core_charge)) potential%alpha_core_charge = alpha_core_charge
2694 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2695 IF (
PRESENT(core_charge_radius)) potential%core_charge_radius = core_charge_radius
2697 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2698 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2700 IF (
PRESENT(ecp_local)) potential%ecp_local = ecp_local
2701 IF (
PRESENT(n_local)) potential%n_local = n_local
2702 IF (
PRESENT(a_local)) potential%a_local => a_local
2703 IF (
PRESENT(c_local)) potential%c_local => c_local
2705 IF (
PRESENT(nloc)) potential%nloc = nloc
2706 IF (
PRESENT(nrloc)) potential%nrloc = nrloc
2707 IF (
PRESENT(aloc)) potential%aloc = aloc
2708 IF (
PRESENT(bloc)) potential%bloc = bloc
2710 IF (
PRESENT(ecp_semi_local)) potential%ecp_semi_local = ecp_semi_local
2711 IF (
PRESENT(sl_lmax)) potential%sl_lmax = sl_lmax
2712 IF (
PRESENT(npot)) potential%npot = npot
2713 IF (
PRESENT(nrpot)) potential%nrpot = nrpot
2714 IF (
PRESENT(apot)) potential%apot = apot
2715 IF (
PRESENT(bpot)) potential%bpot = bpot
2717 IF (
PRESENT(n_nonlocal)) potential%n_nonlocal = n_nonlocal
2718 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2719 IF (
PRESENT(lmax)) potential%lmax = lmax
2720 IF (
PRESENT(is_nonlocal)) potential%is_nonlocal(:) = is_nonlocal(:)
2721 IF (
PRESENT(a_nonlocal)) potential%a_nonlocal => a_nonlocal
2722 IF (
PRESENT(c_nonlocal)) potential%c_nonlocal => c_nonlocal
2723 IF (
PRESENT(h_nonlocal)) potential%h_nonlocal => h_nonlocal
2725 IF (
PRESENT(has_nlcc)) potential%has_nlcc = has_nlcc
2726 IF (
PRESENT(n_nlcc)) potential%n_nlcc = n_nlcc
2727 IF (
PRESENT(a_nlcc)) potential%a_nlcc => a_nlcc
2728 IF (
PRESENT(c_nlcc)) potential%c_nlcc => c_nlcc
2979 SUBROUTINE copy_gth_potential(pot_in, pot_out)
2984 CALL allocate_gth_potential(pot_out)
2986 pot_out%name = pot_in%name
2987 pot_out%aliases = pot_in%aliases
2988 pot_out%alpha_core_charge = pot_in%alpha_core_charge
2989 pot_out%alpha_ppl = pot_in%alpha_ppl
2990 pot_out%ccore_charge = pot_in%ccore_charge
2991 pot_out%cerf_ppl = pot_in%cerf_ppl
2992 pot_out%zeff = pot_in%zeff
2993 pot_out%core_charge_radius = pot_in%core_charge_radius
2994 pot_out%ppl_radius = pot_in%ppl_radius
2995 pot_out%ppnl_radius = pot_in%ppnl_radius
2996 pot_out%zeff_correction = pot_in%zeff_correction
2997 pot_out%lppnl = pot_in%lppnl
2998 pot_out%lprj_ppnl_max = pot_in%lprj_ppnl_max
2999 pot_out%nexp_ppl = pot_in%nexp_ppl
3000 pot_out%nppnl = pot_in%nppnl
3001 pot_out%nprj_ppnl_max = pot_in%nprj_ppnl_max
3002 pot_out%z = pot_in%z
3003 pot_out%nlcc = pot_in%nlcc
3004 pot_out%nexp_nlcc = pot_in%nexp_nlcc
3005 pot_out%lsdpot = pot_in%lsdpot
3006 pot_out%nexp_lsd = pot_in%nexp_lsd
3007 pot_out%lpotextended = pot_in%lpotextended
3008 pot_out%nexp_lpot = pot_in%nexp_lpot
3010 IF (
ASSOCIATED(pot_in%alpha_ppnl))
THEN
3011 ALLOCATE (pot_out%alpha_ppnl(lbound(pot_in%alpha_ppnl, 1):ubound(pot_in%alpha_ppnl, 1)))
3012 pot_out%alpha_ppnl(:) = pot_in%alpha_ppnl(:)
3014 IF (
ASSOCIATED(pot_in%cexp_ppl))
THEN
3015 ALLOCATE (pot_out%cexp_ppl(lbound(pot_in%cexp_ppl, 1):ubound(pot_in%cexp_ppl, 1)))
3016 pot_out%cexp_ppl(:) = pot_in%cexp_ppl(:)
3018 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3019 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3020 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3022 IF (
ASSOCIATED(pot_in%nprj_ppnl))
THEN
3023 ALLOCATE (pot_out%nprj_ppnl(lbound(pot_in%nprj_ppnl, 1):ubound(pot_in%nprj_ppnl, 1)))
3024 pot_out%nprj_ppnl(:) = pot_in%nprj_ppnl(:)
3026 IF (
ASSOCIATED(pot_in%cprj))
THEN
3027 ALLOCATE (pot_out%cprj(lbound(pot_in%cprj, 1):ubound(pot_in%cprj, 1), &
3028 lbound(pot_in%cprj, 2):ubound(pot_in%cprj, 2)))
3029 pot_out%cprj(:, :) = pot_in%cprj(:, :)
3031 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3032 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3033 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3034 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3036 IF (
ASSOCIATED(pot_in%hprj_ppnl))
THEN
3037 ALLOCATE (pot_out%hprj_ppnl(lbound(pot_in%hprj_ppnl, 1):ubound(pot_in%hprj_ppnl, 1), &
3038 lbound(pot_in%hprj_ppnl, 2):ubound(pot_in%hprj_ppnl, 2), &
3039 lbound(pot_in%hprj_ppnl, 3):ubound(pot_in%hprj_ppnl, 3)))
3040 pot_out%hprj_ppnl(:, :, :) = pot_in%hprj_ppnl(:, :, :)
3042 IF (
ASSOCIATED(pot_in%kprj_ppnl))
THEN
3043 ALLOCATE (pot_out%kprj_ppnl(lbound(pot_in%kprj_ppnl, 1):ubound(pot_in%kprj_ppnl, 1), &
3044 lbound(pot_in%kprj_ppnl, 2):ubound(pot_in%kprj_ppnl, 2), &
3045 lbound(pot_in%kprj_ppnl, 3):ubound(pot_in%kprj_ppnl, 3)))
3046 pot_out%kprj_ppnl(:, :, :) = pot_in%kprj_ppnl(:, :, :)
3048 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3049 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1), &
3050 lbound(pot_in%vprj_ppnl, 2):ubound(pot_in%vprj_ppnl, 2)))
3051 pot_out%vprj_ppnl(:, :) = pot_in%vprj_ppnl(:, :)
3053 IF (
ASSOCIATED(pot_in%wprj_ppnl))
THEN
3054 ALLOCATE (pot_out%wprj_ppnl(lbound(pot_in%wprj_ppnl, 1):ubound(pot_in%wprj_ppnl, 1), &
3055 lbound(pot_in%wprj_ppnl, 2):ubound(pot_in%wprj_ppnl, 2)))
3056 pot_out%wprj_ppnl(:, :) = pot_in%wprj_ppnl(:, :)
3058 IF (
ASSOCIATED(pot_in%alpha_nlcc))
THEN
3059 ALLOCATE (pot_out%alpha_nlcc(lbound(pot_in%alpha_nlcc, 1):ubound(pot_in%alpha_nlcc, 1)))
3060 pot_out%alpha_nlcc(:) = pot_in%alpha_nlcc(:)
3062 IF (
ASSOCIATED(pot_in%nct_nlcc))
THEN
3063 ALLOCATE (pot_out%nct_nlcc(lbound(pot_in%nct_nlcc, 1):ubound(pot_in%nct_nlcc, 1)))
3064 pot_out%nct_nlcc(:) = pot_in%nct_nlcc(:)
3066 IF (
ASSOCIATED(pot_in%cval_nlcc))
THEN
3067 ALLOCATE (pot_out%cval_nlcc(lbound(pot_in%cval_nlcc, 1):ubound(pot_in%cval_nlcc, 1), &
3068 lbound(pot_in%cval_nlcc, 2):ubound(pot_in%cval_nlcc, 2)))
3069 pot_out%cval_nlcc(:, :) = pot_in%cval_nlcc(:, :)
3071 IF (
ASSOCIATED(pot_in%alpha_lsd))
THEN
3072 ALLOCATE (pot_out%alpha_lsd(lbound(pot_in%alpha_lsd, 1):ubound(pot_in%alpha_lsd, 1)))
3073 pot_out%alpha_lsd(:) = pot_in%alpha_lsd(:)
3075 IF (
ASSOCIATED(pot_in%nct_lsd))
THEN
3076 ALLOCATE (pot_out%nct_lsd(lbound(pot_in%nct_lsd, 1):ubound(pot_in%nct_lsd, 1)))
3077 pot_out%nct_lsd(:) = pot_in%nct_lsd(:)
3079 IF (
ASSOCIATED(pot_in%cval_lsd))
THEN
3080 ALLOCATE (pot_out%cval_lsd(lbound(pot_in%cval_lsd, 1):ubound(pot_in%cval_lsd, 1), &
3081 lbound(pot_in%cval_lsd, 2):ubound(pot_in%cval_lsd, 2)))
3082 pot_out%cval_lsd(:, :) = pot_in%cval_lsd(:, :)
3084 IF (
ASSOCIATED(pot_in%alpha_lpot))
THEN
3085 ALLOCATE (pot_out%alpha_lpot(lbound(pot_in%alpha_lpot, 1):ubound(pot_in%alpha_lpot, 1)))
3086 pot_out%alpha_lpot(:) = pot_in%alpha_lpot(:)
3088 IF (
ASSOCIATED(pot_in%nct_lpot))
THEN
3089 ALLOCATE (pot_out%nct_lpot(lbound(pot_in%nct_lpot, 1):ubound(pot_in%nct_lpot, 1)))
3090 pot_out%nct_lpot(:) = pot_in%nct_lpot(:)
3092 IF (
ASSOCIATED(pot_in%cval_lpot))
THEN
3093 ALLOCATE (pot_out%cval_lpot(lbound(pot_in%cval_lpot, 1):ubound(pot_in%cval_lpot, 1), &
3094 lbound(pot_in%cval_lpot, 2):ubound(pot_in%cval_lpot, 2)))
3095 pot_out%cval_lpot(:, :) = pot_in%cval_lpot(:, :)
3107 SUBROUTINE copy_sgp_potential(pot_in, pot_out)
3112 CALL allocate_sgp_potential(pot_out)
3114 pot_out%name = pot_in%name
3115 pot_out%aliases = pot_in%aliases
3116 pot_out%z = pot_in%z
3117 pot_out%zeff = pot_in%zeff
3118 pot_out%zeff_correction = pot_in%zeff_correction
3119 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3120 pot_out%ccore_charge = pot_in%ccore_charge
3121 pot_out%core_charge_radius = pot_in%core_charge_radius
3122 pot_out%ppl_radius = pot_in%ppl_radius
3123 pot_out%ppnl_radius = pot_in%ppnl_radius
3124 pot_out%ecp_local = pot_in%ecp_local
3125 pot_out%n_local = pot_in%n_local
3126 pot_out%nloc = pot_in%nloc
3127 pot_out%nrloc = pot_in%nrloc
3128 pot_out%aloc = pot_in%aloc
3129 pot_out%bloc = pot_in%bloc
3130 pot_out%ecp_semi_local = pot_in%ecp_semi_local
3131 pot_out%sl_lmax = pot_in%sl_lmax
3132 pot_out%npot = pot_in%npot
3133 pot_out%nrpot = pot_in%nrpot
3134 pot_out%apot = pot_in%apot
3135 pot_out%bpot = pot_in%bpot
3136 pot_out%n_nonlocal = pot_in%n_nonlocal
3137 pot_out%nppnl = pot_in%nppnl
3138 pot_out%lmax = pot_in%lmax
3139 pot_out%is_nonlocal = pot_in%is_nonlocal
3140 pot_out%has_nlcc = pot_in%has_nlcc
3141 pot_out%n_nlcc = pot_in%n_nlcc
3143 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3144 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3145 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3147 IF (
ASSOCIATED(pot_in%a_local))
THEN
3148 ALLOCATE (pot_out%a_local(lbound(pot_in%a_local, 1):ubound(pot_in%a_local, 1)))
3149 pot_out%a_local(:) = pot_in%a_local(:)
3151 IF (
ASSOCIATED(pot_in%c_local))
THEN
3152 ALLOCATE (pot_out%c_local(lbound(pot_in%c_local, 1):ubound(pot_in%c_local, 1)))
3153 pot_out%c_local(:) = pot_in%c_local(:)
3155 IF (
ASSOCIATED(pot_in%a_nonlocal))
THEN
3156 ALLOCATE (pot_out%a_nonlocal(lbound(pot_in%a_nonlocal, 1):ubound(pot_in%a_nonlocal, 1)))
3157 pot_out%a_nonlocal(:) = pot_in%a_nonlocal(:)
3159 IF (
ASSOCIATED(pot_in%h_nonlocal))
THEN
3160 ALLOCATE (pot_out%h_nonlocal(lbound(pot_in%h_nonlocal, 1):ubound(pot_in%h_nonlocal, 1), &
3161 lbound(pot_in%h_nonlocal, 2):ubound(pot_in%h_nonlocal, 2)))
3162 pot_out%h_nonlocal(:, :) = pot_in%h_nonlocal(:, :)
3164 IF (
ASSOCIATED(pot_in%c_nonlocal))
THEN
3165 ALLOCATE (pot_out%c_nonlocal(lbound(pot_in%c_nonlocal, 1):ubound(pot_in%c_nonlocal, 1), &
3166 lbound(pot_in%c_nonlocal, 2):ubound(pot_in%c_nonlocal, 2), &
3167 lbound(pot_in%c_nonlocal, 3):ubound(pot_in%c_nonlocal, 3)))
3168 pot_out%c_nonlocal(:, :, :) = pot_in%c_nonlocal(:, :, :)
3170 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3171 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3172 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3173 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3175 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3176 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1)))
3177 pot_out%vprj_ppnl(:) = pot_in%vprj_ppnl(:)
3179 IF (
ASSOCIATED(pot_in%a_nlcc))
THEN
3180 ALLOCATE (pot_out%a_nlcc(lbound(pot_in%a_nlcc, 1):ubound(pot_in%a_nlcc, 1)))
3181 pot_out%a_nlcc(:) = pot_in%a_nlcc(:)
3183 IF (
ASSOCIATED(pot_in%c_nlcc))
THEN
3184 ALLOCATE (pot_out%c_nlcc(lbound(pot_in%c_nlcc, 1):ubound(pot_in%c_nlcc, 1)))
3185 pot_out%c_nlcc(:) = pot_in%c_nlcc(:)