Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/control.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,8 @@ end subroutine sqnm
!! MODIFICATION HISTORY
!! 2022/08/17 15:18 dave
!! Introduced scaling to improve conditioning in arxiv/2206.07339
!! 2026/08/13 Augustin Lu
!! Set a wider format and user-selected units for simulation cell volume output.
!! SOURCE
!!
subroutine cell_sqnm(fixed_potential, vary_mu, total_energy)
Expand Down Expand Up @@ -2582,7 +2584,8 @@ subroutine cell_sqnm(fixed_potential, vary_mu, total_energy)
iter, max_stress*volume, enthalpy1, en_conv*dH
if (iprint_MD > 1) then
write(io_lun,'(4x,"Maximum stress ",e14.6," Ha/Bohr**3")') max_stress
write(io_lun,'(4x,"Simulation cell volume ",e14.6," Bohr**3")') volume
write(io_lun,'(4x,"Simulation cell volume ",f18.6,1x,a2,a3)') &
volume * dist_conv**3, d_units(dist_units), '**3'
write(io_lun,'(4x,"Maximum stress ",f14.6," GPa")') &
max_stress*HaBohr3ToGPa
write(io_lun,'(4x,"Stress tolerance: ",f14.6," GPa")') &
Expand Down Expand Up @@ -3764,6 +3767,8 @@ end subroutine full_double_loop
! alternating full ionic and full cell optimisation (full_cg_run_double_loop)
! and full ionic with single line minimisation cell optimisation (this routine)
! Use cell optimisation method 4 for this
! 2026/08/13 Augustin Lu
! Set a wider format and user-selected units for simulation cell volume output.
subroutine full_cg_run_double_loop_alt(fixed_potential, vary_mu, total_energy)

