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
167 C Initialize variables used in minimization.
176 C Initialize the variables responsible for the mode of gradient storage.
182 if (print_order(i).eq.j) then
190 C Set timers and counters for the respective routines
209 nprint_ene=nprint_ene-1
213 c-------------------------------------------------------------------------
215 implicit real*8 (a-h,o-z)
217 include 'DIMENSIONS.ZSCOPT'
218 include 'COMMON.NAMES'
219 include 'COMMON.WEIGHTS'
220 include 'COMMON.FFIELD'
222 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
223 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
225 &'C','M','F','I','L','V','W','Y','A','G','T',
226 &'S','Q','N','E','D','H','R','K','P','X'/
227 data potname /'LJ','LJK','BP','GB','GBV'/
229 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
230 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
231 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
232 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T"/
234 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
235 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
236 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC"/
237 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
238 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
241 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
244 c---------------------------------------------------------------------------
245 subroutine init_int_table
246 implicit real*8 (a-h,o-z)
248 include 'DIMENSIONS.ZSCOPT'
253 include 'COMMON.INFO'
255 include 'COMMON.CHAIN'
256 include 'COMMON.INTERACT'
257 include 'COMMON.LOCAL'
258 include 'COMMON.SBRIDGE'
259 include 'COMMON.IOUNITS'
260 logical scheck,lprint
262 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
263 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
264 C... Determine the numbers of start and end SC-SC interaction
265 C... to deal with by current processor.
268 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
269 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
270 MyRank=MyID-(MyGroup-1)*fgProcs
271 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
273 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
274 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
275 & ' my_sc_inde',my_sc_inde
295 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
296 cd & (ihpb(i),jhpb(i),i=1,nss)
300 if (ihpb(ii).eq.i+nres) then
307 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
311 write (iout,*) 'jj=i+1'
312 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
313 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
319 else if (jj.eq.nct) then
321 write (iout,*) 'jj=nct'
322 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
323 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
331 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
332 & iatsc_s,iatsc_e,i+1,jj-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,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
346 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
347 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
352 ind_scint=int_scint+nct-i
356 ind_scint_old=ind_scint
366 write (iout,*) 'Processor',MyID,' Group',MyGroup
367 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
371 write (iout,'(a)') 'Interaction array:'
373 write (iout,'(i3,2(2x,2i3))')
374 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
379 C Now partition the electrostatic-interaction array
381 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
382 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
384 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
385 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
386 & ' my_ele_inde',my_ele_inde
393 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
394 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
406 write (iout,'(a)') 'Electrostatic interaction array:'
408 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
413 C Partition the SC-p interaction array
415 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
416 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
418 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
419 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
420 & ' my_scp_inde',my_scp_inde
426 if (i.lt.nnt+iscp) then
427 cd write (iout,*) 'i.le.nnt+iscp'
428 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
429 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
431 else if (i.gt.nct-iscp) then
432 cd write (iout,*) 'i.gt.nct-iscp'
433 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
434 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
437 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
438 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
441 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
442 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
451 if (i.lt.nnt+iscp) then
453 iscpstart(i,1)=i+iscp
455 elseif (i.gt.nct-iscp) then
463 iscpstart(i,2)=i+iscp
469 write (iout,'(a)') 'SC-p interaction array:'
470 do i=iatscp_s,iatscp_e
471 write (iout,'(i3,2(2x,2i3))')
472 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
475 C Partition local interactions
477 call int_bounds(nres-2,loc_start,loc_end)
478 loc_start=loc_start+1
480 call int_bounds(nres-2,ithet_start,ithet_end)
481 ithet_start=ithet_start+2
482 ithet_end=ithet_end+2
483 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
484 iphi_start=iphi_start+nnt+2
485 iphi_end=iphi_end+nnt+2
487 write (iout,*) 'Processor:',MyID,
488 & ' loc_start',loc_start,' loc_end',loc_end,
489 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
490 & ' iphi_start',iphi_start,' iphi_end',iphi_end
491 write (*,*) 'Processor:',MyID,
492 & ' loc_start',loc_start,' loc_end',loc_end,
493 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
494 & ' iphi_start',iphi_start,' iphi_end',iphi_end
496 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
497 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
498 & nele_int_tot,' electrostatic and ',nscp_int_tot,
499 & ' SC-p interactions','were distributed among',fgprocs,
500 & ' fine-grain processors.'
512 c---------------------------------------------------------------------------
513 subroutine int_partition(int_index,lower_index,upper_index,atom,
514 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
515 implicit real*8 (a-h,o-z)
517 include 'COMMON.IOUNITS'
518 integer int_index,lower_index,upper_index,atom,at_start,at_end,
519 & first_atom,last_atom,int_gr,jat_start,jat_end
522 if (lprn) write (iout,*) 'int_index=',int_index
523 int_index_old=int_index
524 int_index=int_index+last_atom-first_atom+1
526 & write (iout,*) 'int_index=',int_index,
527 & ' int_index_old',int_index_old,
528 & ' lower_index=',lower_index,
529 & ' upper_index=',upper_index,
530 & ' atom=',atom,' first_atom=',first_atom,
531 & ' last_atom=',last_atom
532 if (int_index.ge.lower_index) then
534 if (at_start.eq.0) then
536 jat_start=first_atom-1+lower_index-int_index_old
540 if (lprn) write (iout,*) 'jat_start',jat_start
541 if (int_index.ge.upper_index) then
543 jat_end=first_atom-1+upper_index-int_index_old
548 if (lprn) write (iout,*) 'jat_end',jat_end
552 c------------------------------------------------------------------------------
553 subroutine hpb_partition
554 implicit real*8 (a-h,o-z)
556 include 'COMMON.SBRIDGE'
557 include 'COMMON.IOUNITS'
559 include 'COMMON.INFO'
560 call int_bounds(nhpb,link_start,link_end)
565 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
566 cd & ' nhpb',nhpb,' link_start=',link_start,
567 cd & ' link_end',link_end