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'
253 &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
254 & 'DSG','DGN','DSN','DTH',
255 &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
256 &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
257 &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
260 &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
261 &'a','y','w','v','l','i','f','m','c','x',
262 &'C','M','F','I','L','V','W','Y','A','G','T',
263 &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
264 data potname /'LJ','LJK','BP','GB','GBV'/
266 & "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
267 & "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
268 & "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB","EVDWPP",
269 & "EVDW2_14","ESTR","ESCCOR","EDIHC","EVDW_T","ELIPTRAN",
270 & "EAFM","ETHETC","EMPTY"/
272 & "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
273 & "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
274 & "WHPB","WVDWPP","WSCP14","WBOND","WSCCOR","WDIHC","WSC",
275 & "WLIPTRAN","WAFM","WTHETC","WSHIELD"/
276 data ww0 /1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,
277 & 1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,1.0d0,0.4d0,1.0d0,1.0d0,
278 & 0.0d0,0.0,0.0d0,0.0d0,0.0d0,0.0d0/
280 data print_order /1,2,3,18,11,12,13,14,4,5,6,7,8,9,10,19,
281 & 16,15,17,20,21,24,22,23,1/
283 c---------------------------------------------------------------------------
284 subroutine init_int_table
285 implicit real*8 (a-h,o-z)
287 include 'DIMENSIONS.ZSCOPT'
292 include 'COMMON.INFO'
294 include 'COMMON.CHAIN'
295 include 'COMMON.INTERACT'
296 include 'COMMON.LOCAL'
297 include 'COMMON.SBRIDGE'
298 include 'COMMON.IOUNITS'
299 logical scheck,lprint
301 integer my_sc_int(0:max_fg_Procs-1),my_sc_intt(0:max_fg_Procs),
302 & my_ele_int(0:max_fg_Procs-1),my_ele_intt(0:max_fg_Procs)
303 C... Determine the numbers of start and end SC-SC interaction
304 C... to deal with by current processor.
307 &write (iout,*) 'INIT_INT_TABLE nres=',nres,' nnt=',nnt,' nct=',nct
308 n_sc_int_tot=(nct-nnt+1)*(nct-nnt)/2-nss
309 MyRank=MyID-(MyGroup-1)*fgProcs
310 call int_bounds(n_sc_int_tot,my_sc_inds,my_sc_inde)
312 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
313 & ' n_sc_int_tot',n_sc_int_tot,' my_sc_inds=',my_sc_inds,
314 & ' my_sc_inde',my_sc_inde
334 cd write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
335 cd & (ihpb(i),jhpb(i),i=1,nss)
340 if (ihpb(ii).eq.i+nres) then
347 cd write (iout,*) 'i=',i,' scheck=',scheck,' jj=',jj
351 write (iout,*) 'jj=i+1'
352 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
353 & iatsc_s,iatsc_e,i+2,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
359 else if (jj.eq.nct) then
361 write (iout,*) 'jj=nct'
362 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
363 & iatsc_s,iatsc_e,i+1,nct-1,nint_gr(i),istart(i,1),iend(i,1),*12)
371 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
372 & iatsc_s,iatsc_e,i+1,jj-1,nint_gr(i),istart(i,1),iend(i,1),*12)
374 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
375 & iatsc_s,iatsc_e,jj+1,nct,nint_gr(i),istart(i,ii),iend(i,ii),*12)
386 call int_partition(ind_scint,my_sc_inds,my_sc_inde,i,
387 & iatsc_s,iatsc_e,i+1,nct,nint_gr(i),istart(i,1),iend(i,1),*12)
392 ind_scint=int_scint+nct-i
396 ind_scint_old=ind_scint
406 write (iout,*) 'Processor',MyID,' Group',MyGroup
407 write (iout,*) 'iatsc_s=',iatsc_s,' iatsc_e=',iatsc_e
411 write (iout,'(a)') 'Interaction array:'
413 write (iout,'(i3,2(2x,2i3))')
414 & i,(istart(i,iint),iend(i,iint),iint=1,nint_gr(i))
419 C Now partition the electrostatic-interaction array
421 nele_int_tot=(npept-ispp)*(npept-ispp+1)/2
422 call int_bounds(nele_int_tot,my_ele_inds,my_ele_inde)
424 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
425 & ' nele_int_tot',nele_int_tot,' my_ele_inds=',my_ele_inds,
426 & ' my_ele_inde',my_ele_inde
433 call int_partition(ind_eleint,my_ele_inds,my_ele_inde,i,
434 & iatel_s,iatel_e,i+ispp,nct-1,ijunk,ielstart(i),ielend(i),*13)
446 write (iout,'(a)') 'Electrostatic interaction array:'
448 write (iout,'(i3,2(2x,2i3))') i,ielstart(i),ielend(i)
453 C Partition the SC-p interaction array
455 nscp_int_tot=(npept-iscp+1)*(npept-iscp+1)
456 call int_bounds(nscp_int_tot,my_scp_inds,my_scp_inde)
458 & write (iout,*) 'Processor',MyID,' MyRank',MyRank,
459 & ' nscp_int_tot',nscp_int_tot,' my_scp_inds=',my_scp_inds,
460 & ' my_scp_inde',my_scp_inde
466 if (i.lt.nnt+iscp) then
467 cd write (iout,*) 'i.le.nnt+iscp'
468 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
469 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,1),
471 else if (i.gt.nct-iscp) then
472 cd write (iout,*) 'i.gt.nct-iscp'
473 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
474 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
477 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
478 & iatscp_s,iatscp_e,nnt,i-iscp,nscp_gr(i),iscpstart(i,1),
481 call int_partition(ind_scpint,my_scp_inds,my_scp_inde,i,
482 & iatscp_s,iatscp_e,i+iscp,nct,nscp_gr(i),iscpstart(i,ii),
491 if (i.lt.nnt+iscp) then
493 iscpstart(i,1)=i+iscp
495 elseif (i.gt.nct-iscp) then
503 iscpstart(i,2)=i+iscp
509 write (iout,'(a)') 'SC-p interaction array:'
510 do i=iatscp_s,iatscp_e
511 write (iout,'(i3,2(2x,2i3))')
512 & i,(iscpstart(i,j),iscpend(i,j),j=1,nscp_gr(i))
515 C Partition local interactions
517 call int_bounds(nres-2,loc_start,loc_end)
518 loc_start=loc_start+1
520 call int_bounds(nres-2,ithet_start,ithet_end)
521 ithet_start=ithet_start+2
522 ithet_end=ithet_end+2
523 call int_bounds(nct-nnt-2,iphi_start,iphi_end)
524 iphi_start=iphi_start+nnt+2
525 iphi_end=iphi_end+nnt+2
526 call int_bounds(nres-3,itau_start,itau_end)
527 itau_start=itau_start+3
530 write (iout,*) 'Processor:',MyID,
531 & ' loc_start',loc_start,' loc_end',loc_end,
532 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
533 & ' iphi_start',iphi_start,' iphi_end',iphi_end
534 write (*,*) 'Processor:',MyID,
535 & ' loc_start',loc_start,' loc_end',loc_end,
536 & ' ithet_start',ithet_start,' ithet_end',ithet_end,
537 & ' iphi_start',iphi_start,' iphi_end',iphi_end
539 if (fgprocs.gt.1 .and. MyID.eq.BossID) then
540 write(iout,'(i10,a,i10,a,i10,a/a,i3,a)') n_sc_int_tot,' SC-SC ',
541 & nele_int_tot,' electrostatic and ',nscp_int_tot,
542 & ' SC-p interactions','were distributed among',fgprocs,
543 & ' fine-grain processors.'
557 c---------------------------------------------------------------------------
558 subroutine int_partition(int_index,lower_index,upper_index,atom,
559 & at_start,at_end,first_atom,last_atom,int_gr,jat_start,jat_end,*)
560 implicit real*8 (a-h,o-z)
562 include 'COMMON.IOUNITS'
563 integer int_index,lower_index,upper_index,atom,at_start,at_end,
564 & first_atom,last_atom,int_gr,jat_start,jat_end
567 if (lprn) write (iout,*) 'int_index=',int_index
568 int_index_old=int_index
569 int_index=int_index+last_atom-first_atom+1
571 & write (iout,*) 'int_index=',int_index,
572 & ' int_index_old',int_index_old,
573 & ' lower_index=',lower_index,
574 & ' upper_index=',upper_index,
575 & ' atom=',atom,' first_atom=',first_atom,
576 & ' last_atom=',last_atom
577 if (int_index.ge.lower_index) then
579 if (at_start.eq.0) then
581 jat_start=first_atom-1+lower_index-int_index_old
585 if (lprn) write (iout,*) 'jat_start',jat_start
586 if (int_index.ge.upper_index) then
588 jat_end=first_atom-1+upper_index-int_index_old
593 if (lprn) write (iout,*) 'jat_end',jat_end
597 c------------------------------------------------------------------------------
598 subroutine hpb_partition
599 implicit real*8 (a-h,o-z)
601 include 'COMMON.SBRIDGE'
602 include 'COMMON.IOUNITS'
604 include 'COMMON.INFO'
605 call int_bounds(nhpb,link_start,link_end)
610 cd write (iout,*) 'Processor',MyID,' MyRank',MyRank,
611 cd & ' nhpb',nhpb,' link_start=',link_start,
612 cd & ' link_end',link_end
615 c------------------------------------------------------------------------------
616 subroutine homology_partition
617 implicit real*8 (a-h,o-z)
619 include 'DIMENSIONS.ZSCOPT'
620 include 'DIMENSIONS.FREE'
624 include 'COMMON.SBRIDGE'
625 include 'COMMON.IOUNITS'
626 c include 'COMMON.SETUP'
627 include 'COMMON.CONTROL'
628 include 'COMMON.CHAIN'
629 include 'COMMON.INTERACT'
630 include 'COMMON.HOMRESTR'
631 write(iout,*)"homology_partition: lim_odl=",lim_odl,
634 call int_bounds(lim_odl,link_start_homo,link_end_homo)
635 call int_bounds(lim_dih,idihconstr_start_homo,
636 & idihconstr_end_homo)
637 idihconstr_start_homo=idihconstr_start_homo+nnt-1+3
638 idihconstr_end_homo=idihconstr_end_homo+nnt-1+3
639 if (me.eq.king .or. .not. out1file)
640 & write (iout,*) 'Processor',fg_rank,' CG group',kolor,
641 & ' absolute rank',MyRank,
642 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
643 & ' link_end',link_end_homo,' lim_dih',lim_dih,
644 & ' idihconstr_start_homo',idihconstr_start_homo,
645 & ' idihconstr_end_homo',idihconstr_end_homo
648 link_end_homo=lim_odl
649 idihconstr_start_homo=nnt+3
650 idihconstr_end_homo=lim_dih+nnt-1+3
652 & ' lim_odl',lim_odl,' link_start=',link_start_homo,
653 & ' link_end',link_end_homo,' lim_dih',lim_dih,
654 & ' idihconstr_start_homo',idihconstr_start_homo,
655 & ' idihconstr_end_homo',idihconstr_end_homo