! Module usage
Expand Down Expand Up @@ -4059,7 +4064,8 @@ subroutine full_cg_run_double_loop_alt(fixed_potential, vary_mu, total_energy)
write(io_lun,'(4x,"Force tolerance: ",f19.8)') MDcgtol
write(io_lun,'(4x,"Maximum stress ",e14.6," Ha/Bohr**3")') &
max_stress
write(io_lun,'(4x,"Simulation cell volume ",e14.6," Bohr**3")') volume
write(io_lun,'(4x,"Simulation cell volume ",f18.6,1x,a2,a3)') &
volume * dist_conv**3, d_units(dist_units), '**3'
write(io_lun,'(4x,"Maximum stress ",f14.6," GPa")') &
max_stress*HaBohr3ToGPa
write(io_lun,'(4x,"Stress tolerance: ",f14.6," GPa")') &
Expand Down
5 changes: 3 additions & 2 deletions src/initial_read_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ end subroutine read_and_write
!! Set flag_out_wf = .true. expricitly when flag_write_projected_DOS is .true.
!! 2026/07/03 09:47 dave
!! Turn off WF and/or pDOS output except for static, diagonalisation runs
!! 2026/08/13 Augustin Lu
!! Remove the obsolete IO.AtomCoordsXYZ input option.
!! TODO
!! SOURCE
!!
Expand Down Expand Up @@ -995,7 +997,7 @@ subroutine read_input(start, start_L, titles, vary_mu,&
pdb_output, banner, get_file_name, time_max, &
flag_MatrixFile_RankFromZero, flag_MatrixFile_BinaryFormat, &
flag_MatrixFile_BinaryFormat_Grab, flag_MatrixFile_BinaryFormat_Dump, &
flag_MatrixFile_BinaryFormat_Dump_END, atom_output_threshold, flag_coords_xyz
flag_MatrixFile_BinaryFormat_Dump_END, atom_output_threshold

use group_module, only: part_method, HILBERT, PYTHON
use H_matrix_module, only: flag_write_locps, flag_dump_locps, &
Expand Down Expand Up @@ -1253,7 +1255,6 @@ subroutine read_input(start, start_L, titles, vary_mu,&
InitAtomicDistance_min = fdf_double('IO.InitAtomicDistance_min', 0.5_double)
end if
atom_output_threshold = fdf_integer('IO.AtomOutputThreshold',200)
flag_coords_xyz = fdf_boolean('IO.AtomCoordsXYZ',.false.)
call my_barrier()
!
!
Expand Down
55 changes: 22 additions & 33 deletions src/io_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
!! they don't exist
!! 2019/11/04 11:36 dave
!! Removed redundant code (old SFC routines)
!! 2026/08/13 Augstin Lu
!! Removed unused flag_coords_xyz
module io_module

use datatypes, only: double
Expand Down Expand Up @@ -114,7 +116,6 @@ module io_module
! Moved here from read_and_write so that it can be used for extended XYZ output
! Moved here from initial_read_module to slove the dependence problem
character(len=80), save :: titles
logical :: flag_coords_xyz

!!***

Expand Down Expand Up @@ -3271,50 +3272,38 @@ end subroutine print_process_info
!! CREATION DATE
!! 2020/03/11
!! MODIFICATION HISTORY
!! 2026/08/13 Augustin Lu
!! Set a wider format and user-selected units for cell output
!! Convert printed atomic coordinates to the selected distance units
!! Remove the obsolete IO.AtomCoordsXYZ output mode.
!!
!! SOURCE
!!
subroutine print_atomic_positions

use global_module, only: atom_coord, iprint_MD, ni_in_cell, species_glob
use dimens, only: r_super_x, r_super_y, r_super_z, atomicnum, volume
use global_module, only: atom_coord, ni_in_cell, species_glob
use dimens, only: r_super_x, r_super_y, r_super_z, volume
use GenComms, only: inode, ionode
use units, only: dist_conv, d_units, dist_units, BohrToAng, bohr
use periodic_table, only: pte
use pseudo_tm_info, only: pseudo
use units, only: dist_conv, d_units, dist_units

implicit none

integer :: i

if(inode==ionode) then
write(io_lun,fmt='(/4x,"Simulation cell dimensions: ",f10.4,a3," x ",f10.4,a3," x ",f10.4,a3)') &
r_super_x*dist_conv, d_units(dist_units), r_super_y*dist_conv, d_units(dist_units), &
r_super_z*dist_conv, d_units(dist_units)
write(io_lun,fmt='(/4x,"Simulation cell volume: ",f10.4,a3,a3)') &
volume*dist_conv*dist_conv*dist_conv, d_units(dist_units),'**3'
if(flag_coords_xyz) then
write(io_lun,fmt='(6x," X Y Z")')
if(dist_units==bohr) then
write(io_lun,fmt='(/6x,"Atomic coordinates in XYZ format (",a2,")")') "A "
do i = 1, ni_in_cell
write (io_lun,fmt='(4x, a2, 3f10.4)') pte(atomicnum(species_glob(i))), atom_coord(1:3,i)*BohrToAng
end do
write(io_lun,fmt='(8x,"N.B. units above converted to Angstroms for xyz output")')
else
write(io_lun,fmt='(/6x,"Atomic coordinates (",a2,")")') d_units(dist_units)
do i = 1, ni_in_cell
write (io_lun,fmt='(4x, a2, 3f10.4)') pte(atomicnum(species_glob(i))), atom_coord(1:3,i)
end do
end if
else
write(io_lun,fmt='(/6x,"Atomic coordinates (",a2,")")') d_units(dist_units)
write(io_lun,fmt='(6x," Atom X Y Z Species")')
do i = 1, ni_in_cell
write (io_lun,fmt='(6x, i7, 3f10.4, 6x, i3)') i,atom_coord(1:3,i), species_glob(i)
end do
end if
if(inode==ionode) then
write(io_lun,fmt='(/4x,"Simulation cell dimensions: ",f18.4,1x,a2," x ",f18.4,1x,a2," x ",f18.4,1x,a2)') &
r_super_x * dist_conv, d_units(dist_units), r_super_y * dist_conv, d_units(dist_units), &
r_super_z * dist_conv, d_units(dist_units)
write(io_lun,fmt='(/4x,"Simulation cell volume: ",f18.6,1x,a2,a3)') &
volume * dist_conv * dist_conv * dist_conv, d_units(dist_units),'**3'
write(io_lun,fmt='(/6x,"Atomic coordinates (",a2,")")') d_units(dist_units)
write(io_lun,fmt='(6x," Atom X Y Z Species")')
do i = 1, ni_in_cell
write (io_lun,fmt='(6x, i7, 3f10.4, 6x, i3)') i, atom_coord(1:3,i) * dist_conv, &
species_glob(i)
end do
end if

return

end subroutine print_atomic_positions
Expand Down
Loading