From f0f59d2f11967fac17797ad7c0f365ca0f3f8d15 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Wed, 11 Mar 2015 13:46:48 +0100
Subject: [PATCH] Fixes from J. Swails

---
 patches/amber14.diff/AmberTools/src/sander/runmd.F90 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/patches/amber14.diff/AmberTools/src/sander/runmd.F90 b/patches/amber14.diff/AmberTools/src/sander/runmd.F90
index 04db2f2fb..7b0a13972 100644
--- a/patches/amber14.diff/AmberTools/src/sander/runmd.F90
+++ b/patches/amber14.diff/AmberTools/src/sander/runmd.F90
@@ -4165,7 +4165,7 @@ subroutine runmd(xx,ix,ih,ipairs,x,winv,amass,f, &
     return                                             ! lam81
    end if                                              ! lam81
 
-   if (plumed_stopflag/=0) goto 480
+   if (plumed.eq.1 .and. plumed_stopflag/=0) goto 480
 
    if (nstep < nstlim) goto 260
    480 continue
@@ -4378,7 +4378,9 @@ subroutine runmd(xx,ix,ih,ipairs,x,winv,amass,f, &
       REQUIRE( ier == 0 )
    end if
 
-   call plumed_f_gfinalize()
+   if (plumed.eq.1) then
+     call plumed_f_gfinalize()
+   end if
 
    500 format(/,' NMR restraints on final step:'/)
    540 format(/5x,' A V E R A G E S   O V E R ',i7,' S T E P S',/)
-- 
GitLab