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"/
267 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
268 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
269 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC"/
270 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
271 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
274 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
277 c---------------------------------------------------------------------------
278 subroutine init_int_table
279 implicit real*8 (a-h,o-z)
281 include 'DIMENSIONS.ZSCOPT'
286 include 'COMMON.INFO'
288 include 'COMMON.CHAIN'
289 include 'COMMON.INTERACT'
290 include 'COMMON.LOCAL'
291 include 'COMMON.SBRIDGE'
292 include 'COMMON.IOUNITS'
293 logical scheck,lprint
295 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
296 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
297 C... Determine the numbers of start and end SC-SC interaction
298 C... to deal with by current processor.
301 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
302 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
303 MyRank=MyID-(MyGroup-1)*fgProcs
304 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
306 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
307 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
308 & ' my_sc_inde',my_sc_inde
328 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
329 cd & (ihpb(i),jhpb(i),i=1,nss)
334 if (ihpb(ii).eq.i+nres) then
341 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
345 write (iout,*) 'jj=i+1'
346 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
347 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
353 else if (jj.eq.nct) then
355 write (iout,*) 'jj=nct'
356 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
357 & iatsc_s,iatsc_e,i+1,nct-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,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
368 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
369 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
380 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
381 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
386 ind_scint=int_scint+nct-i
390 ind_scint_old=ind_scint
400 write (iout,*) 'Processor',MyID,' Group',MyGroup
401 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
405 write (iout,'(a)') 'Interaction array:'
407 write (iout,'(i3,2(2x,2i3))')
408 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
413 C Now partition the electrostatic-interaction array
415 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
416 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
418 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
419 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
420 & ' my_ele_inde',my_ele_inde
427 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
428 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
440 write (iout,'(a)') 'Electrostatic interaction array:'
442 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
447 C Partition the SC-p interaction array
449 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
450 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
452 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
453 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
454 & ' my_scp_inde',my_scp_inde
460 if (i.lt.nnt+iscp) then
461 cd write (iout,*) 'i.le.nnt+iscp'
462 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
463 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
465 else if (i.gt.nct-iscp) then
466 cd write (iout,*) 'i.gt.nct-iscp'
467 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
468 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
471 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
472 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
475 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
476 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
485 if (i.lt.nnt+iscp) then
487 iscpstart(i,1)=i+iscp
489 elseif (i.gt.nct-iscp) then
497 iscpstart(i,2)=i+iscp
503 write (iout,'(a)') 'SC-p interaction array:'
504 do i=iatscp_s,iatscp_e
505 write (iout,'(i3,2(2x,2i3))')
506 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
509 C Partition local interactions
511 call int_bounds(nres-2,loc_start,loc_end)
512 loc_start=loc_start+1
514 call int_bounds(nres-2,ithet_start,ithet_end)
515 ithet_start=ithet_start+2
516 ithet_end=ithet_end+2
517 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
518 iphi_start=iphi_start+nnt+2
519 iphi_end=iphi_end+nnt+2
520 call int_bounds(nres-3,itau_start,itau_end)
521 itau_start=itau_start+3
524 write (iout,*) 'Processor:',MyID,
525 & ' loc_start',loc_start,' loc_end',loc_end,
526 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
527 & ' iphi_start',iphi_start,' iphi_end',iphi_end
528 write (*,*) 'Processor:',MyID,
529 & ' loc_start',loc_start,' loc_end',loc_end,
530 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
531 & ' iphi_start',iphi_start,' iphi_end',iphi_end
533 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
534 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
535 & nele_int_tot,' electrostatic and ',nscp_int_tot,
536 & ' SC-p interactions','were distributed among',fgprocs,
537 & ' fine-grain processors.'
551 c---------------------------------------------------------------------------
552 subroutine int_partition(int_index,lower_index,upper_index,atom,
553 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
554 implicit real*8 (a-h,o-z)
556 include 'COMMON.IOUNITS'
557 integer int_index,lower_index,upper_index,atom,at_start,at_end,
558 & first_atom,last_atom,int_gr,jat_start,jat_end
561 if (lprn) write (iout,*) 'int_index=',int_index
562 int_index_old=int_index
563 int_index=int_index+last_atom-first_atom+1
565 & write (iout,*) 'int_index=',int_index,
566 & ' int_index_old',int_index_old,
567 & ' lower_index=',lower_index,
568 & ' upper_index=',upper_index,
569 & ' atom=',atom,' first_atom=',first_atom,
570 & ' last_atom=',last_atom
571 if (int_index.ge.lower_index) then
573 if (at_start.eq.0) then
575 jat_start=first_atom-1+lower_index-int_index_old
579 if (lprn) write (iout,*) 'jat_start',jat_start
580 if (int_index.ge.upper_index) then
582 jat_end=first_atom-1+upper_index-int_index_old
587 if (lprn) write (iout,*) 'jat_end',jat_end
591 c------------------------------------------------------------------------------
592 subroutine hpb_partition
593 implicit real*8 (a-h,o-z)
595 include 'COMMON.SBRIDGE'
596 include 'COMMON.IOUNITS'
598 include 'COMMON.INFO'
599 call int_bounds(nhpb,link_start,link_end)
604 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
605 cd & ' nhpb',nhpb,' link_start=',link_start,
606 cd & ' link_end',link_end