Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only write groups in Turbomole output if necessary #41

Merged
merged 1 commit into from
Apr 14, 2022
Merged
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
22 changes: 16 additions & 6 deletions src/mctc/io/write/turbomole.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,25 @@ subroutine write_coord(mol, unit)
class(structure_type), intent(in) :: mol
integer, intent(in) :: unit
integer :: iat, ilt, npbc
logical :: expo

write(unit, '(a)') "$coord"
do iat = 1, mol%nat
write(unit, '(3es24.14, 6x, a)') mol%xyz(:, iat), trim(mol%sym(mol%id(iat)))
end do
write(unit, '(a, *(1x, a, "=", i0))') &
"$eht", "charge", nint(mol%charge), "unpaired", mol%uhf
write(unit, '(a, 1x, i0)') "$periodic", count(mol%periodic)
expo = maxval(mol%xyz) > 1.0e+5 .or. minval(mol%xyz) < -1.0e+5
if (expo) then
do iat = 1, mol%nat
write(unit, '(3es24.14, 6x, a)') mol%xyz(:, iat), trim(mol%sym(mol%id(iat)))
end do
else
do iat = 1, mol%nat
write(unit, '(3f24.14, 6x, a)') mol%xyz(:, iat), trim(mol%sym(mol%id(iat)))
end do
end if
if (any([nint(mol%charge), mol%uhf] /= 0)) then
write(unit, '(a, *(1x, a, "=", i0))') &
"$eht", "charge", nint(mol%charge), "unpaired", mol%uhf
end if
if (any(mol%periodic)) then
write(unit, '(a, 1x, i0)') "$periodic", count(mol%periodic)
npbc = count(mol%periodic)
if (size(mol%lattice, 2) == 3) then
write(unit, '(a)') "$lattice bohr"
Expand Down