~jose-soler/siesta/unfolding

« back to all changes in this revision

Viewing changes to Src/m_efield.F

  • Committer: Alberto Garcia
  • Date: 2016-06-23 10:02:59 UTC
  • mto: (483.11.3 4.0-xc) (560.3.1 4.1-ag)
  • mto: This revision was merged to the branch mainline in revision 525.
  • Revision ID: albertog@icmab.es-20160623100259-mewju7fsd2toyp1r
Tags: 4.0-release, v4.0
Release of siesta-4.0

* Update Docs/release_notes.4.0

* Update list of contributors.

* Add some more documentation and comments, and clarify notes in
  output for the recet electric-field/slab-dipole-correction fix.

* Remove Util/pseudo-xml

* Other minor changes in README files


  
                

        

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
!    by the dipole moment of the system, thus allowing to deal with
28
28
!    asymmetric slabs (and compute properties such as the work funcion
29
29
!    of each of the surfaces).
 
30
!    See L. Bengtsson, PRB 59, 12301 (1999), DOI: 10.1103/PhysRevB.59.12301
30
31
 
31
32
      use precision, only: dp
32
33
      use sys,       only: die
187
188
 
188
189
      ! Only allow slab dipole corrections for slabs
189
190
      if ( nbcell == 2 ) then
 
191
         ! Note that we enable the correction if there is an
 
192
         ! external field
190
193
         dipole_correction = fdf_boolean("SlabDipoleCorrection",
191
 
     &        acting_efield)
 
194
     &        .false.)
 
195
         if (acting_efield .and. (.not. dipole_correction)) then
 
196
            if (ionode) write(6,'(/,(a))')
 
197
     .        'efield: SlabDipoleCorrection turned on automatically',
 
198
     .        'efield: when an external electric field is applied.',
 
199
     .        'efield: For backward compatibility, set if to .false.'
 
200
            dipole_correction = .true.
 
201
         endif
192
202
      else
193
203
         dipole_correction = .false.
194
204
      end if
195
205
 
196
206
      if ( dipole_correction ) then
197
207
         if (ionode) write(6,'(/,(a))')
198
 
     .        'efield: SlabDipoleCorrection = .true. in input file',
 
208
     .        'efield: SlabDipoleCorrection enabled.',
199
209
     .        'efield: A dipole layer will be introduced in the vacuum',
200
210
     .        'efield: region to compensate the system dipole'
201
211
         acting_efield = .true.