Commit 58d03fa2 authored by ofgeorg's avatar ofgeorg

committed like suggested by Kevin Stratford

(now f70 compatible)
parent 144f5671
......@@ -24,10 +24,10 @@ C
USE cmaes_param_mod
IMPLICIT NONE
REAL(MK), DIMENSION(n) :: ETIP
REAL(MK), DIMENSION(m,n),INTENT(in) :: X
INTEGER, INTENT(in) :: m ! (3*LJ_N-6) dim vector
INTEGER, INTENT(in) :: n
REAL(MK), DIMENSION(n) :: ETIP
REAL(MK), DIMENSION(m,n),INTENT(in) :: X
REAL(MK), OPTIONAL :: lbounds
REAL(MK), OPTIONAL :: ubounds
......@@ -59,9 +59,11 @@ C
IMPLICIT NONE
LOGICAL GTEST,SECT
INTEGER J1, J2, K1, K2, NAT2, NSITE, NATOMS
DOUBLE PRECISION X(3*NATOMS), V(3*NATOMS), X1, X2, Y1, Y2, Z1, Z2, FLJ, DFLJ, FC, DFC,
DOUBLE PRECISION X(3*NATOMS), V(3*NATOMS), X1, X2, Y1, Y2, Z1, Z2,
1 FLJ, DFLJ, FC, DFC,
1 ETIP, DUMMY, RALPHA12, RALPHA22, RDIST,
2 M1, L1, N1, M2, L2, N2, ALPHA1, CA1, CA2, ALPHA2, S1, S2, C3A1, C3A2,
2 M1, L1, N1, M2, L2, N2, ALPHA1, CA1, CA2, ALPHA2, S1, S2,
2 C3A1, C3A2,
3 L12, M12, N12, L22, M22, N22, C6, C12,
4 GX1, GY1, GZ1, GL1, GM1, GN1, GL2, GM2, GN2, C2A2, C2A1,
5 D1, D2, D3, D4, D5, D6, DA, DB, DC, DIST, DUMMY2,
......@@ -226,7 +228,8 @@ C
! Since site 1 (O) is at the origin we don't need to rotate it, so the LJ term
! can be done much faster.
!
DIST=SQRT((X1-X(3*(J2-1)+1))**2+(Y1-X(3*(J2-1)+2))**2+(Z1-X(3*(J2-1)+3))**2)
DIST=SQRT((X1-X(3*(J2-1)+1))**2+(Y1-X(3*(J2-1)+2))**2
@ +(Z1-X(3*(J2-1)+3))**2)
DUMMY=FLJ(DIST)
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C2A1,C3A1,S1,
1 N12,L12,M12,L22,M22,N22)
GL2=GL2+DUMMY2*DA(p1x,p1y,p1z,p2x,p2y,p2z,x1,y1,z1,
1 n1,l1,m1,x2,y2,z2,l2,m2,n2,rdist,
1 C2A2,RALPHA12,RALPHA22,C3A2,S2,C2A1,C3A1,S1,
1 N12,L12,M12,L22,M22,N22)
GM2=GM2+DUMMY2*DB(p1x,p1y,p1z,p2x,p2y,p2z,x1,y1,z1,
1 n1,l1,m1,x2,y2,z2,l2,m2,n2,rdist,
1 C2A2,RALPHA12,RALPHA22,C3A2,S2,C2A1,C3A1,S1,
1 N12,L12,M12,L22,M22,N22)
GN2=GN2+DUMMY2*DC(p1x,p1y,p1z,p2x,p2y,p2z,x1,y1,z1,
1 n1,l1,m1,x2,y2,z2,l2,m2,n2,rdist,
1 C2A2,RALPHA12,RALPHA22,C3A2,S2,C2A1,C3A1,S1,
1 N12,L12,M12,L22,M22,N22)
ENDIF
ENDDO
ENDDO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment