2003-07-11 23:16:00 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2003 PWSCF group
|
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2004-01-23 01:01:35 +08:00
|
|
|
subroutine output_tau (plot_lattice)
|
2003-07-11 23:16:00 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
2003-11-04 18:53:05 +08:00
|
|
|
USE io_global, ONLY : stdout
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, only: DP
|
2003-07-11 23:16:00 +08:00
|
|
|
use constants, only: bohr_radius_angs
|
|
|
|
use brilz, only: alat, at, bg
|
|
|
|
use basis, only: nat, tau, atomic_positions, ityp, atm
|
2004-01-06 18:53:30 +08:00
|
|
|
implicit none
|
2004-01-23 01:01:35 +08:00
|
|
|
LOGICAL, INTENT(IN):: plot_lattice
|
2003-07-11 23:16:00 +08:00
|
|
|
real (kind=DP), allocatable:: tau_out (:, :)
|
2004-01-23 01:01:35 +08:00
|
|
|
integer :: na, i, k
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
|
|
|
! tau in output format
|
|
|
|
!
|
|
|
|
allocate (tau_out(3,nat))
|
|
|
|
tau_out(:,:) = tau(:,:)
|
2004-02-03 21:50:14 +08:00
|
|
|
!
|
|
|
|
! print cell parameters if required
|
|
|
|
!
|
|
|
|
IF (plot_lattice) THEN
|
|
|
|
WRITE( stdout, '("CELL_PARAMETERS (alat)")')
|
|
|
|
WRITE( stdout, '(3f14.9)') ( (at (i, k) , i = 1, 3) , k = 1, 3)
|
|
|
|
END IF
|
|
|
|
!
|
2003-07-11 23:16:00 +08:00
|
|
|
SELECT CASE ( atomic_positions )
|
|
|
|
!
|
|
|
|
! convert output atomic positions from internally used format
|
|
|
|
! (a0 units) to the same format used in input
|
|
|
|
!
|
|
|
|
CASE ('alat')
|
|
|
|
!
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '("ATOMIC_POSITIONS (alat)")')
|
2003-07-11 23:16:00 +08:00
|
|
|
CASE ('bohr')
|
|
|
|
!
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '("ATOMIC_POSITIONS (bohr)")')
|
2003-07-11 23:16:00 +08:00
|
|
|
tau_out(:,:) = tau_out(:,:)*alat
|
|
|
|
CASE ('crystal')
|
|
|
|
!
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '("ATOMIC_POSITIONS (crystal)")')
|
2003-09-17 16:36:08 +08:00
|
|
|
call cryst_to_cart (nat, tau_out, bg,-1)
|
2003-07-11 23:16:00 +08:00
|
|
|
CASE ('angstrom')
|
|
|
|
!
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '("ATOMIC_POSITIONS (angstrom)")')
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
|
|
|
tau_out(:,:) = tau_out(:,:)*alat*bohr_radius_angs
|
|
|
|
CASE DEFAULT
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '("ATOMIC_POSITIONS")')
|
2003-07-11 23:16:00 +08:00
|
|
|
END SELECT
|
2004-01-23 01:01:35 +08:00
|
|
|
!
|
2003-07-11 23:16:00 +08:00
|
|
|
do na = 1, nat
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout,'(a3,3x,3f14.9)') atm(ityp(na)), (tau_out(i,na), i=1,3)
|
2003-07-11 23:16:00 +08:00
|
|
|
enddo
|
2003-11-04 18:53:05 +08:00
|
|
|
WRITE( stdout, '(/)')
|
2003-07-21 21:35:53 +08:00
|
|
|
deallocate(tau_out)
|
2003-07-11 23:16:00 +08:00
|
|
|
return
|
|
|
|
end subroutine output_tau
|