[Q-e-commits] r8282 - in trunk/espresso: CPV/src PW

giannozz at democritos.it giannozz at democritos.it
Sun Nov 27 21:38:08 CET 2011


Author: giannozz
Date: 2011-11-27 21:38:08 +0100 (Sun, 27 Nov 2011)
New Revision: 8282

Modified:
   trunk/espresso/CPV/src/makov_payne.f90
   trunk/espresso/PW/add_efield.f90
   trunk/espresso/PW/makov_payne.f90
Log:
Harmonization of conversion constants: debye => au_debye 


Modified: trunk/espresso/CPV/src/makov_payne.f90
===================================================================
--- trunk/espresso/CPV/src/makov_payne.f90	2011-11-26 12:48:06 UTC (rev 8281)
+++ trunk/espresso/CPV/src/makov_payne.f90	2011-11-27 20:38:08 UTC (rev 8282)
@@ -17,7 +17,7 @@
   USE ions_base,         ONLY : nat, zv
   USE ions_positions,    ONLY : tau0, ityp
   USE io_global,         ONLY : stdout, ionode, ionode_id
-  USE constants,         ONLY : pi,AUTOEV
+  USE constants,         ONLY : pi, autoev, au_debye
   USE cp_main_variables, ONLY : rhor
   USE electrons_base,    ONLY : nspin
   USE cell_base,         ONLY : at, bg, omega, alat, ibrav
@@ -36,7 +36,7 @@
 REAL(DP), ALLOCATABLE, DIMENSION(:,:,:) :: rhof
 REAL(DP), ALLOCATABLE, DIMENSION(:,:) :: r
 REAL(DP) :: h(3,3),volumetto,a(3,3)
-REAL(DP) :: usunx,usuny,usunz,R0(3),qq,aa,bb,debye
+REAL(DP) :: usunx,usuny,usunz,R0(3),qq,aa,bb
 REAL(DP) :: charge, charge_ion, charge_el
 REAL(DP) :: dipole(3), dipole_ion(3), dipole_el(3)
 REAL(DP) :: quadrupole, quadrupole_ion, quadrupole_el
@@ -213,8 +213,6 @@
    WRITE( stdout, '(/5X,"charge density inside the ", &
         &               "Wigner-Seitz cell:",3F14.8," el.")' ) charge_el
    !
-   debye = 2.54176D0
-   !
    WRITE( stdout, &
           '(/5X,"reference position (R0):",5X,3F14.8," bohr")' ) R0(:)
    !
@@ -222,11 +220,11 @@
    !
    WRITE( stdout, '(/5X,"Dipole moments (with respect to x0):")' )
    WRITE( stdout, '( 5X,"Elect",3F10.4," au,  ", 3F10.4," Debye")' ) &
-       (-dipole_el(ip), ip = 1, 3), (-dipole_el(ip)*debye, ip = 1, 3 )
+       (-dipole_el(ip), ip = 1, 3), (-dipole_el(ip)*au_debye, ip = 1, 3 )
    WRITE( stdout, '( 5X,"Ionic",3F10.4," au,  ", 3F10.4," Debye")' ) &
-       ( dipole_ion(ip),ip = 1, 3), ( dipole_ion(ip)*debye,ip = 1, 3 )
+       ( dipole_ion(ip),ip = 1, 3), ( dipole_ion(ip)*au_debye,ip = 1, 3 )
    WRITE( stdout, '( 5X,"Total",3F10.4," au,  ", 3F10.4," Debye")' ) &
-       ( dipole(ip),    ip = 1, 3), ( dipole(ip)*debye,    ip = 1, 3 )
+       ( dipole(ip),    ip = 1, 3), ( dipole(ip)*au_debye,    ip = 1, 3 )
    !
    ! ... print the electronic, ionic and total quadrupole moments
    !
@@ -253,11 +251,11 @@
    WRITE( stdout, '(/,5X,"*********    MAKOV-PAYNE CORRECTION    *********")' )
    !
    WRITE( stdout,'(/5X,"Makov-Payne correction ",F14.8," a.u. = ",F6.3, &
-        &              " eV (1st order, 1/a0)")'   ) -corr1, -corr1*AUTOEV
+        &              " eV (1st order, 1/a0)")'   ) -corr1, -corr1*autoev
    WRITE( stdout,'( 5X,"                       ",F14.8," a.u. = ",F6.3, &
-        &              " eV (2nd order, 1/a0^3)")' ) -corr2, -corr2*AUTOEV
+        &              " eV (2nd order, 1/a0^3)")' ) -corr2, -corr2*autoev
    WRITE( stdout,'( 5X,"                       ",F14.8," a.u. = ",F6.3, &
-        &              " eV (total)")' ) -corr1-corr2, (-corr1-corr2)*AUTOEV
+        &              " eV (total)")' ) -corr1-corr2, (-corr1-corr2)*autoev
    !
    WRITE( stdout,'(/5X,"corrected Total energy = ",F14.8," a.u.")' ) &
        etot - corr1 - corr2

Modified: trunk/espresso/PW/add_efield.f90
===================================================================
--- trunk/espresso/PW/add_efield.f90	2011-11-26 12:48:06 UTC (rev 8281)
+++ trunk/espresso/PW/add_efield.f90	2011-11-27 20:38:08 UTC (rev 8282)
@@ -45,7 +45,7 @@
   !
   !
   USE kinds,         ONLY : DP
