Skip to content

Commit

Permalink
Add extra check for mutually exclude giving U (or J) and U_MINUS_J pa…
Browse files Browse the repository at this point in the history
…rameters
  • Loading branch information
mtaillefumier authored and mkrack committed Sep 19, 2022
1 parent 378308f commit 1ca6ba6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/qs_kind_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,8 @@ SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, no_f
INTEGER :: handle, i, i_rep, iounit, ipaodesc, ipaopot, ipos, j, jj, k_rep, l, m, n_rep, &
nb_rep, nexp, ngauss, nlcc, nloc, nnl, norbitals, npaodesc, npaopot, nppnl, nspin, nu, z
INTEGER, DIMENSION(:), POINTER :: add_el, elec_conf, orbitals
LOGICAL :: check, explicit, explicit_basis, explicit_kgpot, explicit_potential, nobasis, &
section_enabled, subsection_enabled, update_input
LOGICAL :: check, explicit, explicit_basis, explicit_J, explicit_kgpot, explicit_potential, &
explicit_U, explicit_u_m_j, nobasis, section_enabled, subsection_enabled, update_input
REAL(KIND=dp) :: alpha, ccore, r, rc, zeff_correction
REAL(KIND=dp), DIMENSION(3) :: error
REAL(KIND=dp), DIMENSION(:), POINTER :: a_nl, aloc, anlcc, cloc, cnlcc, nelec
Expand Down Expand Up @@ -1904,11 +1904,13 @@ SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, no_f
CALL section_vals_val_get(dft_plus_u_section, &
keyword_name="U", &
r_val=qs_kind%dft_plus_u%U)
r_val=qs_kind%dft_plus_u%U, &
explicit=explicit_U)
CALL section_vals_val_get(dft_plus_u_section, &
keyword_name="J", &
r_val=qs_kind%dft_plus_u%J)
r_val=qs_kind%dft_plus_u%J, &
explicit=explicit_J)
CALL section_vals_val_get(dft_plus_u_section, &
keyword_name="alpha", &
Expand All @@ -1926,12 +1928,18 @@ SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, no_f
keyword_name="occupation", &
r_val=qs_kind%dft_plus_u%occupation)
#else
nu = 0;
nu = 0
#endif
CALL section_vals_val_get(dft_plus_u_section, &
keyword_name="U_MINUS_J", &
r_val=qs_kind%dft_plus_u%u_minus_j_target)
r_val=qs_kind%dft_plus_u%u_minus_j_target, &
explicit=explicit_u_m_j)
IF ((explicit_U .OR. explicit_J) .AND. explicit_u_m_j) THEN
CPABORT("DFT+U| specifying U or J and U_MINUS_J parameters are mutually exclusive.")
END IF
CALL section_vals_val_get(dft_plus_u_section, &
keyword_name="U_RAMPING", &
r_val=qs_kind%dft_plus_u%u_ramping)
Expand Down

0 comments on commit 1ca6ba6

Please sign in to comment.