NMR log-exp from Adam
[unres.git] / source / unres / src_MD-M / initialize_p.F
index 91a8b83..11a8267 100644 (file)
@@ -333,16 +333,16 @@ c-------------------------------------------------------------------------
      &   "EVDW SC-SC","EVDW2 SC-p","EES p-p","ECORR4 ","ECORR5 ",
      &   "ECORR6 ","EELLO ","ETURN3 ","ETURN4 ","ETURN6 ",
      &   "EBE bend","ESC SCloc","ETORS ","ETORSD ","EHPB ","EVDWPP ",
-     &   "ESTR ","EVDW2_14 ","UCONST ", "      ","ESCCOR",
-     &   "Eliptran","Eafmforce","Ehomology"/
+     &   "ESTR ","EVDW2_14 ","UCONST ", "EDIHC ","ESCCOR",
+     &   "Eliptran","Eafmforce","Ehomology","ESAXS"/
       data wname /
      &   "WSC","WSCP","WELEC","WCORR","WCORR5","WCORR6","WEL_LOC",
      &   "WTURN3","WTURN4","WTURN6","WANG","WSCLOC","WTOR","WTORD",
-     &   "WSTRAIN","WVDWPP","WBOND","SCAL14","     ","    ","WSCCOR",
-     &    "Wliptran","     ","EHOMO"/
-      data nprint_ene /21/
+     &   "WSTRAIN","WVDWPP","WBOND","SCAL14","WDIHCSN","    ","WSCCOR",
+     &    "Wliptran","WAFM ","EHOMO","WSAXS"/
+      data nprint_ene /25/
       data print_order/1,2,3,11,12,13,14,4,5,6,7,8,9,10,19,18,15,17,16,
-     & 21,24,22,23,0/
+     & 21,24,22,23,20,25/
       end 
 c---------------------------------------------------------------------------
       subroutine init_int_table
@@ -628,6 +628,11 @@ C Partition local interactions
       call int_bounds(nres-2,ithet_start,ithet_end)
       ithet_start=ithet_start+2
       ithet_end=ithet_end+2
+      call int_bounds(nsaxs,isaxs_start,isaxs_end)
+c      isaxs_start=isaxs_start+nnt-1
+c      isaxs_end=isaxs_end+nnt-1
+      write (iout,*) me," isaxs_start",isaxs_start,
+     &  " isaxs_end",isaxs_end
       call int_bounds(nct-nnt-2,iturn3_start,iturn3_end) 
       iturn3_start=iturn3_start+nnt
       iphi_start=iturn3_start+2
@@ -741,12 +746,16 @@ c      nlen=nres-nnt+1
         iaux=iphi1_end-iphi1_start+1
         call MPI_Allgather(iaux,1,MPI_INTEGER,iphi1_count(0),1,
      &    MPI_INTEGER,FG_COMM,IERROR)
-        do i=0,maxprocs-1
+        write (iout,*) "ielstart before zeroing out",max_fg_procs
+        call flush (iout)
+        do i=0,max_fg_procs-1
           do j=1,maxres
             ielstart_all(j,i)=0
             ielend_all(j,i)=0
           enddo
         enddo
+        write (iout,*) "ielstart zeroed out"
+        call flush (iout)
         call MPI_Allgather(iturn3_start,1,MPI_INTEGER,
      &    iturn3_start_all(0),1,MPI_INTEGER,FG_COMM,IERROR)
         call MPI_Allgather(iturn4_start,1,MPI_INTEGER,
@@ -881,6 +890,7 @@ c        call flush(iout)
 c        write (iout,*) "Gather itask_cont_to ended"
 c        call flush(iout)
         if (fg_rank.eq.king) then
+         if (me.eq.0 .or. .not. out1file) then
           write (iout,*)"Contact receive task map (proc, #tasks, tasks)"
           do i=0,nfgtasks-1
             write (iout,'(20i4)') i,ntask_cont_from_all(i),
@@ -895,6 +905,7 @@ c        call flush(iout)
           enddo
           write (iout,*)
           call flush(iout)
+         endif
 C Check if every send will have a matching receive
           ncheck_to=0
           ncheck_from=0
@@ -902,7 +913,8 @@ C Check if every send will have a matching receive
             ncheck_to=ncheck_to+ntask_cont_to_all(i)
             ncheck_from=ncheck_from+ntask_cont_from_all(i)
           enddo
-          write (iout,*) "Control sums",ncheck_from,ncheck_to
+          if (me.eq.0 .or. .not. out1file)
+     &     write (iout,*) "Control sums",ncheck_from,ncheck_to
           if (ncheck_from.ne.ncheck_to) then
             write (iout,*) "Error: #receive differs from #send."
             write (iout,*) "Terminating program...!"
@@ -1166,6 +1178,8 @@ c        write (iout,*) "MPI_ROTAT2",MPI_ROTAT2
       iphi1_end=nres
       idihconstr_start=1
       idihconstr_end=ndih_constr
+      isaxs_start=1
+      isaxs_end=nsaxs
       iphid_start=iphi_start
       iphid_end=iphi_end-1
       itau_start=4
@@ -1512,3 +1526,25 @@ cd     &   " lim_dih",lim_dih
 #endif
       return
       end
+c------------------------------------------------------------------------------
+      subroutine NMRpeak_partition
+      implicit real*8 (a-h,o-z)
+      include 'DIMENSIONS'
+#ifdef MPI
+      include 'mpif.h'
+#endif
+      include 'COMMON.SBRIDGE'
+      include 'COMMON.IOUNITS'
+      include 'COMMON.SETUP'
+#ifdef MPI
+      call int_bounds(npeak,link_start_peak,link_end_peak)
+      write (iout,*) 'Processor',fg_rank,' CG group',kolor,
+     &  ' absolute rank',MyRank,
+     &  ' npeak',npeak,' link_start_peak=',link_start_peak,
+     &  ' link_end_peak',link_end_peak
+#else
+      link_start_peak=1
+      link_end_peak=npeak
+#endif
+      return
+      end