Skip to content

Commit

Permalink
Fix optional argument bug in valijkPBC
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas3R committed Dec 12, 2023
1 parent 2f62775 commit 9c97293
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/constr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,7 @@ real(wp) Function valijkPBC(mode,nat,xyz,j,k,i,vTr1,vTr2,vTr3)

real(wp) :: &
& ra(3),rb(3),rab,eps,&
& xyz(3,nat),vecnorm,ran,rbn,vTr1(3),vTr2(3)
real(wp), optional :: vTr3(3)
& xyz(3,nat),vecnorm,ran,rbn,vTr1(3),vTr2(3),vTr3(3)

parameter (eps=1.d-14)

Expand Down
9 changes: 5 additions & 4 deletions src/gfnff/math.f
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ real*8 function valijklffPBC(mo,natoms,xyz,i,j,k,l,vTrj,vTrk,vTrl)
, ic,i,j,k,l,natoms,mo

real*8
, xyz(3,natoms),vTrj(3),vTrk(3),vTrl(3),
, xyz(3,natoms),vTrj(3),vTrk(3),vTrl(3),vDum(3),
, eps,ra(3),rb(3),rc(3),na(3),nb(3),
, rab,rbc,thab,thbc,valijkPBC,
, vecnorm,nan,nbn,rcn,snanb,deter,pi

parameter (eps=1.0d-14)
data pi/3.1415926535897932384626433832795029d0/
vDum=0.0 ! Dummy vector for valijkPBC function

c ... get torsion coordinate
if(mo.eq.1)then ! egtors call -> j (=ii) in central cell
Expand All @@ -136,12 +137,12 @@ real*8 function valijklffPBC(mo,natoms,xyz,i,j,k,l,vTrj,vTrk,vTrl)
, +ra(3)*(rb(1)*rc(2)-rb(2)*rc(1))

if(mo.eq.1)then ! not used
thab=valijkPBC(1,natoms,xyz,i,k,j,vTrl,vTrj)
thbc=valijkPBC(2,natoms,xyz,j,l,k,vTrk,vTrj)
thab=valijkPBC(1,natoms,xyz,i,k,j,vTrl,vTrj,vDum)
thbc=valijkPBC(2,natoms,xyz,j,l,k,vTrk,vTrj,vDum)
else
thab=valijkPBC(3,natoms,xyz,i,k,j,vTrj,vTrl,vTrk) ! i=R k=C j=B
! vTrj=vTrR vTrl=vTrC vTrk=vTrB
thbc=valijkPBC(4,natoms,xyz,j,l,k,vTrk,vTrl) ! j=B l=H k=C
thbc=valijkPBC(4,natoms,xyz,j,l,k,vTrk,vTrl,vDum) ! j=B l=H k=C
! vTrk=vTrB vTrl=vTrC
endif
call crossprod(ra,rb,na)
Expand Down

0 comments on commit 9c97293

Please sign in to comment.