Skip to content

Commit

Permalink
Periodic Efield: Test for options (Optimization, smearing) (#126)
Browse files Browse the repository at this point in the history
* Periodic Efield: Test for options (Optimization, smearing)

* Pretty
  • Loading branch information
juerghutter committed Dec 12, 2018
1 parent b7f71f5 commit 9f65b72
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/qs_environment.F
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ SUBROUTINE qs_init_subsys(qs_env, para_env, subsys, cell, cell_ref, use_ref_cell
INTEGER, DIMENSION(2) :: n_mo, nelectron_spin
LOGICAL :: all_potential_present, be_silent, &
do_kpoints, e1terms, has_unit_metric, &
lribas, was_present
lribas, orb_gradient, was_present
REAL(dp) :: ewald_rcut, maxocc, verlet_skin
TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
TYPE(cp_logger_type), POINTER :: logger
Expand Down Expand Up @@ -840,6 +840,19 @@ SUBROUTINE qs_init_subsys(qs_env, para_env, subsys, cell, cell_ref, use_ref_cell
! XXXXXXX this is backwards XXXXXXXX
dft_control%smear = scf_control%smear%do_smear

! Periodic efield needs equal occupation and orbital gradients
IF (dft_control%apply_period_efield) THEN
CALL get_qs_env(qs_env=qs_env, requires_mo_derivs=orb_gradient)
IF (.NOT. orb_gradient) THEN
CALL cp_abort(__LOCATION__, "Periodic Efield needs orbital gradient and direct optimization."// &
" Use the OT optimization method.")
END IF
IF (dft_control%smear) THEN
CALL cp_abort(__LOCATION__, "Periodic Efield needs equal occupation numbers."// &
" Smearing option is not possible.")
END IF
END IF

! Initialize the GAPW local densities and potentials
IF (dft_control%qs_control%method_id == do_method_gapw .OR. &
dft_control%qs_control%method_id == do_method_gapw_xc) THEN
Expand Down

0 comments on commit 9f65b72

Please sign in to comment.