[Q-e-developers] updating Module/tsvdw.f90
Biswajit Santra
bishalya at gmail.com
Thu Sep 11 02:24:28 CEST 2014
Hello,
We want add some additional printing of the effective Hirshfeld volume of
atoms in the Module/tsvdw.f90 during CP dynamics. The printing needs to be
done at every iprint step in a file named prefix.hrs. We have this already
coded locally in 5.0.2 version where we have the tsvdw.90 in the CPV/src
only. We want to merge that part of the code in the trunk version. Problem
is that we have used the nfi variable from CPV/src/mainvar.f90 to control
the printing. Is it alright to use nfi variable from CPV and update the
make.depend accordingly. Or can it be done in a different may be simpler
way. We would like to add the following + lines.
--- a/Modules/tsvdw.f90
+++ b/Modules/tsvdw.f90
@@ -19,6 +19,7 @@ USE cell_base, ONLY: ainv !h^-1
matrix for converting bet
USE cell_base, ONLY: omega !cell volume (in au^3)
USE constants, ONLY: pi !pi in double-precision
USE control_flags, ONLY: lwfpbe0 !if .TRUE. then PBE0
calculation using Wannier orbitals is turned on ... BS
+USE control_flags, ONLY: iprint !print control in .hrs
file
+USE cp_main_variables, ONLY: nfi !md step index
+USE io_global, ONLY: ionode !logical for I/O node
USE fft_base, ONLY: dffts !FFT derived data type
USE fft_base, ONLY: dfftp !FFT derived data type
USE funct, ONLY: get_iexch !retrieves type of
exchange utilized in functional
@@ -1313,7 +1314,7 @@ PRIVATE :: GetVdWParam
!
! Local variables
!
- INTEGER :: ia,iq,off1
+ INTEGER :: ia,iq,off1,iunit
REAL(DP) :: normr
!
CALL start_clock('tsvdw_veff')
@@ -1369,6 +1370,43 @@ PRIVATE :: GetVdWParam
!
CALL mp_sum(veff,intra_image_comm)
!
+ !BS: print effective Hirshfeld volume of each atom at every iprint steps
in .hirsh file ..
+ !
+ IF ((MOD(nfi,iprint).EQ.0)) THEN
+ !
+ IF (ionode) THEN
+ !
+ iunit=printout_base_unit("hrs")
+ CALL printout_base_open("hrs")
+ !
+ IF (.NOT.tcpbo) THEN
+ !
+ WRITE(iunit,'(I8,F16.8)')nfi,tps
+ !
+ DO ia=1,nat
+ WRITE(iunit,'(3X,F20.14)')veff(ia)
+ END DO
+ !
+ ELSE
+ !
+ IF (conv_elec) THEN
+ !
+ WRITE(iunit,'(I8,f16.8)')nfi,tps
+ !
+ DO ia=1,nat
+ WRITE(iunit,'(3X,F20.14)')veff(ia)
+ END DO
+ !
+ END IF
+ !
+ END IF
+ !
+ CALL printout_base_close("hrs")
+ !
+ END IF
+ !
+ END IF
+ !
CALL stop_clock('tsvdw_veff')
!
RETURN
Thanks & best wishes,
Biswajit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20140910/94848147/attachment.html>
More information about the developers
mailing list