-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsequence.f
81 lines (57 loc) · 1.94 KB
/
sequence.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
implicit none
integer r(5000)
character(len=4) q(6941)
character(len=3) l(7351,5000)
character(len=3) res(7351)
real h(7351)
real b(7351)
real sap_fr(10000)
character(len=45) m(7351)
character(len=40) f(100000)
integer ft(20000)
character(len=40) w(100000)
integer resno(0:7352)
character(len=3) resname(7351)
c real, dimension(1:659,1:7351,1:5000) :: d
c real d2(8000,8000,8000)
integer p(7351), n(7351)
c integer b(1:7351,0:5000)
integer x(7351)
integer natom
integer i, j, k, s
real a(7351), sap(73510)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
open(unit=117,file="frame1.gro",status="unknown")
open(unit=333,file="sequence.dat",status="unknown")
do 17 i = 1,7351
read(117,120) resno(i), resname(i)
c print*, resno(i)
17 enddo
resno(0) = 0
natom = 0
do 43 i = 1,7351
if(resno(i) .ne. resno(i-1)) then
write(333,*) resno(i),resname(i)
natom=0
else
natom = natom + 1
endif
43 enddo
resno(7352) = 1000
open(unit=334,file="ressize.dat",status="unknown")
s=0
natom = 0
do 44 i = 1,7351
if(resno(i) .ne. resno(i+1)) then
write(334,*) resno(i),resname(i),natom+1
s = s + natom+1
natom = 0
else
natom = natom + 1
endif
44 enddo
print*, s
120 format(i5, a3)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
stop
end