important change for single processor for multi-chain
[unres.git] / source / unres / src_MD-M / initialize_p.F
index aa5dfb9..33b33a4 100644 (file)
@@ -80,7 +80,9 @@ C
       igeom=  8
       intin=  9
       ithep= 11
+      ithep_pdb=51
       irotam=12
+      irotam_pdb=52
       itorp= 13
       itordp= 23
       ielep= 14
@@ -194,6 +196,7 @@ c      call memmon_print_usage()
       dsc(ntyp1)=0.0D0
       do i=-maxtor,maxtor
         itortyp(i)=0
+cc      write (iout,*) "TU DOCHODZE",i,itortyp(i)
        do iblock=1,2
         do j=-maxtor,maxtor
           do k=1,maxterm
@@ -242,6 +245,22 @@ C Initialize the bridge arrays
        ihpb(i)=0
        jhpb(i)=0
       enddo
+C Initialize correlation arrays
+      do i=-maxtor,maxtor
+       do k=1,2
+        b1(k,i)=0.0
+        b2(k,i)=0.0
+        b1tilde(k,i)=0.0
+c        b2tilde(k,i)=0.0
+        do j=1,2
+        CC(j,k,i)=0.0
+        Ctilde(j,k,i)=0.0
+        DD(j,k,i)=0.0
+        Dtilde(j,k,i)=0.0
+        EE(j,k,i)=0.0
+        enddo
+       enddo
+      enddo
 C
 C Initialize timing.
 C
@@ -264,8 +283,8 @@ C
 C Initialize constants used to split the energy into long- and short-range
 C components
 C
-      r_cut=2.0d0
-      rlamb=0.3d0
+C      r_cut=2.0d0
+C      rlamb=0.3d0
 #ifndef SPLITELE
       nprint_ene=nprint_ene-1
 #endif
@@ -278,15 +297,17 @@ c-------------------------------------------------------------------------
       include 'COMMON.NAMES'
       include 'COMMON.FFIELD'
       data restyp /
-     &'DD' ,'DPR','DLY','DAR','DHI','DAS','DGL','DSG','DGN','DSN','DTH',
+     &'DD','DAU','DAI','DDB','DSM','DPR','DLY','DAR','DHI','DAS','DGL',
+     & 'DSG','DGN','DSN','DTH',
      &'DYY','DAL','DTY','DTR','DVA','DLE','DIL','DPN','MED','DCY','ZER',
      &'CYS','MET','PHE','ILE','LEU','VAL','TRP','TYR','ALA','GLY','THR',
-     &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','D'/
+     &'SER','GLN','ASN','GLU','ASP','HIS','ARG','LYS','PRO','SME','DBZ',
+     &'AIB','ABU','D'/
       data onelet /
-     &'z','p','k','r','h','d','e','n','q','s','t','g',
+     &'z','z','z','z','z','p','k','r','h','d','e','n','q','s','t','g',
      &'a','y','w','v','l','i','f','m','c','x',
      &'C','M','F','I','L','V','W','Y','A','G','T',
-     &'S','Q','N','E','D','H','R','K','P','X'/
+     &'S','Q','N','E','D','H','R','K','P','z','z','z','z','X'/
       data potname /'LJ','LJK','BP','GB','GBV'/
       data ename /
      &   "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
@@ -319,11 +340,11 @@ c---------------------------------------------------------------------------
       include 'COMMON.IOUNITS'
       include 'COMMON.DERIV'
       include 'COMMON.CONTACTS'
-      common /przechowalnia/ iturn3_start_all(0:MaxProcs),
-     & iturn3_end_all(0:MaxProcs),iturn4_start_all(0:MaxProcs),
-     & iturn4_end_all(0:MaxProcs),iatel_s_all(0:MaxProcs),
-     & iatel_e_all(0:MaxProcs),ielstart_all(maxres,0:MaxProcs-1),
-     & ielend_all(maxres,0:MaxProcs-1),
+      common /przechowalnia/ iturn3_start_all(0:max_fg_procs),
+     & iturn3_end_all(0:max_fg_procs),iturn4_start_all(0:max_fg_procs),
+     & iturn4_end_all(0:max_fg_procs),iatel_s_all(0:max_fg_procs),
+     &iatel_e_all(0:max_fg_procs),ielstart_all(maxres,0:max_fg_procs-1),
+     & ielend_all(maxres,0:max_fg_procs-1),
      & ntask_cont_from_all(0:max_fg_procs-1),
      & itask_cont_from_all(0:max_fg_procs-1,0:max_fg_procs-1),
      & ntask_cont_to_all(0:max_fg_procs-1),
@@ -372,6 +393,7 @@ cd    write (iout,*) 'ns=',ns,' nss=',nss,' ihpb,jhpb',
 cd   &   (ihpb(i),jhpb(i),i=1,nss)
       do i=nnt,nct-1
         scheck=.false.
