From 8b44e68c26db33e6396c675dec849b8b6d9ee14b Mon Sep 17 00:00:00 2001 From: kkudin Date: Thu, 16 Mar 2006 03:41:21 +0000 Subject: [PATCH] Added an option to the CP output routine to print out various files with atomic labels and also to print out *.pos file as XYZ The option is off by default, but can be enabled with nice_output_files=.true. in print_out.f90 source. Kostya git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2919 c92efa57-630b-4861-b058-cf58834340f0 --- CPV/print_out.f90 | 31 +++++++++++++++++++++++++++---- Modules/printout_base.f90 | 4 ++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CPV/print_out.f90 b/CPV/print_out.f90 index 6d85c4025..a530ce43b 100644 --- a/CPV/print_out.f90 +++ b/CPV/print_out.f90 @@ -51,7 +51,7 @@ USE energies, ONLY : print_energies, dft_energy_type USE printout_base, ONLY : printout_base_open, printout_base_close, & printout_pos, printout_cell, printout_stress - USE constants, ONLY : factem, au_gpa, au, amu_si, bohr_radius_cm, scmass + USE constants, ONLY : factem, au_gpa, au, amu_si, bohr_radius_cm, scmass, BOHR_RADIUS_ANGS USE ions_base, ONLY : na, nsp, nat, ind_bck, atm, ityp, pmass, & cdm_displacement, ions_displacement USE cell_base, ONLY : s_to_r @@ -86,6 +86,7 @@ REAL(DP), ALLOCATABLE :: tauw( :, : ) CHARACTER(LEN=3), ALLOCATABLE :: labelw( : ) LOGICAL :: tsic + LOGICAL, PARAMETER :: nice_output_files=.false. ! ALLOCATE( labelw( nat ) ) ! @@ -142,7 +143,15 @@ CALL printout_pos( stdout, tau0, nat, what = 'pos', & label = labelw, sort = ind_bck ) ! - IF( tfile ) CALL printout_pos( 35, tau0, nat, nfi = nfi, tps = tps ) + IF( tfile ) then + if (.not.nice_output_files) then + CALL printout_pos( 35, tau0, nat, nfi = nfi, tps = tps ) + else + CALL printout_pos( 35, tau0, nat, what = 'xyz', & + nfi = nfi, tps = tps, label = labelw, & + fact= BOHR_RADIUS_ANGS ,sort = ind_bck ) + endif + END IF ! ALLOCATE( tauw( 3, nat ) ) ! @@ -165,14 +174,28 @@ CALL printout_pos( stdout, tauw, nat, & what = 'vel', label = labelw, sort = ind_bck ) ! - IF( tfile ) CALL printout_pos( 34, tauw, nat, nfi = nfi, tps = tps ) + IF( tfile ) then + if (.not.nice_output_files) then + CALL printout_pos( 34, tauw, nat, nfi = nfi, tps = tps ) + else + CALL printout_pos( 34, tauw, nat, nfi = nfi, tps = tps, & + what = 'vel', label = labelw, sort = ind_bck ) + endif + END IF ! WRITE( stdout, * ) ! CALL printout_pos( stdout, fion, nat, & what = 'for', label = labelw, sort = ind_bck ) ! - IF( tfile ) CALL printout_pos( 37, fion, nat, nfi = nfi, tps = tps ) + IF( tfile ) then + if (.not.nice_output_files) then + CALL printout_pos( 37, fion, nat, nfi = nfi, tps = tps ) + else + CALL printout_pos( 37, fion, nat, nfi = nfi, tps = tps, & + what = 'for', label = labelw, sort = ind_bck ) + endif + END IF ! DEALLOCATE( tauw ) ! diff --git a/Modules/printout_base.f90 b/Modules/printout_base.f90 index 8417890b0..6fb6ddab2 100644 --- a/Modules/printout_base.f90 +++ b/Modules/printout_base.f90 @@ -122,6 +122,10 @@ CONTAINS f = 1.0d0 END IF ! + IF( PRESENT( what ) ) THEN + IF ( what == 'xyz' ) WRITE( iunit, *) nat + END IF + ! IF( PRESENT( nfi ) .AND. PRESENT( tps ) ) THEN WRITE( iunit, 30 ) nfi, tps ELSE IF( PRESENT( what ) ) THEN