- xj=c(1,j)+0.5D0*dxj-xmedi
- yj=c(2,j)+0.5D0*dyj-ymedi
- zj=c(3,j)+0.5D0*dzj-zmedi
+C xj=c(1,j)+0.5D0*dxj-xmedi
+C yj=c(2,j)+0.5D0*dyj-ymedi
+C zj=c(3,j)+0.5D0*dzj-zmedi
+ xj=c(1,j)+0.5D0*dxj
+ yj=c(2,j)+0.5D0*dyj
+ zj=c(3,j)+0.5D0*dzj
+C if ((i+3).lt.j) then !this condition keeps for turn3 and turn4 not subject to PBC
+ 174 continue
+ if (xj.gt.((0.5d0)*boxxsize)) xj=xj-boxxsize
+ if (xj.lt.((-0.5d0)*boxxsize)) xj=xj+boxxsize
+C Condition for being inside the proper box
+ if ((xj.gt.((0.5d0)*boxxsize)).or.
+ & (xj.lt.((-0.5d0)*boxxsize))) then
+ go to 174
+ endif
+ 175 continue
+ if (yj.gt.((0.5d0)*boxysize)) yj=yj-boxysize
+ if (yj.lt.((-0.5d0)*boxysize)) yj=yj+boxysize
+C Condition for being inside the proper box
+ if ((yj.gt.((0.5d0)*boxysize)).or.
+ & (yj.lt.((-0.5d0)*boxysize))) then
+ go to 175
+ endif
+ 176 continue
+ if (zj.gt.((0.5d0)*boxzsize)) zj=zj-boxzsize
+ if (zj.lt.((-0.5d0)*boxzsize)) zj=zj+boxzsize
+C Condition for being inside the proper box
+ if ((zj.gt.((0.5d0)*boxzsize)).or.
+ & (zj.lt.((-0.5d0)*boxzsize))) then
+ go to 176
+ endif
+C endif !endPBC condintion
+ xj=xj-xmedi
+ yj=yj-ymedi
+ zj=zj-zmedi