1 subroutine make_SCSC_inter_list
8 include "COMMON.CONTROL"
10 include "COMMON.INTERACT"
11 include "COMMON.SPLITELE"
12 include "COMMON.IOUNITS"
13 double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe,
14 & xj_temp,yj_temp,zj_temp
15 double precision dist_init, dist_temp,r_buff_list
16 integer contlisti(maxint_res*maxres),contlistj(maxint_res*maxres)
17 ! integer :: newcontlisti(200*nres),newcontlistj(200*nres)
18 integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint,
20 integer displ(0:max_fg_procs),i_ilist_sc(0:max_fg_procs),ierr
21 logical lprn /.false./
22 ! print *,"START make_SC"
24 write (iout,*) "make_SCSC_inter_list maxint_res",maxint_res
30 if (itypi.eq.ntyp1) cycle
35 if (xi.lt.0) xi=xi+boxxsize
37 if (yi.lt.0) yi=yi+boxysize
39 if (zi.lt.0) zi=zi+boxzsize
41 do j=istart(i,iint),iend(i,iint)
43 if (itypj.eq.ntyp1) cycle
48 if (xj.lt.0) xj=xj+boxxsize
50 if (yj.lt.0) yj=yj+boxysize
52 if (zj.lt.0) zj=zj+boxzsize
53 dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
61 xj=xj_safe+xshift*boxxsize
62 yj=yj_safe+yshift*boxysize
63 zj=zj_safe+zshift*boxzsize
64 dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
65 if(dist_temp.lt.dist_init) then
75 if (subchap.eq.1) then
84 ! r_buff_list is a read value for a buffer
85 if (dsqrt(dist_init).le.(r_cut_int+r_buff_list)) then
86 ! Here the list is created
88 ! this can be substituted by cantor and anti-cantor
96 ! call MPI_Reduce(ilist_sc,g_ilist_sc,1,&
97 ! MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR)
98 ! call MPI_Gather(newnss,1,MPI_INTEGER,&
99 ! i_newnss,1,MPI_INTEGER,king,FG_COMM,IERR)
102 write (iout,*) "before MPIREDUCE",ilist_sc
104 write (iout,*) i,contlisti(i),contlistj(i)
107 if (nfgtasks.gt.1)then
109 call MPI_Reduce(ilist_sc,g_ilist_sc,1,
110 & MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR)
111 c write (iout,*) "SCSC after reduce ierr",ierr
112 if (fg_rank.eq.0.and.g_ilist_sc.gt.maxres*maxint_res) then
113 if ((me.eq.king.or.out1file).and.energy_dec) then
114 write (iout,*) "Too many SCSC interactions",
115 & g_ilist_sc," only",maxres*maxint_res," allowed."
116 write (iout,*) "Reduce r_cut_int and resubmit"
117 write (iout,*) "Specify a smaller r_cut_int and resubmit"
120 write (*,*) "Processor:",me,": Too many SCSC interactions",
121 & g_ilist_sc," only",maxres*maxint_res," allowed."
122 write (iout,*) "Reduce r_cut_int and resubmit"
123 write (iout,*) "Specify a smaller r_cut_int and resubmit"
124 call MPI_Abort(MPI_COMM_WORLD,ierr)
126 c write(iout,*) "before bcast",g_ilist_sc
127 call MPI_Gather(ilist_sc,1,MPI_INTEGER,
128 & i_ilist_sc,1,MPI_INTEGER,king,FG_COMM,IERR)
129 c write (iout,*) "SCSC after gather ierr",ierr
132 displ(i)=i_ilist_sc(i-1)+displ(i-1)
134 ! write(iout,*) "before gather",displ(0),displ(1)
135 call MPI_Gatherv(contlisti,ilist_sc,MPI_INTEGER,
136 & newcontlisti,i_ilist_sc,displ,MPI_INTEGER,
138 c write (iout,*) "SCSC after gatherv ierr",ierr
139 call MPI_Gatherv(contlistj,ilist_sc,MPI_INTEGER,
140 & newcontlistj,i_ilist_sc,displ,MPI_INTEGER,
142 call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM,IERR)
143 c write (iout,*) "SCSC bcast reduce ierr",ierr
144 ! write(iout,*) "before bcast",g_ilist_sc
145 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
146 call MPI_Bcast(newcontlisti,g_ilist_sc,MPI_INT,king,FG_COMM,
148 c write (iout,*) "SCSC bcast reduce ierr",ierr
149 call MPI_Bcast(newcontlistj,g_ilist_sc,MPI_INT,king,FG_COMM,
151 c write (iout,*) "SCSC after bcast ierr",ierr
152 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
159 newcontlisti(i)=contlisti(i)
160 newcontlistj(i)=contlistj(i)
165 if (fg_rank.eq.0 .and. (me.eq.king.or.out1file) .and. energy_dec)
166 & write (iout,'(a30,i10,a,i4)') "Number of SC-SC interactions",
167 & g_ilist_sc," per residue on average",g_ilist_sc/nres
169 write (iout,*) "make_SCSC_inter_list: after GATHERV",g_ilist_sc
171 write (iout,*) i,newcontlisti(i),newcontlistj(i)
174 call int_bounds(g_ilist_sc,g_listscsc_start,g_listscsc_end)
177 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
178 subroutine make_SCp_inter_list
183 include "COMMON.SETUP"
185 include "COMMON.CONTROL"
186 include "COMMON.CHAIN"
187 include "COMMON.INTERACT"
188 include "COMMON.SPLITELE"
189 include "COMMON.IOUNITS"
190 double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe,
191 & xj_temp,yj_temp,zj_temp
192 double precision dist_init, dist_temp,r_buff_list
193 integer contlistscpi(2*maxint_res*maxres),
194 & contlistscpj(2*maxint_res*maxres)
195 ! integer :: newcontlistscpi(200*nres),newcontlistscpj(200*nres)
196 integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint,
197 & ilist_scp,g_ilist_scp
198 integer displ(0:max_fg_procs),i_ilist_scp(0:max_fg_procs),ierr
199 c integer contlistscpi_f(2*maxint_res*maxres),
200 c & contlistscpj_f(2*maxint_res*maxres)
201 integer ilist_scp_first,ifirstrun,g_ilist_sc
202 ! print *,"START make_SC"
204 write (iout,*) "make_SCp_inter_list maxint_res",maxint_res
209 do i=iatscp_s,iatscp_e
210 if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1) cycle
211 xi=0.5D0*(c(1,i)+c(1,i+1))
212 yi=0.5D0*(c(2,i)+c(2,i+1))
213 zi=0.5D0*(c(3,i)+c(3,i+1))
215 if (xi.lt.0) xi=xi+boxxsize
217 if (yi.lt.0) yi=yi+boxysize
219 if (zi.lt.0) zi=zi+boxzsize
223 do j=iscpstart(i,iint),iscpend(i,iint)
225 if (itypj.eq.ntyp1) cycle
226 ! Uncomment following three lines for SC-p interactions
230 ! Uncomment following three lines for Ca-p interactions
238 if (xj.lt.0) xj=xj+boxxsize
240 if (yj.lt.0) yj=yj+boxysize
242 if (zj.lt.0) zj=zj+boxzsize
243 dist_init=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
251 xj=xj_safe+xshift*boxxsize
252 yj=yj_safe+yshift*boxysize
253 zj=zj_safe+zshift*boxzsize
254 dist_temp=(xj-xi)**2+(yj-yi)**2+(zj-zi)**2
255 if(dist_temp.lt.dist_init) then
265 if (subchap.eq.1) then
275 ! r_buff_list is a read value for a buffer
276 if((dsqrt(dist_init).le.(r_cut_int)).and.(ifirstrun.eq.0))
278 ! Here the list is created
279 ilist_scp_first=ilist_scp_first+1
280 ! this can be substituted by cantor and anti-cantor
281 contlistscpi_f(ilist_scp_first)=i
282 contlistscpj_f(ilist_scp_first)=j
285 ! r_buff_list is a read value for a buffer
286 if (dsqrt(dist_init).le.(r_cut_int+r_buff_list)) then
287 ! Here the list is created
288 ilist_scp=ilist_scp+1
289 ! this can be substituted by cantor and anti-cantor
290 contlistscpi(ilist_scp)=i
291 contlistscpj(ilist_scp)=j
298 write (iout,*) "before MPIREDUCE",ilist_scp
300 write (iout,*) i,contlistscpi(i),contlistscpj(i)
303 if (nfgtasks.gt.1)then
305 call MPI_Reduce(ilist_scp,g_ilist_scp,1,
306 & MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR)
307 c write (iout,*) "SCp after reduce ierr",ierr
308 if (fg_rank.eq.0.and.g_ilist_scp.gt.2*maxres*maxint_res) then
309 if ((me.eq.king.or.out1file).and.energy_dec) then
310 write (iout,*) "Too many SCp interactions",
311 & g_ilist_scp," only",2*maxres*maxint_res," allowed."
312 write (iout,*) "Specify a smaller r_cut_int and resubmit"
315 write (*,*) "Processor:",me,": Too many SCp interactions",
316 & g_ilist_scp," only",2*maxres*maxint_res," allowed."
317 write (*,*) "Specify a smaller r_cut_int and resubmit"
318 call MPI_Abort(MPI_COMM_WORLD,ierr)
320 c write(iout,*) "before bcast",g_ilist_sc
321 call MPI_Gather(ilist_scp,1,MPI_INTEGER,
322 & i_ilist_scp,1,MPI_INTEGER,king,FG_COMM,IERR)
323 c write (iout,*) "SCp after gather ierr",ierr
326 displ(i)=i_ilist_scp(i-1)+displ(i-1)
328 ! write(iout,*) "before gather",displ(0),displ(1)
329 call MPI_Gatherv(contlistscpi,ilist_scp,MPI_INTEGER,
330 & newcontlistscpi,i_ilist_scp,displ,MPI_INTEGER,
332 c write (iout,*) "SCp after gatherv ierr",ierr
333 call MPI_Gatherv(contlistscpj,ilist_scp,MPI_INTEGER,
334 & newcontlistscpj,i_ilist_scp,displ,MPI_INTEGER,
336 c write (iout,*) "SCp after gatherv ierr",ierr
337 call MPI_Bcast(g_ilist_scp,1,MPI_INT,king,FG_COMM,IERR)
338 c write (iout,*) "SCp after bcast ierr",ierr
339 ! write(iout,*) "before bcast",g_ilist_sc
340 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
341 call MPI_Bcast(newcontlistscpi,g_ilist_scp,MPI_INT,king,FG_COMM,
343 c write (iout,*) "SCp after bcast ierr",ierr
344 call MPI_Bcast(newcontlistscpj,g_ilist_scp,MPI_INT,king,FG_COMM,
346 c write (iout,*) "SCp bcast reduce ierr",ierr
347 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
350 g_ilist_scp=ilist_scp
353 newcontlistscpi(i)=contlistscpi(i)
354 newcontlistscpj(i)=contlistscpj(i)
359 if (fg_rank.eq.0 .and. (me.eq.king.or.out1file) .and. energy_dec)
360 & write (iout,'(a30,i10,a,i4)') "Number of SC-p interactions",
361 & g_ilist_scp," per residue on average",g_ilist_scp/nres
363 write (iout,*) "make_SCp_inter_list: after GATHERV",g_ilist_scp
365 write (iout,*) i,newcontlistscpi(i),newcontlistscpj(i)
368 ! if (ifirstrun.eq.0) ifirstrun=1
369 ! do i=1,ilist_scp_first
371 ! if ((newcontlistscpi(j).eq.contlistscpi_f(i)).and.&
372 ! (newcontlistscpj(j).eq.contlistscpj_f(i))) go to 126
374 ! print *,itime_mat,"ERROR matrix needs updating"
375 ! print *,contlistscpi_f(i),contlistscpj_f(i)
379 call int_bounds(g_ilist_scp,g_listscp_start,g_listscp_end)
383 !-----------------------------------------------------------------------------
384 subroutine make_pp_vdw_inter_list
389 include "COMMON.SETUP"
391 include "COMMON.CONTROL"
392 include "COMMON.CHAIN"
393 include "COMMON.INTERACT"
394 include "COMMON.SPLITELE"
395 include "COMMON.IOUNITS"
396 double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe,
397 & xj_temp,yj_temp,zj_temp
398 double precision xmedj,ymedj,zmedj
399 double precision dist_init, dist_temp,r_buff_list,dxi,dyi,dzi,
401 double precision dx_normi,dy_normi,dz_normi,dxj,dyj,dzj,
402 & dx_normj,dy_normj,dz_normj
403 integer contlistpp_vdwi(maxint_res*maxres),
404 & contlistpp_vdwj(maxint_res*maxres)
405 ! integer :: newcontlistppi(200*nres),newcontlistppj(200*nres)
406 integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint,
407 & ilist_pp_vdw,g_ilist_pp_vdw
408 integer displ(0:max_fg_procs),i_ilist_pp_vdw(0:max_fg_procs),ierr
409 ! print *,"START make_SC"
411 write (iout,*) "make_pp_vdw_inter_list"
415 do i=iatel_s_vdw,iatel_e_vdw
416 if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1) cycle
420 dx_normi=dc_norm(1,i)
421 dy_normi=dc_norm(2,i)
422 dz_normi=dc_norm(3,i)
423 xmedi=c(1,i)+0.5d0*dxi
424 ymedi=c(2,i)+0.5d0*dyi
425 zmedi=c(3,i)+0.5d0*dzi
426 xmedi=dmod(xmedi,boxxsize)
427 if (xmedi.lt.0) xmedi=xmedi+boxxsize
428 ymedi=dmod(ymedi,boxysize)
429 if (ymedi.lt.0) ymedi=ymedi+boxysize
430 zmedi=dmod(zmedi,boxzsize)
431 if (zmedi.lt.0) zmedi=zmedi+boxzsize
432 do j=ielstart_vdw(i),ielend_vdw(i)
433 ! write (iout,*) i,j,itype(i),itype(j)
434 if (itype(j).eq.ntyp1.or. itype(j+1).eq.ntyp1) cycle
440 dx_normj=dc_norm(1,j)
441 dy_normj=dc_norm(2,j)
442 dz_normj=dc_norm(3,j)
443 ! xj=c(1,j)+0.5D0*dxj-xmedi
444 ! yj=c(2,j)+0.5D0*dyj-ymedi
445 ! zj=c(3,j)+0.5D0*dzj-zmedi
450 if (xj.lt.0) xj=xj+boxxsize
452 if (yj.lt.0) yj=yj+boxysize
454 if (zj.lt.0) zj=zj+boxzsize
456 dist_init=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
463 xj=xj_safe+xshift*boxxsize
464 yj=yj_safe+yshift*boxysize
465 zj=zj_safe+zshift*boxzsize
466 dist_temp=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
467 if(dist_temp.lt.dist_init) then
477 if (dsqrt(dist_init).le.(r_cut_int+r_buff_list)) then
478 ! Here the list is created
479 ilist_pp_vdw=ilist_pp_vdw+1
480 ! this can be substituted by cantor and anti-cantor
481 contlistpp_vdwi(ilist_pp_vdw)=i
482 contlistpp_vdwj(ilist_pp_vdw)=j
489 write (iout,*) "before MPIREDUCE",ilist_pp_vdw
491 write (iout,*) i,contlistpp_vdwi(i),contlistpp_vdwj(i)
494 if (nfgtasks.gt.1)then
496 call MPI_Reduce(ilist_pp_vdw,g_ilist_pp_vdw,1,
497 & MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR)
498 if (fg_rank.eq.0.and.g_ilist_pp_vdw.gt.maxres*maxint_res) then
499 if ((me.eq.king.or.out1file).and.energy_dec) then
500 write (iout,*) "Too many pp VDW interactions",
501 & g_ilist_pp_vdw," only",maxres*maxint_res," allowed."
502 write (iout,*) "Specify a smaller r_cut_int and resubmit"
505 write (*,*) "Processor:",me,": Too many pp VDW interactions",
506 & g_ilist_pp_vdw," only",maxres*maxint_res," allowed."
507 write (8,*) "Specify a smaller r_cut_int and resubmit"
508 call MPI_Abort(MPI_COMM_WORLD,ierr)
510 ! write(iout,*) "before bcast",g_ilist_sc
511 call MPI_Gather(ilist_pp_vdw,1,MPI_INTEGER,
512 & i_ilist_pp_vdw,1,MPI_INTEGER,king,FG_COMM,IERR)
515 displ(i)=i_ilist_pp_vdw(i-1)+displ(i-1)
517 ! write(iout,*) "before gather",displ(0),displ(1)
518 call MPI_Gatherv(contlistpp_vdwi,ilist_pp_vdw,MPI_INTEGER,
519 & newcontlistpp_vdwi,i_ilist_pp_vdw,displ,MPI_INTEGER,
521 call MPI_Gatherv(contlistpp_vdwj,ilist_pp_vdw,MPI_INTEGER,
522 & newcontlistpp_vdwj,i_ilist_pp_vdw,displ,MPI_INTEGER,
524 call MPI_Bcast(g_ilist_pp_vdw,1,MPI_INT,king,FG_COMM,IERR)
525 ! write(iout,*) "before bcast",g_ilist_sc
526 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
527 call MPI_Bcast(newcontlistpp_vdwi,g_ilist_pp_vdw,MPI_INT,king,
529 call MPI_Bcast(newcontlistpp_vdwj,g_ilist_pp_vdw,MPI_INT,king,
532 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
536 g_ilist_pp_vdw=ilist_pp_vdw
539 newcontlistpp_vdwi(i)=contlistpp_vdwi(i)
540 newcontlistpp_vdwj(i)=contlistpp_vdwj(i)
545 call int_bounds(g_ilist_pp_vdw,g_listpp_vdw_start,
547 if (fg_rank.eq.0 .and. (me.eq.king.or.out1file) .and. energy_dec)
548 &write (iout,'(a30,i10,a,i4)') "Number of p-p VDW interactions",
549 & g_ilist_pp_vdw," per residue on average",g_ilist_pp_vdw/nres
551 write (iout,*) "g_listpp_vdw_start",g_listpp_vdw_start,
552 & "g_listpp_vdw_end",g_listpp_vdw_end
553 write (iout,*) "make_pp_vdw_inter_list: after GATHERV",
555 do i=1,g_ilist_pp_vdw
556 write (iout,*) i,newcontlistpp_vdwi(i),newcontlistpp_vdwj(i)
561 !-----------------------------------------------------------------------------
562 subroutine make_pp_inter_list
567 include "COMMON.SETUP"
569 include "COMMON.CONTROL"
570 include "COMMON.CHAIN"
571 include "COMMON.INTERACT"
572 include "COMMON.SPLITELE"
573 include "COMMON.IOUNITS"
574 double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe,
575 & xj_temp,yj_temp,zj_temp
576 double precision xmedj,ymedj,zmedj
577 double precision dist_init, dist_temp,r_buff_list,dxi,dyi,dzi,
579 double precision dx_normi,dy_normi,dz_normi,dxj,dyj,dzj,
580 & dx_normj,dy_normj,dz_normj
581 integer contlistppi(maxint_res*maxres),
582 & contlistppj(maxint_res*maxres)
583 ! integer :: newcontlistppi(200*nres),newcontlistppj(200*nres)
584 integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint,
585 & ilist_pp,g_ilist_pp
586 integer displ(0:max_fg_procs),i_ilist_pp(0:max_fg_procs),ierr
587 ! print *,"START make_SC"
589 write (iout,*) "make_pp_inter_list"
594 if (itype(i).eq.ntyp1 .or. itype(i+1).eq.ntyp1) cycle
598 dx_normi=dc_norm(1,i)
599 dy_normi=dc_norm(2,i)
600 dz_normi=dc_norm(3,i)
601 xmedi=c(1,i)+0.5d0*dxi
602 ymedi=c(2,i)+0.5d0*dyi
603 zmedi=c(3,i)+0.5d0*dzi
604 xmedi=dmod(xmedi,boxxsize)
605 if (xmedi.lt.0) xmedi=xmedi+boxxsize
606 ymedi=dmod(ymedi,boxysize)
607 if (ymedi.lt.0) ymedi=ymedi+boxysize
608 zmedi=dmod(zmedi,boxzsize)
609 if (zmedi.lt.0) zmedi=zmedi+boxzsize
610 do j=ielstart(i),ielend(i)
611 ! write (iout,*) i,j,itype(i),itype(j)
612 if (itype(j).eq.ntyp1.or. itype(j+1).eq.ntyp1) cycle
618 dx_normj=dc_norm(1,j)
619 dy_normj=dc_norm(2,j)
620 dz_normj=dc_norm(3,j)
621 ! xj=c(1,j)+0.5D0*dxj-xmedi
622 ! yj=c(2,j)+0.5D0*dyj-ymedi
623 ! zj=c(3,j)+0.5D0*dzj-zmedi
628 if (xj.lt.0) xj=xj+boxxsize
630 if (yj.lt.0) yj=yj+boxysize
632 if (zj.lt.0) zj=zj+boxzsize
634 dist_init=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
641 xj=xj_safe+xshift*boxxsize
642 yj=yj_safe+yshift*boxysize
643 zj=zj_safe+zshift*boxzsize
644 dist_temp=(xj-xmedi)**2+(yj-ymedi)**2+(zj-zmedi)**2
645 if(dist_temp.lt.dist_init) then
655 if (dsqrt(dist_init).le.(r_cut_int+r_buff_list)) then
656 ! Here the list is created
658 ! this can be substituted by cantor and anti-cantor
659 contlistppi(ilist_pp)=i
660 contlistppj(ilist_pp)=j
667 write (iout,*) "before MPIREDUCE",ilist_pp
669 write (iout,*) i,contlistppi(i),contlistppj(i)
672 if (nfgtasks.gt.1)then
674 call MPI_Reduce(ilist_pp,g_ilist_pp,1,
675 & MPI_INTEGER,MPI_SUM,king,FG_COMM,IERR)
676 c write (iout,*) "After reduce ierr",ierr
677 if (fg_rank.eq.0.and.g_ilist_pp.gt.maxres*maxint_res) then
678 if ((me.eq.king.or.out1file).and.energy_dec) then
679 write (iout,*) "Too many pp interactions",
680 & g_ilist_pp," only",maxres*maxint_res," allowed."
681 write (iout,*) "Specify a smaller r_cut_int and resubmit"
684 write (*,*) "Processor:",me,": Too many pp interactions",
685 & g_ilist_pp," only",maxres*maxint_res," allowed."
686 write (*,*) "Specify a smaller r_cut_int and resubmit"
687 call MPI_Abort(MPI_COMM_WORLD,ierr)
689 ! write(iout,*) "before bcast",g_ilist_sc
690 call MPI_Gather(ilist_pp,1,MPI_INTEGER,
691 & i_ilist_pp,1,MPI_INTEGER,king,FG_COMM,IERR)
692 c write (iout,*) "After gather ierr",ierr
695 displ(i)=i_ilist_pp(i-1)+displ(i-1)
697 ! write(iout,*) "before gather",displ(0),displ(1)
698 call MPI_Gatherv(contlistppi,ilist_pp,MPI_INTEGER,
699 & newcontlistppi,i_ilist_pp,displ,MPI_INTEGER,
701 c write (iout,*) "After gatherb ierr",ierr
702 call MPI_Gatherv(contlistppj,ilist_pp,MPI_INTEGER,
703 & newcontlistppj,i_ilist_pp,displ,MPI_INTEGER,
705 c write (iout,*) "After gatherb ierr",ierr
706 call MPI_Bcast(g_ilist_pp,1,MPI_INT,king,FG_COMM,IERR)
707 ! write(iout,*) "before bcast",g_ilist_sc
708 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
709 c write (iout,*) "After bcast ierr",ierr
710 call MPI_Bcast(newcontlistppi,g_ilist_pp,MPI_INT,king,FG_COMM,
712 c write (iout,*) "After bcast ierr",ierr
713 call MPI_Bcast(newcontlistppj,g_ilist_pp,MPI_INT,king,FG_COMM,
715 c write (iout,*) "After bcast ierr",ierr
717 ! call MPI_Bcast(g_ilist_sc,1,MPI_INT,king,FG_COMM)
724 newcontlistppi(i)=contlistppi(i)
725 newcontlistppj(i)=contlistppj(i)
730 call int_bounds(g_ilist_pp,g_listpp_start,g_listpp_end)
731 if (fg_rank.eq.0 .and. (me.eq.king.or.out1file) .and. energy_dec)
732 & write (iout,'(a30,i10,a,i4)') "Number of p-p interactions",
733 & g_ilist_pp," per residue on average",g_ilist_pp/nres
735 write (iout,*) "make_pp_inter_list: after GATHERV",g_ilist_pp
737 write (iout,*) i,newcontlistppi(i),newcontlistppj(i)