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
159 dyn_ss_mask(i)=.false.
166 C Initialize variables used in minimization.
175 C Initialize the variables responsible for the mode of gradient storage.
181 if (print_order(i).eq.j) then
189 C Set timers and counters for the respective routines
208 nprint_ene=nprint_ene-1
212 c-------------------------------------------------------------------------
214 implicit real*8 (a-h,o-z)
216 include 'sizesclu.dat'
217 include 'COMMON.NAMES'
218 include 'COMMON.FFIELD'
220 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
221 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
223 &'C','M','F','I','L','V','W','Y','A','G','T',
224 &'S','Q','N','E','D','H','R','K','P','X'/
225 data potname /'LJ','LJK','BP','GB','GBV'/
227 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
228 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
229 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
230 & "ESTR","ESCCOR","EVDW2_14","EDIHCNSTR","EHOMOLOGY",
231 & "DFA DIS","DFA TOR","DFA NEI","DFA BET"," "," "/
233 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
234 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
235 & "WHPB","WVDWPP","WBOND","WSCCOR","WSCP14","WDIHCNSTR",
236 & "WHOMOLOGY","WDFAD","WDFAT","WDFAN","WDFAB"," "," "/
238 data print_order /1,2,3,17,11,12,13,14,4,5,6,7,8,9,10,16,15,18,19,
241 c---------------------------------------------------------------------------
242 subroutine init_int_table
243 implicit real*8 (a-h,o-z)
245 include 'sizesclu.dat'
250 include 'COMMON.INFO'
252 include 'COMMON.CHAIN'
253 include 'COMMON.INTERACT'
254 include 'COMMON.LOCAL'
255 include 'COMMON.SBRIDGE'
256 include 'COMMON.IOUNITS'
257 logical scheck,lprint
259 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
260 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
261 C... Determine the numbers of start and end SC-SC interaction
262 C... to deal with by current processor.
265 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
266 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
267 MyRank=MyID-(MyGroup-1)*fgProcs
268 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
270 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
271 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
272 & ' my_sc_inde',my_sc_inde
292 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
293 cd & (ihpb(i),jhpb(i),i=1,nss)
297 if (ihpb(ii).eq.i+nres) then
305 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
309 write (iout,*) 'jj=i+1'
310 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
311 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
317 else if (jj.eq.nct) then
319 write (iout,*) 'jj=nct'
320 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
321 & iatsc_s,iatsc_e,i+1,nct-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,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
332 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
333 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
344 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
345 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
350 ind_scint=int_scint+nct-i
354 ind_scint_old=ind_scint
364 write (iout,*) 'Processor',MyID,' Group',MyGroup
365 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
369 write (iout,'(a)') 'Interaction array:'
371 write (iout,'(i3,2(2x,2i3))')
372 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
377 C Now partition the electrostatic-interaction array
379 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
380 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
382 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
383 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
384 & ' my_ele_inde',my_ele_inde
391 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
392 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
404 write (iout,'(a)') 'Electrostatic interaction array:'
406 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
411 C Partition the SC-p interaction array
413 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
414 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
416 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
417 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
418 & ' my_scp_inde',my_scp_inde
424 if (i.lt.nnt+iscp) then
425 cd write (iout,*) 'i.le.nnt+iscp'
426 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
427 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
429 else if (i.gt.nct-iscp) then
430 cd write (iout,*) 'i.gt.nct-iscp'
431 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
432 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
435 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
436 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
439 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
440 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
449 if (i.lt.nnt+iscp) then
451 iscpstart(i,1)=i+iscp
453 elseif (i.gt.nct-iscp) then
461 iscpstart(i,2)=i+iscp
467 write (iout,'(a)') 'SC-p interaction array:'
468 do i=iatscp_s,iatscp_e
469 write (iout,'(i3,2(2x,2i3))')
470 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
473 C Partition local interactions
475 call int_bounds(nres-2,loc_start,loc_end)
476 loc_start=loc_start+1
478 call int_bounds(nres-2,ithet_start,ithet_end)
479 ithet_start=ithet_start+2
480 ithet_end=ithet_end+2
481 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
482 iphi_start=iphi_start+nnt+2
483 iphi_end=iphi_end+nnt+2
484 call int_bounds(nres-3,itau_start,itau_end)
485 itau_start=itau_start+3
488 write (iout,*) 'Processor:',MyID,
489 & ' loc_start',loc_start,' loc_end',loc_end,
490 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
491 & ' iphi_start',iphi_start,' iphi_end',iphi_end
492 write (*,*) 'Processor:',MyID,
493 & ' loc_start',loc_start,' loc_end',loc_end,
494 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
495 & ' iphi_start',iphi_start,' iphi_end',iphi_end
497 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
498 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
499 & nele_int_tot,' electrostatic and ',nscp_int_tot,
500 & ' SC-p interactions','were distributed among',fgprocs,
501 & ' fine-grain processors.'
516 c---------------------------------------------------------------------------
517 subroutine int_partition(int_index,lower_index,upper_index,atom,
518 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
519 implicit real*8 (a-h,o-z)
521 include 'COMMON.IOUNITS'
522 integer int_index,lower_index,upper_index,atom,at_start,at_end,
523 & first_atom,last_atom,int_gr,jat_start,jat_end
526 if (lprn) write (iout,*) 'int_index=',int_index
527 int_index_old=int_index
528 int_index=int_index+last_atom-first_atom+1
530 & write (iout,*) 'int_index=',int_index,
531 & ' int_index_old',int_index_old,
532 & ' lower_index=',lower_index,
533 & ' upper_index=',upper_index,
534 & ' atom=',atom,' first_atom=',first_atom,
535 & ' last_atom=',last_atom
536 if (int_index.ge.lower_index) then
538 if (at_start.eq.0) then
540 jat_start=first_atom-1+lower_index-int_index_old
544 if (lprn) write (iout,*) 'jat_start',jat_start
545 if (int_index.ge.upper_index) then
547 jat_end=first_atom-1+upper_index-int_index_old
552 if (lprn) write (iout,*) 'jat_end',jat_end
556 c------------------------------------------------------------------------------
557 subroutine hpb_partition
558 implicit real*8 (a-h,o-z)
560 include 'COMMON.SBRIDGE'
561 include 'COMMON.IOUNITS'
563 include 'COMMON.INFO'
564 call int_bounds(nhpb,link_start,link_end)
569 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
570 cd & ' nhpb',nhpb,' link_start=',link_start,
571 cd & ' link_end',link_end
574 c------------------------------------------------------------------------------
575 subroutine homology_partition
576 implicit real*8 (a-h,o-z)
581 include 'COMMON.SBRIDGE'
582 include 'COMMON.IOUNITS'
583 c include 'COMMON.SETUP'
584 include 'COMMON.CONTROL'
585 include 'COMMON.CHAIN'
586 include 'COMMON.INTERACT'
587 include 'COMMON.HOMRESTR'
588 write(iout,*)"homology_partition: lim_odl=",lim_odl,
591 call int_bounds(lim_odl,link_start_homo,link_end_homo)
592 call int_bounds(lim_dih-nnt+1,idihconstr_start_homo,
593 & idihconstr_end_homo)
594 idihconstr_start_homo=idihconstr_start_homo+nnt-1
595 idihconstr_end_homo=idihconstr_end_homo+nnt-1
596 if (me.eq.king .or. .not. out1file)
597 & write (iout,*) 'Processor',fg_rank,' CG group',kolor,
598 & ' absolute rank',MyRank,
599 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
600 & ' link_end',link_end_homo,' lim_dih',lim_dih,
601 & ' idihconstr_start_homo',idihconstr_start_homo,
602 & ' idihconstr_end_homo',idihconstr_end_homo
605 link_end_homo=lim_odl
606 idihconstr_start_homo=nnt
607 idihconstr_end_homo=lim_dih
609 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
610 & ' link_end',link_end_homo,' lim_dih',lim_dih,
611 & ' idihconstr_start_homo',idihconstr_start_homo,
612 & ' idihconstr_end_homo',idihconstr_end_homo