718 SUBROUTINE get_gth_potential(potential, name, aliases, alpha_core_charge, &
719 alpha_ppl, ccore_charge, cerf_ppl, &
720 core_charge_radius, ppl_radius, ppnl_radius, &
721 lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
722 nprj_ppnl_max, z, zeff, zeff_correction, &
723 ppl_present, ppnl_present, soc_present, &
724 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, &
725 cprj_ppnl, vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl, &
726 lpot_present, nexp_lpot, alpha_lpot, nct_lpot, cval_lpot, &
727 lsd_present, nexp_lsd, alpha_lsd, nct_lsd, cval_lsd, &
728 nlcc_present, nexp_nlcc, alpha_nlcc, nct_nlcc, cval_nlcc, &
732 CHARACTER(LEN=default_string_length), &
733 INTENT(OUT),
OPTIONAL :: name, aliases
734 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
735 ccore_charge, cerf_ppl, &
736 core_charge_radius, ppl_radius, &
738 INTEGER,
INTENT(OUT),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
740 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction
741 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, soc_present
742 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
743 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
744 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
745 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
746 POINTER :: hprj_ppnl, kprj_ppnl
747 LOGICAL,
INTENT(OUT),
OPTIONAL :: lpot_present
748 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lpot
749 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lpot
750 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lpot
751 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lpot
752 LOGICAL,
INTENT(OUT),
OPTIONAL :: lsd_present
753 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lsd
754 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lsd
755 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lsd
756 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lsd
757 LOGICAL,
INTENT(OUT),
OPTIONAL :: nlcc_present
758 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_nlcc
759 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_nlcc
760 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_nlcc
761 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_nlcc
762 LOGICAL,
INTENT(OUT),
OPTIONAL :: monovalent
764 IF (
PRESENT(name)) name = potential%name
765 IF (
PRESENT(aliases)) aliases = potential%aliases
766 IF (
PRESENT(alpha_core_charge)) &
767 alpha_core_charge = potential%alpha_core_charge
768 IF (
PRESENT(alpha_ppl)) alpha_ppl = potential%alpha_ppl
769 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
770 IF (
PRESENT(cerf_ppl)) cerf_ppl = potential%cerf_ppl
771 IF (
PRESENT(core_charge_radius)) &
772 core_charge_radius = potential%core_charge_radius
773 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
774 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
775 IF (
PRESENT(soc_present)) soc_present = potential%soc
776 IF (
PRESENT(lppnl)) lppnl = potential%lppnl
777 IF (
PRESENT(lprj_ppnl_max)) lprj_ppnl_max = potential%lprj_ppnl_max
778 IF (
PRESENT(nexp_ppl)) nexp_ppl = potential%nexp_ppl
779 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
780 IF (
PRESENT(nprj_ppnl_max)) nprj_ppnl_max = potential%nprj_ppnl_max
781 IF (
PRESENT(z)) z = potential%z
782 IF (
PRESENT(zeff)) zeff = potential%zeff
783 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
784 IF (
PRESENT(ppl_present)) ppl_present = (potential%nexp_ppl > 0)
785 IF (
PRESENT(ppnl_present)) ppnl_present = (potential%nppnl > 0)
786 IF (
PRESENT(alpha_ppnl)) alpha_ppnl => potential%alpha_ppnl
787 IF (
PRESENT(cexp_ppl)) cexp_ppl => potential%cexp_ppl
788 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
789 IF (
PRESENT(nprj_ppnl)) nprj_ppnl => potential%nprj_ppnl
790 IF (
PRESENT(cprj)) cprj => potential%cprj
791 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
792 IF (
PRESENT(hprj_ppnl)) hprj_ppnl => potential%hprj_ppnl
793 IF (
PRESENT(kprj_ppnl)) kprj_ppnl => potential%kprj_ppnl
794 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
795 IF (
PRESENT(wprj_ppnl)) wprj_ppnl => potential%wprj_ppnl
797 IF (
PRESENT(lpot_present)) lpot_present = potential%lpotextended
798 IF (
PRESENT(nexp_lpot)) nexp_lpot = potential%nexp_lpot
799 IF (
PRESENT(alpha_lpot)) alpha_lpot => potential%alpha_lpot
800 IF (
PRESENT(nct_lpot)) nct_lpot => potential%nct_lpot
801 IF (
PRESENT(cval_lpot)) cval_lpot => potential%cval_lpot
803 IF (
PRESENT(lsd_present)) lsd_present = potential%lsdpot
804 IF (
PRESENT(nexp_lsd)) nexp_lsd = potential%nexp_lsd
805 IF (
PRESENT(alpha_lsd)) alpha_lsd => potential%alpha_lsd
806 IF (
PRESENT(nct_lsd)) nct_lsd => potential%nct_lsd
807 IF (
PRESENT(cval_lsd)) cval_lsd => potential%cval_lsd
809 IF (
PRESENT(nlcc_present)) nlcc_present = potential%nlcc
810 IF (
PRESENT(nexp_nlcc)) nexp_nlcc = potential%nexp_nlcc
811 IF (
PRESENT(alpha_nlcc)) alpha_nlcc => potential%alpha_nlcc
812 IF (
PRESENT(nct_nlcc)) nct_nlcc => potential%nct_nlcc
813 IF (
PRESENT(cval_nlcc)) cval_nlcc => potential%cval_nlcc
815 IF (
PRESENT(monovalent)) monovalent = potential%monovalent
865 SUBROUTINE get_sgp_potential(potential, name, description, aliases, elec_conf, &
866 z, zeff, zeff_correction, alpha_core_charge, &
867 ccore_charge, core_charge_radius, &
868 ppl_radius, ppnl_radius, ppl_present, ppnl_present, ppsl_present, &
869 ecp_local, n_local, a_local, c_local, &
870 nloc, nrloc, aloc, bloc, &
871 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
872 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
873 cprj_ppnl, vprj_ppnl, has_nlcc, n_nlcc, a_nlcc, c_nlcc)
876 CHARACTER(LEN=default_string_length), &
877 INTENT(OUT),
OPTIONAL :: name
878 CHARACTER(LEN=default_string_length), &
879 DIMENSION(4),
INTENT(OUT),
OPTIONAL :: description
880 CHARACTER(LEN=default_string_length), &
881 INTENT(OUT),
OPTIONAL :: aliases
882 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
883 INTEGER,
INTENT(OUT),
OPTIONAL :: z
884 REAL(KIND=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction, &
885 alpha_core_charge, ccore_charge, &
886 core_charge_radius, ppl_radius, &
888 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, ppsl_present, &
890 INTEGER,
INTENT(OUT),
OPTIONAL :: n_local
891 REAL(KIND=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
892 INTEGER,
INTENT(OUT),
OPTIONAL :: nloc
893 INTEGER,
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: nrloc
894 REAL(dp),
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: aloc, bloc
895 LOGICAL,
INTENT(OUT),
OPTIONAL :: ecp_semi_local
896 INTEGER,
INTENT(OUT),
OPTIONAL :: sl_lmax
897 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
898 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
899 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
900 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nonlocal, nppnl, lmax
901 LOGICAL,
DIMENSION(0:5),
OPTIONAL :: is_nonlocal
902 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
903 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
904 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
905 POINTER :: c_nonlocal
906 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj_ppnl
907 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: vprj_ppnl
908 LOGICAL,
INTENT(OUT),
OPTIONAL :: has_nlcc
909 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nlcc
910 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
912 IF (
PRESENT(name)) name = potential%name
913 IF (
PRESENT(aliases)) aliases = potential%aliases
914 IF (
PRESENT(description)) description = potential%description
916 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
918 IF (
PRESENT(z)) z = potential%z
919 IF (
PRESENT(zeff)) zeff = potential%zeff
920 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
921 IF (
PRESENT(alpha_core_charge)) alpha_core_charge = potential%alpha_core_charge
922 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
923 IF (
PRESENT(core_charge_radius)) core_charge_radius = potential%core_charge_radius
925 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
926 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
927 IF (
PRESENT(ppl_present))
THEN
928 ppl_present = (potential%nloc > 0 .OR. potential%n_local > 0)
930 IF (
PRESENT(ppnl_present))
THEN
931 ppnl_present = any(potential%is_nonlocal)
933 IF (
PRESENT(ppsl_present))
THEN
934 ppsl_present = potential%ecp_semi_local
937 IF (
PRESENT(ecp_local)) ecp_local = potential%ecp_local
938 IF (
PRESENT(n_local)) n_local = potential%n_local
939 IF (
PRESENT(a_local)) a_local => potential%a_local
940 IF (
PRESENT(c_local)) c_local => potential%c_local
942 IF (
PRESENT(nloc)) nloc = potential%nloc
943 IF (
PRESENT(nrloc)) nrloc = potential%nrloc
944 IF (
PRESENT(aloc)) aloc = potential%aloc
945 IF (
PRESENT(bloc)) bloc = potential%bloc
947 IF (
PRESENT(ecp_semi_local)) ecp_semi_local = potential%ecp_semi_local
948 IF (
PRESENT(sl_lmax)) sl_lmax = potential%sl_lmax
949 IF (
PRESENT(npot)) npot = potential%npot
950 IF (
PRESENT(nrpot)) nrpot = potential%nrpot
951 IF (
PRESENT(apot)) apot = potential%apot
952 IF (
PRESENT(bpot)) bpot = potential%bpot
954 IF (
PRESENT(n_nonlocal)) n_nonlocal = potential%n_nonlocal
955 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
956 IF (
PRESENT(lmax)) lmax = potential%lmax
957 IF (
PRESENT(is_nonlocal)) is_nonlocal(:) = potential%is_nonlocal(:)
958 IF (
PRESENT(a_nonlocal)) a_nonlocal => potential%a_nonlocal
959 IF (
PRESENT(c_nonlocal)) c_nonlocal => potential%c_nonlocal
960 IF (
PRESENT(h_nonlocal)) h_nonlocal => potential%h_nonlocal
961 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
962 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
964 IF (
PRESENT(has_nlcc)) has_nlcc = potential%has_nlcc
965 IF (
PRESENT(n_nlcc)) n_nlcc = potential%n_nlcc
966 IF (
PRESENT(a_nlcc)) a_nlcc => potential%a_nlcc
967 IF (
PRESENT(c_nlcc)) c_nlcc => potential%c_nlcc
1107 PURE SUBROUTINE init_all_potential(potential, itype, zeff, zeff_correction)
1110 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: itype
1111 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
1115 IF (.NOT.
ASSOCIATED(potential))
RETURN
1117 IF (
PRESENT(zeff)) potential%zeff = zeff
1118 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
1119 dz = potential%z - int(potential%zeff - potential%zeff_correction)
1123 potential%elec_conf(0) = potential%elec_conf(0) - 2
1125 potential%elec_conf(0) = potential%elec_conf(0) - 4
1126 potential%elec_conf(1) = potential%elec_conf(1) - 6
1128 potential%elec_conf(0) = potential%elec_conf(0) - 6
1129 potential%elec_conf(1) = potential%elec_conf(1) - 12
1131 potential%elec_conf(0) = potential%elec_conf(0) - 6
1132 potential%elec_conf(1) = potential%elec_conf(1) - 12
1133 potential%elec_conf(2) = potential%elec_conf(2) - 10
1135 potential%elec_conf(0) = potential%elec_conf(0) - 8
1136 potential%elec_conf(1) = potential%elec_conf(1) - 12
1137 potential%elec_conf(2) = potential%elec_conf(2) - 10
1139 potential%elec_conf(0) = potential%elec_conf(0) - 8
1140 potential%elec_conf(1) = potential%elec_conf(1) - 18
1141 potential%elec_conf(2) = potential%elec_conf(2) - 10
1143 potential%elec_conf(0) = potential%elec_conf(0) - 8
1144 potential%elec_conf(1) = potential%elec_conf(1) - 18
1145 potential%elec_conf(2) = potential%elec_conf(2) - 20
1147 potential%elec_conf(0) = potential%elec_conf(0) - 10
1148 potential%elec_conf(1) = potential%elec_conf(1) - 18
1149 potential%elec_conf(2) = potential%elec_conf(2) - 20
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) - 20
1155 potential%elec_conf(0) = potential%elec_conf(0) - 10
1156 potential%elec_conf(1) = potential%elec_conf(1) - 24
1157 potential%elec_conf(2) = potential%elec_conf(2) - 20
1158 potential%elec_conf(3) = potential%elec_conf(3) - 14
1160 potential%elec_conf(0) = potential%elec_conf(0) - 10
1161 potential%elec_conf(1) = potential%elec_conf(1) - 24
1162 potential%elec_conf(2) = potential%elec_conf(2) - 30
1163 potential%elec_conf(3) = potential%elec_conf(3) - 14
1165 potential%elec_conf(0) = potential%elec_conf(0) - 12
1166 potential%elec_conf(1) = potential%elec_conf(1) - 24
1167 potential%elec_conf(2) = potential%elec_conf(2) - 30
1168 potential%elec_conf(3) = potential%elec_conf(3) - 14
1170 potential%elec_conf(0) = potential%elec_conf(0) - 12
1171 potential%elec_conf(1) = potential%elec_conf(1) - 30
1172 potential%elec_conf(2) = potential%elec_conf(2) - 30
1173 potential%elec_conf(3) = potential%elec_conf(3) - 14
1175 potential%elec_conf(0) = potential%elec_conf(0) - 12
1176 potential%elec_conf(1) = potential%elec_conf(1) - 30
1177 potential%elec_conf(2) = potential%elec_conf(2) - 30
1178 potential%elec_conf(3) = potential%elec_conf(3) - 28
1181 IF (
PRESENT(itype))
THEN
1182 IF (itype ==
"BARE")
THEN
1183 potential%description(1) =
"Bare Coulomb Potential"
1185 potential%description(2) =
"Valence charge only"
1187 potential%description(2) =
"Full atomic charge"
1675 SUBROUTINE read_gth_potential(element_symbol, potential_name, potential, zeff_correction, &
1676 para_env, potential_file_name, potential_section, update_input, &
1679 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, potential_name
1681 REAL(KIND=
dp),
INTENT(IN) :: zeff_correction
1683 CHARACTER(len=default_path_length),
INTENT(IN) :: potential_file_name
1685 LOGICAL,
INTENT(IN) :: update_input
1686 LOGICAL,
INTENT(IN),
OPTIONAL :: monovalent
1688 CHARACTER(LEN=240) :: line
1689 CHARACTER(LEN=242) :: line2
1690 CHARACTER(len=5*default_string_length) :: line_att
1691 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1692 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1693 CHARACTER(LEN=LEN(potential_name)) :: apname
1694 CHARACTER(LEN=LEN(potential_name)+2) :: apname2
1695 INTEGER :: i, ic, ipot, irep, istr, j, l, lppnl, &
1696 lprj_ppnl_max, maxlppl, n, nppnl, &
1697 nprj_ppnl, nprj_ppnl_max, strlen1, &
1699 INTEGER,
DIMENSION(:),
POINTER :: elec_conf
1700 LOGICAL :: found, is_ok, match, read_from_input
1701 REAL(KIND=
dp) :: alpha, ci, r, rc2
1702 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: tmp_vals
1703 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: hprj_ppnl, kprj_ppnl
1711 NULLIFY (parser, tmp_vals)
1716 potential%monovalent = .false.
1717 IF (
PRESENT(monovalent)) potential%monovalent = monovalent
1719 potential%name = potential_name
1720 potential%aliases = potential_name
1721 read_from_input = .false.
1723 IF (.NOT. read_from_input)
THEN
1725 CALL parser_create(parser, potential_file_name, para_env=para_env)
1729 potential%lpotextended = .false.
1730 potential%nexp_lpot = 0
1731 potential%lsdpot = .false.
1732 potential%nexp_lsd = 0
1733 potential%nlcc = .false.
1734 potential%nexp_nlcc = 0
1738 apname = potential_name
1739 symbol = element_symbol
1742 IF (read_from_input)
THEN
1752 IF (read_from_input)
THEN
1758 line2 =
" "//line//
" "
1759 symbol2 =
" "//trim(symbol)//
" "
1760 apname2 =
" "//trim(apname)//
" "
1761 strlen1 = len_trim(symbol2) + 1
1762 strlen2 = len_trim(apname2) + 1
1763 i = index(line2, symbol2(:strlen1))
1764 j = index(line2, apname2(:strlen2))
1765 IF (i > 0 .AND. j > 0)
THEN
1767 i = i + 1 + index(line2(i + 1:),
" ")
1768 potential%aliases = line2(i:)
1776 IF (read_from_input)
THEN
1779 CALL cp_abort(__location__, &
1780 "Error while reading GTH potential from input file")
1781 CALL val_get(val, c_val=line_att)
1782 READ (line_att, *) elec_conf(l)
1784 DO WHILE (len_trim(line_att) /= 0)
1787 READ (line_att, *) elec_conf(l)
1798 IF (update_input)
THEN
1799 WRITE (unit=line_att, fmt=
"(T8,*(1X,I0))") elec_conf(:)
1801 c_val=trim(line_att))
1806 IF (potential%monovalent)
THEN
1807 potential%elec_conf(0) = 1
1809 potential%elec_conf(:) = elec_conf(:)
1812 potential%zeff_correction = zeff_correction
1813 potential%zeff = real(sum(potential%elec_conf),
dp) + zeff_correction
1815 DEALLOCATE (elec_conf)
1819 IF (read_from_input)
THEN
1822 CALL cp_abort(__location__, &
1823 "Error while reading GTH potential from input file")
1824 CALL val_get(val, c_val=line_att)
1825 READ (line_att, *) r
1830 istr = len_trim(line_att) + 1
1831 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3)") r
1833 alpha = 1.0_dp/(2.0_dp*r**2)
1835 potential%alpha_core_charge = alpha
1836 potential%ccore_charge = potential%zeff*sqrt((alpha/
pi)**3)
1838 potential%alpha_ppl = alpha
1839 potential%cerf_ppl = potential%zeff*sqrt((alpha/
pi)**3)
1842 IF (read_from_input)
THEN
1843 READ (line_att, *) n
1847 istr = len_trim(line_att) + 1
1848 WRITE (unit=line_att(istr:), fmt=
"(1X,I0)") n
1850 potential%nexp_ppl = n
1854 IF (read_from_input)
THEN
1855 READ (line_att, *) ci
1859 istr = len_trim(line_att) + 1
1860 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") ci
1862 rc2 = (2.0_dp*potential%alpha_ppl)
1863 potential%cexp_ppl(i) = rc2**(i - 1)*ci
1866 IF (.NOT. read_from_input)
THEN
1868 IF (update_input)
THEN
1870 c_val=trim(line_att))
1874 IF (len_trim(line_att) /= 0)
THEN
1875 CALL cp_abort(__location__, &
1876 "Error while reading GTH potential from input file")
1885 IF (read_from_input)
THEN
1886 read_keywords_from_input:
DO
1889 CALL val_get(val, c_val=line_att)
1890 IF (index(line_att,
"LPOT") /= 0)
THEN
1891 potential%lpotextended = .true.
1893 READ (line_att, *) potential%nexp_lpot
1894 n = potential%nexp_lpot
1897 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1900 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1901 DO ipot = 1, potential%nexp_lpot
1904 CALL val_get(val, c_val=line_att)
1905 READ (line_att, *) r
1906 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1908 READ (line_att, *) potential%nct_lpot(ipot)
1910 DO ic = 1, potential%nct_lpot(ipot)
1911 READ (line_att, *) ci
1912 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1913 potential%cval_lpot(ic, ipot) = ci*rc2
1917 ELSE IF (index(line_att,
"NLCC") /= 0)
THEN
1918 potential%nlcc = .true.
1920 READ (line_att, *) potential%nexp_nlcc
1921 n = potential%nexp_nlcc
1922 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
1925 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
1926 DO ipot = 1, potential%nexp_nlcc
1929 CALL val_get(val, c_val=line_att)
1930 READ (line_att, *) potential%alpha_nlcc(ipot)
1932 READ (line_att, *) potential%nct_nlcc(ipot)
1934 DO ic = 1, potential%nct_nlcc(ipot)
1935 READ (line_att, *) potential%cval_nlcc(ic, ipot)
1937 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
1941 ELSE IF (index(line_att,
"LSD") /= 0)
THEN
1942 potential%lsdpot = .true.
1944 READ (line_att, *) potential%nexp_lsd
1945 n = potential%nexp_lsd
1946 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
1949 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
1950 DO ipot = 1, potential%nexp_lsd
1953 CALL val_get(val, c_val=line_att)
1954 READ (line_att, *) r
1955 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
1957 READ (line_att, *) potential%nct_lsd(ipot)
1959 DO ic = 1, potential%nct_lsd(ipot)
1960 READ (line_att, *) ci
1961 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
1962 potential%cval_lsd(ic, ipot) = ci*rc2
1967 EXIT read_keywords_from_input
1969 END DO read_keywords_from_input
1977 IF (index(line,
"LPOT") /= 0)
THEN
1979 potential%lpotextended = .true.
1981 n = potential%nexp_lpot
1982 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1985 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1988 IF (update_input)
THEN
1989 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LPOT", n
1991 c_val=trim(line_att))
1993 DO ipot = 1, potential%nexp_lpot
1995 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1997 CALL reallocate(tmp_vals, 1, potential%nct_lpot(ipot))
1998 DO ic = 1, potential%nct_lpot(ipot)
2001 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
2002 potential%cval_lpot(ic, ipot) = ci*rc2
2006 IF (update_input)
THEN
2007 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2008 r, potential%nct_lpot(ipot), tmp_vals(1:potential%nct_lpot(ipot))
2010 c_val=trim(line_att))
2013 ELSE IF (index(line,
"NLCC") /= 0)
THEN
2015 potential%nlcc = .true.
2017 n = potential%nexp_nlcc
2018 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
2021 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
2023 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"NLCC", n
2026 c_val=trim(line_att))
2027 DO ipot = 1, potential%nexp_nlcc
2030 CALL reallocate(tmp_vals, 1, potential%nct_nlcc(ipot))
2031 DO ic = 1, potential%nct_nlcc(ipot)
2033 tmp_vals(ic) = potential%cval_nlcc(ic, ipot)
2035 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
2039 IF (update_input)
THEN
2040 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2041 potential%alpha_nlcc(ipot), potential%nct_nlcc(ipot), &
2042 tmp_vals(1:potential%nct_nlcc(ipot))
2044 c_val=trim(line_att))
2047 ELSE IF (index(line,
"LSD") /= 0)
THEN
2049 potential%lsdpot = .true.
2051 n = potential%nexp_lsd
2052 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
2055 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
2058 IF (update_input)
THEN
2059 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LSD", n
2061 c_val=trim(line_att))
2063 DO ipot = 1, potential%nexp_lsd
2065 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
2067 CALL reallocate(tmp_vals, 1, potential%nct_lsd(ipot))
2068 DO ic = 1, potential%nct_lsd(ipot)
2071 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
2072 potential%cval_lsd(ic, ipot) = ci*rc2
2076 IF (update_input)
THEN
2077 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") r, potential%nct_lsd(ipot), &
2078 tmp_vals(1:potential%nct_lsd(ipot))
2080 c_val=trim(line_att))
2084 CALL cp_abort(__location__, &
2085 "Syntax error for <"// &
2086 trim(element_symbol)// &
2087 "> in the atomic potential <"// &
2088 trim(potential_name)// &
2089 "> potential file <"// &
2090 trim(potential_file_name)//
">: "// &
2091 "Expected LPOT/NLCC/LSD keyword, got: <"// &
2096 CALL cp_abort(__location__, &
2097 "Syntax error for <"// &
2098 trim(element_symbol)// &
2099 "> in the atomic potential <"// &
2100 trim(potential_name)// &
2101 "> potential file <"// &
2102 trim(potential_file_name)//
">: "// &
2103 "Expected LPOT/NLCC/LSD keyword or INTEGER, got: <"// &
2106 END DO read_keywords
2110 IF (read_from_input)
THEN
2111 READ (line_att, *) n
2113 IF (index(line_att,
"SOC") /= 0)
THEN
2114 potential%soc = .true.
2121 IF (index(line,
"SOC") /= 0) potential%soc = .true.
2124 IF (update_input)
THEN
2125 IF (potential%soc)
THEN
2126 WRITE (unit=line_att, fmt=
"(T9,I0,2X,A)") n,
"SOC"
2128 WRITE (unit=line_att, fmt=
"(T9,I0)") n
2131 c_val=trim(line_att))
2134 potential%lppnl = n - 1
2137 potential%lprj_ppnl_max = n - 1
2138 potential%nprj_ppnl_max = 0
2142 lppnl = potential%lppnl
2143 nppnl = potential%nppnl
2147 NULLIFY (hprj_ppnl, kprj_ppnl)
2151 CALL reallocate(potential%alpha_ppnl, 0, lppnl)
2152 CALL reallocate(potential%nprj_ppnl, 0, lppnl)
2158 IF (read_from_input)
THEN
2161 CALL cp_abort(__location__, &
2162 "Error while reading GTH potential from input file")
2163 CALL val_get(val, c_val=line_att)
2164 READ (line_att, *) r
2166 READ (line_att, *) nprj_ppnl
2172 istr = len_trim(line_att) + 1
2173 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3,1X,I0)") r, nprj_ppnl
2175 IF (r == 0.0_dp .AND. nprj_ppnl /= 0)
THEN
2176 CALL cp_abort(__location__, &
2177 "An error was detected in the atomic potential <"// &
2178 trim(potential_name)// &
2179 "> potential file <"// &
2180 trim(potential_file_name)//
">")
2182 potential%alpha_ppnl(l) = 0.0_dp
2183 IF (r /= 0.0_dp .AND. n /= 0) potential%alpha_ppnl(l) = 1.0_dp/(2.0_dp*r**2)
2184 potential%nprj_ppnl(l) = nprj_ppnl
2185 nppnl = nppnl + nprj_ppnl*
nco(l)
2186 IF (nprj_ppnl > nprj_ppnl_max)
THEN
2187 nprj_ppnl_max = nprj_ppnl
2188 CALL reallocate(hprj_ppnl, 1, nprj_ppnl_max, &
2191 CALL reallocate(kprj_ppnl, 1, nprj_ppnl_max, &
2197 IF (read_from_input)
THEN
2198 READ (line_att, *) hprj_ppnl(i, i, l)
2202 istr = len_trim(line_att) + 1
2203 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, i, l)
2206 IF (read_from_input)
THEN
2207 IF (len_trim(line_att) /= 0) &
2208 CALL cp_abort(__location__, &
2209 "Error while reading GTH potential from input file")
2212 CALL cp_abort(__location__, &
2213 "Error while reading GTH potential from input file")
2214 CALL val_get(val, c_val=line_att)
2215 READ (line_att, *) hprj_ppnl(i, i, l)
2218 IF (update_input)
THEN
2221 c_val=trim(line_att))
2225 istr = len_trim(line_att) + 1
2226 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2227 repeat(
" ", 25*(i - 1)), hprj_ppnl(i, i, l)
2230 DO j = i + 1, nprj_ppnl
2231 IF (read_from_input)
THEN
2232 READ (line_att, *) hprj_ppnl(i, j, l)
2236 istr = len_trim(line_att) + 1
2237 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, j, l)
2241 IF (.NOT. read_from_input)
THEN
2242 IF (update_input)
THEN
2245 c_val=trim(line_att))
2249 IF (len_trim(line_att) /= 0)
THEN
2250 CALL cp_abort(__location__, &
2251 "Error while reading GTH potential from input file")
2254 IF (nprj_ppnl > 1)
THEN
2257 IF (potential%soc .AND. (l > 0))
THEN
2260 IF (read_from_input)
THEN
2261 IF (len_trim(line_att) /= 0) &
2262 CALL cp_abort(__location__, &
2263 "Error while reading GTH potential from input file")
2266 CALL cp_abort(__location__, &
2267 "Error while reading GTH potential from input file")
2268 CALL val_get(val, c_val=line_att)
2269 READ (line_att, *) kprj_ppnl(i, i, l)
2272 IF (i > 1 .AND. update_input)
THEN
2275 c_val=trim(line_att))
2279 istr = len_trim(line_att) + 1
2280 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2281 repeat(
" ", 25*(i - 1)), kprj_ppnl(i, i, l)
2283 DO j = i + 1, nprj_ppnl
2284 IF (read_from_input)
THEN
2285 READ (line_att, *) kprj_ppnl(i, j, l)
2289 istr = len_trim(line_att) + 1
2290 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") kprj_ppnl(i, j, l)
2294 IF (read_from_input)
THEN
2295 IF (len_trim(line_att) /= 0)
THEN
2296 CALL cp_abort(__location__, &
2297 "Error while reading GTH potential from input file")
2300 IF (update_input)
THEN
2303 c_val=trim(line_att))
2307 IF (nprj_ppnl > 1)
THEN
2311 lprj_ppnl_max = max(lprj_ppnl_max, l + 2*(nprj_ppnl - 1))
2314 potential%nppnl = nppnl
2317 potential%lprj_ppnl_max = lprj_ppnl_max
2318 potential%nprj_ppnl_max = nprj_ppnl_max
2319 CALL reallocate(potential%hprj_ppnl, 1, nprj_ppnl_max, &
2322 potential%hprj_ppnl(:, :, :) = hprj_ppnl(:, :, :)
2323 CALL reallocate(potential%kprj_ppnl, 1, nprj_ppnl_max, &
2326 potential%kprj_ppnl(:, :, :) = kprj_ppnl(:, :, :)
2329 CALL reallocate(potential%cprj_ppnl, 1, nprj_ppnl_max, 0, lppnl)
2330 CALL reallocate(potential%vprj_ppnl, 1, nppnl, 1, nppnl)
2331 CALL reallocate(potential%wprj_ppnl, 1, nppnl, 1, nppnl)
2333 DEALLOCATE (hprj_ppnl, kprj_ppnl)
2339 CALL cp_abort(__location__, &
2340 "The requested atomic potential <"// &
2341 trim(potential_name)// &
2342 "> for element <"// &
2344 "> was not found in the potential file <"// &
2345 trim(potential_file_name)//
">")
2349 IF (.NOT. read_from_input)
THEN
2351 IF (match .AND. update_input)
THEN
2353 WRITE (unit=line_att, fmt=
"(T9,A)") &
2354 "# Potential name: "//trim(adjustl(apname2(:strlen2)))// &
2355 " for element symbol: "//trim(adjustl(symbol2(:strlen1)))
2357 c_val=trim(line_att))
2359 WRITE (unit=line_att, fmt=
"(T9,A)") &
2360 "# Potential read from the potential filename: "//trim(adjustl(potential_file_name))
2362 c_val=trim(line_att))
2368 IF (
ASSOCIATED(tmp_vals))
DEALLOCATE (tmp_vals)
2552 SUBROUTINE set_gth_potential(potential, name, alpha_core_charge, alpha_ppl, &
2553 ccore_charge, cerf_ppl, core_charge_radius, &
2554 ppl_radius, ppnl_radius, lppnl, lprj_ppnl_max, &
2555 nexp_ppl, nppnl, nprj_ppnl_max, z, zeff, zeff_correction, &
2556 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, cprj_ppnl, &
2557 vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl)
2560 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2562 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
2563 ccore_charge, cerf_ppl, &
2564 core_charge_radius, ppl_radius, &
2566 INTEGER,
INTENT(IN),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
2568 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
2569 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
2570 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
2571 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
2572 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
2573 POINTER :: hprj_ppnl, kprj_ppnl
2575 IF (
PRESENT(name)) potential%name = name
2576 IF (
PRESENT(alpha_core_charge)) &
2577 potential%alpha_core_charge = alpha_core_charge
2578 IF (
PRESENT(alpha_ppl)) potential%alpha_ppl = alpha_ppl
2579 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2580 IF (
PRESENT(cerf_ppl)) potential%cerf_ppl = cerf_ppl
2581 IF (
PRESENT(core_charge_radius)) &
2582 potential%core_charge_radius = core_charge_radius
2583 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2584 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2585 IF (
PRESENT(lppnl)) potential%lppnl = lppnl
2586 IF (
PRESENT(lprj_ppnl_max)) potential%lprj_ppnl_max = lprj_ppnl_max
2587 IF (
PRESENT(nexp_ppl)) potential%nexp_ppl = nexp_ppl
2588 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2589 IF (
PRESENT(nprj_ppnl_max)) potential%nprj_ppnl_max = nprj_ppnl_max
2590 IF (
PRESENT(z)) potential%z = z
2591 IF (
PRESENT(zeff)) potential%zeff = zeff
2592 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2593 IF (
PRESENT(alpha_ppnl)) potential%alpha_ppnl => alpha_ppnl
2594 IF (
PRESENT(cexp_ppl)) potential%cexp_ppl => cexp_ppl
2595 IF (
PRESENT(elec_conf))
THEN
2596 IF (
ASSOCIATED(potential%elec_conf))
THEN
2597 DEALLOCATE (potential%elec_conf)
2599 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2600 potential%elec_conf(:) = elec_conf(:)
2602 IF (
PRESENT(nprj_ppnl)) potential%nprj_ppnl => nprj_ppnl
2603 IF (
PRESENT(cprj)) potential%cprj => cprj
2604 IF (
PRESENT(cprj_ppnl)) potential%cprj_ppnl => cprj_ppnl
2605 IF (
PRESENT(hprj_ppnl)) potential%hprj_ppnl => hprj_ppnl
2606 IF (
PRESENT(kprj_ppnl)) potential%kprj_ppnl => kprj_ppnl
2607 IF (
PRESENT(vprj_ppnl)) potential%vprj_ppnl => vprj_ppnl
2608 IF (
PRESENT(wprj_ppnl)) potential%wprj_ppnl => wprj_ppnl
2653 SUBROUTINE set_sgp_potential(potential, name, description, aliases, elec_conf, &
2654 z, zeff, zeff_correction, alpha_core_charge, &
2655 ccore_charge, core_charge_radius, &
2656 ppl_radius, ppnl_radius, &
2657 ecp_local, n_local, a_local, c_local, &
2658 nloc, nrloc, aloc, bloc, &
2659 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
2660 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
2661 has_nlcc, n_nlcc, a_nlcc, c_nlcc)
2664 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2666 CHARACTER(LEN=default_string_length), &
2667 DIMENSION(4),
INTENT(IN),
OPTIONAL :: description
2668 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2670 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
2671 INTEGER,
INTENT(IN),
OPTIONAL :: z
2672 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction, &
2673 alpha_core_charge, ccore_charge, &
2674 core_charge_radius, ppl_radius, &
2676 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_local
2677 INTEGER,
INTENT(IN),
OPTIONAL :: n_local
2678 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
2679 INTEGER,
INTENT(IN),
OPTIONAL :: nloc
2680 INTEGER,
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: nrloc
2681 REAL(
dp),
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: aloc, bloc
2682 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_semi_local
2683 INTEGER,
INTENT(IN),
OPTIONAL :: sl_lmax
2684 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
2685 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
2686 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
2687 INTEGER,
INTENT(IN),
OPTIONAL :: n_nonlocal, nppnl, lmax
2688 LOGICAL,
DIMENSION(0:5),
INTENT(IN),
OPTIONAL :: is_nonlocal
2689 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
2690 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
2691 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
2692 POINTER :: c_nonlocal
2693 LOGICAL,
INTENT(IN),
OPTIONAL :: has_nlcc
2694 INTEGER,
INTENT(IN),
OPTIONAL :: n_nlcc
2695 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
2697 IF (
PRESENT(name)) potential%name = name
2698 IF (
PRESENT(aliases)) potential%aliases = aliases
2699 IF (
PRESENT(description)) potential%description = description
2701 IF (
PRESENT(elec_conf))
THEN
2702 IF (
ASSOCIATED(potential%elec_conf))
THEN
2703 DEALLOCATE (potential%elec_conf)
2705 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2706 potential%elec_conf(:) = elec_conf(:)
2709 IF (
PRESENT(z)) potential%z = z
2710 IF (
PRESENT(zeff)) potential%zeff = zeff
2711 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2712 IF (
PRESENT(alpha_core_charge)) potential%alpha_core_charge = alpha_core_charge
2713 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2714 IF (
PRESENT(core_charge_radius)) potential%core_charge_radius = core_charge_radius
2716 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2717 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2719 IF (
PRESENT(ecp_local)) potential%ecp_local = ecp_local
2720 IF (
PRESENT(n_local)) potential%n_local = n_local
2721 IF (
PRESENT(a_local)) potential%a_local => a_local
2722 IF (
PRESENT(c_local)) potential%c_local => c_local
2724 IF (
PRESENT(nloc)) potential%nloc = nloc
2725 IF (
PRESENT(nrloc)) potential%nrloc = nrloc
2726 IF (
PRESENT(aloc)) potential%aloc = aloc
2727 IF (
PRESENT(bloc)) potential%bloc = bloc
2729 IF (
PRESENT(ecp_semi_local)) potential%ecp_semi_local = ecp_semi_local
2730 IF (
PRESENT(sl_lmax)) potential%sl_lmax = sl_lmax
2731 IF (
PRESENT(npot)) potential%npot = npot
2732 IF (
PRESENT(nrpot)) potential%nrpot = nrpot
2733 IF (
PRESENT(apot)) potential%apot = apot
2734 IF (
PRESENT(bpot)) potential%bpot = bpot
2736 IF (
PRESENT(n_nonlocal)) potential%n_nonlocal = n_nonlocal
2737 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2738 IF (
PRESENT(lmax)) potential%lmax = lmax
2739 IF (
PRESENT(is_nonlocal)) potential%is_nonlocal(:) = is_nonlocal(:)
2740 IF (
PRESENT(a_nonlocal)) potential%a_nonlocal => a_nonlocal
2741 IF (
PRESENT(c_nonlocal)) potential%c_nonlocal => c_nonlocal
2742 IF (
PRESENT(h_nonlocal)) potential%h_nonlocal => h_nonlocal
2744 IF (
PRESENT(has_nlcc)) potential%has_nlcc = has_nlcc
2745 IF (
PRESENT(n_nlcc)) potential%n_nlcc = n_nlcc
2746 IF (
PRESENT(a_nlcc)) potential%a_nlcc => a_nlcc
2747 IF (
PRESENT(c_nlcc)) potential%c_nlcc => c_nlcc
2998 SUBROUTINE copy_gth_potential(pot_in, pot_out)
3003 CALL allocate_gth_potential(pot_out)
3005 pot_out%name = pot_in%name
3006 pot_out%aliases = pot_in%aliases
3007 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3008 pot_out%alpha_ppl = pot_in%alpha_ppl
3009 pot_out%ccore_charge = pot_in%ccore_charge
3010 pot_out%cerf_ppl = pot_in%cerf_ppl
3011 pot_out%zeff = pot_in%zeff
3012 pot_out%core_charge_radius = pot_in%core_charge_radius
3013 pot_out%ppl_radius = pot_in%ppl_radius
3014 pot_out%ppnl_radius = pot_in%ppnl_radius
3015 pot_out%zeff_correction = pot_in%zeff_correction
3016 pot_out%lppnl = pot_in%lppnl
3017 pot_out%lprj_ppnl_max = pot_in%lprj_ppnl_max
3018 pot_out%nexp_ppl = pot_in%nexp_ppl
3019 pot_out%nppnl = pot_in%nppnl
3020 pot_out%nprj_ppnl_max = pot_in%nprj_ppnl_max
3021 pot_out%z = pot_in%z
3022 pot_out%nlcc = pot_in%nlcc
3023 pot_out%nexp_nlcc = pot_in%nexp_nlcc
3024 pot_out%lsdpot = pot_in%lsdpot
3025 pot_out%nexp_lsd = pot_in%nexp_lsd
3026 pot_out%lpotextended = pot_in%lpotextended
3027 pot_out%nexp_lpot = pot_in%nexp_lpot
3029 IF (
ASSOCIATED(pot_in%alpha_ppnl))
THEN
3030 ALLOCATE (pot_out%alpha_ppnl(lbound(pot_in%alpha_ppnl, 1):ubound(pot_in%alpha_ppnl, 1)))
3031 pot_out%alpha_ppnl(:) = pot_in%alpha_ppnl(:)
3033 IF (
ASSOCIATED(pot_in%cexp_ppl))
THEN
3034 ALLOCATE (pot_out%cexp_ppl(lbound(pot_in%cexp_ppl, 1):ubound(pot_in%cexp_ppl, 1)))
3035 pot_out%cexp_ppl(:) = pot_in%cexp_ppl(:)
3037 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3038 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3039 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3041 IF (
ASSOCIATED(pot_in%nprj_ppnl))
THEN
3042 ALLOCATE (pot_out%nprj_ppnl(lbound(pot_in%nprj_ppnl, 1):ubound(pot_in%nprj_ppnl, 1)))
3043 pot_out%nprj_ppnl(:) = pot_in%nprj_ppnl(:)
3045 IF (
ASSOCIATED(pot_in%cprj))
THEN
3046 ALLOCATE (pot_out%cprj(lbound(pot_in%cprj, 1):ubound(pot_in%cprj, 1), &
3047 lbound(pot_in%cprj, 2):ubound(pot_in%cprj, 2)))
3048 pot_out%cprj(:, :) = pot_in%cprj(:, :)
3050 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3051 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3052 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3053 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3055 IF (
ASSOCIATED(pot_in%hprj_ppnl))
THEN
3056 ALLOCATE (pot_out%hprj_ppnl(lbound(pot_in%hprj_ppnl, 1):ubound(pot_in%hprj_ppnl, 1), &
3057 lbound(pot_in%hprj_ppnl, 2):ubound(pot_in%hprj_ppnl, 2), &
3058 lbound(pot_in%hprj_ppnl, 3):ubound(pot_in%hprj_ppnl, 3)))
3059 pot_out%hprj_ppnl(:, :, :) = pot_in%hprj_ppnl(:, :, :)
3061 IF (
ASSOCIATED(pot_in%kprj_ppnl))
THEN
3062 ALLOCATE (pot_out%kprj_ppnl(lbound(pot_in%kprj_ppnl, 1):ubound(pot_in%kprj_ppnl, 1), &
3063 lbound(pot_in%kprj_ppnl, 2):ubound(pot_in%kprj_ppnl, 2), &
3064 lbound(pot_in%kprj_ppnl, 3):ubound(pot_in%kprj_ppnl, 3)))
3065 pot_out%kprj_ppnl(:, :, :) = pot_in%kprj_ppnl(:, :, :)
3067 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3068 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1), &
3069 lbound(pot_in%vprj_ppnl, 2):ubound(pot_in%vprj_ppnl, 2)))
3070 pot_out%vprj_ppnl(:, :) = pot_in%vprj_ppnl(:, :)
3072 IF (
ASSOCIATED(pot_in%wprj_ppnl))
THEN
3073 ALLOCATE (pot_out%wprj_ppnl(lbound(pot_in%wprj_ppnl, 1):ubound(pot_in%wprj_ppnl, 1), &
3074 lbound(pot_in%wprj_ppnl, 2):ubound(pot_in%wprj_ppnl, 2)))
3075 pot_out%wprj_ppnl(:, :) = pot_in%wprj_ppnl(:, :)
3077 IF (
ASSOCIATED(pot_in%alpha_nlcc))
THEN
3078 ALLOCATE (pot_out%alpha_nlcc(lbound(pot_in%alpha_nlcc, 1):ubound(pot_in%alpha_nlcc, 1)))
3079 pot_out%alpha_nlcc(:) = pot_in%alpha_nlcc(:)
3081 IF (
ASSOCIATED(pot_in%nct_nlcc))
THEN
3082 ALLOCATE (pot_out%nct_nlcc(lbound(pot_in%nct_nlcc, 1):ubound(pot_in%nct_nlcc, 1)))
3083 pot_out%nct_nlcc(:) = pot_in%nct_nlcc(:)
3085 IF (
ASSOCIATED(pot_in%cval_nlcc))
THEN
3086 ALLOCATE (pot_out%cval_nlcc(lbound(pot_in%cval_nlcc, 1):ubound(pot_in%cval_nlcc, 1), &
3087 lbound(pot_in%cval_nlcc, 2):ubound(pot_in%cval_nlcc, 2)))
3088 pot_out%cval_nlcc(:, :) = pot_in%cval_nlcc(:, :)
3090 IF (
ASSOCIATED(pot_in%alpha_lsd))
THEN
3091 ALLOCATE (pot_out%alpha_lsd(lbound(pot_in%alpha_lsd, 1):ubound(pot_in%alpha_lsd, 1)))
3092 pot_out%alpha_lsd(:) = pot_in%alpha_lsd(:)
3094 IF (
ASSOCIATED(pot_in%nct_lsd))
THEN
3095 ALLOCATE (pot_out%nct_lsd(lbound(pot_in%nct_lsd, 1):ubound(pot_in%nct_lsd, 1)))
3096 pot_out%nct_lsd(:) = pot_in%nct_lsd(:)
3098 IF (
ASSOCIATED(pot_in%cval_lsd))
THEN
3099 ALLOCATE (pot_out%cval_lsd(lbound(pot_in%cval_lsd, 1):ubound(pot_in%cval_lsd, 1), &
3100 lbound(pot_in%cval_lsd, 2):ubound(pot_in%cval_lsd, 2)))
3101 pot_out%cval_lsd(:, :) = pot_in%cval_lsd(:, :)
3103 IF (
ASSOCIATED(pot_in%alpha_lpot))
THEN
3104 ALLOCATE (pot_out%alpha_lpot(lbound(pot_in%alpha_lpot, 1):ubound(pot_in%alpha_lpot, 1)))
3105 pot_out%alpha_lpot(:) = pot_in%alpha_lpot(:)
3107 IF (
ASSOCIATED(pot_in%nct_lpot))
THEN
3108 ALLOCATE (pot_out%nct_lpot(lbound(pot_in%nct_lpot, 1):ubound(pot_in%nct_lpot, 1)))
3109 pot_out%nct_lpot(:) = pot_in%nct_lpot(:)
3111 IF (
ASSOCIATED(pot_in%cval_lpot))
THEN
3112 ALLOCATE (pot_out%cval_lpot(lbound(pot_in%cval_lpot, 1):ubound(pot_in%cval_lpot, 1), &
3113 lbound(pot_in%cval_lpot, 2):ubound(pot_in%cval_lpot, 2)))
3114 pot_out%cval_lpot(:, :) = pot_in%cval_lpot(:, :)
3126 SUBROUTINE copy_sgp_potential(pot_in, pot_out)
3131 CALL allocate_sgp_potential(pot_out)
3133 pot_out%name = pot_in%name
3134 pot_out%aliases = pot_in%aliases
3135 pot_out%z = pot_in%z
3136 pot_out%zeff = pot_in%zeff
3137 pot_out%zeff_correction = pot_in%zeff_correction
3138 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3139 pot_out%ccore_charge = pot_in%ccore_charge
3140 pot_out%core_charge_radius = pot_in%core_charge_radius
3141 pot_out%ppl_radius = pot_in%ppl_radius
3142 pot_out%ppnl_radius = pot_in%ppnl_radius
3143 pot_out%ecp_local = pot_in%ecp_local
3144 pot_out%n_local = pot_in%n_local
3145 pot_out%nloc = pot_in%nloc
3146 pot_out%nrloc = pot_in%nrloc
3147 pot_out%aloc = pot_in%aloc
3148 pot_out%bloc = pot_in%bloc
3149 pot_out%ecp_semi_local = pot_in%ecp_semi_local
3150 pot_out%sl_lmax = pot_in%sl_lmax
3151 pot_out%npot = pot_in%npot
3152 pot_out%nrpot = pot_in%nrpot
3153 pot_out%apot = pot_in%apot
3154 pot_out%bpot = pot_in%bpot
3155 pot_out%n_nonlocal = pot_in%n_nonlocal
3156 pot_out%nppnl = pot_in%nppnl
3157 pot_out%lmax = pot_in%lmax
3158 pot_out%is_nonlocal = pot_in%is_nonlocal
3159 pot_out%has_nlcc = pot_in%has_nlcc
3160 pot_out%n_nlcc = pot_in%n_nlcc
3162 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3163 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3164 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3166 IF (
ASSOCIATED(pot_in%a_local))
THEN
3167 ALLOCATE (pot_out%a_local(lbound(pot_in%a_local, 1):ubound(pot_in%a_local, 1)))
3168 pot_out%a_local(:) = pot_in%a_local(:)
3170 IF (
ASSOCIATED(pot_in%c_local))
THEN
3171 ALLOCATE (pot_out%c_local(lbound(pot_in%c_local, 1):ubound(pot_in%c_local, 1)))
3172 pot_out%c_local(:) = pot_in%c_local(:)
3174 IF (
ASSOCIATED(pot_in%a_nonlocal))
THEN
3175 ALLOCATE (pot_out%a_nonlocal(lbound(pot_in%a_nonlocal, 1):ubound(pot_in%a_nonlocal, 1)))
3176 pot_out%a_nonlocal(:) = pot_in%a_nonlocal(:)
3178 IF (
ASSOCIATED(pot_in%h_nonlocal))
THEN
3179 ALLOCATE (pot_out%h_nonlocal(lbound(pot_in%h_nonlocal, 1):ubound(pot_in%h_nonlocal, 1), &
3180 lbound(pot_in%h_nonlocal, 2):ubound(pot_in%h_nonlocal, 2)))
3181 pot_out%h_nonlocal(:, :) = pot_in%h_nonlocal(:, :)
3183 IF (
ASSOCIATED(pot_in%c_nonlocal))
THEN
3184 ALLOCATE (pot_out%c_nonlocal(lbound(pot_in%c_nonlocal, 1):ubound(pot_in%c_nonlocal, 1), &
3185 lbound(pot_in%c_nonlocal, 2):ubound(pot_in%c_nonlocal, 2), &
3186 lbound(pot_in%c_nonlocal, 3):ubound(pot_in%c_nonlocal, 3)))
3187 pot_out%c_nonlocal(:, :, :) = pot_in%c_nonlocal(:, :, :)
3189 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3190 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3191 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3192 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3194 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3195 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1)))
3196 pot_out%vprj_ppnl(:) = pot_in%vprj_ppnl(:)
3198 IF (
ASSOCIATED(pot_in%a_nlcc))
THEN
3199 ALLOCATE (pot_out%a_nlcc(lbound(pot_in%a_nlcc, 1):ubound(pot_in%a_nlcc, 1)))
3200 pot_out%a_nlcc(:) = pot_in%a_nlcc(:)
3202 IF (
ASSOCIATED(pot_in%c_nlcc))
THEN
3203 ALLOCATE (pot_out%c_nlcc(lbound(pot_in%c_nlcc, 1):ubound(pot_in%c_nlcc, 1)))
3204 pot_out%c_nlcc(:) = pot_in%c_nlcc(:)