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
63 C Set default weights of the energy terms.
124 gaussc(l,k,j,i)=0.0D0
145 C Initialize the bridge arrays
160 dyn_ss_mask(i)=.false.
167 C Initialize variables used in minimization.
176 C Initialize the variables responsible for the mode of gradient storage.
182 if (print_order(i).eq.j) then
190 C Set timers and counters for the respective routines
209 nprint_ene=nprint_ene-1
213 c-------------------------------------------------------------------------
215 implicit real*8 (a-h,o-z)
217 include 'sizesclu.dat'
218 include 'COMMON.NAMES'
219 include 'COMMON.FFIELD'
221 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
222 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
224 &'C','M','F','I','L','V','W','Y','A','G','T',
225 &'S','Q','N','E','D','H','R','K','P','X'/
226 data potname /'LJ','LJK','BP','GB','GBV'/
228 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
229 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
230 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
231 & "ESTR","ESCCOR","EVDW2_14","EDIHCNSTR","EHOMOLOGY",
232 & "DFA DIS","DFA TOR","DFA NEI","DFA BET"," "," "/
234 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
235 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
236 & "WHPB","WVDWPP","WBOND","WSCCOR","WSCP14","WDIHCNSTR",
237 & "WHOMOLOGY","WDFAD","WDFAT","WDFAN","WDFAB"," "," "/
239 data print_order /1,2,3,17,11,12,13,14,4,5,6,7,8,9,10,16,15,18,19,
242 c---------------------------------------------------------------------------
243 subroutine init_int_table
244 implicit real*8 (a-h,o-z)
246 include 'sizesclu.dat'
251 include 'COMMON.INFO'
253 include 'COMMON.CHAIN'
254 include 'COMMON.INTERACT'
255 include 'COMMON.LOCAL'
256 include 'COMMON.SBRIDGE'
257 include 'COMMON.IOUNITS'
258 logical scheck,lprint
260 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
261 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
262 C... Determine the numbers of start and end SC-SC interaction
263 C... to deal with by current processor.
266 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
267 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
268 MyRank=MyID-(MyGroup-1)*fgProcs
269 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
271 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
272 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
273 & ' my_sc_inde',my_sc_inde
293 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
294 cd & (ihpb(i),jhpb(i),i=1,nss)
298 if (ihpb(ii).eq.i+nres) then
306 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
310 write (iout,*) 'jj=i+1'
311 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
312 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
318 else if (jj.eq.nct) then
320 write (iout,*) 'jj=nct'
321 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
322 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
330 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
331 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
333 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
334 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
345 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
346 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
351 ind_scint=int_scint+nct-i
355 ind_scint_old=ind_scint
365 write (iout,*) 'Processor',MyID,' Group',MyGroup
366 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
370 write (iout,'(a)') 'Interaction array:'
372 write (iout,'(i3,2(2x,2i3))')
373 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
378 C Now partition the electrostatic-interaction array
380 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
381 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
383 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
384 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
385 & ' my_ele_inde',my_ele_inde
392 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
393 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
405 write (iout,'(a)') 'Electrostatic interaction array:'
407 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
412 C Partition the SC-p interaction array
414 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
415 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
417 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
418 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
419 & ' my_scp_inde',my_scp_inde
425 if (i.lt.nnt+iscp) then
426 cd write (iout,*) 'i.le.nnt+iscp'
427 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
428 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
430 else if (i.gt.nct-iscp) then
431 cd write (iout,*) 'i.gt.nct-iscp'
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,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
440 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
441 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
450 if (i.lt.nnt+iscp) then
452 iscpstart(i,1)=i+iscp
454 elseif (i.gt.nct-iscp) then
462 iscpstart(i,2)=i+iscp
468 write (iout,'(a)') 'SC-p interaction array:'
469 do i=iatscp_s,iatscp_e
470 write (iout,'(i3,2(2x,2i3))')
471 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
474 C Partition local interactions
476 call int_bounds(nres-2,loc_start,loc_end)
477 loc_start=loc_start+1
479 call int_bounds(nres-2,ithet_start,ithet_end)
480 ithet_start=ithet_start+2
481 ithet_end=ithet_end+2
482 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
483 iphi_start=iphi_start+nnt+2
484 iphi_end=iphi_end+nnt+2
485 call int_bounds(nres-3,itau_start,itau_end)
486 itau_start=itau_start+3
489 write (iout,*) '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
493 write (*,*) 'Processor:',MyID,
494 & ' loc_start',loc_start,' loc_end',loc_end,
495 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
496 & ' iphi_start',iphi_start,' iphi_end',iphi_end
498 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
499 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
500 & nele_int_tot,' electrostatic and ',nscp_int_tot,
501 & ' SC-p interactions','were distributed among',fgprocs,
502 & ' fine-grain processors.'
517 c---------------------------------------------------------------------------
518 subroutine int_partition(int_index,lower_index,upper_index,atom,
519 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
520 implicit real*8 (a-h,o-z)
522 include 'COMMON.IOUNITS'
523 integer int_index,lower_index,upper_index,atom,at_start,at_end,
524 & first_atom,last_atom,int_gr,jat_start,jat_end
527 if (lprn) write (iout,*) 'int_index=',int_index
528 int_index_old=int_index
529 int_index=int_index+last_atom-first_atom+1
531 & write (iout,*) 'int_index=',int_index,
532 & ' int_index_old',int_index_old,
533 & ' lower_index=',lower_index,
534 & ' upper_index=',upper_index,
535 & ' atom=',atom,' first_atom=',first_atom,
536 & ' last_atom=',last_atom
537 if (int_index.ge.lower_index) then
539 if (at_start.eq.0) then
541 jat_start=first_atom-1+lower_index-int_index_old
545 if (lprn) write (iout,*) 'jat_start',jat_start
546 if (int_index.ge.upper_index) then
548 jat_end=first_atom-1+upper_index-int_index_old
553 if (lprn) write (iout,*) 'jat_end',jat_end
557 c------------------------------------------------------------------------------
558 subroutine hpb_partition
559 implicit real*8 (a-h,o-z)
561 include 'COMMON.SBRIDGE'
562 include 'COMMON.IOUNITS'
564 include 'COMMON.INFO'
565 call int_bounds(nhpb,link_start,link_end)
570 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
571 cd & ' nhpb',nhpb,' link_start=',link_start,
572 cd & ' link_end',link_end
575 c------------------------------------------------------------------------------
576 subroutine homology_partition
577 implicit real*8 (a-h,o-z)
582 include 'COMMON.SBRIDGE'
583 include 'COMMON.IOUNITS'
584 c include 'COMMON.SETUP'
585 include 'COMMON.CONTROL'
586 include 'COMMON.CHAIN'
587 include 'COMMON.INTERACT'
588 include 'COMMON.HOMRESTR'
589 write(iout,*)"homology_partition: lim_odl=",lim_odl,
592 call int_bounds(lim_odl,link_start_homo,link_end_homo)
593 call int_bounds(lim_dih-nnt+1,idihconstr_start_homo,
594 & idihconstr_end_homo)
595 idihconstr_start_homo=idihconstr_start_homo+nnt-1
596 idihconstr_end_homo=idihconstr_end_homo+nnt-1
597 if (me.eq.king .or. .not. out1file)
598 & write (iout,*) 'Processor',fg_rank,' CG group',kolor,
599 & ' absolute rank',MyRank,
600 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
601 & ' link_end',link_end_homo,' lim_dih',lim_dih,
602 & ' idihconstr_start_homo',idihconstr_start_homo,
603 & ' idihconstr_end_homo',idihconstr_end_homo
606 link_end_homo=lim_odl
607 idihconstr_start_homo=nnt
608 idihconstr_end_homo=lim_dih
610 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
611 & ' link_end',link_end_homo,' lim_dih',lim_dih,
612 & ' idihconstr_start_homo',idihconstr_start_homo,
613 & ' idihconstr_end_homo',idihconstr_end_homo