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
65 C Lipidic input file for parameters range 60-79
68 C Set default weights of the energy terms.
114 athet(j,i,ichir1,ichir2)=0.0D0
115 bthet(j,i,ichir1,ichir2)=0.0D0
135 gaussc(l,k,j,i)=0.0D0
148 v1(k,j,i,iblock)=0.0D0
149 v2(k,j,i,iblock)=0.0D0
159 v1c(1,l,i,j,k,iblock)=0.0D0
160 v1s(1,l,i,j,k,iblock)=0.0D0
161 v1c(2,l,i,j,k,iblock)=0.0D0
162 v1s(2,l,i,j,k,iblock)=0.0D0
166 v2c(m,l,i,j,k,iblock)=0.0D0
167 v2s(m,l,i,j,k,iblock)=0.0D0
178 C Initialize the bridge arrays
191 dyn_ss_mask(i)=.false.
198 C Initialize variables used in minimization.
207 C Initialize the variables responsible for the mode of gradient storage.
213 if (print_order(i).eq.j) then
221 C Set timers and counters for the respective routines
240 nprint_ene=nprint_ene-1
244 c-------------------------------------------------------------------------
246 implicit real*8 (a-h,o-z)
248 include 'DIMENSIONS.ZSCOPT'
249 include 'COMMON.NAMES'
250 include 'COMMON.WEIGHTS'
251 include 'COMMON.FFIELD'
252 include 'COMMON.SHIELD'
254 &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
255 & 'DSG','DGN','DSN','DTH',
256 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
257 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
258 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
261 &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
262 &'a','y','w','v','l','i','f','m','c','x',
263 &'C','M','F','I','L','V','W','Y','A','G','T',
264 &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
265 data potname /'LJ','LJK','BP','GB','GBV'/
267 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
268 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
269 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
270 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T","ELIPTRAN",
271 & "EAFM","ETHETC","EMPTY"/
273 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
274 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
275 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC",
276 & "WLIPTRAN","WAFM","WTHETC","WSHIELD"/
277 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
278 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
279 & 0.0d0,0.0,0.0d0,0.0d0,0.0d0,0.0d0/
281 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
282 & 16,15,17,20,21,24,22,23,1/
284 c---------------------------------------------------------------------------
285 subroutine init_int_table
286 implicit real*8 (a-h,o-z)
288 include 'DIMENSIONS.ZSCOPT'
293 include 'COMMON.INFO'
295 include 'COMMON.CHAIN'
296 include 'COMMON.INTERACT'
297 include 'COMMON.LOCAL'
298 include 'COMMON.SBRIDGE'
299 include 'COMMON.IOUNITS'
300 logical scheck,lprint
302 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
303 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
304 C... Determine the numbers of start and end SC-SC interaction
305 C... to deal with by current processor.
308 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
309 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
310 MyRank=MyID-(MyGroup-1)*fgProcs
311 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
313 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
314 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
315 & ' my_sc_inde',my_sc_inde
335 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
336 cd & (ihpb(i),jhpb(i),i=1,nss)
341 if (ihpb(ii).eq.i+nres) then
348 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
352 write (iout,*) 'jj=i+1'
353 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
354 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
360 else if (jj.eq.nct) then
362 write (iout,*) 'jj=nct'
363 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
364 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
372 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
373 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
375 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
376 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
387 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
388 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
393 ind_scint=int_scint+nct-i
397 ind_scint_old=ind_scint
407 write (iout,*) 'Processor',MyID,' Group',MyGroup
408 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
412 write (iout,'(a)') 'Interaction array:'
414 write (iout,'(i3,2(2x,2i3))')
415 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
420 C Now partition the electrostatic-interaction array
422 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
423 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
425 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
426 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
427 & ' my_ele_inde',my_ele_inde
434 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
435 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
447 write (iout,'(a)') 'Electrostatic interaction array:'
449 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
454 C Partition the SC-p interaction array
456 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
457 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
459 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
460 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
461 & ' my_scp_inde',my_scp_inde
467 if (i.lt.nnt+iscp) then
468 cd write (iout,*) 'i.le.nnt+iscp'
469 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
470 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
472 else if (i.gt.nct-iscp) then
473 cd write (iout,*) 'i.gt.nct-iscp'
474 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
475 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
478 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
479 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
482 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
483 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
492 if (i.lt.nnt+iscp) then
494 iscpstart(i,1)=i+iscp
496 elseif (i.gt.nct-iscp) then
504 iscpstart(i,2)=i+iscp
510 write (iout,'(a)') 'SC-p interaction array:'
511 do i=iatscp_s,iatscp_e
512 write (iout,'(i3,2(2x,2i3))')
513 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
516 C Partition local interactions
518 call int_bounds(nres-2,loc_start,loc_end)
519 loc_start=loc_start+1
521 call int_bounds(nres-2,ithet_start,ithet_end)
522 ithet_start=ithet_start+2
523 ithet_end=ithet_end+2
524 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
525 iphi_start=iphi_start+nnt+2
526 iphi_end=iphi_end+nnt+2
527 call int_bounds(nres-3,itau_start,itau_end)
528 itau_start=itau_start+3
531 write (iout,*) 'Processor:',MyID,
532 & ' loc_start',loc_start,' loc_end',loc_end,
533 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
534 & ' iphi_start',iphi_start,' iphi_end',iphi_end
535 write (*,*) '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
540 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
541 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
542 & nele_int_tot,' electrostatic and ',nscp_int_tot,
543 & ' SC-p interactions','were distributed among',fgprocs,
544 & ' fine-grain processors.'
558 c---------------------------------------------------------------------------
559 subroutine int_partition(int_index,lower_index,upper_index,atom,
560 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
561 implicit real*8 (a-h,o-z)
563 include 'COMMON.IOUNITS'
564 integer int_index,lower_index,upper_index,atom,at_start,at_end,
565 & first_atom,last_atom,int_gr,jat_start,jat_end
568 if (lprn) write (iout,*) 'int_index=',int_index
569 int_index_old=int_index
570 int_index=int_index+last_atom-first_atom+1
572 & write (iout,*) 'int_index=',int_index,
573 & ' int_index_old',int_index_old,
574 & ' lower_index=',lower_index,
575 & ' upper_index=',upper_index,
576 & ' atom=',atom,' first_atom=',first_atom,
577 & ' last_atom=',last_atom
578 if (int_index.ge.lower_index) then
580 if (at_start.eq.0) then
582 jat_start=first_atom-1+lower_index-int_index_old
586 if (lprn) write (iout,*) 'jat_start',jat_start
587 if (int_index.ge.upper_index) then
589 jat_end=first_atom-1+upper_index-int_index_old
594 if (lprn) write (iout,*) 'jat_end',jat_end
598 c------------------------------------------------------------------------------
599 subroutine hpb_partition
600 implicit real*8 (a-h,o-z)
602 include 'COMMON.SBRIDGE'
603 include 'COMMON.IOUNITS'
605 include 'COMMON.INFO'
606 call int_bounds(nhpb,link_start,link_end)
611 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
612 cd & ' nhpb',nhpb,' link_start=',link_start,
613 cd & ' link_end',link_end