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.
110 athet(j,i,ichir1,ichir2)=0.0D0
111 bthet(j,i,ichir1,ichir2)=0.0D0
131 gaussc(l,k,j,i)=0.0D0
144 v1(k,j,i,iblock)=0.0D0
145 v2(k,j,i,iblock)=0.0D0
155 v1c(1,l,i,j,k,iblock)=0.0D0
156 v1s(1,l,i,j,k,iblock)=0.0D0
157 v1c(2,l,i,j,k,iblock)=0.0D0
158 v1s(2,l,i,j,k,iblock)=0.0D0
162 v2c(m,l,i,j,k,iblock)=0.0D0
163 v2s(m,l,i,j,k,iblock)=0.0D0
174 C Initialize the bridge arrays
187 dyn_ss_mask(i)=.false.
194 C Initialize variables used in minimization.
203 C Initialize the variables responsible for the mode of gradient storage.
209 if (print_order(i).eq.j) then
217 C Set timers and counters for the respective routines
236 nprint_ene=nprint_ene-1
240 c-------------------------------------------------------------------------
242 implicit real*8 (a-h,o-z)
244 include 'DIMENSIONS.ZSCOPT'
245 include 'COMMON.NAMES'
246 include 'COMMON.WEIGHTS'
247 include 'COMMON.FFIELD'
249 &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
250 & 'DSG','DGN','DSN','DTH',
251 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
252 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
253 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
256 &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
257 &'a','y','w','v','l','i','f','m','c','x',
258 &'C','M','F','I','L','V','W','Y','A','G','T',
259 &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
260 data potname /'LJ','LJK','BP','GB','GBV'/
262 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
263 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
264 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
265 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T","ELIPTRAN",
268 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
269 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
270 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC",
271 & "WLIPTRAN","WAFM","WTHETC"/
272 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
273 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
274 & 0.0d0,0.0,0.0d0,0.0d0,0.0d0/
276 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
277 & 16,15,17,20,21,24,22,23/
279 c---------------------------------------------------------------------------
280 subroutine init_int_table
281 implicit real*8 (a-h,o-z)
283 include 'DIMENSIONS.ZSCOPT'
288 include 'COMMON.INFO'
290 include 'COMMON.CHAIN'
291 include 'COMMON.INTERACT'
292 include 'COMMON.LOCAL'
293 include 'COMMON.SBRIDGE'
294 include 'COMMON.IOUNITS'
295 logical scheck,lprint
297 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
298 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
299 C... Determine the numbers of start and end SC-SC interaction
300 C... to deal with by current processor.
303 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
304 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
305 MyRank=MyID-(MyGroup-1)*fgProcs
306 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
308 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
309 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
310 & ' my_sc_inde',my_sc_inde
330 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
331 cd & (ihpb(i),jhpb(i),i=1,nss)
336 if (ihpb(ii).eq.i+nres) then
343 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
347 write (iout,*) 'jj=i+1'
348 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
349 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
355 else if (jj.eq.nct) then
357 write (iout,*) 'jj=nct'
358 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
359 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
367 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
368 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
370 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
371 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
382 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
383 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
388 ind_scint=int_scint+nct-i
392 ind_scint_old=ind_scint
402 write (iout,*) 'Processor',MyID,' Group',MyGroup
403 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
407 write (iout,'(a)') 'Interaction array:'
409 write (iout,'(i3,2(2x,2i3))')
410 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
415 C Now partition the electrostatic-interaction array
417 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
418 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
420 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
421 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
422 & ' my_ele_inde',my_ele_inde
429 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
430 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
442 write (iout,'(a)') 'Electrostatic interaction array:'
444 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
449 C Partition the SC-p interaction array
451 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
452 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
454 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
455 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
456 & ' my_scp_inde',my_scp_inde
462 if (i.lt.nnt+iscp) then
463 cd write (iout,*) 'i.le.nnt+iscp'
464 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
465 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
467 else if (i.gt.nct-iscp) then
468 cd write (iout,*) 'i.gt.nct-iscp'
469 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
470 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
473 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
474 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
477 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
478 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
487 if (i.lt.nnt+iscp) then
489 iscpstart(i,1)=i+iscp
491 elseif (i.gt.nct-iscp) then
499 iscpstart(i,2)=i+iscp
505 write (iout,'(a)') 'SC-p interaction array:'
506 do i=iatscp_s,iatscp_e
507 write (iout,'(i3,2(2x,2i3))')
508 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
511 C Partition local interactions
513 call int_bounds(nres-2,loc_start,loc_end)
514 loc_start=loc_start+1
516 call int_bounds(nres-2,ithet_start,ithet_end)
517 ithet_start=ithet_start+2
518 ithet_end=ithet_end+2
519 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
520 iphi_start=iphi_start+nnt+2
521 iphi_end=iphi_end+nnt+2
522 call int_bounds(nres-3,itau_start,itau_end)
523 itau_start=itau_start+3
526 write (iout,*) '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
530 write (*,*) 'Processor:',MyID,
531 & ' loc_start',loc_start,' loc_end',loc_end,
532 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
533 & ' iphi_start',iphi_start,' iphi_end',iphi_end
535 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
536 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
537 & nele_int_tot,' electrostatic and ',nscp_int_tot,
538 & ' SC-p interactions','were distributed among',fgprocs,
539 & ' fine-grain processors.'
553 c---------------------------------------------------------------------------
554 subroutine int_partition(int_index,lower_index,upper_index,atom,
555 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
556 implicit real*8 (a-h,o-z)
558 include 'COMMON.IOUNITS'
559 integer int_index,lower_index,upper_index,atom,at_start,at_end,
560 & first_atom,last_atom,int_gr,jat_start,jat_end
563 if (lprn) write (iout,*) 'int_index=',int_index
564 int_index_old=int_index
565 int_index=int_index+last_atom-first_atom+1
567 & write (iout,*) 'int_index=',int_index,
568 & ' int_index_old',int_index_old,
569 & ' lower_index=',lower_index,
570 & ' upper_index=',upper_index,
571 & ' atom=',atom,' first_atom=',first_atom,
572 & ' last_atom=',last_atom
573 if (int_index.ge.lower_index) then
575 if (at_start.eq.0) then
577 jat_start=first_atom-1+lower_index-int_index_old
581 if (lprn) write (iout,*) 'jat_start',jat_start
582 if (int_index.ge.upper_index) then
584 jat_end=first_atom-1+upper_index-int_index_old
589 if (lprn) write (iout,*) 'jat_end',jat_end
593 c------------------------------------------------------------------------------
594 subroutine hpb_partition
595 implicit real*8 (a-h,o-z)
597 include 'COMMON.SBRIDGE'
598 include 'COMMON.IOUNITS'
600 include 'COMMON.INFO'
601 call int_bounds(nhpb,link_start,link_end)
606 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
607 cd & ' nhpb',nhpb,' link_start=',link_start,
608 cd & ' link_end',link_end