720 SUBROUTINE get_gth_potential(potential, name, aliases, alpha_core_charge, &
721 alpha_ppl, ccore_charge, cerf_ppl, &
722 core_charge_radius, ppl_radius, ppnl_radius, &
723 lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
724 nprj_ppnl_max, z, zeff, zeff_correction, &
725 ppl_present, ppnl_present, soc_present, &
726 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, &
727 cprj_ppnl, vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl, &
728 lpot_present, nexp_lpot, alpha_lpot, nct_lpot, cval_lpot, &
729 lsd_present, nexp_lsd, alpha_lsd, nct_lsd, cval_lsd, &
730 nlcc_present, nexp_nlcc, alpha_nlcc, nct_nlcc, cval_nlcc, &
734 CHARACTER(LEN=default_string_length), &
735 INTENT(OUT),
OPTIONAL :: name, aliases
736 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
737 ccore_charge, cerf_ppl, &
738 core_charge_radius, ppl_radius, &
740 INTEGER,
INTENT(OUT),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
742 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction
743 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, soc_present
744 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
745 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
746 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
747 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
748 POINTER :: hprj_ppnl, kprj_ppnl
749 LOGICAL,
INTENT(OUT),
OPTIONAL :: lpot_present
750 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lpot
751 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lpot
752 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lpot
753 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lpot
754 LOGICAL,
INTENT(OUT),
OPTIONAL :: lsd_present
755 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_lsd
756 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_lsd
757 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_lsd
758 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_lsd
759 LOGICAL,
INTENT(OUT),
OPTIONAL :: nlcc_present
760 INTEGER,
INTENT(OUT),
OPTIONAL :: nexp_nlcc
761 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_nlcc
762 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: nct_nlcc
763 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cval_nlcc
764 LOGICAL,
INTENT(OUT),
OPTIONAL :: monovalent
766 IF (
PRESENT(name)) name = potential%name
767 IF (
PRESENT(aliases)) aliases = potential%aliases
768 IF (
PRESENT(alpha_core_charge))
THEN
769 alpha_core_charge = potential%alpha_core_charge
771 IF (
PRESENT(alpha_ppl)) alpha_ppl = potential%alpha_ppl
772 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
773 IF (
PRESENT(cerf_ppl)) cerf_ppl = potential%cerf_ppl
774 IF (
PRESENT(core_charge_radius))
THEN
775 core_charge_radius = potential%core_charge_radius
777 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
778 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
779 IF (
PRESENT(soc_present)) soc_present = potential%soc
780 IF (
PRESENT(lppnl)) lppnl = potential%lppnl
781 IF (
PRESENT(lprj_ppnl_max)) lprj_ppnl_max = potential%lprj_ppnl_max
782 IF (
PRESENT(nexp_ppl)) nexp_ppl = potential%nexp_ppl
783 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
784 IF (
PRESENT(nprj_ppnl_max)) nprj_ppnl_max = potential%nprj_ppnl_max
785 IF (
PRESENT(z)) z = potential%z
786 IF (
PRESENT(zeff)) zeff = potential%zeff
787 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
788 IF (
PRESENT(ppl_present)) ppl_present = (potential%nexp_ppl > 0)
789 IF (
PRESENT(ppnl_present)) ppnl_present = (potential%nppnl > 0)
790 IF (
PRESENT(alpha_ppnl)) alpha_ppnl => potential%alpha_ppnl
791 IF (
PRESENT(cexp_ppl)) cexp_ppl => potential%cexp_ppl
792 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
793 IF (
PRESENT(nprj_ppnl)) nprj_ppnl => potential%nprj_ppnl
794 IF (
PRESENT(cprj)) cprj => potential%cprj
795 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
796 IF (
PRESENT(hprj_ppnl)) hprj_ppnl => potential%hprj_ppnl
797 IF (
PRESENT(kprj_ppnl)) kprj_ppnl => potential%kprj_ppnl
798 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
799 IF (
PRESENT(wprj_ppnl)) wprj_ppnl => potential%wprj_ppnl
801 IF (
PRESENT(lpot_present)) lpot_present = potential%lpotextended
802 IF (
PRESENT(nexp_lpot)) nexp_lpot = potential%nexp_lpot
803 IF (
PRESENT(alpha_lpot)) alpha_lpot => potential%alpha_lpot
804 IF (
PRESENT(nct_lpot)) nct_lpot => potential%nct_lpot
805 IF (
PRESENT(cval_lpot)) cval_lpot => potential%cval_lpot
807 IF (
PRESENT(lsd_present)) lsd_present = potential%lsdpot
808 IF (
PRESENT(nexp_lsd)) nexp_lsd = potential%nexp_lsd
809 IF (
PRESENT(alpha_lsd)) alpha_lsd => potential%alpha_lsd
810 IF (
PRESENT(nct_lsd)) nct_lsd => potential%nct_lsd
811 IF (
PRESENT(cval_lsd)) cval_lsd => potential%cval_lsd
813 IF (
PRESENT(nlcc_present)) nlcc_present = potential%nlcc
814 IF (
PRESENT(nexp_nlcc)) nexp_nlcc = potential%nexp_nlcc
815 IF (
PRESENT(alpha_nlcc)) alpha_nlcc => potential%alpha_nlcc
816 IF (
PRESENT(nct_nlcc)) nct_nlcc => potential%nct_nlcc
817 IF (
PRESENT(cval_nlcc)) cval_nlcc => potential%cval_nlcc
819 IF (
PRESENT(monovalent)) monovalent = potential%monovalent
869 SUBROUTINE get_sgp_potential(potential, name, description, aliases, elec_conf, &
870 z, zeff, zeff_correction, alpha_core_charge, &
871 ccore_charge, core_charge_radius, &
872 ppl_radius, ppnl_radius, ppl_present, ppnl_present, ppsl_present, &
873 ecp_local, n_local, a_local, c_local, &
874 nloc, nrloc, aloc, bloc, &
875 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
876 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
877 cprj_ppnl, vprj_ppnl, has_nlcc, n_nlcc, a_nlcc, c_nlcc)
880 CHARACTER(LEN=default_string_length), &
881 INTENT(OUT),
OPTIONAL :: name
882 CHARACTER(LEN=default_string_length), &
883 DIMENSION(4),
INTENT(OUT),
OPTIONAL :: description
884 CHARACTER(LEN=default_string_length), &
885 INTENT(OUT),
OPTIONAL :: aliases
886 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
887 INTEGER,
INTENT(OUT),
OPTIONAL :: z
888 REAL(KIND=
dp),
INTENT(OUT),
OPTIONAL :: zeff, zeff_correction, &
889 alpha_core_charge, ccore_charge, &
890 core_charge_radius, ppl_radius, &
892 LOGICAL,
INTENT(OUT),
OPTIONAL :: ppl_present, ppnl_present, ppsl_present, &
894 INTEGER,
INTENT(OUT),
OPTIONAL :: n_local
895 REAL(KIND=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
896 INTEGER,
INTENT(OUT),
OPTIONAL :: nloc
897 INTEGER,
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: nrloc
898 REAL(dp),
DIMENSION(1:10),
INTENT(OUT),
OPTIONAL :: aloc, bloc
899 LOGICAL,
INTENT(OUT),
OPTIONAL :: ecp_semi_local
900 INTEGER,
INTENT(OUT),
OPTIONAL :: sl_lmax
901 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
902 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
903 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
904 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nonlocal, nppnl, lmax
905 LOGICAL,
DIMENSION(0:5),
OPTIONAL :: is_nonlocal
906 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
907 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
908 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
909 POINTER :: c_nonlocal
910 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj_ppnl
911 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: vprj_ppnl
912 LOGICAL,
INTENT(OUT),
OPTIONAL :: has_nlcc
913 INTEGER,
INTENT(OUT),
OPTIONAL :: n_nlcc
914 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
916 IF (
PRESENT(name)) name = potential%name
917 IF (
PRESENT(aliases)) aliases = potential%aliases
918 IF (
PRESENT(description)) description = potential%description
920 IF (
PRESENT(elec_conf)) elec_conf => potential%elec_conf
922 IF (
PRESENT(z)) z = potential%z
923 IF (
PRESENT(zeff)) zeff = potential%zeff
924 IF (
PRESENT(zeff_correction)) zeff_correction = potential%zeff_correction
925 IF (
PRESENT(alpha_core_charge)) alpha_core_charge = potential%alpha_core_charge
926 IF (
PRESENT(ccore_charge)) ccore_charge = potential%ccore_charge
927 IF (
PRESENT(core_charge_radius)) core_charge_radius = potential%core_charge_radius
929 IF (
PRESENT(ppl_radius)) ppl_radius = potential%ppl_radius
930 IF (
PRESENT(ppnl_radius)) ppnl_radius = potential%ppnl_radius
931 IF (
PRESENT(ppl_present))
THEN
932 ppl_present = (potential%nloc > 0 .OR. potential%n_local > 0)
934 IF (
PRESENT(ppnl_present))
THEN
935 ppnl_present = any(potential%is_nonlocal)
937 IF (
PRESENT(ppsl_present))
THEN
938 ppsl_present = potential%ecp_semi_local
941 IF (
PRESENT(ecp_local)) ecp_local = potential%ecp_local
942 IF (
PRESENT(n_local)) n_local = potential%n_local
943 IF (
PRESENT(a_local)) a_local => potential%a_local
944 IF (
PRESENT(c_local)) c_local => potential%c_local
946 IF (
PRESENT(nloc)) nloc = potential%nloc
947 IF (
PRESENT(nrloc)) nrloc = potential%nrloc
948 IF (
PRESENT(aloc)) aloc = potential%aloc
949 IF (
PRESENT(bloc)) bloc = potential%bloc
951 IF (
PRESENT(ecp_semi_local)) ecp_semi_local = potential%ecp_semi_local
952 IF (
PRESENT(sl_lmax)) sl_lmax = potential%sl_lmax
953 IF (
PRESENT(npot)) npot = potential%npot
954 IF (
PRESENT(nrpot)) nrpot = potential%nrpot
955 IF (
PRESENT(apot)) apot = potential%apot
956 IF (
PRESENT(bpot)) bpot = potential%bpot
958 IF (
PRESENT(n_nonlocal)) n_nonlocal = potential%n_nonlocal
959 IF (
PRESENT(nppnl)) nppnl = potential%nppnl
960 IF (
PRESENT(lmax)) lmax = potential%lmax
961 IF (
PRESENT(is_nonlocal)) is_nonlocal(:) = potential%is_nonlocal(:)
962 IF (
PRESENT(a_nonlocal)) a_nonlocal => potential%a_nonlocal
963 IF (
PRESENT(c_nonlocal)) c_nonlocal => potential%c_nonlocal
964 IF (
PRESENT(h_nonlocal)) h_nonlocal => potential%h_nonlocal
965 IF (
PRESENT(cprj_ppnl)) cprj_ppnl => potential%cprj_ppnl
966 IF (
PRESENT(vprj_ppnl)) vprj_ppnl => potential%vprj_ppnl
968 IF (
PRESENT(has_nlcc)) has_nlcc = potential%has_nlcc
969 IF (
PRESENT(n_nlcc)) n_nlcc = potential%n_nlcc
970 IF (
PRESENT(a_nlcc)) a_nlcc => potential%a_nlcc
971 IF (
PRESENT(c_nlcc)) c_nlcc => potential%c_nlcc
1111 PURE SUBROUTINE init_all_potential(potential, itype, zeff, zeff_correction)
1114 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: itype
1115 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
1119 IF (.NOT.
ASSOCIATED(potential))
RETURN
1121 IF (
PRESENT(zeff)) potential%zeff = zeff
1122 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
1123 dz = potential%z - int(potential%zeff - potential%zeff_correction)
1127 potential%elec_conf(0) = potential%elec_conf(0) - 2
1129 potential%elec_conf(0) = potential%elec_conf(0) - 4
1130 potential%elec_conf(1) = potential%elec_conf(1) - 6
1132 potential%elec_conf(0) = potential%elec_conf(0) - 6
1133 potential%elec_conf(1) = potential%elec_conf(1) - 12
1135 potential%elec_conf(0) = potential%elec_conf(0) - 6
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) - 12
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) - 10
1147 potential%elec_conf(0) = potential%elec_conf(0) - 8
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) - 18
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
1159 potential%elec_conf(0) = potential%elec_conf(0) - 10
1160 potential%elec_conf(1) = potential%elec_conf(1) - 24
1161 potential%elec_conf(2) = potential%elec_conf(2) - 20
1162 potential%elec_conf(3) = potential%elec_conf(3) - 14
1164 potential%elec_conf(0) = potential%elec_conf(0) - 10
1165 potential%elec_conf(1) = potential%elec_conf(1) - 24
1166 potential%elec_conf(2) = potential%elec_conf(2) - 30
1167 potential%elec_conf(3) = potential%elec_conf(3) - 14
1169 potential%elec_conf(0) = potential%elec_conf(0) - 12
1170 potential%elec_conf(1) = potential%elec_conf(1) - 24
1171 potential%elec_conf(2) = potential%elec_conf(2) - 30
1172 potential%elec_conf(3) = potential%elec_conf(3) - 14
1174 potential%elec_conf(0) = potential%elec_conf(0) - 12
1175 potential%elec_conf(1) = potential%elec_conf(1) - 30
1176 potential%elec_conf(2) = potential%elec_conf(2) - 30
1177 potential%elec_conf(3) = potential%elec_conf(3) - 14
1179 potential%elec_conf(0) = potential%elec_conf(0) - 12
1180 potential%elec_conf(1) = potential%elec_conf(1) - 30
1181 potential%elec_conf(2) = potential%elec_conf(2) - 30
1182 potential%elec_conf(3) = potential%elec_conf(3) - 28
1185 IF (
PRESENT(itype))
THEN
1186 IF (itype ==
"BARE")
THEN
1187 potential%description(1) =
"Bare Coulomb Potential"
1189 potential%description(2) =
"Valence charge only"
1191 potential%description(2) =
"Full atomic charge"
1683 SUBROUTINE read_gth_potential(element_symbol, potential_name, potential, zeff_correction, &
1684 para_env, potential_file_name, potential_section, update_input, &
1687 CHARACTER(LEN=*),
INTENT(IN) :: element_symbol, potential_name
1689 REAL(KIND=
dp),
INTENT(IN) :: zeff_correction
1691 CHARACTER(len=default_path_length),
INTENT(IN) :: potential_file_name
1693 LOGICAL,
INTENT(IN) :: update_input
1694 LOGICAL,
INTENT(IN),
OPTIONAL :: monovalent
1696 CHARACTER(LEN=240) :: line
1697 CHARACTER(LEN=242) :: line2
1698 CHARACTER(len=5*default_string_length) :: line_att
1699 CHARACTER(LEN=LEN(element_symbol)) :: symbol
1700 CHARACTER(LEN=LEN(element_symbol)+2) :: symbol2
1701 CHARACTER(LEN=LEN(potential_name)) :: apname
1702 CHARACTER(LEN=LEN(potential_name)+2) :: apname2
1703 INTEGER :: i, ic, ipot, irep, istr, j, l, lppnl, &
1704 lprj_ppnl_max, maxlppl, n, nppnl, &
1705 nprj_ppnl, nprj_ppnl_max, strlen1, &
1707 INTEGER,
DIMENSION(:),
POINTER :: elec_conf
1708 LOGICAL :: found, is_ok, match, read_from_input
1709 REAL(KIND=
dp) :: alpha, ci, r, rc2
1710 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: tmp_vals
1711 REAL(KIND=
dp),
DIMENSION(:, :, :),
POINTER :: hprj_ppnl, kprj_ppnl
1719 NULLIFY (parser, tmp_vals)
1724 potential%monovalent = .false.
1725 IF (
PRESENT(monovalent)) potential%monovalent = monovalent
1727 potential%name = potential_name
1728 potential%aliases = potential_name
1729 read_from_input = .false.
1731 IF (.NOT. read_from_input)
THEN
1733 CALL parser_create(parser, potential_file_name, para_env=para_env)
1737 potential%lpotextended = .false.
1738 potential%nexp_lpot = 0
1739 potential%lsdpot = .false.
1740 potential%nexp_lsd = 0
1741 potential%nlcc = .false.
1742 potential%nexp_nlcc = 0
1746 apname = potential_name
1747 symbol = element_symbol
1750 IF (read_from_input)
THEN
1760 IF (read_from_input)
THEN
1766 line2 =
" "//line//
" "
1767 symbol2 =
" "//trim(symbol)//
" "
1768 apname2 =
" "//trim(apname)//
" "
1769 strlen1 = len_trim(symbol2) + 1
1770 strlen2 = len_trim(apname2) + 1
1771 i = index(line2, symbol2(:strlen1))
1772 j = index(line2, apname2(:strlen2))
1773 IF (i > 0 .AND. j > 0)
THEN
1775 i = i + 1 + index(line2(i + 1:),
" ")
1776 potential%aliases = line2(i:)
1784 IF (read_from_input)
THEN
1786 IF (.NOT. is_ok)
THEN
1787 CALL cp_abort(__location__, &
1788 "Error while reading GTH potential from input file")
1790 CALL val_get(val, c_val=line_att)
1791 READ (line_att, *) elec_conf(l)
1793 DO WHILE (len_trim(line_att) /= 0)
1796 READ (line_att, *) elec_conf(l)
1807 IF (update_input)
THEN
1808 WRITE (unit=line_att, fmt=
"(T8,*(1X,I0))") elec_conf(:)
1810 c_val=trim(line_att))
1815 IF (potential%monovalent)
THEN
1816 potential%elec_conf(0) = 1
1818 potential%elec_conf(:) = elec_conf(:)
1821 potential%zeff_correction = zeff_correction
1822 potential%zeff = real(sum(potential%elec_conf),
dp) + zeff_correction
1824 DEALLOCATE (elec_conf)
1828 IF (read_from_input)
THEN
1830 IF (.NOT. is_ok)
THEN
1831 CALL cp_abort(__location__, &
1832 "Error while reading GTH potential from input file")
1834 CALL val_get(val, c_val=line_att)
1835 READ (line_att, *) r
1840 istr = len_trim(line_att) + 1
1841 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3)") r
1843 alpha = 1.0_dp/(2.0_dp*r**2)
1845 potential%alpha_core_charge = alpha
1846 potential%ccore_charge = potential%zeff*sqrt((alpha/
pi)**3)
1848 potential%alpha_ppl = alpha
1849 potential%cerf_ppl = potential%zeff*sqrt((alpha/
pi)**3)
1852 IF (read_from_input)
THEN
1853 READ (line_att, *) n
1857 istr = len_trim(line_att) + 1
1858 WRITE (unit=line_att(istr:), fmt=
"(1X,I0)") n
1860 potential%nexp_ppl = n
1864 IF (read_from_input)
THEN
1865 READ (line_att, *) ci
1869 istr = len_trim(line_att) + 1
1870 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") ci
1872 rc2 = (2.0_dp*potential%alpha_ppl)
1873 potential%cexp_ppl(i) = rc2**(i - 1)*ci
1876 IF (.NOT. read_from_input)
THEN
1878 IF (update_input)
THEN
1880 c_val=trim(line_att))
1884 IF (len_trim(line_att) /= 0)
THEN
1885 CALL cp_abort(__location__, &
1886 "Error while reading GTH potential from input file")
1895 IF (read_from_input)
THEN
1896 read_keywords_from_input:
DO
1899 CALL val_get(val, c_val=line_att)
1900 IF (index(line_att,
"LPOT") /= 0)
THEN
1901 potential%lpotextended = .true.
1903 READ (line_att, *) potential%nexp_lpot
1904 n = potential%nexp_lpot
1907 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1910 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1911 DO ipot = 1, potential%nexp_lpot
1914 CALL val_get(val, c_val=line_att)
1915 READ (line_att, *) r
1916 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
1918 READ (line_att, *) potential%nct_lpot(ipot)
1920 DO ic = 1, potential%nct_lpot(ipot)
1921 READ (line_att, *) ci
1922 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
1923 potential%cval_lpot(ic, ipot) = ci*rc2
1927 ELSE IF (index(line_att,
"NLCC") /= 0)
THEN
1928 potential%nlcc = .true.
1930 READ (line_att, *) potential%nexp_nlcc
1931 n = potential%nexp_nlcc
1932 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
1935 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
1936 DO ipot = 1, potential%nexp_nlcc
1939 CALL val_get(val, c_val=line_att)
1940 READ (line_att, *) potential%alpha_nlcc(ipot)
1942 READ (line_att, *) potential%nct_nlcc(ipot)
1944 DO ic = 1, potential%nct_nlcc(ipot)
1945 READ (line_att, *) potential%cval_nlcc(ic, ipot)
1947 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
1951 ELSE IF (index(line_att,
"LSD") /= 0)
THEN
1952 potential%lsdpot = .true.
1954 READ (line_att, *) potential%nexp_lsd
1955 n = potential%nexp_lsd
1956 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
1959 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
1960 DO ipot = 1, potential%nexp_lsd
1963 CALL val_get(val, c_val=line_att)
1964 READ (line_att, *) r
1965 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
1967 READ (line_att, *) potential%nct_lsd(ipot)
1969 DO ic = 1, potential%nct_lsd(ipot)
1970 READ (line_att, *) ci
1971 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
1972 potential%cval_lsd(ic, ipot) = ci*rc2
1977 EXIT read_keywords_from_input
1979 END DO read_keywords_from_input
1987 IF (index(line,
"LPOT") /= 0)
THEN
1989 potential%lpotextended = .true.
1991 n = potential%nexp_lpot
1992 NULLIFY (potential%alpha_lpot, potential%nct_lpot, potential%cval_lpot)
1995 CALL reallocate(potential%cval_lpot, 1, 4, 1, n)
1998 IF (update_input)
THEN
1999 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LPOT", n
2001 c_val=trim(line_att))
2003 DO ipot = 1, potential%nexp_lpot
2005 potential%alpha_lpot(ipot) = 0.5_dp/(r*r)
2007 CALL reallocate(tmp_vals, 1, potential%nct_lpot(ipot))
2008 DO ic = 1, potential%nct_lpot(ipot)
2011 rc2 = (2._dp*potential%alpha_lpot(ipot))**(ic - 1)
2012 potential%cval_lpot(ic, ipot) = ci*rc2
2016 IF (update_input)
THEN
2017 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2018 r, potential%nct_lpot(ipot), tmp_vals(1:potential%nct_lpot(ipot))
2020 c_val=trim(line_att))
2023 ELSE IF (index(line,
"NLCC") /= 0)
THEN
2025 potential%nlcc = .true.
2027 n = potential%nexp_nlcc
2028 NULLIFY (potential%alpha_nlcc, potential%nct_nlcc, potential%cval_nlcc)
2031 CALL reallocate(potential%cval_nlcc, 1, 4, 1, n)
2033 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"NLCC", n
2036 c_val=trim(line_att))
2037 DO ipot = 1, potential%nexp_nlcc
2040 CALL reallocate(tmp_vals, 1, potential%nct_nlcc(ipot))
2041 DO ic = 1, potential%nct_nlcc(ipot)
2043 tmp_vals(ic) = potential%cval_nlcc(ic, ipot)
2045 potential%cval_nlcc(ic, ipot) = potential%cval_nlcc(ic, ipot)/(4.0_dp*
pi)
2049 IF (update_input)
THEN
2050 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") &
2051 potential%alpha_nlcc(ipot), potential%nct_nlcc(ipot), &
2052 tmp_vals(1:potential%nct_nlcc(ipot))
2054 c_val=trim(line_att))
2057 ELSE IF (index(line,
"LSD") /= 0)
THEN
2059 potential%lsdpot = .true.
2061 n = potential%nexp_lsd
2062 NULLIFY (potential%alpha_lsd, potential%nct_lsd, potential%cval_lsd)
2065 CALL reallocate(potential%cval_lsd, 1, 4, 1, n)
2068 IF (update_input)
THEN
2069 WRITE (unit=line_att, fmt=
"(T9,A,1X,I0)")
"LSD", n
2071 c_val=trim(line_att))
2073 DO ipot = 1, potential%nexp_lsd
2075 potential%alpha_lsd(ipot) = 0.5_dp/(r*r)
2077 CALL reallocate(tmp_vals, 1, potential%nct_lsd(ipot))
2078 DO ic = 1, potential%nct_lsd(ipot)
2081 rc2 = (2._dp*potential%alpha_lsd(ipot))**(ic - 1)
2082 potential%cval_lsd(ic, ipot) = ci*rc2
2086 IF (update_input)
THEN
2087 WRITE (unit=line_att, fmt=
"(T9,ES25.16E3,1X,I0,*(ES25.16E3))") r, potential%nct_lsd(ipot), &
2088 tmp_vals(1:potential%nct_lsd(ipot))
2090 c_val=trim(line_att))
2094 CALL cp_abort(__location__, &
2095 "Syntax error for <"// &
2096 trim(element_symbol)// &
2097 "> in the atomic potential <"// &
2098 trim(potential_name)// &
2099 "> potential file <"// &
2100 trim(potential_file_name)//
">: "// &
2101 "Expected LPOT/NLCC/LSD keyword, got: <"// &
2106 CALL cp_abort(__location__, &
2107 "Syntax error for <"// &
2108 trim(element_symbol)// &
2109 "> in the atomic potential <"// &
2110 trim(potential_name)// &
2111 "> potential file <"// &
2112 trim(potential_file_name)//
">: "// &
2113 "Expected LPOT/NLCC/LSD keyword or INTEGER, got: <"// &
2116 END DO read_keywords
2120 IF (read_from_input)
THEN
2121 READ (line_att, *) n
2123 IF (index(line_att,
"SOC") /= 0)
THEN
2124 potential%soc = .true.
2131 IF (index(line,
"SOC") /= 0) potential%soc = .true.
2134 IF (update_input)
THEN
2135 IF (potential%soc)
THEN
2136 WRITE (unit=line_att, fmt=
"(T9,I0,2X,A)") n,
"SOC"
2138 WRITE (unit=line_att, fmt=
"(T9,I0)") n
2141 c_val=trim(line_att))
2144 potential%lppnl = n - 1
2147 potential%lprj_ppnl_max = n - 1
2148 potential%nprj_ppnl_max = 0
2152 lppnl = potential%lppnl
2153 nppnl = potential%nppnl
2157 NULLIFY (hprj_ppnl, kprj_ppnl)
2161 CALL reallocate(potential%alpha_ppnl, 0, lppnl)
2162 CALL reallocate(potential%nprj_ppnl, 0, lppnl)
2168 IF (read_from_input)
THEN
2170 IF (.NOT. is_ok)
THEN
2171 CALL cp_abort(__location__, &
2172 "Error while reading GTH potential from input file")
2174 CALL val_get(val, c_val=line_att)
2175 READ (line_att, *) r
2177 READ (line_att, *) nprj_ppnl
2183 istr = len_trim(line_att) + 1
2184 WRITE (unit=line_att(istr:), fmt=
"(T9,ES25.16E3,1X,I0)") r, nprj_ppnl
2186 IF (r == 0.0_dp .AND. nprj_ppnl /= 0)
THEN
2187 CALL cp_abort(__location__, &
2188 "An error was detected in the atomic potential <"// &
2189 trim(potential_name)// &
2190 "> potential file <"// &
2191 trim(potential_file_name)//
">")
2193 potential%alpha_ppnl(l) = 0.0_dp
2194 IF (r /= 0.0_dp .AND. n /= 0) potential%alpha_ppnl(l) = 1.0_dp/(2.0_dp*r**2)
2195 potential%nprj_ppnl(l) = nprj_ppnl
2196 nppnl = nppnl + nprj_ppnl*
nco(l)
2197 IF (nprj_ppnl > nprj_ppnl_max)
THEN
2198 nprj_ppnl_max = nprj_ppnl
2199 CALL reallocate(hprj_ppnl, 1, nprj_ppnl_max, &
2202 CALL reallocate(kprj_ppnl, 1, nprj_ppnl_max, &
2208 IF (read_from_input)
THEN
2209 READ (line_att, *) hprj_ppnl(i, i, l)
2213 istr = len_trim(line_att) + 1
2214 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, i, l)
2217 IF (read_from_input)
THEN
2218 IF (len_trim(line_att) /= 0)
THEN
2219 CALL cp_abort(__location__, &
2220 "Error while reading GTH potential from input file")
2223 IF (.NOT. is_ok)
THEN
2224 CALL cp_abort(__location__, &
2225 "Error while reading GTH potential from input file")
2227 CALL val_get(val, c_val=line_att)
2228 READ (line_att, *) hprj_ppnl(i, i, l)
2231 IF (update_input)
THEN
2234 c_val=trim(line_att))
2238 istr = len_trim(line_att) + 1
2239 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2240 repeat(
" ", 25*(i - 1)), hprj_ppnl(i, i, l)
2243 DO j = i + 1, nprj_ppnl
2244 IF (read_from_input)
THEN
2245 READ (line_att, *) hprj_ppnl(i, j, l)
2249 istr = len_trim(line_att) + 1
2250 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") hprj_ppnl(i, j, l)
2254 IF (.NOT. read_from_input)
THEN
2255 IF (update_input)
THEN
2258 c_val=trim(line_att))
2262 IF (len_trim(line_att) /= 0)
THEN
2263 CALL cp_abort(__location__, &
2264 "Error while reading GTH potential from input file")
2267 IF (nprj_ppnl > 1)
THEN
2270 IF (potential%soc .AND. (l > 0))
THEN
2273 IF (read_from_input)
THEN
2274 IF (len_trim(line_att) /= 0)
THEN
2275 CALL cp_abort(__location__, &
2276 "Error while reading GTH potential from input file")
2279 IF (.NOT. is_ok)
THEN
2280 CALL cp_abort(__location__, &
2281 "Error while reading GTH potential from input file")
2283 CALL val_get(val, c_val=line_att)
2284 READ (line_att, *) kprj_ppnl(i, i, l)
2287 IF (i > 1 .AND. update_input)
THEN
2290 c_val=trim(line_att))
2294 istr = len_trim(line_att) + 1
2295 WRITE (unit=line_att(istr:), fmt=
"(T36,A,ES25.16E3)") &
2296 repeat(
" ", 25*(i - 1)), kprj_ppnl(i, i, l)
2298 DO j = i + 1, nprj_ppnl
2299 IF (read_from_input)
THEN
2300 READ (line_att, *) kprj_ppnl(i, j, l)
2304 istr = len_trim(line_att) + 1
2305 WRITE (unit=line_att(istr:), fmt=
"(ES25.16E3)") kprj_ppnl(i, j, l)
2309 IF (read_from_input)
THEN
2310 IF (len_trim(line_att) /= 0)
THEN
2311 CALL cp_abort(__location__, &
2312 "Error while reading GTH potential from input file")
2315 IF (update_input)
THEN
2318 c_val=trim(line_att))
2322 IF (nprj_ppnl > 1)
THEN
2326 lprj_ppnl_max = max(lprj_ppnl_max, l + 2*(nprj_ppnl - 1))
2329 potential%nppnl = nppnl
2332 potential%lprj_ppnl_max = lprj_ppnl_max
2333 potential%nprj_ppnl_max = nprj_ppnl_max
2334 CALL reallocate(potential%hprj_ppnl, 1, nprj_ppnl_max, &
2337 potential%hprj_ppnl(:, :, :) = hprj_ppnl(:, :, :)
2338 CALL reallocate(potential%kprj_ppnl, 1, nprj_ppnl_max, &
2341 potential%kprj_ppnl(:, :, :) = kprj_ppnl(:, :, :)
2344 CALL reallocate(potential%cprj_ppnl, 1, nprj_ppnl_max, 0, lppnl)
2345 CALL reallocate(potential%vprj_ppnl, 1, nppnl, 1, nppnl)
2346 CALL reallocate(potential%wprj_ppnl, 1, nppnl, 1, nppnl)
2348 DEALLOCATE (hprj_ppnl, kprj_ppnl)
2354 CALL cp_abort(__location__, &
2355 "The requested atomic potential <"// &
2356 trim(potential_name)// &
2357 "> for element <"// &
2359 "> was not found in the potential file <"// &
2360 trim(potential_file_name)//
">")
2364 IF (.NOT. read_from_input)
THEN
2366 IF (match .AND. update_input)
THEN
2368 WRITE (unit=line_att, fmt=
"(T9,A)") &
2369 "# Potential name: "//trim(adjustl(apname2(:strlen2)))// &
2370 " for element symbol: "//trim(adjustl(symbol2(:strlen1)))
2372 c_val=trim(line_att))
2374 WRITE (unit=line_att, fmt=
"(T9,A)") &
2375 "# Potential read from the potential filename: "//trim(adjustl(potential_file_name))
2377 c_val=trim(line_att))
2383 IF (
ASSOCIATED(tmp_vals))
DEALLOCATE (tmp_vals)
2569 SUBROUTINE set_gth_potential(potential, name, alpha_core_charge, alpha_ppl, &
2570 ccore_charge, cerf_ppl, core_charge_radius, &
2571 ppl_radius, ppnl_radius, lppnl, lprj_ppnl_max, &
2572 nexp_ppl, nppnl, nprj_ppnl_max, z, zeff, zeff_correction, &
2573 alpha_ppnl, cexp_ppl, elec_conf, nprj_ppnl, cprj, cprj_ppnl, &
2574 vprj_ppnl, wprj_ppnl, hprj_ppnl, kprj_ppnl)
2577 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2579 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: alpha_core_charge, alpha_ppl, &
2580 ccore_charge, cerf_ppl, &
2581 core_charge_radius, ppl_radius, &
2583 INTEGER,
INTENT(IN),
OPTIONAL :: lppnl, lprj_ppnl_max, nexp_ppl, nppnl, &
2585 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction
2586 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: alpha_ppnl, cexp_ppl
2587 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf, nprj_ppnl
2588 REAL(kind=
dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: cprj, cprj_ppnl, vprj_ppnl, wprj_ppnl
2589 REAL(kind=
dp),
DIMENSION(:, :, :),
OPTIONAL, &
2590 POINTER :: hprj_ppnl, kprj_ppnl
2592 IF (
PRESENT(name)) potential%name = name
2593 IF (
PRESENT(alpha_core_charge))
THEN
2594 potential%alpha_core_charge = alpha_core_charge
2596 IF (
PRESENT(alpha_ppl)) potential%alpha_ppl = alpha_ppl
2597 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2598 IF (
PRESENT(cerf_ppl)) potential%cerf_ppl = cerf_ppl
2599 IF (
PRESENT(core_charge_radius))
THEN
2600 potential%core_charge_radius = core_charge_radius
2602 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2603 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2604 IF (
PRESENT(lppnl)) potential%lppnl = lppnl
2605 IF (
PRESENT(lprj_ppnl_max)) potential%lprj_ppnl_max = lprj_ppnl_max
2606 IF (
PRESENT(nexp_ppl)) potential%nexp_ppl = nexp_ppl
2607 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2608 IF (
PRESENT(nprj_ppnl_max)) potential%nprj_ppnl_max = nprj_ppnl_max
2609 IF (
PRESENT(z)) potential%z = z
2610 IF (
PRESENT(zeff)) potential%zeff = zeff
2611 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2612 IF (
PRESENT(alpha_ppnl)) potential%alpha_ppnl => alpha_ppnl
2613 IF (
PRESENT(cexp_ppl)) potential%cexp_ppl => cexp_ppl
2614 IF (
PRESENT(elec_conf))
THEN
2615 IF (
ASSOCIATED(potential%elec_conf))
THEN
2616 DEALLOCATE (potential%elec_conf)
2618 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2619 potential%elec_conf(:) = elec_conf(:)
2621 IF (
PRESENT(nprj_ppnl)) potential%nprj_ppnl => nprj_ppnl
2622 IF (
PRESENT(cprj)) potential%cprj => cprj
2623 IF (
PRESENT(cprj_ppnl)) potential%cprj_ppnl => cprj_ppnl
2624 IF (
PRESENT(hprj_ppnl)) potential%hprj_ppnl => hprj_ppnl
2625 IF (
PRESENT(kprj_ppnl)) potential%kprj_ppnl => kprj_ppnl
2626 IF (
PRESENT(vprj_ppnl)) potential%vprj_ppnl => vprj_ppnl
2627 IF (
PRESENT(wprj_ppnl)) potential%wprj_ppnl => wprj_ppnl
2672 SUBROUTINE set_sgp_potential(potential, name, description, aliases, elec_conf, &
2673 z, zeff, zeff_correction, alpha_core_charge, &
2674 ccore_charge, core_charge_radius, &
2675 ppl_radius, ppnl_radius, &
2676 ecp_local, n_local, a_local, c_local, &
2677 nloc, nrloc, aloc, bloc, &
2678 ecp_semi_local, sl_lmax, npot, nrpot, apot, bpot, &
2679 n_nonlocal, nppnl, lmax, is_nonlocal, a_nonlocal, h_nonlocal, c_nonlocal, &
2680 has_nlcc, n_nlcc, a_nlcc, c_nlcc)
2683 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2685 CHARACTER(LEN=default_string_length), &
2686 DIMENSION(4),
INTENT(IN),
OPTIONAL :: description
2687 CHARACTER(LEN=default_string_length),
INTENT(IN), &
2689 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: elec_conf
2690 INTEGER,
INTENT(IN),
OPTIONAL :: z
2691 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: zeff, zeff_correction, &
2692 alpha_core_charge, ccore_charge, &
2693 core_charge_radius, ppl_radius, &
2695 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_local
2696 INTEGER,
INTENT(IN),
OPTIONAL :: n_local
2697 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_local, c_local
2698 INTEGER,
INTENT(IN),
OPTIONAL :: nloc
2699 INTEGER,
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: nrloc
2700 REAL(
dp),
DIMENSION(1:10),
INTENT(IN),
OPTIONAL :: aloc, bloc
2701 LOGICAL,
INTENT(IN),
OPTIONAL :: ecp_semi_local
2702 INTEGER,
INTENT(IN),
OPTIONAL :: sl_lmax
2703 INTEGER,
DIMENSION(0:10),
OPTIONAL :: npot
2704 INTEGER,
DIMENSION(1:15, 0:10),
OPTIONAL :: nrpot
2705 REAL(dp),
DIMENSION(1:15, 0:10),
OPTIONAL :: apot, bpot
2706 INTEGER,
INTENT(IN),
OPTIONAL :: n_nonlocal, nppnl, lmax
2707 LOGICAL,
DIMENSION(0:5),
INTENT(IN),
OPTIONAL :: is_nonlocal
2708 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nonlocal
2709 REAL(KIND=dp),
DIMENSION(:, :),
OPTIONAL,
POINTER :: h_nonlocal
2710 REAL(KIND=dp),
DIMENSION(:, :, :),
OPTIONAL, &
2711 POINTER :: c_nonlocal
2712 LOGICAL,
INTENT(IN),
OPTIONAL :: has_nlcc
2713 INTEGER,
INTENT(IN),
OPTIONAL :: n_nlcc
2714 REAL(KIND=dp),
DIMENSION(:),
OPTIONAL,
POINTER :: a_nlcc, c_nlcc
2716 IF (
PRESENT(name)) potential%name = name
2717 IF (
PRESENT(aliases)) potential%aliases = aliases
2718 IF (
PRESENT(description)) potential%description = description
2720 IF (
PRESENT(elec_conf))
THEN
2721 IF (
ASSOCIATED(potential%elec_conf))
THEN
2722 DEALLOCATE (potential%elec_conf)
2724 ALLOCATE (potential%elec_conf(0:
SIZE(elec_conf) - 1))
2725 potential%elec_conf(:) = elec_conf(:)
2728 IF (
PRESENT(z)) potential%z = z
2729 IF (
PRESENT(zeff)) potential%zeff = zeff
2730 IF (
PRESENT(zeff_correction)) potential%zeff_correction = zeff_correction
2731 IF (
PRESENT(alpha_core_charge)) potential%alpha_core_charge = alpha_core_charge
2732 IF (
PRESENT(ccore_charge)) potential%ccore_charge = ccore_charge
2733 IF (
PRESENT(core_charge_radius)) potential%core_charge_radius = core_charge_radius
2735 IF (
PRESENT(ppl_radius)) potential%ppl_radius = ppl_radius
2736 IF (
PRESENT(ppnl_radius)) potential%ppnl_radius = ppnl_radius
2738 IF (
PRESENT(ecp_local)) potential%ecp_local = ecp_local
2739 IF (
PRESENT(n_local)) potential%n_local = n_local
2740 IF (
PRESENT(a_local)) potential%a_local => a_local
2741 IF (
PRESENT(c_local)) potential%c_local => c_local
2743 IF (
PRESENT(nloc)) potential%nloc = nloc
2744 IF (
PRESENT(nrloc)) potential%nrloc = nrloc
2745 IF (
PRESENT(aloc)) potential%aloc = aloc
2746 IF (
PRESENT(bloc)) potential%bloc = bloc
2748 IF (
PRESENT(ecp_semi_local)) potential%ecp_semi_local = ecp_semi_local
2749 IF (
PRESENT(sl_lmax)) potential%sl_lmax = sl_lmax
2750 IF (
PRESENT(npot)) potential%npot = npot
2751 IF (
PRESENT(nrpot)) potential%nrpot = nrpot
2752 IF (
PRESENT(apot)) potential%apot = apot
2753 IF (
PRESENT(bpot)) potential%bpot = bpot
2755 IF (
PRESENT(n_nonlocal)) potential%n_nonlocal = n_nonlocal
2756 IF (
PRESENT(nppnl)) potential%nppnl = nppnl
2757 IF (
PRESENT(lmax)) potential%lmax = lmax
2758 IF (
PRESENT(is_nonlocal)) potential%is_nonlocal(:) = is_nonlocal(:)
2759 IF (
PRESENT(a_nonlocal)) potential%a_nonlocal => a_nonlocal
2760 IF (
PRESENT(c_nonlocal)) potential%c_nonlocal => c_nonlocal
2761 IF (
PRESENT(h_nonlocal)) potential%h_nonlocal => h_nonlocal
2763 IF (
PRESENT(has_nlcc)) potential%has_nlcc = has_nlcc
2764 IF (
PRESENT(n_nlcc)) potential%n_nlcc = n_nlcc
2765 IF (
PRESENT(a_nlcc)) potential%a_nlcc => a_nlcc
2766 IF (
PRESENT(c_nlcc)) potential%c_nlcc => c_nlcc
3017 SUBROUTINE copy_gth_potential(pot_in, pot_out)
3022 CALL allocate_gth_potential(pot_out)
3024 pot_out%name = pot_in%name
3025 pot_out%aliases = pot_in%aliases
3026 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3027 pot_out%alpha_ppl = pot_in%alpha_ppl
3028 pot_out%ccore_charge = pot_in%ccore_charge
3029 pot_out%cerf_ppl = pot_in%cerf_ppl
3030 pot_out%zeff = pot_in%zeff
3031 pot_out%core_charge_radius = pot_in%core_charge_radius
3032 pot_out%ppl_radius = pot_in%ppl_radius
3033 pot_out%ppnl_radius = pot_in%ppnl_radius
3034 pot_out%zeff_correction = pot_in%zeff_correction
3035 pot_out%lppnl = pot_in%lppnl
3036 pot_out%lprj_ppnl_max = pot_in%lprj_ppnl_max
3037 pot_out%nexp_ppl = pot_in%nexp_ppl
3038 pot_out%nppnl = pot_in%nppnl
3039 pot_out%nprj_ppnl_max = pot_in%nprj_ppnl_max
3040 pot_out%z = pot_in%z
3041 pot_out%nlcc = pot_in%nlcc
3042 pot_out%nexp_nlcc = pot_in%nexp_nlcc
3043 pot_out%lsdpot = pot_in%lsdpot
3044 pot_out%nexp_lsd = pot_in%nexp_lsd
3045 pot_out%lpotextended = pot_in%lpotextended
3046 pot_out%nexp_lpot = pot_in%nexp_lpot
3048 IF (
ASSOCIATED(pot_in%alpha_ppnl))
THEN
3049 ALLOCATE (pot_out%alpha_ppnl(lbound(pot_in%alpha_ppnl, 1):ubound(pot_in%alpha_ppnl, 1)))
3050 pot_out%alpha_ppnl(:) = pot_in%alpha_ppnl(:)
3052 IF (
ASSOCIATED(pot_in%cexp_ppl))
THEN
3053 ALLOCATE (pot_out%cexp_ppl(lbound(pot_in%cexp_ppl, 1):ubound(pot_in%cexp_ppl, 1)))
3054 pot_out%cexp_ppl(:) = pot_in%cexp_ppl(:)
3056 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3057 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3058 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3060 IF (
ASSOCIATED(pot_in%nprj_ppnl))
THEN
3061 ALLOCATE (pot_out%nprj_ppnl(lbound(pot_in%nprj_ppnl, 1):ubound(pot_in%nprj_ppnl, 1)))
3062 pot_out%nprj_ppnl(:) = pot_in%nprj_ppnl(:)
3064 IF (
ASSOCIATED(pot_in%cprj))
THEN
3065 ALLOCATE (pot_out%cprj(lbound(pot_in%cprj, 1):ubound(pot_in%cprj, 1), &
3066 lbound(pot_in%cprj, 2):ubound(pot_in%cprj, 2)))
3067 pot_out%cprj(:, :) = pot_in%cprj(:, :)
3069 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3070 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3071 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3072 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3074 IF (
ASSOCIATED(pot_in%hprj_ppnl))
THEN
3075 ALLOCATE (pot_out%hprj_ppnl(lbound(pot_in%hprj_ppnl, 1):ubound(pot_in%hprj_ppnl, 1), &
3076 lbound(pot_in%hprj_ppnl, 2):ubound(pot_in%hprj_ppnl, 2), &
3077 lbound(pot_in%hprj_ppnl, 3):ubound(pot_in%hprj_ppnl, 3)))
3078 pot_out%hprj_ppnl(:, :, :) = pot_in%hprj_ppnl(:, :, :)
3080 IF (
ASSOCIATED(pot_in%kprj_ppnl))
THEN
3081 ALLOCATE (pot_out%kprj_ppnl(lbound(pot_in%kprj_ppnl, 1):ubound(pot_in%kprj_ppnl, 1), &
3082 lbound(pot_in%kprj_ppnl, 2):ubound(pot_in%kprj_ppnl, 2), &
3083 lbound(pot_in%kprj_ppnl, 3):ubound(pot_in%kprj_ppnl, 3)))
3084 pot_out%kprj_ppnl(:, :, :) = pot_in%kprj_ppnl(:, :, :)
3086 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3087 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1), &
3088 lbound(pot_in%vprj_ppnl, 2):ubound(pot_in%vprj_ppnl, 2)))
3089 pot_out%vprj_ppnl(:, :) = pot_in%vprj_ppnl(:, :)
3091 IF (
ASSOCIATED(pot_in%wprj_ppnl))
THEN
3092 ALLOCATE (pot_out%wprj_ppnl(lbound(pot_in%wprj_ppnl, 1):ubound(pot_in%wprj_ppnl, 1), &
3093 lbound(pot_in%wprj_ppnl, 2):ubound(pot_in%wprj_ppnl, 2)))
3094 pot_out%wprj_ppnl(:, :) = pot_in%wprj_ppnl(:, :)
3096 IF (
ASSOCIATED(pot_in%alpha_nlcc))
THEN
3097 ALLOCATE (pot_out%alpha_nlcc(lbound(pot_in%alpha_nlcc, 1):ubound(pot_in%alpha_nlcc, 1)))
3098 pot_out%alpha_nlcc(:) = pot_in%alpha_nlcc(:)
3100 IF (
ASSOCIATED(pot_in%nct_nlcc))
THEN
3101 ALLOCATE (pot_out%nct_nlcc(lbound(pot_in%nct_nlcc, 1):ubound(pot_in%nct_nlcc, 1)))
3102 pot_out%nct_nlcc(:) = pot_in%nct_nlcc(:)
3104 IF (
ASSOCIATED(pot_in%cval_nlcc))
THEN
3105 ALLOCATE (pot_out%cval_nlcc(lbound(pot_in%cval_nlcc, 1):ubound(pot_in%cval_nlcc, 1), &
3106 lbound(pot_in%cval_nlcc, 2):ubound(pot_in%cval_nlcc, 2)))
3107 pot_out%cval_nlcc(:, :) = pot_in%cval_nlcc(:, :)
3109 IF (
ASSOCIATED(pot_in%alpha_lsd))
THEN
3110 ALLOCATE (pot_out%alpha_lsd(lbound(pot_in%alpha_lsd, 1):ubound(pot_in%alpha_lsd, 1)))
3111 pot_out%alpha_lsd(:) = pot_in%alpha_lsd(:)
3113 IF (
ASSOCIATED(pot_in%nct_lsd))
THEN
3114 ALLOCATE (pot_out%nct_lsd(lbound(pot_in%nct_lsd, 1):ubound(pot_in%nct_lsd, 1)))
3115 pot_out%nct_lsd(:) = pot_in%nct_lsd(:)
3117 IF (
ASSOCIATED(pot_in%cval_lsd))
THEN
3118 ALLOCATE (pot_out%cval_lsd(lbound(pot_in%cval_lsd, 1):ubound(pot_in%cval_lsd, 1), &
3119 lbound(pot_in%cval_lsd, 2):ubound(pot_in%cval_lsd, 2)))
3120 pot_out%cval_lsd(:, :) = pot_in%cval_lsd(:, :)
3122 IF (
ASSOCIATED(pot_in%alpha_lpot))
THEN
3123 ALLOCATE (pot_out%alpha_lpot(lbound(pot_in%alpha_lpot, 1):ubound(pot_in%alpha_lpot, 1)))
3124 pot_out%alpha_lpot(:) = pot_in%alpha_lpot(:)
3126 IF (
ASSOCIATED(pot_in%nct_lpot))
THEN
3127 ALLOCATE (pot_out%nct_lpot(lbound(pot_in%nct_lpot, 1):ubound(pot_in%nct_lpot, 1)))
3128 pot_out%nct_lpot(:) = pot_in%nct_lpot(:)
3130 IF (
ASSOCIATED(pot_in%cval_lpot))
THEN
3131 ALLOCATE (pot_out%cval_lpot(lbound(pot_in%cval_lpot, 1):ubound(pot_in%cval_lpot, 1), &
3132 lbound(pot_in%cval_lpot, 2):ubound(pot_in%cval_lpot, 2)))
3133 pot_out%cval_lpot(:, :) = pot_in%cval_lpot(:, :)
3145 SUBROUTINE copy_sgp_potential(pot_in, pot_out)
3150 CALL allocate_sgp_potential(pot_out)
3152 pot_out%name = pot_in%name
3153 pot_out%aliases = pot_in%aliases
3154 pot_out%z = pot_in%z
3155 pot_out%zeff = pot_in%zeff
3156 pot_out%zeff_correction = pot_in%zeff_correction
3157 pot_out%alpha_core_charge = pot_in%alpha_core_charge
3158 pot_out%ccore_charge = pot_in%ccore_charge
3159 pot_out%core_charge_radius = pot_in%core_charge_radius
3160 pot_out%ppl_radius = pot_in%ppl_radius
3161 pot_out%ppnl_radius = pot_in%ppnl_radius
3162 pot_out%ecp_local = pot_in%ecp_local
3163 pot_out%n_local = pot_in%n_local
3164 pot_out%nloc = pot_in%nloc
3165 pot_out%nrloc = pot_in%nrloc
3166 pot_out%aloc = pot_in%aloc
3167 pot_out%bloc = pot_in%bloc
3168 pot_out%ecp_semi_local = pot_in%ecp_semi_local
3169 pot_out%sl_lmax = pot_in%sl_lmax
3170 pot_out%npot = pot_in%npot
3171 pot_out%nrpot = pot_in%nrpot
3172 pot_out%apot = pot_in%apot
3173 pot_out%bpot = pot_in%bpot
3174 pot_out%n_nonlocal = pot_in%n_nonlocal
3175 pot_out%nppnl = pot_in%nppnl
3176 pot_out%lmax = pot_in%lmax
3177 pot_out%is_nonlocal = pot_in%is_nonlocal
3178 pot_out%has_nlcc = pot_in%has_nlcc
3179 pot_out%n_nlcc = pot_in%n_nlcc
3181 IF (
ASSOCIATED(pot_in%elec_conf))
THEN
3182 ALLOCATE (pot_out%elec_conf(lbound(pot_in%elec_conf, 1):ubound(pot_in%elec_conf, 1)))
3183 pot_out%elec_conf(:) = pot_in%elec_conf(:)
3185 IF (
ASSOCIATED(pot_in%a_local))
THEN
3186 ALLOCATE (pot_out%a_local(lbound(pot_in%a_local, 1):ubound(pot_in%a_local, 1)))
3187 pot_out%a_local(:) = pot_in%a_local(:)
3189 IF (
ASSOCIATED(pot_in%c_local))
THEN
3190 ALLOCATE (pot_out%c_local(lbound(pot_in%c_local, 1):ubound(pot_in%c_local, 1)))
3191 pot_out%c_local(:) = pot_in%c_local(:)
3193 IF (
ASSOCIATED(pot_in%a_nonlocal))
THEN
3194 ALLOCATE (pot_out%a_nonlocal(lbound(pot_in%a_nonlocal, 1):ubound(pot_in%a_nonlocal, 1)))
3195 pot_out%a_nonlocal(:) = pot_in%a_nonlocal(:)
3197 IF (
ASSOCIATED(pot_in%h_nonlocal))
THEN
3198 ALLOCATE (pot_out%h_nonlocal(lbound(pot_in%h_nonlocal, 1):ubound(pot_in%h_nonlocal, 1), &
3199 lbound(pot_in%h_nonlocal, 2):ubound(pot_in%h_nonlocal, 2)))
3200 pot_out%h_nonlocal(:, :) = pot_in%h_nonlocal(:, :)
3202 IF (
ASSOCIATED(pot_in%c_nonlocal))
THEN
3203 ALLOCATE (pot_out%c_nonlocal(lbound(pot_in%c_nonlocal, 1):ubound(pot_in%c_nonlocal, 1), &
3204 lbound(pot_in%c_nonlocal, 2):ubound(pot_in%c_nonlocal, 2), &
3205 lbound(pot_in%c_nonlocal, 3):ubound(pot_in%c_nonlocal, 3)))
3206 pot_out%c_nonlocal(:, :, :) = pot_in%c_nonlocal(:, :, :)
3208 IF (
ASSOCIATED(pot_in%cprj_ppnl))
THEN
3209 ALLOCATE (pot_out%cprj_ppnl(lbound(pot_in%cprj_ppnl, 1):ubound(pot_in%cprj_ppnl, 1), &
3210 lbound(pot_in%cprj_ppnl, 2):ubound(pot_in%cprj_ppnl, 2)))
3211 pot_out%cprj_ppnl(:, :) = pot_in%cprj_ppnl(:, :)
3213 IF (
ASSOCIATED(pot_in%vprj_ppnl))
THEN
3214 ALLOCATE (pot_out%vprj_ppnl(lbound(pot_in%vprj_ppnl, 1):ubound(pot_in%vprj_ppnl, 1)))
3215 pot_out%vprj_ppnl(:) = pot_in%vprj_ppnl(:)
3217 IF (
ASSOCIATED(pot_in%a_nlcc))
THEN
3218 ALLOCATE (pot_out%a_nlcc(lbound(pot_in%a_nlcc, 1):ubound(pot_in%a_nlcc, 1)))
3219 pot_out%a_nlcc(:) = pot_in%a_nlcc(:)
3221 IF (
ASSOCIATED(pot_in%c_nlcc))
THEN
3222 ALLOCATE (pot_out%c_nlcc(lbound(pot_in%c_nlcc, 1):ubound(pot_in%c_nlcc, 1)))
3223 pot_out%c_nlcc(:) = pot_in%c_nlcc(:)