3 C Define constants and zero out tables.
5 implicit real*8 (a-h,o-z)
11 include 'COMMON.IOUNITS'
12 include 'COMMON.CHAIN'
13 include 'COMMON.INTERACT'
15 include 'COMMON.LOCAL'
16 include 'COMMON.TORSION'
17 include 'COMMON.FFIELD'
18 include 'COMMON.SBRIDGE'
19 include 'COMMON.MINIM'
20 include 'COMMON.DERIV'
21 include "COMMON.NAMES"
22 include "COMMON.TIME1"
24 C The following is just to define auxiliary variables used in angle conversion
62 C Set default weights of the energy terms.
123 gaussc(l,k,j,i)=0.0D0
144 C Initialize the bridge arrays
163 C Initialize variables used in minimization.
172 C Initialize the variables responsible for the mode of gradient storage.
178 if (print_order(i).eq.j) then
186 C Set timers and counters for the respective routines
205 nprint_ene=nprint_ene-1
209 c-------------------------------------------------------------------------
211 implicit real*8 (a-h,o-z)
213 include 'sizesclu.dat'
214 include 'COMMON.NAMES'
215 include 'COMMON.FFIELD'
216 include 'COMMON.INTERACT'
218 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
219 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
221 &'C','M','F','I','L','V','W','Y','A','G','T',
222 &'S','Q','N','E','D','H','R','K','P','X'/
223 data potname /'LJ','LJK','BP','GB','GBV','MM'/
225 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
226 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
227 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
228 & "ESTR","ESCCOR","EVDW2_14",""/
230 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
231 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
232 & "WHPB","WVDWPP","WBOND","WSCCOR","WSCP14",""/
234 data print_order /1,2,3,17,11,12,13,14,4,5,6,7,8,9,10,16,15,18,19,
236 c Dielectric constant of water
237 data eps_out /80.0d0/
239 c---------------------------------------------------------------------------
240 subroutine init_int_table
241 implicit real*8 (a-h,o-z)
243 include 'sizesclu.dat'
248 include 'COMMON.INFO'
250 include 'COMMON.CHAIN'
251 include 'COMMON.INTERACT'
252 include 'COMMON.LOCAL'
253 include 'COMMON.SBRIDGE'
254 include 'COMMON.IOUNITS'
255 logical scheck,lprint
257 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
258 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
259 C... Determine the numbers of start and end SC-SC interaction
260 C... to deal with by current processor.
263 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
264 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
265 MyRank=MyID-(MyGroup-1)*fgProcs
266 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
268 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
269 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
270 & ' my_sc_inde',my_sc_inde
290 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
291 cd & (ihpb(i),jhpb(i),i=1,nss)
295 if (ihpb(ii).eq.i+nres) then
302 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
306 write (iout,*) 'jj=i+1'
307 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
308 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
314 else if (jj.eq.nct) then
316 write (iout,*) 'jj=nct'
317 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
318 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
326 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
327 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
329 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
330 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
341 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
342 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
347 ind_scint=int_scint+nct-i
351 ind_scint_old=ind_scint
361 write (iout,*) 'Processor',MyID,' Group',MyGroup
362 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
366 write (iout,'(a)') 'Interaction array:'
368 write (iout,'(i3,2(2x,2i3))')
369 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
374 C Now partition the electrostatic-interaction array
376 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
377 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
379 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
380 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
381 & ' my_ele_inde',my_ele_inde
388 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
389 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
401 write (iout,'(a)') 'Electrostatic interaction array:'
403 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
408 C Partition the SC-p interaction array
410 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
411 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
413 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
414 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
415 & ' my_scp_inde',my_scp_inde
421 if (i.lt.nnt+iscp) then
422 cd write (iout,*) 'i.le.nnt+iscp'
423 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
424 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
426 else if (i.gt.nct-iscp) then
427 cd write (iout,*) 'i.gt.nct-iscp'
428 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
429 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
432 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
433 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
436 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
437 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
446 if (i.lt.nnt+iscp) then
448 iscpstart(i,1)=i+iscp
450 elseif (i.gt.nct-iscp) then
458 iscpstart(i,2)=i+iscp
464 write (iout,'(a)') 'SC-p interaction array:'
465 do i=iatscp_s,iatscp_e
466 write (iout,'(i3,2(2x,2i3))')
467 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
470 C Partition local interactions
472 call int_bounds(nres-2,loc_start,loc_end)
473 loc_start=loc_start+1
475 call int_bounds(nres-2,ithet_start,ithet_end)
476 ithet_start=ithet_start+2
477 ithet_end=ithet_end+2
478 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
479 iphi_start=iphi_start+nnt+2
480 iphi_end=iphi_end+nnt+2
481 call int_bounds(nres-3,itau_start,itau_end)
482 itau_start=itau_start+3
485 write (iout,*) 'Processor:',MyID,
486 & ' loc_start',loc_start,' loc_end',loc_end,
487 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
488 & ' iphi_start',iphi_start,' iphi_end',iphi_end
489 write (*,*) 'Processor:',MyID,
490 & ' loc_start',loc_start,' loc_end',loc_end,
491 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
492 & ' iphi_start',iphi_start,' iphi_end',iphi_end
494 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
495 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
496 & nele_int_tot,' electrostatic and ',nscp_int_tot,
497 & ' SC-p interactions','were distributed among',fgprocs,
498 & ' fine-grain processors.'
513 c---------------------------------------------------------------------------
514 subroutine int_partition(int_index,lower_index,upper_index,atom,
515 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
516 implicit real*8 (a-h,o-z)
518 include 'COMMON.IOUNITS'
519 integer int_index,lower_index,upper_index,atom,at_start,at_end,
520 & first_atom,last_atom,int_gr,jat_start,jat_end
523 if (lprn) write (iout,*) 'int_index=',int_index
524 int_index_old=int_index
525 int_index=int_index+last_atom-first_atom+1
527 & write (iout,*) 'int_index=',int_index,
528 & ' int_index_old',int_index_old,
529 & ' lower_index=',lower_index,
530 & ' upper_index=',upper_index,
531 & ' atom=',atom,' first_atom=',first_atom,
532 & ' last_atom=',last_atom
533 if (int_index.ge.lower_index) then
535 if (at_start.eq.0) then
537 jat_start=first_atom-1+lower_index-int_index_old
541 if (lprn) write (iout,*) 'jat_start',jat_start
542 if (int_index.ge.upper_index) then
544 jat_end=first_atom-1+upper_index-int_index_old
549 if (lprn) write (iout,*) 'jat_end',jat_end
553 c------------------------------------------------------------------------------
554 subroutine hpb_partition
555 implicit real*8 (a-h,o-z)
557 include 'COMMON.SBRIDGE'
558 include 'COMMON.IOUNITS'
560 include 'COMMON.INFO'
561 call int_bounds(nhpb,link_start,link_end)
566 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
567 cd & ' nhpb',nhpb,' link_start=',link_start,
568 cd & ' link_end',link_end