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.
106 athet(j,i,ichir1,ichir2)=0.0D0
107 bthet(j,i,ichir1,ichir2)=0.0D0
127 gaussc(l,k,j,i)=0.0D0
140 v1(k,j,i,iblock)=0.0D0
141 v2(k,j,i,iblock)=0.0D0
151 v1c(1,l,i,j,k,iblock)=0.0D0
152 v1s(1,l,i,j,k,iblock)=0.0D0
153 v1c(2,l,i,j,k,iblock)=0.0D0
154 v1s(2,l,i,j,k,iblock)=0.0D0
158 v2c(m,l,i,j,k,iblock)=0.0D0
159 v2s(m,l,i,j,k,iblock)=0.0D0
170 C Initialize the bridge arrays
185 dyn_ss_mask(i)=.false.
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' ,'DPR','DLY','DAR','DHI','DAS','DGL','DSG','DGN','DSN','DTH',
247 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
248 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
249 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
251 &'z','p','k','r','h','d','e','n','q','s','t','g',
252 &'a','y','w','v','l','i','f','m','c','x',
253 &'C','M','F','I','L','V','W','Y','A','G','T',
254 &'S','Q','N','E','D','H','R','K','P','X'/
255 data potname /'LJ','LJK','BP','GB','GBV'/
257 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
258 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
259 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
260 & "ESTR","ESCCOR","EVDW2_14",""/
262 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
263 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
264 & "WHPB","WVDWPP","WBOND","WSCCOR","WSCP14",""/
266 data print_order /1,2,3,17,11,12,13,14,4,5,6,7,8,9,10,16,15,18,19,
269 c---------------------------------------------------------------------------
270 subroutine init_int_table
271 implicit real*8 (a-h,o-z)
273 include 'sizesclu.dat'
278 include 'COMMON.INFO'
280 include 'COMMON.CHAIN'
281 include 'COMMON.INTERACT'
282 include 'COMMON.LOCAL'
283 include 'COMMON.SBRIDGE'
284 include 'COMMON.IOUNITS'
285 logical scheck,lprint
287 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
288 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
289 C... Determine the numbers of start and end SC-SC interaction
290 C... to deal with by current processor.
293 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
294 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
295 MyRank=MyID-(MyGroup-1)*fgProcs
296 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
298 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
299 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
300 & ' my_sc_inde',my_sc_inde
320 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
321 cd & (ihpb(i),jhpb(i),i=1,nss)
325 if (ihpb(ii).eq.i+nres) then
333 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
337 write (iout,*) 'jj=i+1'
338 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
339 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
345 else if (jj.eq.nct) then
347 write (iout,*) 'jj=nct'
348 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
349 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
357 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
358 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
360 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
361 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
372 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
373 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
378 ind_scint=int_scint+nct-i
382 ind_scint_old=ind_scint
392 write (iout,*) 'Processor',MyID,' Group',MyGroup
393 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
397 write (iout,'(a)') 'Interaction array:'
399 write (iout,'(i3,2(2x,2i3))')
400 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
405 C Now partition the electrostatic-interaction array
407 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
408 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
410 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
411 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
412 & ' my_ele_inde',my_ele_inde
419 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
420 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
432 write (iout,'(a)') 'Electrostatic interaction array:'
434 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
439 C Partition the SC-p interaction array
441 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
442 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
444 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
445 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
446 & ' my_scp_inde',my_scp_inde
452 if (i.lt.nnt+iscp) then
453 cd write (iout,*) 'i.le.nnt+iscp'
454 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
455 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
457 else if (i.gt.nct-iscp) then
458 cd write (iout,*) 'i.gt.nct-iscp'
459 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
460 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
463 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
464 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
467 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
468 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
477 if (i.lt.nnt+iscp) then
479 iscpstart(i,1)=i+iscp
481 elseif (i.gt.nct-iscp) then
489 iscpstart(i,2)=i+iscp
495 write (iout,'(a)') 'SC-p interaction array:'
496 do i=iatscp_s,iatscp_e
497 write (iout,'(i3,2(2x,2i3))')
498 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
501 C Partition local interactions
503 call int_bounds(nres-2,loc_start,loc_end)
504 loc_start=loc_start+1
506 call int_bounds(nres-2,ithet_start,ithet_end)
507 ithet_start=ithet_start+2
508 ithet_end=ithet_end+2
509 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
510 iphi_start=iphi_start+nnt+2
511 iphi_end=iphi_end+nnt+2
512 call int_bounds(nres-3,itau_start,itau_end)
513 itau_start=itau_start+3
516 write (iout,*) 'Processor:',MyID,
517 & ' loc_start',loc_start,' loc_end',loc_end,
518 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
519 & ' iphi_start',iphi_start,' iphi_end',iphi_end
520 write (*,*) 'Processor:',MyID,
521 & ' loc_start',loc_start,' loc_end',loc_end,
522 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
523 & ' iphi_start',iphi_start,' iphi_end',iphi_end
525 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
526 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
527 & nele_int_tot,' electrostatic and ',nscp_int_tot,
528 & ' SC-p interactions','were distributed among',fgprocs,
529 & ' fine-grain processors.'
544 c---------------------------------------------------------------------------
545 subroutine int_partition(int_index,lower_index,upper_index,atom,
546 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
547 implicit real*8 (a-h,o-z)
549 include 'COMMON.IOUNITS'
550 integer int_index,lower_index,upper_index,atom,at_start,at_end,
551 & first_atom,last_atom,int_gr,jat_start,jat_end
554 if (lprn) write (iout,*) 'int_index=',int_index
555 int_index_old=int_index
556 int_index=int_index+last_atom-first_atom+1
558 & write (iout,*) 'int_index=',int_index,
559 & ' int_index_old',int_index_old,
560 & ' lower_index=',lower_index,
561 & ' upper_index=',upper_index,
562 & ' atom=',atom,' first_atom=',first_atom,
563 & ' last_atom=',last_atom
564 if (int_index.ge.lower_index) then
566 if (at_start.eq.0) then
568 jat_start=first_atom-1+lower_index-int_index_old
572 if (lprn) write (iout,*) 'jat_start',jat_start
573 if (int_index.ge.upper_index) then
575 jat_end=first_atom-1+upper_index-int_index_old
580 if (lprn) write (iout,*) 'jat_end',jat_end
584 c------------------------------------------------------------------------------
585 subroutine hpb_partition
586 implicit real*8 (a-h,o-z)
588 include 'COMMON.SBRIDGE'
589 include 'COMMON.IOUNITS'
591 include 'COMMON.INFO'
592 call int_bounds(nhpb,link_start,link_end)
597 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
598 cd & ' nhpb',nhpb,' link_start=',link_start,
599 cd & ' link_end',link_end