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-05-21 19:15:39 +08:00
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
SUBROUTINE output_tau( plot_lattice )
|
|
|
|
!----------------------------------------------------------------------------
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
USE io_global, ONLY : stdout
|
|
|
|
USE kinds, ONLY : DP
|
|
|
|
USE constants, ONLY : bohr_radius_angs
|
|
|
|
USE cell_base, ONLY : alat, at, bg
|
2004-06-12 21:44:18 +08:00
|
|
|
USE ions_base, ONLY : nat, tau, ityp, atm
|
|
|
|
USE basis, ONLY : atomic_positions
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
|
|
|
LOGICAL, INTENT(IN) :: plot_lattice
|
|
|
|
REAL (KIND=DP), ALLOCATABLE :: tau_out(:,:)
|
|
|
|
INTEGER :: na, i, k
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! ... tau in output format
|
|
|
|
!
|
|
|
|
ALLOCATE( tau_out(3,nat) )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
|
|
|
tau_out(:,:) = tau(:,:)
|
2004-02-03 21:50:14 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
! ... print cell parameters if required
|
2004-02-03 21:50:14 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
IF ( plot_lattice ) THEN
|
|
|
|
!
|
|
|
|
WRITE( stdout, '(/"CELL_PARAMETERS (alat)")')
|
|
|
|
WRITE( stdout, '(3F14.9)') ( ( at(i,k), i = 1, 3), k = 1, 3 )
|
|
|
|
!
|
2004-02-03 21:50:14 +08:00
|
|
|
END IF
|
|
|
|
!
|
2004-05-21 19:15:39 +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' )
|
|
|
|
!
|
|
|
|
WRITE( stdout, '(/"ATOMIC_POSITIONS (alat)")' )
|
|
|
|
!
|
|
|
|
CASE( 'bohr' )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
WRITE( stdout, '(/"ATOMIC_POSITIONS (bohr)")' )
|
|
|
|
tau_out(:,:) = tau_out(:,:) * alat
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
CASE( 'crystal' )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
WRITE( stdout, '(/"ATOMIC_POSITIONS (crystal)")' )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
call cryst_to_cart( nat, tau_out, bg, -1 )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
CASE( 'angstrom' )
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
WRITE( stdout, '(/"ATOMIC_POSITIONS (angstrom)")' )
|
|
|
|
!
|
|
|
|
tau_out(:,:) = tau_out(:,:) * alat * bohr_radius_angs
|
2003-07-11 23:16:00 +08:00
|
|
|
!
|
|
|
|
CASE DEFAULT
|
2004-05-21 19:15:39 +08:00
|
|
|
!
|
|
|
|
WRITE( stdout, '(/"ATOMIC_POSITIONS")' )
|
|
|
|
!
|
2003-07-11 23:16:00 +08:00
|
|
|
END SELECT
|
2004-01-23 01:01:35 +08:00
|
|
|
!
|
2004-05-21 19:15:39 +08:00
|
|
|
DO na = 1, nat
|
|
|
|
!
|
|
|
|
WRITE( stdout,'(A3,3X,3F14.9)') atm(ityp(na)), tau_out(:,na)
|
|
|
|
!
|
|
|
|
END DO
|
|
|
|
!
|
|
|
|
WRITE( stdout, '(/)' )
|
|
|
|
!
|
|
|
|
DEALLOCATE( tau_out )
|
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE output_tau
|