-  USE constants,     ONLY : fpi, eps8, e2
+  USE constants,     ONLY : fpi, eps8, e2, au_debye
   USE ions_base,     ONLY : nat, ityp, zv
   USE cell_base,     ONLY : alat, at, omega, bg, saw
   USE extfield,      ONLY : tefield, dipfield, edir, eamp, emaxpos, &
@@ -73,7 +73,7 @@
   INTEGER :: index, index0, i, j, k
   INTEGER :: ir, na, ipol
   REAL(DP) :: length, vamp, value, sawarg, e_dipole, ion_dipole
-  REAL(DP) :: tot_dipole, bmod, debye
+  REAL(DP) :: tot_dipole, bmod
 
   LOGICAL :: first=.TRUE.
   SAVE first
@@ -98,7 +98,6 @@
   !---------------------
 
   bmod=SQRT(bg(1,edir)**2+bg(2,edir)**2+bg(3,edir)**2)
-  debye = 2.54176D0
 
   tot_dipole=0._dp
   e_dipole  =0._dp
@@ -192,14 +191,14 @@
           !
           IF ( iverbosity > 0 ) THEN
               WRITE( stdout, '(8X,"Elec. dipole ",1F15.4," Ry au,  ", 1F15.4," Debye")' ) &
-                                            e_dipole, (e_dipole*debye)
+                                            e_dipole, (e_dipole*au_debye)
               WRITE( stdout, '(8X,"Ion. dipole  ",1F15.4," Ry au,", 1F15.4," Debye")' ) &
-                                          ion_dipole, (ion_dipole*debye)
+                                          ion_dipole, (ion_dipole*au_debye)
           ENDIF
 
           WRITE( stdout, '(8X,"Dipole       ",1F15.4," Ry au, ", 1F15.4," Debye")' ) &
                                             (tot_dipole* (omega/fpi)),   &
-                                            ((tot_dipole* (omega/fpi))*debye)  
+                                            ((tot_dipole* (omega/fpi))*au_debye)  
 
           WRITE( stdout, '(8x,"Dipole field     ", f11.4," Ry au")') tot_dipole
           WRITE( stdout,*)

Modified: trunk/espresso/PW/makov_payne.f90
===================================================================
--- trunk/espresso/PW/makov_payne.f90	2011-11-26 12:48:06 UTC (rev 8281)
+++ trunk/espresso/PW/makov_payne.f90	2011-11-27 20:38:08 UTC (rev 8282)
@@ -166,7 +166,7 @@
   !
   USE kinds,      ONLY : DP
   USE io_global,  ONLY : stdout
-  USE constants,  ONLY : e2, pi, rytoev
+  USE constants,  ONLY : e2, pi, rytoev, au_debye
   USE ions_base,  ONLY : nat, ityp, tau, zv
   USE cell_base,  ONLY : at, bg, omega, alat, ibrav
   USE io_global,  ONLY : ionode
@@ -181,7 +181,7 @@
   REAL(DP), INTENT(IN)  :: dipole_el(0:3), quadrupole_el
   REAL(DP), INTENT(OUT) :: qq
   !
-  REAL(DP) :: debye, dipole_ion(3), quadrupole_ion, dipole(3), quadrupole
+  REAL(DP) :: dipole_ion(3), quadrupole_ion, dipole(3), quadrupole
   REAL(DP) :: zvia, zvtot
   REAL(DP) :: corr1, corr2, aa, bb
   INTEGER  :: ia, ip
@@ -234,8 +234,6 @@
   WRITE( stdout, '(/5X,"charge density inside the ", &
        &               "Wigner-Seitz cell:",3F14.8," el.")' ) dipole_el(0)
   !
-  debye = 2.54176D0
-  !
   WRITE( stdout, &
          '(/5X,"reference position (x0):",5X,3F14.8," bohr")' ) x0(:)*alat
   !
@@ -243,16 +241,16 @@
   !
   WRITE( stdout, '(/5X,"Dipole moments (with respect to x0):")' )
   WRITE( stdout, '( 5X,"Elect",3F9.4," au (Ha),",3F9.4," Debye")' ) &
-      (-dipole_el(ip), ip = 1, 3), (-dipole_el(ip)*debye, ip = 1, 3 )
+      (-dipole_el(ip), ip = 1, 3), (-dipole_el(ip)*au_debye, ip = 1, 3 )
   WRITE( stdout, '( 5X,"Ionic",3F9.4," au (Ha),", 3F9.4," Debye")' ) &
-      ( dipole_ion(ip),ip = 1, 3), ( dipole_ion(ip)*debye,ip = 1, 3 )
+      ( dipole_ion(ip),ip = 1, 3), ( dipole_ion(ip)*au_debye,ip = 1, 3 )
 #ifdef __SOLVENT
   IF ( do_solvent ) &
     WRITE( stdout, '( 5X,"Diele",3F9.4," au (Ha),", 3F9.4," Debye")' ) &
-      (-pol_dipole(ip),ip = 1, 3), (-pol_dipole(ip)*debye,ip = 1, 3 )
+      (-pol_dipole(ip),ip = 1, 3), (-pol_dipole(ip)*au_debye,ip = 1, 3 )
 #endif
   WRITE( stdout, '( 5X,"Total",3F9.4," au (Ha),", 3F9.4," Debye")' ) &
-      ( dipole(ip),    ip = 1, 3), ( dipole(ip)*debye,    ip = 1, 3 )
+      ( dipole(ip),    ip = 1, 3), ( dipole(ip)*au_debye,    ip = 1, 3 )
   !
   ! ... print the electronic, ionic and total quadrupole moments
   !



More information about the Q-e-commits mailing list