update
[unres.git] / source / unres / src_MD-M / minimize_p.F
index 06c7a73..3de233f 100644 (file)
@@ -141,11 +141,13 @@ C Workers wait for variables and NF, and NFL from the boss
       do while (iorder.ge.0)
 c      write (*,*) 'Processor',fg_rank,' CG group',kolor,
 c     & ' receives order from Master'
+#ifdef MPI
         time00=MPI_Wtime()
         call MPI_Bcast(iorder,1,MPI_INTEGER,king,FG_COMM,IERR)
         time_Bcast=time_Bcast+MPI_Wtime()-time00
         if (icall.gt.4 .and. iorder.ge.0) 
      &   time_order(iorder)=time_order(iorder)+MPI_Wtime()-time00
+#endif
        icall=icall+1
 c      write (*,*) 
 c     & 'Processor',fg_rank,' completed receive MPI_BCAST order',iorder
@@ -261,7 +263,7 @@ c     endif
 cd      print *,'func',nf,nfl,icg
       call var_to_geom(n,x)
       call zerograd
-      call chainbuild
+      call chainbuild_extconf
 cd    write (iout,*) 'ETOTAL called from FUNC'
       call etotal(energia(0))
       call sum_gradient
@@ -295,7 +297,7 @@ c     endif
       icg=mod(nf,2)+1
       call var_to_geom_restr(n,x)
       call zerograd
-      call chainbuild
+      call chainbuild_extconf
 cd    write (iout,*) 'ETOTAL called from FUNC'
       call etotal(energia(0))
       call sum_gradient
@@ -408,6 +410,7 @@ c----------------------------------------------------------
 #ifdef MPI
       include 'mpif.h'
 #endif
+      include 'COMMON.CONTROL'
       include 'COMMON.SETUP'
       include 'COMMON.IOUNITS'
       include 'COMMON.VAR'
@@ -482,8 +485,18 @@ c     v(25)=4.0D0
         enddo
         endif
       enddo
+c-----
+c      write (iout,*) "checkgrad before SUMSL"
+c      icheckgrad=1
+c      aincr=1.0d-7
+c      call exec_checkgrad
+c-----
 
       call sumsl(k,d,x,func_dc,grad_dc,iv,liv,lv,v,idum,rdum,fdum)      
+c-----
+c      write (iout,*) "checkgrad after SUMSL"
+c      call exec_checkgrad
+c-----
 
       k=0
       do i=1,nres-1