-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chapter6.txt
1196 lines (1076 loc) · 41.3 KB
/
Chapter6.txt
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;
; Ethanol, Jorgensen et al. JACS 118 pp. 11225 (1996)
;
[ moleculetype ]
; name nrexcl
ETH 3
[ atoms ]
; nr type resnr residu atom cgnr charge mass
1 opls_157 1 ETH C 1 -0.18
2 opls_156 1 ETH H 1 0.06
3 opls_156 1 ETH H 1 0.06
4 opls_156 1 ETH H 1 0.06
5 opls_157 1 ETH C 2 0.145
6 opls_156 1 ETH H 2 0.06
7 opls_156 1 ETH H 2 0.06
8 opls_154 1 ETH OA 2 -0.683
9 opls_155 1 ETH HO 2 0.418
[ bonds ]
; ai aj funct c0 c1
1 5 1
3 1 1
4 1 1
2 1 1
7 5 1
6 5 1
8 5 1
9 8 1
[ pairs ]
; i j func
2 6
2 7
2 8
3 6
3 7
3 8
4 6
4 7
4 8
1 9
6 9
7 9
[ angles ]
; ai aj ak funct c0 c1
; H3
2 1 5 1
3 1 5 1
4 1 5 1
;
4 1 3 1
4 1 2 1
;
3 1 2 1
;
1 5 7 1
1 5 6 1
1 5 8 1
;
5 8 9 1
;
6 5 7 1
6 5 8 1
;
7 5 8 1
;
[ dihedrals ]
2 1 5 6 3
3 1 5 6 3
4 1 5 6 3
2 1 5 7 3
3 1 5 7 3
4 1 5 7 3
2 1 5 8 3
3 1 5 8 3
4 1 5 8 3
1 5 8 9 3
6 5 8 9 3
7 5 8 9 3
>perl topolgen_1.1.pl -f [].PDB -o [].TOP
>./src/topolbuild -dir ../dat/GROMACS/ -n ethanol -ff oplsaa -r EtOH -charge
>./src/topolbuild -dir ../dat/GROMACS/ -n /INPUTS/ethanol -ff oplsaa -r EtOH -charge
@<TRIPOS>MOLECULE
ethanol
9 8 0 0 0
SMALL
GASTEIGER
@<TRIPOS>ATOM
> 1 C -0.5500 1.4170 0.0350 C.3 1 LIG1 -0.0418
> 2 C 0.9640 1.4240 0.0060 C.3 1 LIG1 0.0414
> 3 H -0.9570 1.6910 -0.9440 H 1 LIG1 0.0252
> 4 H -0.9250 2.1540 0.7530 H 1 LIG1 0.0252
> 5 H -0.9300 0.4300 0.3100 H 1 LIG1 0.0252
> 6 O 1.4380 2.7200 -0.3300 O.3 1 LIG1 -0.3953
> 7 H 1.3460 0.7090 -0.7290 H 1 LIG1 0.0554
> 8 H 1.3670 1.1580 0.9880 H 1 LIG1 0.0554
> 9 H 1.0810 2.9440 -1.2070 H 1 LIG1 0.2094
@<TRIPOS>BOND
1 1 2 1
2 1 3 1
3 1 4 1
4 1 5 1
5 2 6 1
6 2 7 1
7 2 8 1
8 6 9 1
@<TRIPOS>
ethanol
9
1EtOH C 1 -0.055 0.142 0.004
1EtOH H 2 -0.096 0.169 -0.094
1EtOH H 3 -0.093 0.215 0.075
1EtOH H 4 -0.093 0.043 0.031
1EtOH C 5 0.096 0.142 0.001
1EtOH H 6 0.135 0.071 -0.073
1EtOH H 7 0.137 0.116 0.099
1EtOH O 8 0.144 0.272 -0.033
1EtOH H 9 0.108 0.294 -0.121
0.71850 0.75420 0.65850
;
; OPLS-AA topology, built by TopolGen version 1.1_dev (10/14/2009)
; Script written by: Justin Lemkul ([email protected])
; This is your molecule's topology
; Check it carefully for any errors. It is not necessarily perfect!
;
; Topology written on Sat Nov 5 15:10:45 EDT 2016
;
; Include force field
#include "ffoplsaa.itp"
[ moleculetype ]
; Name nrexcl
UNL 3
[ atoms ]
; nr type resnr residue atom cgnr charge mass typeB chargeB massB
1 opls_135 1 UNL C 1 -0.180 12.01100
2 opls_135 1 UNL C 2 -0.180 12.01100
3 opls_140 1 UNL H 2 0.060 1.00800
4 opls_140 1 UNL H 2 0.060 1.00800
5 opls_140 1 UNL H 2 0.060 1.00800
6 opls_140 1 UNL H 2 0.060 1.00800
7 opls_140 1 UNL H 2 0.060 1.00800
8 opls_154 1 UNL O 2 -0.683 15.99940
9 opls_155 1 UNL H 2 0.418 1.00800
[ bonds ]
; ai aj funct
1 2 1 ; C C
1 3 1 ; C H
1 4 1 ; C H
1 5 1 ; C H
2 6 1 ; C H
2 7 1 ; C H
2 8 1 ; C O
8 9 1 ; O H
[ pairs ]
; ai aj funct
1 9 1 ; C H
6 9 1 ; H H
7 9 1 ; H H
[ angles ]
; ai aj ak funct
2 1 3 1 ; C C H
2 1 4 1 ; C C H
2 1 5 1 ; C C H
1 2 6 1 ; C C H
1 2 7 1 ; C C H
1 2 8 1 ; C C O
3 1 4 1 ; H C H
3 1 5 1 ; H C H
4 1 5 1 ; H C H
6 2 7 1 ; H C H
6 2 8 1 ; H C O
7 2 8 1 ; H C O
2 8 9 1 ; O C H
[ dihedrals ]
; ai aj ak al funct
1 2 8 9 3 ; C C O H
6 2 8 9 3 ; H C O H
7 2 8 9 3 ; H C O H
[ system ]
; Name
UNL topology, generated by TopolGen
[ molecules ]
; Compound #mols
UNL 1
;
; Topology from .mol2 file
; topolbuild version 1.3
; Command line:
; ./src/topolbuild -dir ./dat/GROMACS/ -n ./INPUTS/ethanol -ff oplsaa -r EtOH -charge
;
; The force field files to be included
#include "ffethanol.itp"
[ moleculetype ]
; name nrexcl
ethanol 3
[ atoms ]
; nr type resnr residu atom cgnr charge mass
1 opls_135 1 EtOH C 1 -0.18000 12.01100 ; -0.1800000
2 opls_140 1 EtOH H 1 0.06000 1.00800 ; -0.1200000
3 opls_140 1 EtOH H 1 0.06000 1.00800 ; -0.0600000
4 opls_140 1 EtOH H 1 0.06000 1.00800 ; 0.0000000
5 opls_157 1 EtOH C 2 0.14500 12.01100 ; 0.1450000
6 opls_140 1 EtOH H 2 0.06000 1.00800 ; 0.2050000
7 opls_140 1 EtOH H 2 0.06000 1.00800 ; 0.2650000
8 opls_154 1 EtOH O 2 -0.68300 15.99940 ; -0.4180000
9 opls_155 1 EtOH H 2 0.41800 1.00800 ; 0.0000000
; total molecule charge = 0.0000000
[ bonds ]
; ai aj funct b0 kb
1 5 1 0.15290 224262. ; C- C
1 2 1 0.10900 284512. ; C- H
1 3 1 0.10900 284512. ; C- H
1 4 1 0.10900 284512. ; C- H
5 8 1 0.14100 267776. ; C- O
5 6 1 0.10900 284512. ; C- H
5 7 1 0.10900 284512. ; C- H
8 9 1 0.09450 462750. ; O- H
[ constraints ]
5 9 2 0.19305 ; C H
[ pairs ]
2 8 1 ; H- O
2 6 1 ; H- H
2 7 1 ; H- H
3 8 1 ; H- O
3 6 1 ; H- H
3 7 1 ; H- H
4 8 1 ; H- O
4 6 1 ; H- H
4 7 1 ; H- H
1 9 1 ; C- H
6 9 1 ; H- H
7 9 1 ; H- H
[ angles ]
; ai aj ak funct th0 cth
2 1 5 1 110.700 313.8000 ; H- C- C
3 1 5 1 110.700 313.8000 ; H- C- C
4 1 5 1 110.700 313.8000 ; H- C- C
1 5 8 1 109.500 418.4000 ; C- C- O
1 5 6 1 110.700 313.8000 ; C- C- H
1 5 7 1 110.700 313.8000 ; C- C- H
3 1 2 1 107.800 276.1440 ; H- C- H
4 1 2 1 107.800 276.1440 ; H- C- H
4 1 3 1 107.800 276.1440 ; H- C- H
6 5 8 1 109.500 292.8800 ; H- C- O
7 5 8 1 109.500 292.8800 ; H- C- O
5 8 9 1 108.500 460.2400 ; C- O- H
7 5 6 1 107.800 276.1440 ; H- C- H
[ dihedrals ]
; ai aj ak al funct c0 c1 c2 c3 c4 c5
> 2 1 5 8 3 0.97905 2.93716 0.00000 -3.91622 0.00000 0.00000 ; dih H- C- C- O
> 1 5 8 9 3 -0.44350 3.83255 0.72801 -4.11705 0.00000 0.00000 ; dih C- C- O- H
; Include Position restraint file
; WARNING: Position restraints and distance restraints ought not be done together
#ifdef POSRES
#include "posreethanol.itp"
#endif
; Include water topology
#include "spce.itp"
#ifdef POSRES_WATER
; Position restraint for each water oxygen
[ position_restraints ]
; i funct fcx fcy fcz
1 1 1000 1000 1000
#endif
; Include generic topology for ions
#include "ions.itp"
[ system ]
; title from mol2 input
ethanol
[ molecules ]
; molecule name nr.
ethanol 1
>ifort -c my_prog.f
>ifort -o my_prog my_prog.o whatever_libs_you_need
>ifort -o my_prog my_prog.f whatever_libs_you_need
program Build
implicit none
integer MxN
parameter(MxN=200)
real*8 xyz(3*MxN),bnd(MxN),tht(MxN),phi(MxN),x,y,z
real*8 pi,gradDeg,aa,bb,cc,zOff
integer idum,ibnd(3,MxN),itype(MxN),itypeB(MxN),icg(MxN)
integer j,Nat,Nat1,Nat2,kRes,ires
character*2 t2
character*3 tn(MxN),t3
character*4 resID,t4,resIDt
character*25 f1,f2,f3,f4,f5
c.. defining the angles for coordinate transformation
pi=dacos(-1.d0)
gradDeg=pi/180.d0
c.. opening the read in file which has the filename in-formation
>c.. creating variables for
c.. Nat1-the number of atoms in the mixture PDB [input]
c.. Nat2- the polymer PDB, aa,bb,cc-the box vectors [in-put]
c.. zOff-distance above z=0 to plane polymer [input]
c.. f1-the name of the .DAT containing the input file-names [input]
c.. f2-the name of the .PDB with the input mixture [in-put]
c.. f3-the name of the .PDB with the polymer [input]
c.. f4-the name of the polymer ITP file [output]
c.. f5-the name of the GRO file [output]
open(unit=9, file='BuildGroFiles.dat', status='unknown')
read(9,*) Nat1
read(9,*) Nat2
read(9,*) aa,bb,cc
read(9,*) zOff
read(9,*) f1
read(9,*) f2
read(9,*) f3
read(9,*) f4
read(9,*) f5
c.. the following section of code reads in each of the named files
>c.. into the program space
open(unit=10, file=f1, status='old')
open(unit=12, file=f2, status='old')
open(unit=29, file=f3, status='unknown')
open(unit=34, file=f4, status='unknown')
open(unit=39, file=f5, status='unknown')
c.. summation to determine the total number of atoms
read(12,*)
read(12,*)
read(12,*)
read(12,*)
read(12,*)
write(39,*) 'gro file'
write(39,*) Nat1+Nat2
c.. taking in the atom names, types and coordinates
c.. converting atomic coordinates from angstroms to nm
do j=1,Nat1
read(12,128) t4, idum,t3,resIDt,t2,ires,x,y,z
write(39,129)ires,resIDt, t3, j, x/10.,y/10.,z/10.
enddo
c.. The bbnd(j),tht(j) and phi(j) are defined in a
c.. later section
c.. Do I need to add some types to these lines?
c.. For the polyalkanes and other heteroatoms, yes.
read(10,*) resID
read(10,*) Nat
do j=1,Nat
read(10,*) idum,bnd(j),tht(j),phi(j),
$ ibnd(1,j),ibnd(2,j),ibnd(3,j),itype(j),icg(j)
if (itype(j).eq.1) then
tn(j)='CH1'
else if (itype(j).eq.2) then
tn(j)='CH2'
else if (itype(j).eq.3) then
tn(j)='CH3'
else if (itype(j).eq.4) then
tn(j)=' H'
else if (itype(j).eq.5) then
tn(j)='CC4'
else
write(*,*) 'problem with atom definition'
pause
endif
enddo
c.. creating a topology file
call makeTop(Nat,ibnd,itype,itypeB,icg,tn,resID)
c.. adding atoms starting at the origin
xyz(1)= +0.d0
xyz(2)= +0.d0
xyz(3)= +0.d0
c.. vector addition along bond length
c.. to determine the atomic coordinates
c.. angles given by atomic hybridizations
xyz(4)=xyz(1)+bnd(2)
xyz(5)=xyz(2)+0.d0
xyz(6)=xyz(3)+0.d0
xyz(7)=xyz(4)-bnd(3)*dcos(gradDeg*tht(3))
xyz(8)=xyz(5)+0.d0
xyz(9)=xyz(6)+bnd(3)*dsin(gradDeg*tht(3))
c.. j=1 is doubled. ? j=2 and 3 missing..?
do j=4,Nat
call Getxyz(j,xyz,ibnd(1,j),bnd(j),tht(j),phi(j))
enddo
do j=1,Nat
write(29,119) 'ATOM', j,tn(j),resID, 1,
$ xyz(3*(j-1)+1),xyz(3*(j-1)+2),xyz(3*(j-1)+3),
$ 1.d0,0.d0
enddo
c..
do j=1,Nat
write(39,129) ires+1, resID, tn(j), j+Nat1,
$ (aa/2)+xyz(3*(j-1)+1)/10.,
$ (bb/2)+xyz(3*(j-1)+2)/10.,
$ zOff+xyz(3*(j-1)+3)/10.
>enddo
c..
write(39,130) aa,bb,cc
close(10)
close(34)
c.. defining the spacing of the output in the [.gro] file
101 format(i3,3f10.2,3i3,i5)
119 format(a4,3x,i4,1x,a3,1x,a4,i6,4x,3f8.3,2f6.2)
128 format(a6,i5,1x,a3,2x,a4,a1,i6,4x,3f8.3,2f6.2)
129 format(i5,a4,3x,a3,i5,3f8.3)
130 format(3f8.3)
stop
end
c *************************************************************
subroutine Getxyz(jdo,xyz,ibnd,bnd,tht,phi)
implicit none
integer MxN,Mx3N
parameter (MxN=200,Mx3N=3*MxN)
real*8 xyz(Mx3N)
real*8 gradDeg,bnd,tht,phi,pi,d,a(3,3),b(3,3),dum(3,3)
real*8 r1(3),r2(3),r1m,r2m,t,xp(3)
integer i,j,ibnd(3),indx(6),jdo
c..This subroutine creates the topology file sections and types
>
pi=dacos(-1.d0)
gradDeg=pi/180.d0
c..
r1m=0.d0
r2m=0.d0
do 10 i=1,3
r1(i)=xyz(3*(ibnd(1)-1)+i)-xyz(3*(ibnd(2)-1)+i)
r2(i)=xyz(3*(ibnd(2)-1)+i)-xyz(3*(ibnd(3)-1)+i)
r1m=r1m+r1(i)**2
r2m=r2m+r2(i)**2
10 continue
a(3,1)=r1(2)*r2(3)-r1(3)*r2(2)
a(3,2)=r1(3)*r2(1)-r1(1)*r2(3)
a(3,3)=r1(1)*r2(2)-r1(2)*r2(1)
t=dsqrt(a(3,1)**2+a(3,2)**2+a(3,3)**2)
a(3,1)=a(3,1)/t
a(3,2)=a(3,2)/t
a(3,3)=a(3,3)/t
a(1,1)=r1(1)
a(1,2)=r1(2)
a(1,3)=r1(3)
t=dsqrt(a(1,1)**2+a(1,2)**2+a(1,3)**2)
a(1,1)=a(1,1)/t
a(1,2)=a(1,2)/t
a(1,3)=a(1,3)/t
a(2,1)=a(3,2)*a(1,3)-a(3,3)*a(1,2)
a(2,2)=a(3,3)*a(1,1)-a(3,1)*a(1,3)
a(2,3)=a(3,1)*a(1,2)-a(3,2)*a(1,1)
t=dsqrt(a(2,1)**2+a(2,2)**2+a(2,3)**2)
a(2,1)=a(2,1)/t
a(2,2)=a(2,2)/t
a(2,3)=a(2,3)/t
c.. This section uses an unfamiliar command LUDCMP (?)
c.. and LUBKSB (?)
c.. is the LUDCMP an LU decomposition? Why is it required here?
>c.. How then is LUBKSB related to it?
c.. This decomposition is one of the simplest methods to invert a
>c.. matrix. The matrix includes a transformation from carthesian to
>c.. spherical coordinates. Therefore the LUD decomposi-tion assists
>c.. in the reverse transformation required to place the polymer in the box
c.. These operations are only performed for i and j go from 1 to 3.
>
do 20 i=1,3
do 21 j=1,3
b(i,j)=0.d0
21 dum(i,j)=a(i,j)
20 b(i,i)=1.d0
call LUDCMP(dum,3,3,indx,d)
do 25 i=1,3
25 call LUBKSB(dum,3,3,indx,b(1,i))
c.. the following set of lines are determining the dis-tance
c.. in x, y and z that an atom is away from another atom
c.. based upon the hybridization and dihedral rotation
xp(1)= bnd*dcos(pi-gradDeg*tht)
xp(2)= bnd*dcos(pi-gradDeg*phi)*dsin(pi-gradDeg*tht)
xp(3)= bnd*dsin(pi-gradDeg*phi)*dsin(pi-gradDeg*tht)
c.. this line is less obvious
do 30 i=1,3
xyz(3*(jdo-1)+i)=xyz(3*(ibnd(1)-1)+i)
$ +b(i,1)*xp(1)+b(i,2)*xp(2)+b(i,3)*xp(3)
>30 continue
return
end
c. The LU decomposition subroutine
SUBROUTINE LUDCMP(A,N,NP,INDX,D)
implicit real*8 (a-h,o-z)
PARAMETER (MxN=100,TINY=1.0E-20)
DIMENSION A(NP,NP),INDX(N),VV(MxN)
D=1.d0
DO 12 I=1,N
AAMAX=0.d0
DO 11 J=1,N
IF (dABS(A(I,J)).GT.AAMAX) AAMAX=dABS(A(I,J))
11 CONTINUE
IF (AAMAX.EQ.0.d0) PAUSE 'Singular matrix.'
VV(I)=1.d0/AAMAX
12 CONTINUE
DO 19 J=1,N
IF (J.GT.1) THEN
DO 14 I=1,J-1
SUM=A(I,J)
IF (I.GT.1)THEN
DO 13 K=1,I-1
SUM=SUM-A(I,K)*A(K,J)
13 CONTINUE
A(I,J)=SUM
ENDIF
14 CONTINUE
ENDIF
AAMAX=0.d0
DO 16 I=J,N
SUM=A(I,J)
IF (J.GT.1)THEN
DO 15 K=1,J-1
SUM=SUM-A(I,K)*A(K,J)
15 CONTINUE
A(I,J)=SUM
ENDIF
DUM=VV(I)*dABS(SUM)
IF (DUM.GE.AAMAX) THEN
IMAX=I
AAMAX=DUM
ENDIF
16 CONTINUE
IF (J.NE.IMAX)THEN
DO 17 K=1,N
DUM=A(IMAX,K)
A(IMAX,K)=A(J,K)
A(J,K)=DUM
17 CONTINUE
D=-D
VV(IMAX)=VV(J)
ENDIF
INDX(J)=IMAX
IF(J.NE.N)THEN
IF(A(J,J).EQ.0.)A(J,J)=TINY
DUM=1.d0/A(J,J)
DO 18 I=J+1,N
A(I,J)=A(I,J)*DUM
18 CONTINUE
ENDIF
19 CONTINUE
IF(A(N,N).EQ.0.d0)A(N,N)=TINY
RETURN
END
c.. The LUBKSB routine. Unknown function.
SUBROUTINE LUBKSB(A,N,NP,INDX,B)
implicit real*8 (a-h,o-z)
DIMENSION A(NP,NP),INDX(N),B(N)
II=0
DO 12 I=1,N
LL=INDX(I)
SUM=B(LL)
B(LL)=B(I)
IF (II.NE.0)THEN
DO 11 J=II,I-1
SUM=SUM-A(I,J)*B(J)
11 CONTINUE
ELSE IF (SUM.NE.0.) THEN
II=I
ENDIF
B(I)=SUM
12 CONTINUE
DO 14 I=N,1,-1
SUM=B(I)
IF(I.LT.N)THEN
DO 13 J=I+1,N
SUM=SUM-A(I,J)*B(J)
13 CONTINUE
ENDIF
B(I)=SUM/A(I,I)
14 CONTINUE
RETURN
END
c.. The next subroutine creates the topology
subroutine makeTop(Nat,ibnd,itype,itypeB,icg,tn,resid)
implicit none
integer MxN,MxI
parameter(MxN=200,MxI=10*MxN)
integer Nat,ibnd(3,MxN),itype(MxN),itypeB(MxN),icg(MxN)
integer n1,n2,n3
integer i,j,k,L,ni,nbonds,nangles,ntorsions
integer Neigh(0:5,MxN)
integer Mbnd(2,MxI), Mang(3,MxI), Mtor(4,MxI)
integer ibt(MxI),iat(MxI),itt(MxI)
real*8 q,tm,cb1(MxI),cb2(MxI),ca1(MxI),ca2(MxI)
real*8 ct1(MxI),ct2(MxI),ct3(MxI),qsum
integer i1,i2,i3,i4,ii,ixbt,ixat,ixtt
integer nnq,nnb,nna,nnt,ixq(10),ixb(10),ixa(10),ixt(10)
real*8 xq(10),xb1(10),xb2(10),xa1(10),xa2(10)
real*8 xt1(10),xt2(10),xt3(10),xm(10)
character*3 tn(MxN),xtn(10)
character*4 resID
character*8 tnb
do i=1,Nat
ni=0
do j=1,Nat
if (i.ne.j.and.(ibnd(1,i).eq.j.or.ibnd(1,j).eq.i)) then
> ni=ni+1
Neigh(ni,i)=j
if (ni.gt.4) then
pause 'error'
stop
endif
endif
enddo
Neigh(0,i)=ni
enddo
c.. the section determines the number of bond, angles,
c.. and torsions to create. This will likely be the most
c.. difficult part to modify to include other atom types.
nbonds=0
nangles=0
ntorsions=0
do i=1,Nat
do n1=1,Neigh(0,i)
j=Neigh(n1,i)
if (j.gt.i) then
nbonds=nbonds+1
Mbnd(1,nbonds)=i
Mbnd(2,nbonds)=j
endif
do n2=1,Neigh(0,j)
k=Neigh(n2,j)
if (k.ne.i) then
if (k.gt.i) then
nangles=nangles+1
Mang(1,nangles)=i
Mang(2,nangles)=j
Mang(3,nangles)=k
endif
do n3=1,Neigh(0,k)
L=Neigh(n3,k)
if (L.ne.j) then
if (L.gt.i) then
ntorsions=ntorsions+1
Mtor(1,ntorsions)=i
Mtor(2,ntorsions)=j
Mtor(3,ntorsions)=k
Mtor(4,ntorsions)=L
endif
endif !L.ne.j
enddo !L
endif !k.ne.i
enddo !k
enddo !j
enddo !i
write(34,*) '[ moleculetype ]'
write(34,108) resID,3
write(34,*)
write(34,*) '[ atoms ]'
do i=1,Nat
c.. more atom types will need to be added here
c.. for polyethers, polyfluoroalkanes, etc.
c.. correlating each of the atom types, previously named,
c.. to a specific opls-aa parameterization
c.. this inserts the Coulombic constants for the force
c.. field parameterizations
if (tn(i).eq.'CH3') then
tnb='opls_135'
q= -0.18
tm= 12.011
else if (tn(i).eq.'CH2') then
tnb='opls_136'
q= -0.12
tm= 12.011
else if (tn(i).eq.'CH1') then
tnb='opls_137'
q= -0.06
tm= 12.011
else if (tn(i).eq.' H') then
tnb='opls_140'
q= +0.06
tm= 1.008
else if (tn(i).eq.'CC4') then
tnb='opls_139'
q= +0.00
tm= 12.011
else
write(*,*) 'problem with atom assignment'
pause
endif
c. Writing out the generated information to the file
write(34,1011) i, tnb,1,resID, tn(i), icg(i),q,tm
enddo
write(34,*)
write(34,*) '[ bonds ]'
do i=1,nbonds
ibt(i)=1
write(34,102) Mbnd(1,i),Mbnd(2,i),ibt(i)
enddo
write(34,*)
write(34,*) '[ pairs ]'
do i=1,ntorsions
ibt(i)=1
write(34,102) Mtor(1,i),Mtor(4,i),ibt(i)
enddo
write(34,*)
write(34,*) '[ angles ]'
do i=1,nangles
iat(i)=1
write(34,103) Mang(1,i),Mang(2,i),Mang(3,i),
$ iat(i)
> enddo
write(34,*)
write(34,*) '[ dihedrals ]'
do i=1,ntorsions
itt(i)=3
write(34,104) Mtor(1,i),Mtor(2,i),Mtor(3,i),Mtor(4,i),
$ itt(i)
> enddo
c.. what is the role of line 1011? The only differences from
>c.. line 101 is in the second and third entries.
c.. line of the code that calls 101.
c.. 102 is pairs formatting
c.. 103 is angles formatting
c.. 104 is dihedrals formatting
c.. 108 is molecule type formatting
101 format(i6,8x,a3,i7,3x,a4,4x,a3,i7,f11.3,f11.3)
1011 format(i6,7x,a8,i7,3x,a4,4x,a3,i7,f11.3,f11.3)
102 format(3i6,2e13.4)
103 format(4i6,2e13.4)
104 format(5i6,2e13.4,i7)
108 format(a4,i6)
close(15)
return
end
PE12
38
1 0.d0 0.d0 0.d0 0 0 0 3 1
2 1.52d0 109.d0 0.d0 1 0 0 2 2
3 1.52d0 109.d0 180.d0 2 1 0 2 3
4 1.52d0 109.d0 180.d0 3 2 1 2 4
5 1.52d0 109.d0 180.d0 4 3 2 2 5
6 1.52d0 109.d0 180.d0 5 4 3 2 6
7 1.52d0 109.d0 180.d0 6 5 4 2 7
8 1.52d0 109.d0 180.d0 7 6 5 2 8
9 1.52d0 109.d0 180.d0 8 7 6 2 9
10 1.52d0 109.d0 180.d0 9 8 7 2 10
11 1.52d0 109.d0 180.d0 10 9 8 2 11
12 1.52d0 109.d0 180.d0 11 10 9 3 12
13 1.00d0 109.d0 60.d0 3 2 1 4 3
14 1.00d0 109.d0 -60.d0 3 2 1 4 3
15 1.00d0 109.d0 60.d0 4 3 2 4 4
16 1.00d0 109.d0 -60.d0 4 3 2 4 4
17 1.00d0 109.d0 60.d0 5 4 3 4 5
18 1.00d0 109.d0 -60.d0 5 4 3 4 5
19 1.00d0 109.d0 60.d0 6 5 4 4 6
20 1.00d0 109.d0 -60.d0 6 5 4 4 6
21 1.00d0 109.d0 60.d0 7 6 5 4 7
22 1.00d0 109.d0 -60.d0 7 6 5 4 7
23 1.00d0 109.d0 60.d0 8 7 6 4 8
24 1.00d0 109.d0 -60.d0 8 7 6 4 8
25 1.00d0 109.d0 60.d0 9 8 7 4 9
26 1.00d0 109.d0 -60.d0 9 8 7 4 9
27 1.00d0 109.d0 60.d0 10 9 8 4 10
28 1.00d0 109.d0 -60.d0 10 9 8 4 10
29 1.00d0 109.d0 60.d0 11 10 9 4 11
30 1.00d0 109.d0 -60.d0 11 10 9 4 11
31 1.00d0 109.d0 60.d0 12 11 10 4 12
32 1.00d0 109.d0 -60.d0 12 11 10 4 12
33 1.00d0 109.d0 60.d0 1 2 3 4 1
34 1.00d0 109.d0 -60.d0 1 2 3 4 1
35 1.00d0 109.d0 -60.d0 2 3 4 4 2
36 1.00d0 109.d0 +60.d0 2 3 4 4 2
37 1.00d0 109.d0 180.d0 1 2 3 4 1
38 1.00d0 109.d0 180.d0 12 11 10 4 12
PE14
44
1 0.d0 0.d0 0.d0 0 0 0 3 1
2 1.52d0 109.d0 0.d0 1 0 0 2 2
3 1.52d0 109.d0 180.d0 2 1 0 2 3
4 1.52d0 109.d0 180.d0 3 2 1 2 4
5 1.52d0 109.d0 180.d0 4 3 2 2 5
6 1.52d0 109.d0 180.d0 5 4 3 2 6
7 1.52d0 109.d0 180.d0 6 5 4 2 7
8 1.52d0 109.d0 180.d0 7 6 5 2 8
9 1.52d0 109.d0 180.d0 8 7 6 2 9
10 1.52d0 109.d0 180.d0 9 8 7 2 10
11 1.52d0 109.d0 180.d0 10 9 8 2 11
12 1.52d0 109.d0 180.d0 11 10 9 2 12
13 1.52d0 109.d0 180.d0 12 11 10 2 13
14 1.00d0 109.d0 180.d0 13 12 11 3 14
15 1.00d0 109.d0 -60.d0 3 2 1 4 3
16 1.00d0 109.d0 +60.d0 3 2 1 4 3
17 1.00d0 109.d0 -60.d0 4 3 2 4 4
18 1.00d0 109.d0 +60.d0 4 3 2 4 4
19 1.00d0 109.d0 +60.d0 5 4 3 4 5
20 1.00d0 109.d0 -60.d0 5 4 3 4 5
21 1.00d0 109.d0 +60.d0 6 5 4 4 6
22 1.00d0 109.d0 -60.d0 6 5 4 4 6
23 1.00d0 109.d0 +60.d0 7 6 5 4 7
24 1.00d0 109.d0 -60.d0 7 6 5 4 7
25 1.00d0 109.d0 +60.d0 8 7 6 4 8
26 1.00d0 109.d0 -60.d0 8 7 6 4 8
27 1.00d0 109.d0 60.d0 9 8 7 4 9
28 1.00d0 109.d0 -60.d0 9 8 7 4 9
29 1.00d0 109.d0 -60.d0 10 9 8 4 10
30 1.00d0 109.d0 +60.d0 10 9 8 4 10
31 1.00d0 109.d0 +60.d0 11 10 9 4 11
32 1.00d0 109.d0 -60.d0 11 10 9 4 11
33 1.00d0 109.d0 60.d0 12 11 10 4 12
34 1.00d0 109.d0 -60.d0 12 11 10 4 12
35 1.00d0 109.d0 -60.d0 13 12 11 4 13
36 1.00d0 109.d0 +60.d0 13 12 11 4 13
37 1.00d0 109.d0 -60.d0 14 13 12 4 14
38 1.00d0 109.d0 +60.d0 14 13 12 4 14
39 1.00d0 109.d0 +60.d0 1 2 3 4 1
40 1.00d0 109.d0 -60.d0 1 2 3 4 1
41 1.00d0 109.d0 -60.d0 2 3 4 4 2
42 1.00d0 109.d0 +60.d0 2 3 4 4 2
43 1.00d0 109.d0 180.d0 1 2 3 4 1
44 1.00d0 109.d0 180.d0 14 13 12 4 14
PE18
56
1 0.d0 0.d0 0.d0 0 0 0 3 1
2 1.52d0 109.d0 0.d0 1 0 0 2 2
3 1.52d0 109.d0 180.d0 2 1 0 2 3
4 1.52d0 109.d0 180.d0 3 2 1 2 4
5 1.52d0 109.d0 180.d0 4 3 2 2 5
6 1.52d0 109.d0 180.d0 5 4 3 2 6
7 1.52d0 109.d0 180.d0 6 5 4 2 7
8 1.52d0 109.d0 180.d0 7 6 5 2 8
9 1.52d0 109.d0 180.d0 8 7 6 2 9
10 1.52d0 109.d0 180.d0 9 8 7 2 10
11 1.52d0 109.d0 180.d0 10 9 8 2 11
12 1.52d0 109.d0 180.d0 11 10 9 2 12
13 1.52d0 109.d0 180.d0 12 11 10 2 13
14 1.52d0 109.d0 180.d0 13 12 11 2 14
15 1.52d0 109.d0 180.d0 14 13 12 2 15
16 1.52d0 109.d0 180.d0 15 14 13 2 16
17 1.52d0 109.d0 180.d0 16 15 14 2 17
18 1.52d0 109.d0 180.d0 17 16 15 2 18
19 1.00d0 109.d0 60.d0 3 2 1 4 3
20 1.00d0 109.d0 -60.d0 3 2 1 4 3
21 1.00d0 109.d0 60.d0 4 3 2 4 4
22 1.00d0 109.d0 -60.d0 4 3 2 4 4
23 1.00d0 109.d0 60.d0 5 4 3 4 5
24 1.00d0 109.d0 -60.d0 5 4 3 4 5
25 1.00d0 109.d0 60.d0 6 5 4 4 6
26 1.00d0 109.d0 -60.d0 6 5 4 4 6
27 1.00d0 109.d0 60.d0 7 6 5 4 7
28 1.00d0 109.d0 -60.d0 7 6 5 4 7
29 1.00d0 109.d0 60.d0 8 7 6 4 8
30 1.00d0 109.d0 -60.d0 8 7 6 4 8
31 1.00d0 109.d0 60.d0 9 8 7 4 9
32 1.00d0 109.d0 -60.d0 9 8 7 4 9
33 1.00d0 109.d0 60.d0 10 9 8 4 10
34 1.00d0 109.d0 -60.d0 10 9 8 4 10
35 1.00d0 109.d0 +60.d0 11 10 9 4 11
36 1.00d0 109.d0 -60.d0 11 10 9 4 11
37 1.00d0 109.d0 +60.d0 12 11 10 4 12
38 1.00d0 109.d0 -60.d0 12 11 10 4 12
39 1.00d0 109.d0 +60.d0 13 12 11 4 13
40 1.00d0 109.d0 -60.d0 13 12 11 4 13
41 1.00d0 109.d0 60.d0 14 13 12 4 14
42 1.00d0 109.d0 -60.d0 14 13 12 4 14
43 1.00d0 109.d0 +60.d0 15 14 13 4 15
44 1.00d0 109.d0 -60.d0 15 14 13 4 15
45 1.00d0 109.d0 +60.d0 16 15 14 4 16
46 1.00d0 109.d0 -60.d0 16 15 14 4 16
47 1.00d0 109.d0 60.d0 17 16 15 4 17
48 1.00d0 109.d0 -60.d0 17 16 15 4 17
49 1.00d0 109.d0 +60.d0 18 17 16 4 18
50 1.00d0 109.d0 -60.d0 18 17 16 4 18
51 1.00d0 109.d0 180.d0 1 2 3 4 1
52 1.00d0 109.d0 -60.d0 1 2 3 4 1
53 1.00d0 109.d0 60.d0 2 3 4 4 2
54 1.00d0 109.d0 -60.d0 2 3 4 4 2
55 1.00d0 109.d0 +60.d0 1 2 3 4 1
56 1.00d0 109.d0 180.d0 18 17 16 4 18
PE24
74
1 0.d0 0.d0 0.d0 0 0 0 3 1
2 1.52d0 109.d0 0.d0 1 0 0 2 2
3 1.52d0 109.d0 180.d0 2 1 0 2 3
4 1.52d0 109.d0 180.d0 3 2 1 2 4
5 1.52d0 109.d0 180.d0 4 3 2 2 5
6 1.52d0 109.d0 180.d0 5 4 3 2 6
7 1.52d0 109.d0 180.d0 6 5 4 2 7
8 1.52d0 109.d0 180.d0 7 6 5 2 8
9 1.52d0 109.d0 180.d0 8 7 6 2 9
10 1.52d0 109.d0 180.d0 9 8 7 2 10
11 1.52d0 109.d0 180.d0 10 9 8 2 11
12 1.52d0 109.d0 180.d0 11 10 9 2 12
13 1.52d0 109.d0 180.d0 12 11 10 2 13
14 1.52d0 109.d0 180.d0 13 12 11 2 14
15 1.52d0 109.d0 180.d0 14 13 12 2 15
16 1.52d0 109.d0 180.d0 15 14 13 2 16
17 1.52d0 109.d0 180.d0 16 15 14 2 17
18 1.52d0 109.d0 180.d0 17 16 15 2 18
19 1.52d0 109.d0 180.d0 18 17 16 2 19
20 1.52d0 109.d0 180.d0 19 18 17 2 20
21 1.52d0 109.d0 180.d0 20 19 18 2 21
22 1.52d0 109.d0 180.d0 21 20 19 2 22
23 1.52d0 109.d0 180.d0 22 21 20 2 23
24 1.52d0 109.d0 180.d0 23 22 21 3 24
25 1.00d0 109.d0 +60.d0 3 2 1 4 3
26 1.00d0 109.d0 -60.d0 3 2 1 4 3