source: rgyr.f

Last change on this file was 3fbbfbb, checked in by Jan Meinke <j.meinke@…>, 14 years ago

Move to doxygen comments and smmp_p.

Doxygen comments in Fortran are !> ... !! ... !<. I'm planning move the API documentation from the
lyx file into the code. This should make it easier to get documentation for all the common block
variables as well.

Use import smmp_p to indicate the parallel version of the Python bindings.

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