Skip to content

Commit

Permalink
fix writing of induced dipole files during optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
jayponder committed Apr 30, 2024
1 parent 9e8e906 commit 112e51c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/mdsave.f
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ subroutine mdsave (istep,dt,epot,eksum)
240 format (' Velocity File',15x,a)
end if
c
c save the force vector components for the current step,
c save the force vector components for the current step;
c only correct for single time step Cartesian integrators
c
if (frcsave .and. integrate.ne.'RIGIDBODY'
Expand Down
20 changes: 20 additions & 0 deletions source/optsave.f
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ subroutine optsave (ncycle,f,xx)
call version (frcfile,'new')
open (unit=ifrc,file=frcfile,status='new')
end if
else
frcfile = filename(1:leng)
call suffix (frcfile,'frc','old')
inquire (file=frcfile,exist=exist)
if (exist) then
open (unit=ifrc,file=frcfile,status='old')
rewind (unit=ifrc)
else
open (unit=ifrc,file=frcfile,status='new')
end if
end if
write (ifrc,10) n,title(1:ltitle)
10 format (i6,2x,a)
Expand Down Expand Up @@ -207,6 +217,16 @@ subroutine optsave (ncycle,f,xx)
call version (indfile,'new')
open (unit=iind,file=indfile,status='new')
end if
else
indfile = filename(1:leng)
call suffix (indfile,'uind','old')
inquire (file=indfile,exist=exist)
if (exist) then
open (unit=iind,file=indfile,status='old')
rewind (unit=iind)
else
open (unit=iind,file=indfile,status='new')
end if
end if
write (iind,40) n,title(1:ltitle)
40 format (i6,2x,a)
Expand Down
4 changes: 4 additions & 0 deletions source/richmond.f
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ subroutine richmond (n,x,y,z,rad,weight,probe,total,area)
if (moved) then
write (iout,140) ir
140 format (/,' RICHMOND -- Connectivity Error at Atom',i6)
call fatal
else
moved = .true.
xr = xr + rmove
Expand All @@ -545,6 +546,7 @@ subroutine richmond (n,x,y,z,rad,weight,probe,total,area)
if (moved) then
write (iout,170) ir
170 format (/,' RICHMOND -- Negative Area at Atom',i6)
call fatal
else
moved = .true.
xr = xr + rmove
Expand Down Expand Up @@ -1205,6 +1207,7 @@ subroutine richmond1 (n,x,y,z,rad,weight,probe,
if (moved) then
write (iout,140) ir
140 format (/,' RICHMOND1 -- Connectivity Error at Atom',i6)
call fatal
else
moved = .true.
xr = xr + rmove
Expand All @@ -1227,6 +1230,7 @@ subroutine richmond1 (n,x,y,z,rad,weight,probe,
if (moved) then
write (iout,170) ir
170 format (/,' RICHMOND1 -- Negative Area at Atom',i6)
call fatal
else
moved = .true.
xr = xr + rmove
Expand Down
35 changes: 26 additions & 9 deletions source/testsurf.f
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ program testsurf
use iounit
use kvdws
use nonpol
use ptable
use vdwpot
implicit none
integer i,icrd
integer nsize,nfudge
integer freeunit
real*8 surf,vol
real*8 probe
real*8 probe,rmax
real*8 reentrant
real*8 wall,cpu
real*8, allocatable :: rsolv(:)
Expand Down Expand Up @@ -80,6 +81,14 @@ program testsurf
50 continue
end if
c
c print out the total number of atoms
c
write (iout,60)
60 format (/,' Alternative Surface Area & Volume Methods')
write (iout,70) n,probe
70 format (/,' Number of Atoms :',12x,i8,
& /,' Probe Size :',11x,f14.4)
c
c perform dynamic allocation of some local arrays
c
nfudge = 10
Expand All @@ -91,6 +100,22 @@ program testsurf
allocate (dsurf(3,nsize))
allocate (dvol(3,nsize))
c
c if all radii are zero then switch to generic vdw radii
c
rmax = 0.0d0
do i = 1, n
rmax = rad(i)
if (rmax .gt. 0.0d0) goto 99
end do
99 continue
if (rmax .eq. 0.0d0) then
write (iout,98)
98 format (/,' Atomic Radii not Set, Using Generic VDW Values')
do i = 1, n
rad(i) = vdwrad(atomic(i))
end do
end if
c
c set radii to use for surface area and volume calculation
c
do i = 1, n
Expand All @@ -114,14 +139,6 @@ program testsurf
dsurf(3,i) = 0.0d0
end do
c
c print out the total number of atoms
c
write (iout,60)
60 format (/,' Alternative Surface Area & Volume Methods')
write (iout,70) n,probe
70 format (/,' Number of Atoms :',12x,i8,
& /,' Probe Size :',11x,f14.4)
c
c compute accessible surface area via Richmond method
c
surf = 0.0d0
Expand Down

0 comments on commit 112e51c

Please sign in to comment.