+        if (dyn_ss) goto 10
         do ii=1,nss
           if (ihpb(ii).eq.i+nres) then
             scheck=.true.
@@ -591,6 +613,9 @@ C Partition local interactions
       iphi_end=iturn3_end+2
       iturn3_start=iturn3_start-1
       iturn3_end=iturn3_end-1
+      call int_bounds(nres-3,itau_start,itau_end)
+      itau_start=itau_start+3
+      itau_end=itau_end+3
       call int_bounds(nres-3,iphi1_start,iphi1_end)
       iphi1_start=iphi1_start+3
       iphi1_end=iphi1_end+3
@@ -1119,10 +1144,13 @@ c        write (iout,*) "MPI_ROTAT2",MPI_ROTAT2
       idihconstr_end=ndih_constr
       iphid_start=iphi_start
       iphid_end=iphi_end-1
+      itau_start=4
+      itau_end=nres
       ibond_start=2
       ibond_end=nres-1
       ibondp_start=nnt
-      ibondp_end=nct-1
+C      ibondp_end=nct-1
+      ibondp_end=nct
       ivec_start=1
       ivec_end=nres-1
       iset_start=3
@@ -1140,15 +1168,16 @@ c---------------------------------------------------------------------------
       include "COMMON.INTERACT"
       include "COMMON.SETUP"
       include "COMMON.IOUNITS"
-      integer ii,jj,itask(4),ntask_cont_to,itask_cont_to(0:MaxProcs-1)
+      integer ii,jj,itask(4),ntask_cont_to,
+     &itask_cont_to(0:max_fg_procs-1)
       logical flag
       integer iturn3_start_all,iturn3_end_all,iturn4_start_all,
      & iturn4_end_all,iatel_s_all,iatel_e_all,ielstart_all,ielend_all
-      common /przechowalnia/ iturn3_start_all(0:MaxProcs),
-     & iturn3_end_all(0:MaxProcs),iturn4_start_all(0:MaxProcs),
-     & iturn4_end_all(0:MaxProcs),iatel_s_all(0:MaxProcs),
-     & iatel_e_all(0:MaxProcs),ielstart_all(maxres,0:MaxProcs-1),
-     & ielend_all(maxres,0:MaxProcs-1)
+      common /przechowalnia/ iturn3_start_all(0:max_fg_procs),
+     & iturn3_end_all(0:max_fg_procs),iturn4_start_all(0:max_fg_procs),
+     & iturn4_end_all(0:max_fg_procs),iatel_s_all(0:max_fg_procs),
+     &iatel_e_all(0:max_fg_procs),ielstart_all(maxres,0:max_fg_procs-1),
+     & ielend_all(maxres,0:max_fg_procs-1)
       integer iproc,isent,k,l
 c Determines whether to send interaction ii,jj to other processors; a given
 c interaction can be sent to at most 2 processors.
@@ -1230,15 +1259,15 @@ c---------------------------------------------------------------------------
       include "COMMON.SETUP"
       include "COMMON.IOUNITS"
       integer ii,jj,itask(2),ntask_cont_from,
-     & itask_cont_from(0:MaxProcs-1)
+     & itask_cont_from(0:max_fg_procs-1)
       logical flag
       integer iturn3_start_all,iturn3_end_all,iturn4_start_all,
      & iturn4_end_all,iatel_s_all,iatel_e_all,ielstart_all,ielend_all
-      common /przechowalnia/ iturn3_start_all(0:MaxProcs),
-     & iturn3_end_all(0:MaxProcs),iturn4_start_all(0:MaxProcs),
-     & iturn4_end_all(0:MaxProcs),iatel_s_all(0:MaxProcs),
-     & iatel_e_all(0:MaxProcs),ielstart_all(maxres,0:MaxProcs-1),
-     & ielend_all(maxres,0:MaxProcs-1)
+      common /przechowalnia/ iturn3_start_all(0:max_fg_procs),
+     & iturn3_end_all(0:max_fg_procs),iturn4_start_all(0:max_fg_procs),
+     & iturn4_end_all(0:max_fg_procs),iatel_s_all(0:max_fg_procs),
+     &iatel_e_all(0:max_fg_procs),ielstart_all(maxres,0:max_fg_procs-1),
+     & ielend_all(maxres,0:max_fg_procs-1)
       integer iproc,k,l
       do iproc=fg_rank+1,nfgtasks-1
         do k=iturn3_start_all(iproc),iturn3_end_all(iproc)
@@ -1290,7 +1319,7 @@ c---------------------------------------------------------------------------
       subroutine add_task(iproc,ntask_cont,itask_cont)
       implicit none
       include "DIMENSIONS"
-      integer iproc,ntask_cont,itask_cont(0:MaxProcs-1)
+      integer iproc,ntask_cont,itask_cont(0:max_fg_procs-1)
       integer ii
       do ii=1,ntask_cont
         if (itask_cont(ii).eq.iproc) return