1 C------------------------------------------------------------------------------
2 C Set of diagnostic routines for checking cumulant terms by numerical
3 C integration. They are not required unless new correlation terms need
5 C------------------------------------------------------------------------------
6 subroutine checkint3(i,j,mu1,mu2,a22,a23,a32,a33,acipa,
8 C Calculate third-order correlation terms by numerical integration.
9 implicit real*8 (a-h,o-z)
11 include 'COMMON.IOUNITS'
14 include 'COMMON.LOCAL'
15 include 'COMMON.CHAIN'
16 include 'COMMON.DERIV'
17 include 'COMMON.INTERACT'
18 include 'COMMON.CONTACTS'
19 include 'COMMON.TORSION'
20 include 'COMMON.VECTORS'
21 include 'COMMON.FFIELD'
22 ! real*8 mu(2,maxres),muder(2,maxres),
23 ! & muij(4),mu1(2,maxres),mu2(2,maxres),auxvec(2)
24 real*8 muij(4),auxvec(2)
27 eel_loc_1=a22*b1(1,iti)*b1(1,itj)+a23*b1(1,iti)*b1(2,itj)+
28 & a32*b1(2,iti)*b1(1,itj)+a33*b1(2,iti)*b1(2,itj)
29 eel_loc_2=a22*b1(1,iti)*Ub2(1,j)+a23*b1(1,iti)*Ub2(2,j)+
30 & a32*b1(2,iti)*Ub2(1,j)+a33*b1(2,iti)*Ub2(2,j)
31 eel_loc_3=a22*Ub2(1,i)*b1(1,itj)+a23*Ub2(1,i)*b1(2,itj)+
32 & a32*Ub2(2,i)*b1(1,itj)+a33*Ub2(2,i)*b1(2,itj)
33 eel_loc_4=a22*Ub2(1,i)*Ub2(1,j)+a23*Ub2(1,i)*Ub2(2,j)+
34 & a32*Ub2(2,i)*Ub2(1,j)+a33*Ub2(2,i)*Ub2(2,j)
35 if (i.gt.iatel_s) then
36 iti1=itortyp(itype(i))
40 iti2=itortyp(itype(i+1))
41 itj1=itortyp(itype(j))
42 if (j.lt.iatel_e+2) then
43 itj2=itortyp(itype(j+1))
48 call integral3(phi(i+2),phi(j+2),iti1,iti2,itj1,itj2,
49 & acipa,.false.,eel_1,eel_2,eel_3,eel_4)
51 call integral3(phi(i+2),phi(j+2),iti1,iti2,itj1,itj2,
52 & acipa,.true.,eel_1,eel_2,eel_3,eel_4)
54 cd write (iout,*) 'eel_1',eel_loc_1,' eel_1_num',4*eel_1
55 cd write (iout,*) 'eel_2',eel_loc_2,' eel_2_num',4*eel_2
56 cd write (iout,*) 'eel_3',eel_loc_3,' eel_3_num',4*eel_3
57 cd write (iout,*) 'eel_4',eel_loc_4,' eel_4_num',4*eel_4
58 write (iout,*) 'eel',eel_loc_ij,' eel_num',
59 &4*(eel_1+eel_2+eel_3+eel_4)
62 c----------------------------------------------------------------------
63 subroutine checkint4(i,j,k,l,jj,kk,eel4_num)
64 c Calculate fourth-order correlation terms by numerical integration.
65 implicit real*8 (a-h,o-z)
67 include 'COMMON.IOUNITS'
68 include 'COMMON.CHAIN'
69 include 'COMMON.DERIV'
70 include 'COMMON.INTERACT'
71 include 'COMMON.CONTACTS'
72 include 'COMMON.TORSION'
75 double precision gx(3),gx1(3)
76 double precision ee1t(2,2),ee2t(2,2),ee1ta1(2,2),ee2ta2(2,2),
77 & ee1ta1_der(2,2,3,5),ee2ta2_der(2,2,3,5),aa1(2,2),aa2(2,2),
78 & aa2t(2,2),uugk(2,2),uugl(2,2),uugj(2,2),pizda(2,2)
79 itk = itortyp(itype(k))
81 C Copy dipole matrices to temporary arrays
84 aa1(iii,jjj)=a_chuj(iii,jjj,jj,i)
85 aa2(iii,jjj)=a_chuj(iii,jjj,kk,k)
88 C Apply inverse transformation
90 aa1(1,iii)=-aa1(1,iii)
94 aa1(iii,1)=-aa1(iii,1)
99 aa1(iii,jjj)=-aa1(iii,jjj)
103 if (k.lt.nres-1) then
105 aa2(1,iii)=-aa2(1,iii)
110 aa2(iii,jjj)=-aa2(iii,jjj)
114 if (l.lt.nres-1) then
116 aa2(iii,1)=-aa2(iii,1)
121 aa2(iii,jjj)=-aa2(iii,jjj)
126 itl = itortyp(itype(l))
127 c Compute numerical integrals
128 print *,phi(k+2),phi(l+2),itk,itl
129 if (l.lt.nres-1) then
130 cd write(2,*)'1 ',itk,itl,a_chuj(:,:,jj,i),a_chuj(:,:,kk,k)
131 c call integral(0.0d0,0.0d0,itk,itl,aa1(1,1),
132 c & aa2(1,1),1.0d0,1.0d0,-1.0d0,-1.0d0,.false.,eel4_num)
133 call integral(0.0d0,phi(k+2)-pi,0.0d0,phi(l+2)-pi,itk,itl,
135 & 1.0d0,-1.0d0,1.0d0,-1.0d0,.false.,eel4_num)
137 cd write(2,*)'2 ',itk,itl,a_chuj(:,:,jj,i),a_chuj(:,:,kk,k)
138 c call integral(0.0d0,0.0d0,itk,itl,aa1(1,1),
139 c & aa2(1,1),1.0d0,1.0d0,1.0d0,1.0d0,.false.,eel4_num)
140 call integral(0.0d0,phi(k+2)-pi,0.0d0,0.0d0,itk,itl,
142 & 1.0d0,-1.0d0,1.0d0,-1.0d0,.false.,eel4_num)
145 itl = itortyp(itype(j))
146 if (j.lt.nres-1) then
147 call integral(0.0d0,phi(k+2)-pi,phi(j+2)-pi,0.0d0,itk,itl,
148 & aa1(1,1),aa2(1,1),1.0d0,-1.0d0,-1.0d0,1.0d0,.true.,eel4_num)
150 call integral(0.0d0,phi(k+2)-pi,0.0d0,0.0d0,itk,itl,aa1(1,1),
151 & aa2(1,1),1.0d0,-1.0d0,-1.0d0,1.0d0,.true.,eel4_num)
157 c-----------------------------------------------------------------------------
158 subroutine checkint5(i,j,k,l,jj,kk,eel5_1_num,eel5_2_num,
159 & eel5_3_num,eel5_4_num)
160 c Calculate fifth-order correlation terms by numerical integration.
161 implicit real*8 (a-h,o-z)
163 include 'COMMON.IOUNITS'
164 include 'COMMON.CHAIN'
165 include 'COMMON.DERIV'
166 include 'COMMON.INTERACT'
167 include 'COMMON.CONTACTS'
168 include 'COMMON.TORSION'
171 double precision gx(3),gx1(3)
172 double precision ee1t(2,2),ee2t(2,2),ee1ta1(2,2),ee2ta2(2,2),
173 & ee1ta1_der(2,2,3,5),ee2ta2_der(2,2,3,5),aa1(2,2),aa2(2,2),
174 & aa2t(2,2),uugk(2,2),uugl(2,2),uugj(2,2),pizda(2,2)
175 iti = itortyp(itype(i))
176 itk = itortyp(itype(k))
177 itk1= itortyp(itype(k+1))
179 C Copy dipole matrices to temporary arrays
182 aa1(iii,jjj)=a_chuj(iii,jjj,jj,i)
183 aa2(iii,jjj)=a_chuj(iii,jjj,kk,k)
186 C Apply inverse transformation
188 aa1(1,iii)=-aa1(1,iii)
190 if (j.lt.nres-1) then
192 aa1(iii,1)=-aa1(iii,1)
197 aa1(iii,jjj)=-aa1(iii,jjj)
201 if (k.lt.nres-1) then
203 aa2(1,iii)=-aa2(1,iii)
208 aa2(iii,jjj)=-aa2(iii,jjj)
212 if (l.lt.nres-1) then
214 aa2(iii,1)=-aa2(iii,1)
219 aa2(iii,jjj)=-aa2(iii,jjj)
228 itj = itortyp(itype(j))
229 itl = itortyp(itype(l))
230 itl1= itortyp(itype(l+1))
231 c Compute numerical integrals
232 if (l.lt.nres-1) then
234 call integral5(phi(i+2),phi(k+2),phi(j+2),phi(l+2),
235 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
236 & 1,1,1,1,.false.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
238 call integral5(phi(i+2),phi(k+2),phi(j+2),phi(l+2),
239 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
240 & -1,1,1,1,.false.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
244 call integral5(phi(i+2),phi(k+2),phi(j+2),pi,
245 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
246 & 1,1,1,-1,.false.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
248 call integral5(phi(i+2),phi(k+2),phi(j+2),pi,
249 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
250 & -1,1,1,-1,.false.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
254 itj = itortyp(itype(j))
255 itl = itortyp(itype(l))
256 itj1= itortyp(itype(j+1))
257 if (j.lt.nres-1) then
259 call integral5(phi(i+2),phi(k+2),phi(l+2),phi(j+2),
260 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
261 & 1,1,1,1,.true.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
263 call integral5(phi(i+2),phi(k+2),phi(l+2),phi(j+2),
264 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
265 & -1,1,1,1,.true.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
269 call integral5(phi(i+2),phi(k+2),phi(l+2),pi,
270 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
271 & 1,1,1,-1,.true.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
273 call integral5(phi(i+2),phi(k+2),phi(l+2),pi,
274 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
275 & -1,1,1,-1,.true.,eel5_1_num,eel5_2_num,eel5_3_num,eel5_4_num)
282 c-----------------------------------------------------------------------------
283 subroutine checkint6(i,j,k,l,jj,kk,eel6_1_num,eel6_2_num,
284 & eel6_3_num,eel6_4_num,eel6_5_num,eel6_6_num)
285 c Calculate sixth-order correlation terms by numerical integration.
286 implicit real*8 (a-h,o-z)
288 include 'COMMON.IOUNITS'
289 include 'COMMON.CHAIN'
290 include 'COMMON.DERIV'
291 include 'COMMON.INTERACT'
292 include 'COMMON.CONTACTS'
293 include 'COMMON.TORSION'
296 double precision gx(3),gx1(3)
297 double precision ee1t(2,2),ee2t(2,2),ee1ta1(2,2),ee2ta2(2,2),
298 & ee1ta1_der(2,2,3,5),ee2ta2_der(2,2,3,5),aa1(2,2),aa2(2,2),
299 & aa2t(2,2),uugk(2,2),uugl(2,2),uugj(2,2),pizda(2,2)
300 iti = itortyp(itype(i))
301 itk = itortyp(itype(k))
302 itk1= itortyp(itype(k+1))
304 C Copy dipole matrices to temporary arrays
307 aa1(iii,jjj)=a_chuj(iii,jjj,jj,i)
308 aa2(iii,jjj)=a_chuj(iii,jjj,kk,k)
311 C Apply inverse transformation
313 aa1(1,iii)=-aa1(1,iii)
315 if (j.lt.nres-1) then
317 aa1(iii,1)=-aa1(iii,1)
322 aa1(iii,jjj)=-aa1(iii,jjj)
326 if (k.lt.nres-1) then
328 aa2(1,iii)=-aa2(1,iii)
333 aa2(iii,jjj)=-aa2(iii,jjj)
337 if (l.lt.nres-1) then
339 aa2(iii,1)=-aa2(iii,1)
344 aa2(iii,jjj)=-aa2(iii,jjj)
355 itj = itortyp(itype(j))
356 itl = itortyp(itype(l))
357 itl1= itortyp(itype(l+1))
358 c Compute numerical integrals
359 if (l.lt.nres-1) then
361 call integral6(phi(i+2),phi(k+2),phi(j+2),phi(l+2),
362 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
363 & 1,1,1,1,.false.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
364 & eel6_5_num,eel6_6_num)
366 call integral6(phi(i+2),phi(k+2),phi(j+2),phi(l+2),
367 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
368 & -1,1,1,1,.false.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
369 & eel6_5_num,eel6_6_num)
373 call integral6(phi(i+2),phi(k+2),phi(j+2),pi,
374 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
375 & 1,1,1,-1,.false.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
376 & eel6_5_num,eel6_6_num)
378 call integral6(phi(i+2),phi(k+2),phi(j+2),pi,
379 & iti,itk,itk1,itj,itl,itl1,aa1(1,1),aa2(1,1),
380 & -1,1,1,-1,.false.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
381 & eel6_5_num,eel6_6_num)
385 itj = itortyp(itype(j))
386 itl = itortyp(itype(l))
387 itj1= itortyp(itype(j+1))
388 if (j.lt.nres-1) then
390 call integral6(phi(i+2),phi(k+2),phi(l+2),phi(j+2),
391 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
392 & 1,1,1,1,.true.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
393 & eel6_5_num,eel6_6_num)
395 call integral6(phi(i+2),phi(k+2),phi(l+2),phi(j+2),
396 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
397 & -1,1,1,1,.true.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
398 & eel6_5_num,eel6_6_num)
402 call integral6(phi(i+2),phi(k+2),phi(l+2),pi,
403 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
404 & 1,1,1,-1,.true.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
405 & eel6_5_num,eel6_6_num)
407 call integral6(phi(i+2),phi(k+2),phi(l+2),pi,
408 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),
409 & -1,1,1,-1,.true.,eel6_1_num,eel6_2_num,eel6_3_num,eel6_4_num,
410 & eel6_5_num,eel6_6_num)
417 c-----------------------------------------------------------------------------
418 subroutine checkint_turn6(i,jj,kk,eel_turn6_num)
419 c Calculate sixth-order turn correlation terms by numerical integration.
420 implicit real*8 (a-h,o-z)
422 include 'COMMON.IOUNITS'
423 include 'COMMON.CHAIN'
424 include 'COMMON.DERIV'
425 include 'COMMON.INTERACT'
426 include 'COMMON.CONTACTS'
427 include 'COMMON.TORSION'
430 double precision gx(3),gx1(3)
431 double precision ee1t(2,2),ee2t(2,2),ee1ta1(2,2),ee2ta2(2,2),
432 & ee1ta1_der(2,2,3,5),ee2ta2_der(2,2,3,5),aa1(2,2),aa2(2,2),
433 & aa2t(2,2),uugk(2,2),uugl(2,2),uugj(2,2),pizda(2,2)
437 iti = itortyp(itype(i))
438 itk = itortyp(itype(k))
439 itk1= itortyp(itype(k+1))
441 C Copy dipole matrices to temporary arrays
444 aa1(iii,jjj)=a_chuj(iii,jjj,jj,i)
445 aa2(iii,jjj)=a_chuj(iii,jjj,kk,k)
448 C Apply inverse transformation
450 aa1(1,iii)=-aa1(1,iii)
452 if (j.lt.nres-1) then
454 aa1(iii,1)=-aa1(iii,1)
459 aa1(iii,jjj)=-aa1(iii,jjj)
463 if (k.lt.nres-1) then
465 aa2(1,iii)=-aa2(1,iii)
470 aa2(iii,jjj)=-aa2(iii,jjj)
474 if (l.lt.nres-1) then
476 aa2(iii,1)=-aa2(iii,1)
481 aa2(iii,jjj)=-aa2(iii,jjj)
486 itj = itortyp(itype(j))
487 itl = itortyp(itype(l))
488 itj1= itortyp(itype(j+1))
489 call integral_turn6(phi(i+2),phi(i+3),phi(i+4),phi(i+5),
490 & iti,itk,itk1,itl,itj,itj1,aa1(1,1),aa2(1,1),eel_turn6_num)
491 write (2,*) 'eel_turn6_num',eel_turn6_num
495 c-----------------------------------------------------------------------------
496 subroutine checkint_turn3(i,a_temp,eel_turn3_num)
497 implicit real*8 (a-h,o-z)
499 c Calculate third-order turn correlation terms by numerical integration.
500 include 'COMMON.IOUNITS'
501 include 'COMMON.CHAIN'
502 include 'COMMON.DERIV'
503 include 'COMMON.INTERACT'
504 include 'COMMON.CONTACTS'
505 include 'COMMON.TORSION'
508 double precision a_temp(2,2),aa1(2,2)
509 iti1 = itortyp(itype(i+1))
510 iti2 = itortyp(itype(i+2))
512 C Apply inverse transformation
515 aa1(iii,jjj)=a_temp(iii,jjj)
519 aa1(1,iii)=-aa1(1,iii)
521 if (i.lt.nres-3) then
523 aa1(iii,1)=-aa1(iii,1)
528 aa1(iii,jjj)=-aa1(iii,jjj)
533 c Compute numerical integrals
534 if (i.lt.nres-3) then
535 call integral3a(phi(i+3),phi(i+4),iti1,iti2,
536 & aa1(1,1), 1,eel_turn3_num)
538 call integral3a(phi(i+3),phi(i+4),iti1,iti2,
539 & aa1(1,1),-1,eel_turn3_num)
544 c-----------------------------------------------------------------------------
545 subroutine checkint_turn4(i,a_temp,eel_turn4_num)
546 c Calculate fourth-order turn correlation terms by numerical integration.
547 implicit real*8 (a-h,o-z)
549 include 'COMMON.IOUNITS'
550 include 'COMMON.CHAIN'
551 include 'COMMON.DERIV'
552 include 'COMMON.INTERACT'
553 include 'COMMON.CONTACTS'
554 include 'COMMON.TORSION'
557 double precision a_temp(2,2),aa1(2,2)
558 iti1 = itortyp(itype(i+1))
559 iti2 = itortyp(itype(i+2))
560 iti3 = itortyp(itype(i+3))
562 C Apply inverse transformation
565 aa1(iii,jjj)=a_temp(iii,jjj)
569 aa1(1,iii)=-aa1(1,iii)
571 if (i.lt.nres-4) then
573 aa1(iii,1)=-aa1(iii,1)
578 aa1(iii,jjj)=-aa1(iii,jjj)
583 c Compute numerical integrals
584 if (i.lt.nres-4) then
585 call integral4a(phi(i+3),phi(i+4),phi(i+5),
586 & iti1,iti2,iti3,aa1(1,1),1,eel_turn4_num)
588 call integral4a(phi(i+3),phi(i+4),phi(i+5),
589 & iti1,iti2,iti3,aa1(1,1),-1,eel_turn4_num)