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.
109 athet(j,i,ichir1,ichir2)=0.0D0
110 bthet(j,i,ichir1,ichir2)=0.0D0
130 gaussc(l,k,j,i)=0.0D0
143 v1(k,j,i,iblock)=0.0D0
144 v2(k,j,i,iblock)=0.0D0
154 v1c(1,l,i,j,k,iblock)=0.0D0
155 v1s(1,l,i,j,k,iblock)=0.0D0
156 v1c(2,l,i,j,k,iblock)=0.0D0
157 v1s(2,l,i,j,k,iblock)=0.0D0
161 v2c(m,l,i,j,k,iblock)=0.0D0
162 v2s(m,l,i,j,k,iblock)=0.0D0
173 C Initialize the bridge arrays
192 C Initialize variables used in minimization.
201 C Initialize the variables responsible for the mode of gradient storage.
207 if (print_order(i).eq.j) then
215 C Set timers and counters for the respective routines
234 nprint_ene=nprint_ene-1
238 c-------------------------------------------------------------------------
240 implicit real*8 (a-h,o-z)
242 include 'sizesclu.dat'
243 include 'COMMON.NAMES'
244 include 'COMMON.FFIELD'
246 &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
247 & 'DSG','DGN','DSN','DTH',
248 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
249 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
250 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
253 &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
254 &'a','y','w','v','l','i','f','m','c','x',
255 &'C','M','F','I','L','V','W','Y','A','G','T',
256 &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
257 data potname /'LJ','LJK','BP','GB','GBV'/
259 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
260 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
261 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
262 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T","ELIPTRAN",
263 & "EAFM","ETHETC","ESAXS"/
265 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
266 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
267 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC",
268 & "WLIPTRAN","WAFM","WTHETC","WSAXS"/
270 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
271 & 16,15,17,20,21,24,22,23,25/
273 c---------------------------------------------------------------------------
274 subroutine init_int_table
275 implicit real*8 (a-h,o-z)
277 include 'sizesclu.dat'
282 include 'COMMON.INFO'
284 include 'COMMON.CONTROL'
285 include 'COMMON.CHAIN'
286 include 'COMMON.INTERACT'
287 include 'COMMON.LOCAL'
288 include 'COMMON.SBRIDGE'
289 include 'COMMON.IOUNITS'
290 logical scheck,lprint
292 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
293 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
294 C... Determine the numbers of start and end SC-SC interaction
295 C... to deal with by current processor.
298 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
299 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
300 MyRank=MyID-(MyGroup-1)*fgProcs
301 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
303 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
304 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
305 & ' my_sc_inde',my_sc_inde
325 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
326 cd & (ihpb(i),jhpb(i),i=1,nss)
331 if (ihpb(ii).eq.i+nres) then
338 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
342 write (iout,*) 'jj=i+1'
343 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
344 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
350 else if (jj.eq.nct) then
352 write (iout,*) 'jj=nct'
353 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
354 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
362 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
363 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
365 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
366 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
377 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
378 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
383 ind_scint=ind_scint+nct-i
387 ind_scint_old=ind_scint
397 write (iout,*) 'Processor',MyID,' Group',MyGroup
398 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
402 write (iout,'(a)') 'Interaction array:'
404 write (iout,'(i3,2(2x,2i3))')
405 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
410 C Now partition the electrostatic-interaction array
412 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
413 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
415 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
416 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
417 & ' my_ele_inde',my_ele_inde
424 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
425 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
437 write (iout,'(a)') 'Electrostatic interaction array:'
439 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
444 C Partition the SC-p interaction array
446 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
447 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
449 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
450 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
451 & ' my_scp_inde',my_scp_inde
457 if (i.lt.nnt+iscp) then
458 cd write (iout,*) 'i.le.nnt+iscp'
459 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
460 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
462 else if (i.gt.nct-iscp) then
463 cd write (iout,*) 'i.gt.nct-iscp'
464 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
465 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
468 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
469 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
472 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
473 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
482 if (i.lt.nnt+iscp) then
484 iscpstart(i,1)=i+iscp
486 elseif (i.gt.nct-iscp) then
494 iscpstart(i,2)=i+iscp
500 write (iout,'(a)') 'SC-p interaction array:'
501 do i=iatscp_s,iatscp_e
502 write (iout,'(i3,2(2x,2i3))')
503 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
506 C Partition local interactions
508 call int_bounds(nres-2,loc_start,loc_end)
509 loc_start=loc_start+1
511 call int_bounds(nres-2,ithet_start,ithet_end)
512 ithet_start=ithet_start+2
513 ithet_end=ithet_end+2
514 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
515 iphi_start=iphi_start+nnt+2
516 iphi_end=iphi_end+nnt+2
517 call int_bounds(nres-3,itau_start,itau_end)
518 itau_start=itau_start+3
520 call int_bounds(nsaxs,isaxs_start,isaxs_end)
522 write (iout,*) 'Processor:',MyID,
523 & ' loc_start',loc_start,' loc_end',loc_end,
524 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
525 & ' iphi_start',iphi_start,' iphi_end',iphi_end
526 write (*,*) 'Processor:',MyID,
527 & ' loc_start',loc_start,' loc_end',loc_end,
528 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
529 & ' iphi_start',iphi_start,' iphi_end',iphi_end
531 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
532 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
533 & nele_int_tot,' electrostatic and ',nscp_int_tot,
534 & ' SC-p interactions','were distributed among',fgprocs,
535 & ' fine-grain processors.'
548 write (iout,*) "OSAXS_START",isaxs_start," ISAXS_END",isaxs_end
552 c---------------------------------------------------------------------------
553 subroutine int_partition(int_index,lower_index,upper_index,atom,
554 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
555 implicit real*8 (a-h,o-z)
557 include 'COMMON.IOUNITS'
558 integer int_index,lower_index,upper_index,atom,at_start,at_end,
559 & first_atom,last_atom,int_gr,jat_start,jat_end
562 if (lprn) write (iout,*) 'int_index=',int_index
563 int_index_old=int_index
564 int_index=int_index+last_atom-first_atom+1
566 & write (iout,*) 'int_index=',int_index,
567 & ' int_index_old',int_index_old,
568 & ' lower_index=',lower_index,
569 & ' upper_index=',upper_index,
570 & ' atom=',atom,' first_atom=',first_atom,
571 & ' last_atom=',last_atom
572 if (int_index.ge.lower_index) then
574 if (at_start.eq.0) then
576 jat_start=first_atom-1+lower_index-int_index_old
580 if (lprn) write (iout,*) 'jat_start',jat_start
581 if (int_index.ge.upper_index) then
583 jat_end=first_atom-1+upper_index-int_index_old
588 if (lprn) write (iout,*) 'jat_end',jat_end
592 c------------------------------------------------------------------------------
593 subroutine hpb_partition
594 implicit real*8 (a-h,o-z)
596 include 'COMMON.SBRIDGE'
597 include 'COMMON.IOUNITS'
599 include 'COMMON.INFO'
600 call int_bounds(nhpb,link_start,link_end)
605 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
606 cd & ' nhpb',nhpb,' link_start=',link_start,
607 cd & ' link_end',link_end
610 c------------------------------------------------------------------------------
611 subroutine homology_partition
612 implicit real*8 (a-h,o-z)
617 include 'COMMON.SBRIDGE'
618 include 'COMMON.IOUNITS'
619 c include 'COMMON.SETUP'
620 include 'COMMON.CONTROL'
621 include 'COMMON.CHAIN'
622 include 'COMMON.INTERACT'
623 include 'COMMON.HOMRESTR'
624 write(iout,*)"homology_partition: lim_odl=",lim_odl,
627 call int_bounds(lim_odl,link_start_homo,link_end_homo)
628 call int_bounds(lim_dih,idihconstr_start_homo,
629 & idihconstr_end_homo)
630 idihconstr_start_homo=idihconstr_start_homo+nnt-1+3
631 idihconstr_end_homo=idihconstr_end_homo+nnt-1+3
632 if (me.eq.king .or. .not. out1file)
633 & write (iout,*) 'Processor',fg_rank,' CG group',kolor,
634 & ' absolute rank',MyRank,
635 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
636 & ' link_end',link_end_homo,' lim_dih',lim_dih,
637 & ' idihconstr_start_homo',idihconstr_start_homo,
638 & ' idihconstr_end_homo',idihconstr_end_homo
641 link_end_homo=lim_odl
642 idihconstr_start_homo=nnt+3
643 idihconstr_end_homo=lim_dih+nnt-1+3
645 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
646 & ' link_end',link_end_homo,' lim_dih',lim_dih,
647 & ' idihconstr_start_homo',idihconstr_start_homo,
648 & ' idihconstr_end_homo',idihconstr_end_homo