Merge branch 'devel' into AFM
[unres.git] / source / unres / src_MD-M / refsys.f
index b57c201..35a881e 100644 (file)
@@ -1,4 +1,6 @@
       subroutine refsys(i2,i3,i4,e1,e2,e3,fail)
+c This subroutine calculates unit vectors of a local reference system
+c defined by atoms (i2), (i3), and (i4). The x axis is the axis from
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
 c this subroutine calculates unity vectors of a local reference system
@@ -12,14 +14,18 @@ c form a linear fragment. returns vectors e1, e2, and e3.
       double precision e1(3),e2(3),e3(3)
       double precision u(3),z(3)
       include 'COMMON.IOUNITS'
-      include "COMMON.CHAIN"
-      data coinc /1.0d-13/,align /1.0d-13/
+      double precision coinc/1.0D-13/,align /1.0D-13/
+c      print *,'just initialize'
       fail=.false.
-      s1=0.0d0
-      s2=0.0d0
+c      print *,fail
+      s1=0.0
+      s2=0.0
+      print *,s1,s2
       do 1 i=1,3
+      print *, i2,i3,i4
       zi=c(i,i2)-c(i,i3)
       ui=c(i,i4)-c(i,i3)
+      print *,zi,ui
       s1=s1+zi*zi
       s2=s2+ui*ui
       z(i)=zi
@@ -34,6 +40,7 @@ c form a linear fragment. returns vectors e1, e2, and e3.
       write(iout,1000) i3,i4,i1
       fail=.true.
       return
+      print *,'two if pass'
     4 s1=1.0/s1
       s2=1.0/s2
       v1=z(2)*u(3)-z(3)*u(2)
@@ -54,7 +61,9 @@ c form a linear fragment. returns vectors e1, e2, and e3.
       e2(1)=e1(3)*e3(2)-e1(2)*e3(3)
       e2(2)=e1(1)*e3(3)-e1(3)*e3(1)
       e2(3)=e1(2)*e3(1)-e1(1)*e3(2)
- 1000 format (/1x,' * * * error - atoms',i4,' and',i4,' coincide.')
- 1010 format (/1x,' * * * error - atoms',2(i4,2h, ),i4,' form a linear')
+ 1000 format (/1x,' * * * Error - atoms',i4,' and',i4,' coincide.',
+     1 'coordinates of atom',i4,' are set to zero.')
+ 1010 format (/1x,' * * * Error - atoms',2(i4,2h, ),i4,' form a linear',
+     1 ' fragment. coordinates of atom',i4,' are set to zero.')
       return
       end