3 C Define constants and zero out tables.
5 implicit real*8 (a-h,o-z)
7 include 'DIMENSIONS.ZSCOPT'
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.WEIGHTS"
22 include "COMMON.NAMES"
23 include "COMMON.TIME1"
25 C The following is just to define auxiliary variables used in angle conversion
66 C Set default weights of the energy terms.
127 gaussc(l,k,j,i)=0.0D0
148 C Initialize the bridge arrays
163 dyn_ss_mask(i)=.false.
170 C Initialize variables used in minimization.
179 C Initialize the variables responsible for the mode of gradient storage.
185 if (print_order(i).eq.j) then
193 C Set timers and counters for the respective routines
212 nprint_ene=nprint_ene-1
216 c-------------------------------------------------------------------------
218 implicit real*8 (a-h,o-z)
220 include 'DIMENSIONS.ZSCOPT'
221 include 'COMMON.NAMES'
222 include 'COMMON.WEIGHTS'
223 include 'COMMON.FFIELD'
225 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
226 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
228 &'C','M','F','I','L','V','W','Y','A','G','T',
229 &'S','Q','N','E','D','H','R','K','P','X'/
230 data potname /'LJ','LJK','BP','GB','GBV'/
232 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
233 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
234 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB ","EVDWPP ",
235 & "ESTR ","EVDW2_14 ","ESCCOR ", " ","EDIHCNSTR","EHOMOLOGY",
236 & "DFA DIS","DFA TOR","DFA NEI","DFA BET"/
238 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
239 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
240 & "WSTRAIN","WVDWPP","WBOND","SCAL14","WSCCOR"," ","WDIHCNSTR",
241 & "WHOMOLOGY","WDFAD","WDFAT","WDFAN","WDFAB"/
243 data print_order/1,2,3,11,12,13,14,4,5,6,7,8,9,10,19,18,15,17,16,
244 & 21,23,24,25,26,0,0,0/
246 c---------------------------------------------------------------------------
247 subroutine init_int_table
248 implicit real*8 (a-h,o-z)
250 include 'DIMENSIONS.ZSCOPT'
255 include 'COMMON.INFO'
257 include 'COMMON.CHAIN'
258 include 'COMMON.INTERACT'
259 include 'COMMON.LOCAL'
260 include 'COMMON.SBRIDGE'
261 include 'COMMON.IOUNITS'
262 logical scheck,lprint
264 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
265 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
266 C... Determine the numbers of start and end SC-SC interaction
267 C... to deal with by current processor.
270 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
271 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
272 MyRank=MyID-(MyGroup-1)*fgProcs
273 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
275 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
276 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
277 & ' my_sc_inde',my_sc_inde
297 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
298 cd & (ihpb(i),jhpb(i),i=1,nss)
303 if (ihpb(ii).eq.i+nres) then
310 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
314 write (iout,*) 'jj=i+1'
315 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
316 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
322 else if (jj.eq.nct) then
324 write (iout,*) 'jj=nct'
325 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
326 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
334 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
335 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
337 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
338 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
349 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
350 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
355 ind_scint=int_scint+nct-i
359 ind_scint_old=ind_scint
369 write (iout,*) 'Processor',MyID,' Group',MyGroup
370 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
374 write (iout,'(a)') 'Interaction array:'
376 write (iout,'(i3,2(2x,2i3))')
377 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
382 C Now partition the electrostatic-interaction array
384 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
385 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
387 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
388 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
389 & ' my_ele_inde',my_ele_inde
396 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
397 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
409 write (iout,'(a)') 'Electrostatic interaction array:'
411 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
416 C Partition the SC-p interaction array
418 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
419 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
421 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
422 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
423 & ' my_scp_inde',my_scp_inde
429 if (i.lt.nnt+iscp) then
430 cd write (iout,*) 'i.le.nnt+iscp'
431 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
432 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
434 else if (i.gt.nct-iscp) then
435 cd write (iout,*) 'i.gt.nct-iscp'
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,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
444 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
445 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
454 if (i.lt.nnt+iscp) then
456 iscpstart(i,1)=i+iscp
458 elseif (i.gt.nct-iscp) then
466 iscpstart(i,2)=i+iscp
472 write (iout,'(a)') 'SC-p interaction array:'
473 do i=iatscp_s,iatscp_e
474 write (iout,'(i3,2(2x,2i3))')
475 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
478 C Partition local interactions
480 call int_bounds(nres-2,loc_start,loc_end)
481 loc_start=loc_start+1
483 call int_bounds(nres-2,ithet_start,ithet_end)
484 ithet_start=ithet_start+2
485 ithet_end=ithet_end+2
486 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
487 iphi_start=iphi_start+nnt+2
488 iphi_end=iphi_end+nnt+2
489 call int_bounds(nres-3,itau_start,itau_end)
490 itau_start=itau_start+3
493 write (iout,*) '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
497 write (*,*) 'Processor:',MyID,
498 & ' loc_start',loc_start,' loc_end',loc_end,
499 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
500 & ' iphi_start',iphi_start,' iphi_end',iphi_end
502 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
503 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
504 & nele_int_tot,' electrostatic and ',nscp_int_tot,
505 & ' SC-p interactions','were distributed among',fgprocs,
506 & ' fine-grain processors.'
520 c---------------------------------------------------------------------------
521 subroutine int_partition(int_index,lower_index,upper_index,atom,
522 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
523 implicit real*8 (a-h,o-z)
525 include 'COMMON.IOUNITS'
526 integer int_index,lower_index,upper_index,atom,at_start,at_end,
527 & first_atom,last_atom,int_gr,jat_start,jat_end
530 if (lprn) write (iout,*) 'int_index=',int_index
531 int_index_old=int_index
532 int_index=int_index+last_atom-first_atom+1
534 & write (iout,*) 'int_index=',int_index,
535 & ' int_index_old',int_index_old,
536 & ' lower_index=',lower_index,
537 & ' upper_index=',upper_index,
538 & ' atom=',atom,' first_atom=',first_atom,
539 & ' last_atom=',last_atom
540 if (int_index.ge.lower_index) then
542 if (at_start.eq.0) then
544 jat_start=first_atom-1+lower_index-int_index_old
548 if (lprn) write (iout,*) 'jat_start',jat_start
549 if (int_index.ge.upper_index) then
551 jat_end=first_atom-1+upper_index-int_index_old
556 if (lprn) write (iout,*) 'jat_end',jat_end
560 c------------------------------------------------------------------------------
561 subroutine hpb_partition
562 implicit real*8 (a-h,o-z)
564 include 'COMMON.SBRIDGE'
565 include 'COMMON.IOUNITS'
567 include 'COMMON.INFO'
568 call int_bounds(nhpb,link_start,link_end)
573 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
574 cd & ' nhpb',nhpb,' link_start=',link_start,
575 cd & ' link_end',link_end
578 c------------------------------------------------------------------------------
579 subroutine homology_partition
580 implicit real*8 (a-h,o-z)
582 include 'DIMENSIONS.ZSCOPT'
586 include 'COMMON.SBRIDGE'
587 include 'COMMON.IOUNITS'
588 c include 'COMMON.SETUP'
589 include 'COMMON.CONTROL'
590 include 'COMMON.CHAIN'
591 include 'COMMON.INTERACT'
592 include 'COMMON.HOMRESTR'
593 write(iout,*)"homology_partition: lim_odl=",lim_odl,
596 call int_bounds(lim_odl,link_start_homo,link_end_homo)
597 call int_bounds(lim_dih-nnt+1,idihconstr_start_homo,
598 & idihconstr_end_homo)
599 idihconstr_start_homo=idihconstr_start_homo+nnt-1
600 idihconstr_end_homo=idihconstr_end_homo+nnt-1
601 if (me.eq.king .or. .not. out1file)
602 & write (iout,*) 'Processor',fg_rank,' CG group',kolor,
603 & ' absolute rank',MyRank,
604 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
605 & ' link_end',link_end_homo,' lim_dih',lim_dih,
606 & ' idihconstr_start_homo',idihconstr_start_homo,
607 & ' idihconstr_end_homo',idihconstr_end_homo
610 link_end_homo=lim_odl
611 idihconstr_start_homo=nnt
612 idihconstr_end_homo=lim_dih
614 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
615 & ' link_end',link_end_homo,' lim_dih',lim_dih,
616 & ' idihconstr_start_homo',idihconstr_start_homo,
617 & ' idihconstr_end_homo',idihconstr_end_homo