Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_hbond.c
index 931824997119f833311f3dd071f9a47ec9a257cc..73b17d1a05180fd8f32226f48718799e035c281c 100644 (file)
@@ -2389,39 +2389,9 @@ static real compute_weighted_rates(int n, real t[], real ct[], real nt[],
     return chi2;
 }
 
-static void smooth_tail(int n, real t[], real c[], real sigma_c[], real start,
-                        const output_env_t oenv)
-{
-    FILE  *fp;
-    real   e_1;
-    double fitparm[4];
-    int    i;
-
-    e_1 = exp(-1);
-    for (i = 0; (i < n); i++)
-    {
-        if (c[i] < e_1)
-        {
-            break;
-        }
-    }
-    if (i < n)
-    {
-        fitparm[0] = t[i];
-    }
-    else
-    {
-        fitparm[0] = 10;
-    }
-    fitparm[1] = 0.95;
-    do_lmfit(n, c, sigma_c, 0, t, start, t[n-1], oenv, bDebugMode(),
-             effnEXP2, fitparm, 0, NULL);
-}
-
 void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
                   real sigma_ct[], real sigma_nt[], real sigma_kt[],
-                  real fit_start, real temp, real smooth_tail_start,
-                  const output_env_t oenv)
+                  real fit_start, real temp)
 {
     int        i0, i;
     real       k = 1, kp = 1, kow = 1;
@@ -2429,12 +2399,6 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
     double     tmp, sn2 = 0, sc2 = 0, sk2 = 0, scn = 0, sck = 0, snk = 0;
     gmx_bool   bError = (sigma_ct != NULL) && (sigma_nt != NULL) && (sigma_kt != NULL);
 
-    if (smooth_tail_start >= 0)
-    {
-        smooth_tail(n, t, ct, sigma_ct, smooth_tail_start, oenv);
-        smooth_tail(n, t, nt, sigma_nt, smooth_tail_start, oenv);
-        smooth_tail(n, t, kt, sigma_kt, smooth_tail_start, oenv);
-    }
     for (i0 = 0; (i0 < n-2) && ((t[i0]-t[0]) < fit_start); i0++)
     {
         ;
@@ -2593,7 +2557,7 @@ static void normalizeACF(real *ct, real *gt, int nhb, int len)
  */
 static void do_hbac(const char *fn, t_hbdata *hb,
                     int nDump, gmx_bool bMerge, gmx_bool bContact, real fit_start,
-                    real temp, gmx_bool R2, real smooth_tail_start, const output_env_t oenv,
+                    real temp, gmx_bool R2, const output_env_t oenv,
                     const char *gemType, int nThreads,
                     const int NN, const gmx_bool bBallistic, const gmx_bool bGemFit)
 {
@@ -3290,7 +3254,7 @@ static void do_hbac(const char *fn, t_hbdata *hb,
             xvgrclose(fp);
 
             analyse_corr(nn, hb->time, ct, ght, kt, NULL, NULL, NULL,
-                         fit_start, temp, smooth_tail_start, oenv);
+                         fit_start, temp);
 
             do_view(oenv, fn, NULL);
             sfree(rhbex);
@@ -3610,7 +3574,7 @@ int gmx_hbond(int argc, char *argv[])
     };
 
     static real        acut     = 30, abin = 1, rcut = 0.35, r2cut = 0, rbin = 0.005, rshell = -1;
-    static real        maxnhb   = 0, fit_start = 1, fit_end = 60, temp = 298.15, smooth_tail_start = -1, D = -1;
+    static real        maxnhb   = 0, fit_start = 1, fit_end = 60, temp = 298.15, D = -1;
     static gmx_bool    bNitAcc  = TRUE, bDA = TRUE, bMerge = TRUE;
     static int         nDump    = 0, nFitPoints = 100;
     static int         nThreads = 0, nBalExp = 4;
@@ -3646,8 +3610,6 @@ int gmx_hbond(int argc, char *argv[])
           "Time (ps) to which to stop fitting the correlation functions in order to obtain the forward and backward rate constants for HB breaking and formation (only with [TT]-gemfit[tt])" },
         { "-temp",  FALSE, etREAL, {&temp},
           "Temperature (K) for computing the Gibbs energy corresponding to HB breaking and reforming" },
-        { "-smooth", FALSE, etREAL, {&smooth_tail_start},
-          "If >= 0, the tail of the ACF will be smoothed by fitting it to an exponential function: y = A exp(-x/[GRK]tau[grk])" },
         { "-dump",  FALSE, etINT, {&nDump},
           "Dump the first N hydrogen bond ACFs in a single [REF].xvg[ref] file for debugging" },
         { "-max_hb", FALSE, etREAL, {&maxnhb},
@@ -4645,7 +4607,7 @@ int gmx_hbond(int argc, char *argv[])
             }
             gemstring = gmx_strdup(gemType[hb->per->gemtype]);
             do_hbac(opt2fn("-ac", NFILE, fnm), hb, nDump,
-                    bMerge, bContact, fit_start, temp, r2cut > 0, smooth_tail_start, oenv,
+                    bMerge, bContact, fit_start, temp, r2cut > 0, oenv,
                     gemstring, nThreads, NN, bBallistic, bGemFit);
         }
         if (opt2bSet("-life", NFILE, fnm))