Merge "only use CPU_COUNT if it's available" into release-4-6
[gromacs/AngularHB.git] / src / gmxlib / nonbonded / nb_kernel_f77_single / f77skernel104.f
blobda05c244374639c680d8156f30bbb2b8cae99ad0
2 C This source code is part of
4 C G R O M A C S
6 C Copyright (c) 1991-2000, University of Groningen, The Netherlands.
7 C Copyright (c) 2001-2009, The GROMACS Development Team
9 C Gromacs is a library for molecular simulation and trajectory analysis,
10 C written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for
11 C a full list of developers and information, check out http://www.gromacs.org
13 C This program is free software; you can redistribute it and/or modify it under
14 C the terms of the GNU Lesser General Public License as published by the Free
15 C Software Foundation; either version 2 of the License, or (at your option) any
16 C later version.
17 C As a special exception, you may use this file as part of a free software
18 C library without restriction. Specifically, if other files instantiate
19 C templates or use macros or inline functions from this file, or you compile
20 C this file and link it with other files to produce an executable, this
21 C file does not by itself cause the resulting executable to be covered by
22 C the GNU Lesser General Public License.
24 C In plain-speak: do not worry about classes/macros/templates either - only
25 C changes to the library have to be LGPL, not an application linking with it.
27 C To help fund GROMACS development, we humbly ask that you cite
28 C the papers people have written on it - you can find them on the website!
32 C Gromacs nonbonded kernel f77skernel104
33 C Coulomb interaction: Normal Coulomb
34 C VdW interaction: Not calculated
35 C water optimization: pairs of TIP4P interactions
36 C Calculate forces: yes
38 subroutine f77skernel104(
39 & nri,
40 & iinr,
41 & jindex,
42 & jjnr,
43 & shift,
44 & shiftvec,
45 & fshift,
46 & gid,
47 & pos,
48 & faction,
49 & charge,
50 & facel,
51 & krf,
52 & crf,
53 & Vc,
54 & type,
55 & ntype,
56 & vdwparam,
57 & Vvdw,
58 & tabscale,
59 & VFtab,
60 & invsqrta,
61 & dvda,
62 & gbtabscale,
63 & GBtab,
64 & nthreads,
65 & count,
66 & mtx,
67 & outeriter,
68 & inneriter,
69 & work)
70 implicit none
71 integer*4 nri,iinr(*),jindex(*),jjnr(*),shift(*)
72 real*4 shiftvec(*),fshift(*),pos(*),faction(*)
73 integer*4 gid(*),type(*),ntype
74 real*4 charge(*),facel,krf,crf,Vc(*),vdwparam(*)
75 real*4 Vvdw(*),tabscale,VFtab(*)
76 real*4 invsqrta(*),dvda(*),gbtabscale,GBtab(*)
77 integer*4 nthreads,count,mtx,outeriter,inneriter
78 real*4 work(*)
80 integer*4 n,ii,is3,ii3,k,nj0,nj1,jnr,j3,ggid
81 integer*4 nn0,nn1,nouter,ninner
82 real*4 shX,shY,shZ
83 real*4 fscal,tx,ty,tz
84 real*4 rinvsq
85 real*4 qq,vcoul,vctot
86 real*4 ix2,iy2,iz2,fix2,fiy2,fiz2
87 real*4 ix3,iy3,iz3,fix3,fiy3,fiz3
88 real*4 ix4,iy4,iz4,fix4,fiy4,fiz4
89 real*4 jx2,jy2,jz2,fjx2,fjy2,fjz2
90 real*4 jx3,jy3,jz3,fjx3,fjy3,fjz3
91 real*4 jx4,jy4,jz4,fjx4,fjy4,fjz4
92 real*4 dx22,dy22,dz22,rsq22,rinv22
93 real*4 dx23,dy23,dz23,rsq23,rinv23
94 real*4 dx24,dy24,dz24,rsq24,rinv24
95 real*4 dx32,dy32,dz32,rsq32,rinv32
96 real*4 dx33,dy33,dz33,rsq33,rinv33
97 real*4 dx34,dy34,dz34,rsq34,rinv34
98 real*4 dx42,dy42,dz42,rsq42,rinv42
99 real*4 dx43,dy43,dz43,rsq43,rinv43
100 real*4 dx44,dy44,dz44,rsq44,rinv44
101 real*4 qH,qM,qqMM,qqMH,qqHH
104 C Initialize water data
105 ii = iinr(1)+1
106 qH = charge(ii+1)
107 qM = charge(ii+3)
108 qqMM = facel*qM*qM
109 qqMH = facel*qM*qH
110 qqHH = facel*qH*qH
113 C Reset outer and inner iteration counters
114 nouter = 0
115 ninner = 0
117 C Loop over thread workunits
118 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
119 if(nn1.gt.nri) nn1=nri
121 C Start outer loop over neighborlists
123 do n=nn0+1,nn1
125 C Load shift vector for this list
126 is3 = 3*shift(n)+1
127 shX = shiftvec(is3)
128 shY = shiftvec(is3+1)
129 shZ = shiftvec(is3+2)
131 C Load limits for loop over neighbors
132 nj0 = jindex(n)+1
133 nj1 = jindex(n+1)
135 C Get outer coordinate index
136 ii = iinr(n)+1
137 ii3 = 3*ii-2
139 C Load i atom data, add shift vector
140 ix2 = shX + pos(ii3+3)
141 iy2 = shY + pos(ii3+4)
142 iz2 = shZ + pos(ii3+5)
143 ix3 = shX + pos(ii3+6)
144 iy3 = shY + pos(ii3+7)
145 iz3 = shZ + pos(ii3+8)
146 ix4 = shX + pos(ii3+9)
147 iy4 = shY + pos(ii3+10)
148 iz4 = shZ + pos(ii3+11)
150 C Zero the potential energy for this list
151 vctot = 0
153 C Clear i atom forces
154 fix2 = 0
155 fiy2 = 0
156 fiz2 = 0
157 fix3 = 0
158 fiy3 = 0
159 fiz3 = 0
160 fix4 = 0
161 fiy4 = 0
162 fiz4 = 0
164 do k=nj0,nj1
166 C Get j neighbor index, and coordinate index
167 jnr = jjnr(k)+1
168 j3 = 3*jnr-2
170 C load j atom coordinates
171 jx2 = pos(j3+3)
172 jy2 = pos(j3+4)
173 jz2 = pos(j3+5)
174 jx3 = pos(j3+6)
175 jy3 = pos(j3+7)
176 jz3 = pos(j3+8)
177 jx4 = pos(j3+9)
178 jy4 = pos(j3+10)
179 jz4 = pos(j3+11)
181 C Calculate distance
182 dx22 = ix2 - jx2
183 dy22 = iy2 - jy2
184 dz22 = iz2 - jz2
185 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22
186 dx23 = ix2 - jx3
187 dy23 = iy2 - jy3
188 dz23 = iz2 - jz3
189 rsq23 = dx23*dx23+dy23*dy23+dz23*dz23
190 dx24 = ix2 - jx4
191 dy24 = iy2 - jy4
192 dz24 = iz2 - jz4
193 rsq24 = dx24*dx24+dy24*dy24+dz24*dz24
194 dx32 = ix3 - jx2
195 dy32 = iy3 - jy2
196 dz32 = iz3 - jz2
197 rsq32 = dx32*dx32+dy32*dy32+dz32*dz32
198 dx33 = ix3 - jx3
199 dy33 = iy3 - jy3
200 dz33 = iz3 - jz3
201 rsq33 = dx33*dx33+dy33*dy33+dz33*dz33
202 dx34 = ix3 - jx4
203 dy34 = iy3 - jy4
204 dz34 = iz3 - jz4
205 rsq34 = dx34*dx34+dy34*dy34+dz34*dz34
206 dx42 = ix4 - jx2
207 dy42 = iy4 - jy2
208 dz42 = iz4 - jz2
209 rsq42 = dx42*dx42+dy42*dy42+dz42*dz42
210 dx43 = ix4 - jx3
211 dy43 = iy4 - jy3
212 dz43 = iz4 - jz3
213 rsq43 = dx43*dx43+dy43*dy43+dz43*dz43
214 dx44 = ix4 - jx4
215 dy44 = iy4 - jy4
216 dz44 = iz4 - jz4
217 rsq44 = dx44*dx44+dy44*dy44+dz44*dz44
219 C Calculate 1/r and 1/r2
220 rinv22 = 1.0/sqrt(rsq22)
221 rinv23 = 1.0/sqrt(rsq23)
222 rinv24 = 1.0/sqrt(rsq24)
223 rinv32 = 1.0/sqrt(rsq32)
224 rinv33 = 1.0/sqrt(rsq33)
225 rinv34 = 1.0/sqrt(rsq34)
226 rinv42 = 1.0/sqrt(rsq42)
227 rinv43 = 1.0/sqrt(rsq43)
228 rinv44 = 1.0/sqrt(rsq44)
230 C Load parameters for j atom
231 qq = qqHH
232 rinvsq = rinv22*rinv22
234 C Coulomb interaction
235 vcoul = qq*rinv22
236 vctot = vctot+vcoul
237 fscal = (vcoul)*rinvsq
239 C Calculate temporary vectorial force
240 tx = fscal*dx22
241 ty = fscal*dy22
242 tz = fscal*dz22
244 C Increment i atom force
245 fix2 = fix2 + tx
246 fiy2 = fiy2 + ty
247 fiz2 = fiz2 + tz
249 C Decrement j atom force
250 fjx2 = faction(j3+3) - tx
251 fjy2 = faction(j3+4) - ty
252 fjz2 = faction(j3+5) - tz
254 C Load parameters for j atom
255 qq = qqHH
256 rinvsq = rinv23*rinv23
258 C Coulomb interaction
259 vcoul = qq*rinv23
260 vctot = vctot+vcoul
261 fscal = (vcoul)*rinvsq
263 C Calculate temporary vectorial force
264 tx = fscal*dx23
265 ty = fscal*dy23
266 tz = fscal*dz23
268 C Increment i atom force
269 fix2 = fix2 + tx
270 fiy2 = fiy2 + ty
271 fiz2 = fiz2 + tz
273 C Decrement j atom force
274 fjx3 = faction(j3+6) - tx
275 fjy3 = faction(j3+7) - ty
276 fjz3 = faction(j3+8) - tz
278 C Load parameters for j atom
279 qq = qqMH
280 rinvsq = rinv24*rinv24
282 C Coulomb interaction
283 vcoul = qq*rinv24
284 vctot = vctot+vcoul
285 fscal = (vcoul)*rinvsq
287 C Calculate temporary vectorial force
288 tx = fscal*dx24
289 ty = fscal*dy24
290 tz = fscal*dz24
292 C Increment i atom force
293 fix2 = fix2 + tx
294 fiy2 = fiy2 + ty
295 fiz2 = fiz2 + tz
297 C Decrement j atom force
298 fjx4 = faction(j3+9) - tx
299 fjy4 = faction(j3+10) - ty
300 fjz4 = faction(j3+11) - tz
302 C Load parameters for j atom
303 qq = qqHH
304 rinvsq = rinv32*rinv32
306 C Coulomb interaction
307 vcoul = qq*rinv32
308 vctot = vctot+vcoul
309 fscal = (vcoul)*rinvsq
311 C Calculate temporary vectorial force
312 tx = fscal*dx32
313 ty = fscal*dy32
314 tz = fscal*dz32
316 C Increment i atom force
317 fix3 = fix3 + tx
318 fiy3 = fiy3 + ty
319 fiz3 = fiz3 + tz
321 C Decrement j atom force
322 fjx2 = fjx2 - tx
323 fjy2 = fjy2 - ty
324 fjz2 = fjz2 - tz
326 C Load parameters for j atom
327 qq = qqHH
328 rinvsq = rinv33*rinv33
330 C Coulomb interaction
331 vcoul = qq*rinv33
332 vctot = vctot+vcoul
333 fscal = (vcoul)*rinvsq
335 C Calculate temporary vectorial force
336 tx = fscal*dx33
337 ty = fscal*dy33
338 tz = fscal*dz33
340 C Increment i atom force
341 fix3 = fix3 + tx
342 fiy3 = fiy3 + ty
343 fiz3 = fiz3 + tz
345 C Decrement j atom force
346 fjx3 = fjx3 - tx
347 fjy3 = fjy3 - ty
348 fjz3 = fjz3 - tz
350 C Load parameters for j atom
351 qq = qqMH
352 rinvsq = rinv34*rinv34
354 C Coulomb interaction
355 vcoul = qq*rinv34
356 vctot = vctot+vcoul
357 fscal = (vcoul)*rinvsq
359 C Calculate temporary vectorial force
360 tx = fscal*dx34
361 ty = fscal*dy34
362 tz = fscal*dz34
364 C Increment i atom force
365 fix3 = fix3 + tx
366 fiy3 = fiy3 + ty
367 fiz3 = fiz3 + tz
369 C Decrement j atom force
370 fjx4 = fjx4 - tx
371 fjy4 = fjy4 - ty
372 fjz4 = fjz4 - tz
374 C Load parameters for j atom
375 qq = qqMH
376 rinvsq = rinv42*rinv42
378 C Coulomb interaction
379 vcoul = qq*rinv42
380 vctot = vctot+vcoul
381 fscal = (vcoul)*rinvsq
383 C Calculate temporary vectorial force
384 tx = fscal*dx42
385 ty = fscal*dy42
386 tz = fscal*dz42
388 C Increment i atom force
389 fix4 = fix4 + tx
390 fiy4 = fiy4 + ty
391 fiz4 = fiz4 + tz
393 C Decrement j atom force
394 faction(j3+3) = fjx2 - tx
395 faction(j3+4) = fjy2 - ty
396 faction(j3+5) = fjz2 - tz
398 C Load parameters for j atom
399 qq = qqMH
400 rinvsq = rinv43*rinv43
402 C Coulomb interaction
403 vcoul = qq*rinv43
404 vctot = vctot+vcoul
405 fscal = (vcoul)*rinvsq
407 C Calculate temporary vectorial force
408 tx = fscal*dx43
409 ty = fscal*dy43
410 tz = fscal*dz43
412 C Increment i atom force
413 fix4 = fix4 + tx
414 fiy4 = fiy4 + ty
415 fiz4 = fiz4 + tz
417 C Decrement j atom force
418 faction(j3+6) = fjx3 - tx
419 faction(j3+7) = fjy3 - ty
420 faction(j3+8) = fjz3 - tz
422 C Load parameters for j atom
423 qq = qqMM
424 rinvsq = rinv44*rinv44
426 C Coulomb interaction
427 vcoul = qq*rinv44
428 vctot = vctot+vcoul
429 fscal = (vcoul)*rinvsq
431 C Calculate temporary vectorial force
432 tx = fscal*dx44
433 ty = fscal*dy44
434 tz = fscal*dz44
436 C Increment i atom force
437 fix4 = fix4 + tx
438 fiy4 = fiy4 + ty
439 fiz4 = fiz4 + tz
441 C Decrement j atom force
442 faction(j3+9) = fjx4 - tx
443 faction(j3+10) = fjy4 - ty
444 faction(j3+11) = fjz4 - tz
446 C Inner loop uses 234 flops/iteration
447 end do
450 C Add i forces to mem and shifted force list
451 faction(ii3+3) = faction(ii3+3) + fix2
452 faction(ii3+4) = faction(ii3+4) + fiy2
453 faction(ii3+5) = faction(ii3+5) + fiz2
454 faction(ii3+6) = faction(ii3+6) + fix3
455 faction(ii3+7) = faction(ii3+7) + fiy3
456 faction(ii3+8) = faction(ii3+8) + fiz3
457 faction(ii3+9) = faction(ii3+9) + fix4
458 faction(ii3+10) = faction(ii3+10) + fiy4
459 faction(ii3+11) = faction(ii3+11) + fiz4
460 fshift(is3) = fshift(is3)+fix2+fix3+fix4
461 fshift(is3+1) = fshift(is3+1)+fiy2+fiy3+fiy4
462 fshift(is3+2) = fshift(is3+2)+fiz2+fiz3+fiz4
464 C Add potential energies to the group for this list
465 ggid = gid(n)+1
466 Vc(ggid) = Vc(ggid) + vctot
468 C Increment number of inner iterations
469 ninner = ninner + nj1 - nj0
471 C Outer loop uses 28 flops/iteration
472 end do
475 C Increment number of outer iterations
476 nouter = nouter + nn1 - nn0
477 if(nn1.lt.nri) goto 10
479 C Write outer/inner iteration count to pointers
480 outeriter = nouter
481 inneriter = ninner
482 return
491 C Gromacs nonbonded kernel f77skernel104nf
492 C Coulomb interaction: Normal Coulomb
493 C VdW interaction: Not calculated
494 C water optimization: pairs of TIP4P interactions
495 C Calculate forces: no
497 subroutine f77skernel104nf(
498 & nri,
499 & iinr,
500 & jindex,
501 & jjnr,
502 & shift,
503 & shiftvec,
504 & fshift,
505 & gid,
506 & pos,
507 & faction,
508 & charge,
509 & facel,
510 & krf,
511 & crf,
512 & Vc,
513 & type,
514 & ntype,
515 & vdwparam,
516 & Vvdw,
517 & tabscale,
518 & VFtab,
519 & invsqrta,
520 & dvda,
521 & gbtabscale,
522 & GBtab,
523 & nthreads,
524 & count,
525 & mtx,
526 & outeriter,
527 & inneriter,
528 & work)
529 implicit none
530 integer*4 nri,iinr(*),jindex(*),jjnr(*),shift(*)
531 real*4 shiftvec(*),fshift(*),pos(*),faction(*)
532 integer*4 gid(*),type(*),ntype
533 real*4 charge(*),facel,krf,crf,Vc(*),vdwparam(*)
534 real*4 Vvdw(*),tabscale,VFtab(*)
535 real*4 invsqrta(*),dvda(*),gbtabscale,GBtab(*)
536 integer*4 nthreads,count,mtx,outeriter,inneriter
537 real*4 work(*)
539 integer*4 n,ii,is3,ii3,k,nj0,nj1,jnr,j3,ggid
540 integer*4 nn0,nn1,nouter,ninner
541 real*4 shX,shY,shZ
542 real*4 qq,vcoul,vctot
543 real*4 ix2,iy2,iz2
544 real*4 ix3,iy3,iz3
545 real*4 ix4,iy4,iz4
546 real*4 jx2,jy2,jz2
547 real*4 jx3,jy3,jz3
548 real*4 jx4,jy4,jz4
549 real*4 dx22,dy22,dz22,rsq22,rinv22
550 real*4 dx23,dy23,dz23,rsq23,rinv23
551 real*4 dx24,dy24,dz24,rsq24,rinv24
552 real*4 dx32,dy32,dz32,rsq32,rinv32
553 real*4 dx33,dy33,dz33,rsq33,rinv33
554 real*4 dx34,dy34,dz34,rsq34,rinv34
555 real*4 dx42,dy42,dz42,rsq42,rinv42
556 real*4 dx43,dy43,dz43,rsq43,rinv43
557 real*4 dx44,dy44,dz44,rsq44,rinv44
558 real*4 qH,qM,qqMM,qqMH,qqHH
561 C Initialize water data
562 ii = iinr(1)+1
563 qH = charge(ii+1)
564 qM = charge(ii+3)
565 qqMM = facel*qM*qM
566 qqMH = facel*qM*qH
567 qqHH = facel*qH*qH
570 C Reset outer and inner iteration counters
571 nouter = 0
572 ninner = 0
574 C Loop over thread workunits
575 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
576 if(nn1.gt.nri) nn1=nri
578 C Start outer loop over neighborlists
580 do n=nn0+1,nn1
582 C Load shift vector for this list
583 is3 = 3*shift(n)+1
584 shX = shiftvec(is3)
585 shY = shiftvec(is3+1)
586 shZ = shiftvec(is3+2)
588 C Load limits for loop over neighbors
589 nj0 = jindex(n)+1
590 nj1 = jindex(n+1)
592 C Get outer coordinate index
593 ii = iinr(n)+1
594 ii3 = 3*ii-2
596 C Load i atom data, add shift vector
597 ix2 = shX + pos(ii3+3)
598 iy2 = shY + pos(ii3+4)
599 iz2 = shZ + pos(ii3+5)
600 ix3 = shX + pos(ii3+6)
601 iy3 = shY + pos(ii3+7)
602 iz3 = shZ + pos(ii3+8)
603 ix4 = shX + pos(ii3+9)
604 iy4 = shY + pos(ii3+10)
605 iz4 = shZ + pos(ii3+11)
607 C Zero the potential energy for this list
608 vctot = 0
610 C Clear i atom forces
612 do k=nj0,nj1
614 C Get j neighbor index, and coordinate index
615 jnr = jjnr(k)+1
616 j3 = 3*jnr-2
618 C load j atom coordinates
619 jx2 = pos(j3+3)
620 jy2 = pos(j3+4)
621 jz2 = pos(j3+5)
622 jx3 = pos(j3+6)
623 jy3 = pos(j3+7)
624 jz3 = pos(j3+8)
625 jx4 = pos(j3+9)
626 jy4 = pos(j3+10)
627 jz4 = pos(j3+11)
629 C Calculate distance
630 dx22 = ix2 - jx2
631 dy22 = iy2 - jy2
632 dz22 = iz2 - jz2
633 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22
634 dx23 = ix2 - jx3
635 dy23 = iy2 - jy3
636 dz23 = iz2 - jz3
637 rsq23 = dx23*dx23+dy23*dy23+dz23*dz23
638 dx24 = ix2 - jx4
639 dy24 = iy2 - jy4
640 dz24 = iz2 - jz4
641 rsq24 = dx24*dx24+dy24*dy24+dz24*dz24
642 dx32 = ix3 - jx2
643 dy32 = iy3 - jy2
644 dz32 = iz3 - jz2
645 rsq32 = dx32*dx32+dy32*dy32+dz32*dz32
646 dx33 = ix3 - jx3
647 dy33 = iy3 - jy3
648 dz33 = iz3 - jz3
649 rsq33 = dx33*dx33+dy33*dy33+dz33*dz33
650 dx34 = ix3 - jx4
651 dy34 = iy3 - jy4
652 dz34 = iz3 - jz4
653 rsq34 = dx34*dx34+dy34*dy34+dz34*dz34
654 dx42 = ix4 - jx2
655 dy42 = iy4 - jy2
656 dz42 = iz4 - jz2
657 rsq42 = dx42*dx42+dy42*dy42+dz42*dz42
658 dx43 = ix4 - jx3
659 dy43 = iy4 - jy3
660 dz43 = iz4 - jz3
661 rsq43 = dx43*dx43+dy43*dy43+dz43*dz43
662 dx44 = ix4 - jx4
663 dy44 = iy4 - jy4
664 dz44 = iz4 - jz4
665 rsq44 = dx44*dx44+dy44*dy44+dz44*dz44
667 C Calculate 1/r and 1/r2
668 rinv22 = 1.0/sqrt(rsq22)
669 rinv23 = 1.0/sqrt(rsq23)
670 rinv24 = 1.0/sqrt(rsq24)
671 rinv32 = 1.0/sqrt(rsq32)
672 rinv33 = 1.0/sqrt(rsq33)
673 rinv34 = 1.0/sqrt(rsq34)
674 rinv42 = 1.0/sqrt(rsq42)
675 rinv43 = 1.0/sqrt(rsq43)
676 rinv44 = 1.0/sqrt(rsq44)
678 C Load parameters for j atom
679 qq = qqHH
681 C Coulomb interaction
682 vcoul = qq*rinv22
683 vctot = vctot+vcoul
685 C Load parameters for j atom
686 qq = qqHH
688 C Coulomb interaction
689 vcoul = qq*rinv23
690 vctot = vctot+vcoul
692 C Load parameters for j atom
693 qq = qqMH
695 C Coulomb interaction
696 vcoul = qq*rinv24
697 vctot = vctot+vcoul
699 C Load parameters for j atom
700 qq = qqHH
702 C Coulomb interaction
703 vcoul = qq*rinv32
704 vctot = vctot+vcoul
706 C Load parameters for j atom
707 qq = qqHH
709 C Coulomb interaction
710 vcoul = qq*rinv33
711 vctot = vctot+vcoul
713 C Load parameters for j atom
714 qq = qqMH
716 C Coulomb interaction
717 vcoul = qq*rinv34
718 vctot = vctot+vcoul
720 C Load parameters for j atom
721 qq = qqMH
723 C Coulomb interaction
724 vcoul = qq*rinv42
725 vctot = vctot+vcoul
727 C Load parameters for j atom
728 qq = qqMH
730 C Coulomb interaction
731 vcoul = qq*rinv43
732 vctot = vctot+vcoul
734 C Load parameters for j atom
735 qq = qqMM
737 C Coulomb interaction
738 vcoul = qq*rinv44
739 vctot = vctot+vcoul
741 C Inner loop uses 135 flops/iteration
742 end do
745 C Add i forces to mem and shifted force list
747 C Add potential energies to the group for this list
748 ggid = gid(n)+1
749 Vc(ggid) = Vc(ggid) + vctot
751 C Increment number of inner iterations
752 ninner = ninner + nj1 - nj0
754 C Outer loop uses 10 flops/iteration
755 end do
758 C Increment number of outer iterations
759 nouter = nouter + nn1 - nn0
760 if(nn1.lt.nri) goto 10
762 C Write outer/inner iteration count to pointers
763 outeriter = nouter
764 inneriter = ninner
765 return