source: rgyr.f@ bd2278d

Last change on this file since bd2278d was bd2278d, checked in by baerbaer <baerbaer@…>, 16 years ago

Reformatting comments and continuation marks.

Fortran 90 and higher use ! to mark comments no matter where they are in the
code. The only valid continuation marker is &.
I also added the SMMP.kdevelop.filelist to the repository to make it easier
to use kdevelop.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@12 26dc1dd8-5c4e-0410-9ffe-d298b4865968

  • Property mode set to 100644
File size: 2.9 KB
Line 
1!**************************************************************
2!
3! This file contains the subroutines: rgyr
4!
5! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,
6! Shura Hayryan, Chin-Ku
7! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
8! Jan H. Meinke, Sandipan Mohanty
9!
10! **************************************************************
11
12
13 subroutine rgyr(nml, rgy, ee)
14
15! CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE
16! FOR A GIVEN PROTEIN CONFORMATION
17! If nml == 0, calculate the radius of gyration for all molecules
18!
19! rgy = radius-of-gyration
20! ee = end-to-end distance
21!
22! REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine
23!
24! CALLS: NONE
25!
26 include 'INCL.H'
27!f2py intent(in) nml
28!f2py intent(out) rgy
29!f2py intent(out) ee
30 integer typ
31 if (nml.eq.0) then
32 nml1 = 1
33 nml2 = ntlml
34 else
35 nml1 = nml
36 nml2 = nml
37 endif
38
39
40 nat = iatrs2(irsml2(nml2))-iatrs1(irsml1(nml1))+1
41
42 if (nat.le.0) then
43 write (*,'(a,i4)')
44 & ' rgyr> No atoms found for molecule #',nml
45 return
46 endif
47
48 dn = dble(nat)
49 dnp = 0.0
50 dnh = 0.0
51
52 dx =0.d0
53 dxp = 0.0d0
54 dxp = 0.0d0
55 dy =0.d0
56 dyp = 0.0d0
57 dyh = 0.0d0
58 dz =0.d0
59 dzp = 0.0d0
60 dzh = 0.0d0
61 d2 =0.d0
62 d2p = 0.0
63 d2h = 0.0
64
65 do i=iatrs1(irsml1(nml1)), iatrs1(irsml1(nml1)) + nat
66 xi = xat(i)
67 yi = yat(i)
68 zi = zat(i)
69 dx = dx + xi
70 dy = dy + yi
71 dz = dz + zi
72 d2 = d2 + xi**2 + yi**2 + zi**2
73 if(sigma(i).lt.0) then
74 dxp = dxp + xi
75 dyp = dyp + yi
76 dzp = dzp + zi
77 d2p = d2p + xi**2 + yi**2 + zi**2
78 dnp = dnp + 1
79 endif
80 if(sigma(i).gt.0) then
81 dxh = dxh + xi
82 dyh = dyh + yi
83 dzh = dzh + zi
84 d2h = d2h + xi**2 + yi**2 + zi**2
85 dnh = dnp + 1
86 endif
87 enddo
88
89 dx = dx/dn
90 dy = dy/dn
91 dz = dz/dn
92 d2 = d2/dn
93 rg2 = d2 - (dx**2+dy**2+dz**2)
94
95 dxp = dxp/dnp
96 dyp = dyp/dnp
97 dzp = dzp/dnp
98 d2p = d2p/dnp
99 rg2p = d2p - (dxp**2+dyp**2+dzp**2)
100
101 dxh = dxh/dnh
102 dyh = dyh/dnh
103 dzh = dzh/dnh
104 d2h = d2h/dnh
105
106 rg2h = d2h - (dxh**2+dyh**2+dzh**2)
107
108 if (rg2.gt.0.d0) then
109 rgy = sqrt(rg2)
110 else
111 rgy = 0.d0
112 endif
113
114 if (rg2p.gt.0.d0) then
115 rgyp = sqrt(rg2p)
116 else
117 rgyp = 0.d0
118 endif
119
120 if (rg2h.gt.0.d0) then
121 rgyh = sqrt(rg2h)
122 else
123 rgyh = 0.d0
124 endif
125
126 i1=ind_alf(irsml1(nml1))
127 i2=ind_alf(irsml2(nml2))
128
129 ee = sqrt((xat(i2)-xat(i1))**2+(yat(i2)-yat(i1))**2
130 & +(zat(i2)-zat(i1))**2)
131
132 return
133 end
134
Note: See TracBrowser for help on using the repository browser.