write_qchem Subroutine

public subroutine write_qchem(self, unit)

Arguments

Type IntentOptional Attributes Name
class(structure_type), intent(in) :: self

Instance of the molecular structure data

integer, intent(in) :: unit

File handle


Source Code

subroutine write_qchem(self, unit)

   !> Instance of the molecular structure data
   class(structure_type), intent(in) :: self

   !> File handle
   integer, intent(in) :: unit

   integer :: iat
   logical :: expo

   write(unit, '(a)') "$molecule"
   write(unit, '(*(1x, i0))') nint(self%charge), self%uhf + 1

   expo = maxval(self%xyz) > 1.0e+5 .or. minval(self%xyz) < -1.0e+5
   if (expo) then
      do iat = 1, self%nat
         write(unit, '(a, 1x, 3es24.14)') &
           self%sym(self%id(iat)), self%xyz(:, iat) * autoaa
      end do
   else
      do iat = 1, self%nat
         write(unit, '(a, 1x, 3f24.14)') &
           self%sym(self%id(iat)), self%xyz(:, iat) * autoaa
      end do
   end if

   write(unit, '(a)') "$end"

end subroutine write_qchem