Skip to content

Commit

Permalink
corrected use statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JayTheDog committed Aug 6, 2021
1 parent 5635559 commit 96a70ea
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subroutine input(tstep,tmax,ntraj,iseed,etemp,Tinit,
use cidcommon
use common1
use newcommon
use print_output, only: qcstring
use qcxms_info, only: qcstring
use xtb_mctc_accuracy, only: wp
use xtb_mctc_convert
implicit none
Expand Down
105 changes: 56 additions & 49 deletions src/read_coordinates.f90
Original file line number Diff line number Diff line change
Expand Up @@ -93,38 +93,45 @@ subroutine rd(init,fname,nuc,xyz,iat)
tmcoord = .false.

! this is not yet finished
start: if ( init ) then
inquire(file='coord',exist=ex)
!start: if ( init ) then
! inquire(file='coord',exist=ex)
!
!exst: if ( ex ) then
! fname = 'coord'
!
! else ! get argument line input file or give file name
!
! call get_command_argument(1, value=xyzfile, status=check)
! fname = xyzfile
!
! if (check > 0 ) then
! write(*,*) '- Which input file ? - '
! read(*,'(a)') xyzfile
!
! if (xyzfile /= ' ') then
! tmcoord = .false.
! fname = xyzfile
! write(*,*) ' Reading input file : ', fname
! else
! stop '- No input provided - E X I T - '
! endif
!
! endif
!
! endif exst
!
! endif start

! if (fname == 'coord') tmcoord = .true.

inquire(file='coord',exist=ex)
exst: if ( ex ) then
fname = 'coord'

else ! get argument line input file or give file name

call get_command_argument(1, value=xyzfile, status=check)
fname = xyzfile

if (check > 0 ) then
write(*,*) '- Which input file ? - '
read(*,'(a)') xyzfile

if (xyzfile /= ' ') then
tmcoord = .false.
fname = xyzfile
write(*,*) ' Reading input file : ', fname
else
stop '- No input provided - E X I T - '
endif

endif

stop ' - No coord file available - E X I T - '
endif exst

endif start

! this check is important for '.not. init' call
if (fname == 'coord') tmcoord = .true.

open(file=fname, newunit=io_coord, status='old', iostat=io_error)

if (io_error > 0) then
Expand All @@ -138,7 +145,7 @@ subroutine rd(init,fname,nuc,xyz,iat)

! either turbomole coord file or xyz file

if (tmcoord) then
! if (tmcoord) then
do
read(io_coord,'(a)',iostat=iocheck)line
if (iocheck < 0) exit
Expand All @@ -162,29 +169,29 @@ subroutine rd(init,fname,nuc,xyz,iat)

enddo

else ! no coord file (here we take xyz)
read(io_coord,*) nuc
read(io_coord,*)

if (.not. init) then

nuc = 0
do
read(io_coord, '(a)',iostat=iocheck) line
if (iocheck > 0) stop 'error in xyz file'
if (iocheck < 0) exit ! EOF

nuc=nuc+1

call readl(line,xx,nn)
iat(nuc)=toNumber(line)
xyz(1,nuc)=xx(1)*aatoau
xyz(2,nuc)=xx(2)*aatoau
xyz(3,nuc)=xx(3)*aatoau

end do
endif
endif
! else ! no coord file (here we take xyz)
! read(io_coord,*) nuc
! read(io_coord,*)
!
! if (.not. init) then
!
! nuc = 0
! do
! read(io_coord, '(a)',iostat=iocheck) line
! if (iocheck > 0) stop 'error in xyz file'
! if (iocheck < 0) exit ! EOF
!
! nuc=nuc+1
!
! call readl(line,xx,nn)
! iat(nuc)=toNumber(line)
! xyz(1,nuc)=xx(1)*aatoau
! xyz(2,nuc)=xx(2)*aatoau
! xyz(3,nuc)=xx(3)*aatoau
!
! end do
! endif
! endif

close(io_coord)

Expand Down

0 comments on commit 96a70ea

Please sign in to comment.