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 Lipidic input file for parameters range 60-79
69 C Set default weights of the energy terms.
115 athet(j,i,ichir1,ichir2)=0.0D0
116 bthet(j,i,ichir1,ichir2)=0.0D0
136 gaussc(l,k,j,i)=0.0D0
149 v1(k,j,i,iblock)=0.0D0
150 v2(k,j,i,iblock)=0.0D0
160 v1c(1,l,i,j,k,iblock)=0.0D0
161 v1s(1,l,i,j,k,iblock)=0.0D0
162 v1c(2,l,i,j,k,iblock)=0.0D0
163 v1s(2,l,i,j,k,iblock)=0.0D0
167 v2c(m,l,i,j,k,iblock)=0.0D0
168 v2s(m,l,i,j,k,iblock)=0.0D0
179 C Initialize the bridge arrays
192 dyn_ss_mask(i)=.false.
199 C Initialize variables used in minimization.
208 C Initialize the variables responsible for the mode of gradient storage.
214 if (print_order(i).eq.j) then
222 C Set timers and counters for the respective routines
241 nprint_ene=nprint_ene-1
245 c-------------------------------------------------------------------------
247 implicit real*8 (a-h,o-z)
249 include 'DIMENSIONS.ZSCOPT'
250 include 'COMMON.NAMES'
251 include 'COMMON.WEIGHTS'
252 include 'COMMON.FFIELD'
253 include 'COMMON.SHIELD'
255 &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
256 & 'DSG','DGN','DSN','DTH',
257 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
258 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
259 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
262 &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
263 &'a','y','w','v','l','i','f','m','c','x',
264 &'C','M','F','I','L','V','W','Y','A','G','T',
265 &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
266 data potname /'LJ','LJK','BP','GB','GBV'/
268 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
269 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
270 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
271 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T","ELIPTRAN",
272 & "EAFM","ETHETC","EMPTY","ETUBE"/
274 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
275 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
276 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC",
277 & "WLIPTRAN","WAFM","WTHETC","WSHIELD","WTUBE"/
278 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
279 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
280 & 0.0d0,0.0,0.0d0,0.0d0,0.0d0,0.0d0,0.0d0/
282 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
283 & 16,15,17,20,21,24,22,23,1,25/
285 c---------------------------------------------------------------------------
286 subroutine init_int_table
287 implicit real*8 (a-h,o-z)
289 include 'DIMENSIONS.ZSCOPT'
294 include 'COMMON.INFO'
296 include 'COMMON.CHAIN'
297 include 'COMMON.INTERACT'
298 include 'COMMON.LOCAL'
299 include 'COMMON.SBRIDGE'
300 include 'COMMON.IOUNITS'
301 logical scheck,lprint
303 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
304 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
305 C... Determine the numbers of start and end SC-SC interaction
306 C... to deal with by current processor.
309 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
310 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
311 MyRank=MyID-(MyGroup-1)*fgProcs
312 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
314 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
315 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
316 & ' my_sc_inde',my_sc_inde
336 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
337 cd & (ihpb(i),jhpb(i),i=1,nss)
342 if (ihpb(ii).eq.i+nres) then
349 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
353 write (iout,*) 'jj=i+1'
354 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
355 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
361 else if (jj.eq.nct) then
363 write (iout,*) 'jj=nct'
364 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
365 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
373 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
374 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
376 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
377 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
388 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
389 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
394 ind_scint=int_scint+nct-i
398 ind_scint_old=ind_scint
408 write (iout,*) 'Processor',MyID,' Group',MyGroup
409 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
413 write (iout,'(a)') 'Interaction array:'
415 write (iout,'(i3,2(2x,2i3))')
416 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
421 C Now partition the electrostatic-interaction array
423 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
424 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
426 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
427 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
428 & ' my_ele_inde',my_ele_inde
435 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
436 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
448 write (iout,'(a)') 'Electrostatic interaction array:'
450 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
455 C Partition the SC-p interaction array
457 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
458 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
460 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
461 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
462 & ' my_scp_inde',my_scp_inde
468 if (i.lt.nnt+iscp) then
469 cd write (iout,*) 'i.le.nnt+iscp'
470 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
471 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
473 else if (i.gt.nct-iscp) then
474 cd write (iout,*) 'i.gt.nct-iscp'
475 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
476 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
479 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
480 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
483 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
484 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
493 if (i.lt.nnt+iscp) then
495 iscpstart(i,1)=i+iscp
497 elseif (i.gt.nct-iscp) then
505 iscpstart(i,2)=i+iscp
511 write (iout,'(a)') 'SC-p interaction array:'
512 do i=iatscp_s,iatscp_e
513 write (iout,'(i3,2(2x,2i3))')
514 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
517 C Partition local interactions
519 call int_bounds(nres-2,loc_start,loc_end)
520 loc_start=loc_start+1
522 call int_bounds(nres-2,ithet_start,ithet_end)
523 ithet_start=ithet_start+2
524 ithet_end=ithet_end+2
525 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
526 iphi_start=iphi_start+nnt+2
527 iphi_end=iphi_end+nnt+2
528 call int_bounds(nres-3,itau_start,itau_end)
529 itau_start=itau_start+3
531 call int_bounds(nres-1,itube_start,itube_end)
532 itube_start=itube_start
535 write (iout,*) 'Processor:',MyID,
536 & ' loc_start',loc_start,' loc_end',loc_end,
537 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
538 & ' iphi_start',iphi_start,' iphi_end',iphi_end
539 write (*,*) 'Processor:',MyID,
540 & ' loc_start',loc_start,' loc_end',loc_end,
541 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
542 & ' iphi_start',iphi_start,' iphi_end',iphi_end
544 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
545 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
546 & nele_int_tot,' electrostatic and ',nscp_int_tot,
547 & ' SC-p interactions','were distributed among',fgprocs,
548 & ' fine-grain processors.'
564 c---------------------------------------------------------------------------
565 subroutine int_partition(int_index,lower_index,upper_index,atom,
566 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
567 implicit real*8 (a-h,o-z)
569 include 'COMMON.IOUNITS'
570 integer int_index,lower_index,upper_index,atom,at_start,at_end,
571 & first_atom,last_atom,int_gr,jat_start,jat_end
574 if (lprn) write (iout,*) 'int_index=',int_index
575 int_index_old=int_index
576 int_index=int_index+last_atom-first_atom+1
578 & write (iout,*) 'int_index=',int_index,
579 & ' int_index_old',int_index_old,
580 & ' lower_index=',lower_index,
581 & ' upper_index=',upper_index,
582 & ' atom=',atom,' first_atom=',first_atom,
583 & ' last_atom=',last_atom
584 if (int_index.ge.lower_index) then
586 if (at_start.eq.0) then
588 jat_start=first_atom-1+lower_index-int_index_old
592 if (lprn) write (iout,*) 'jat_start',jat_start
593 if (int_index.ge.upper_index) then
595 jat_end=first_atom-1+upper_index-int_index_old
600 if (lprn) write (iout,*) 'jat_end',jat_end
604 c------------------------------------------------------------------------------
605 subroutine hpb_partition
606 implicit real*8 (a-h,o-z)
608 include 'COMMON.SBRIDGE'
609 include 'COMMON.IOUNITS'
611 include 'COMMON.INFO'
612 call int_bounds(nhpb,link_start,link_end)
617 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
618 cd & ' nhpb',nhpb,' link_start=',link_start,
619 cd & ' link_end',link_end