Rename ffopen and ffclose to gmx_ff*.
authorRossen Apostolov <rossen@kth.se>
Wed, 12 Feb 2014 13:14:42 +0000 (14:14 +0100)
committerRossen Apostolov <rossen@kth.se>
Thu, 20 Feb 2014 13:44:54 +0000 (14:44 +0100)
There are name clashes with e.g. PathScale compiler.

Fixes #1250.

Change-Id: I3e5e85d9335f2695515483d59d440276823624f0

111 files changed:
cmake/legacy_and_external.supp
src/contrib/do_multiprot.c
src/contrib/do_shift.c
src/contrib/ehanal.c
src/contrib/ehdata.c
src/contrib/ehole.c
src/contrib/gen_table.c
src/contrib/gmx_sdf.c
src/contrib/hexamer.c
src/contrib/hrefify.c
src/contrib/mkice.c
src/contrib/pmetest.c
src/contrib/test.c
src/gromacs/essentialdynamics/edsam.c
src/gromacs/fileio/filenm.h
src/gromacs/fileio/futil.cpp
src/gromacs/fileio/futil.h
src/gromacs/fileio/gmxfio.c
src/gromacs/fileio/strdb.c
src/gromacs/gmxana/anadih.c
src/gromacs/gmxana/autocorr.c
src/gromacs/gmxana/cmat.c
src/gromacs/gmxana/gmx_anadock.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_analyze.c
src/gromacs/gmxana/gmx_angle.c
src/gromacs/gmxana/gmx_bar.c
src/gromacs/gmxana/gmx_bundle.c
src/gromacs/gmxana/gmx_chi.c
src/gromacs/gmxana/gmx_cluster.c
src/gromacs/gmxana/gmx_clustsize.c
src/gromacs/gmxana/gmx_confrms.c
src/gromacs/gmxana/gmx_covar.c
src/gromacs/gmxana/gmx_current.c
src/gromacs/gmxana/gmx_density.c
src/gromacs/gmxana/gmx_densmap.c
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.c
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.c
src/gromacs/gmxana/gmx_do_dssp.c
src/gromacs/gmxana/gmx_dyecoupl.c
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxana/gmx_enemat.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_genion.c
src/gromacs/gmxana/gmx_genpr.c
src/gromacs/gmxana/gmx_gyrate.c
src/gromacs/gmxana/gmx_h2order.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxana/gmx_helix.c
src/gromacs/gmxana/gmx_helixorient.c
src/gromacs/gmxana/gmx_hydorder.c
src/gromacs/gmxana/gmx_kinetics.c
src/gromacs/gmxana/gmx_lie.c
src/gromacs/gmxana/gmx_make_edi.c
src/gromacs/gmxana/gmx_mdmat.c
src/gromacs/gmxana/gmx_mindist.c
src/gromacs/gmxana/gmx_mk_angndx.c
src/gromacs/gmxana/gmx_morph.c
src/gromacs/gmxana/gmx_msd.c
src/gromacs/gmxana/gmx_nmeig.c
src/gromacs/gmxana/gmx_order.c
src/gromacs/gmxana/gmx_polystat.c
src/gromacs/gmxana/gmx_potential.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_rama.c
src/gromacs/gmxana/gmx_rdf.c
src/gromacs/gmxana/gmx_rms.c
src/gromacs/gmxana/gmx_rmsdist.c
src/gromacs/gmxana/gmx_rmsf.c
src/gromacs/gmxana/gmx_rotmat.c
src/gromacs/gmxana/gmx_saltbr.c
src/gromacs/gmxana/gmx_sas.c
src/gromacs/gmxana/gmx_sham.c
src/gromacs/gmxana/gmx_sigeps.c
src/gromacs/gmxana/gmx_sorient.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_spol.c
src/gromacs/gmxana/gmx_tcaf.c
src/gromacs/gmxana/gmx_traj.c
src/gromacs/gmxana/gmx_trjconv.c
src/gromacs/gmxana/gmx_trjorder.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/gmx_vanhove.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_xpm2ps.c
src/gromacs/gmxana/powerspect.c
src/gromacs/gmxana/pp2shift.c
src/gromacs/gmxlib/atomprop.c
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/readinp.c
src/gromacs/gmxlib/sfactor.c
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gen_vsite.c
src/gromacs/gmxpreprocess/h_db.c
src/gromacs/gmxpreprocess/nm2type.c
src/gromacs/gmxpreprocess/pdb2gmx.c
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/resall.c
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/ter_db.c
src/gromacs/gmxpreprocess/tomorse.c
src/gromacs/gmxpreprocess/x2top.c
src/gromacs/gmxpreprocess/xlate.c
src/gromacs/mdlib/pme.c
src/gromacs/mdlib/tables.c
src/gromacs/pulling/pull_rotation.c
src/gromacs/utility/file.cpp
src/programs/mdrun/membed.c
src/programs/view/fgrid.cpp

index 8df7e76baefb4c236a92d2c66a809572106677b7..81277a930deafdcd1c561682d45538b61407be86 100644 (file)
    fun:bTimeSet
 }
 {
-   ffclose/tMPI_Thread_mutex_init_once
+   gmx_ffclose/tMPI_Thread_mutex_init_once
    Memcheck:Leak
    ...
    fun:tMPI_Thread_mutex_init_once
    fun:tMPI_Thread_mutex_lock
-   fun:ffclose
+   fun:gmx_ffclose
 }
 
 {
index edaca60f71c7d2abc0e4f24dbe8b22cb7ecaa27f..66dc816b643351c15396ec7a7ce81d4dffd0c5b8 100644 (file)
@@ -75,7 +75,7 @@ static void process_multiprot_output(const char *fn, real *rmsd, int *nres, rvec
     
     (*rmsd)=-1;
     (*nres)=0;
-    mpoutput=ffopen (fn,"r");
+    mpoutput=gmx_ffopen (fn,"r");
     
     if (bCountres) {
        do {
@@ -138,7 +138,7 @@ static void process_multiprot_output(const char *fn, real *rmsd, int *nres, rvec
            (*nres) = atoi(string);
        }
     }
-    ffclose(mpoutput);
+    gmx_ffclose(mpoutput);
 }
 
 int main(int argc,char *argv[])
@@ -289,7 +289,7 @@ int main(int argc,char *argv[])
        }
     }
     else {
-       ffclose(tmpf);
+       gmx_ffclose(tmpf);
     }
 
     if (ftp != efPDB) {
@@ -348,7 +348,7 @@ int main(int argc,char *argv[])
                    useatoms.nres=max(useatoms.nres,useatoms.atom[i].resind+1);
                }
                useatoms.nr=nout;
-               out=ffopen(TrjoutFile,filemode);
+               out=gmx_ffopen(TrjoutFile,filemode);
                break;
        }
        if (outftp == efG87)
@@ -369,9 +369,9 @@ int main(int argc,char *argv[])
     do {
        t = output_env_conv_time(oenv,fr.time);
        gmx_rmpbc(gpbc,natoms,fr.box,fr.x);
-       tapein=ffopen(pdbfile,"w");
+       tapein=gmx_ffopen(pdbfile,"w");
        write_pdbfile_indexed(tapein,NULL,atoms,fr.x,ePBC,fr.box,' ',-1,gnx,index,NULL,TRUE); 
-       ffclose(tapein);
+       gmx_ffclose(tapein);
        system(multiprot);
        remove(pdbfile);
        process_multiprot_output(fn, &rmsd, &nres2,rotangles,translation,bCountres,countres);
@@ -433,17 +433,17 @@ int main(int argc,char *argv[])
        for (i=0;i<ratoms.nres;i++) {
            fprintf(fres,"%10d  %12d\n",countres[i].resnr,countres[i].count);
        }
-       ffclose(fres);
+       gmx_ffclose(fres);
     }
-    ffclose(fo);
-    ffclose(frc);
+    gmx_ffclose(fo);
+    gmx_ffclose(frc);
     fprintf(stderr,"\n");
     close_trj(status);
     if (trxout != NULL) {
        close_trx(trxout);
     }
     else if (out != NULL) {
-       ffclose(out);
+       gmx_ffclose(out);
     }
     view_all(oenv,NFILE, fnm);
     sfree(xr);
index 7e567ac2f46e0ba0346c46a6397a94c5f164410d..bcc227c353e7dc46abf3ce82d64bc579b2cf18a8 100644 (file)
@@ -61,7 +61,7 @@ void cat(FILE *out,char *fn,real t)
   char   anm[24],rnm[24];
   double f1,f2,f3,f4,f5,f6;
    
-  in=ffopen(fn,"r");
+  in=gmx_ffopen(fn,"r");
   while ((ptr=fgets2(buf,255,in)) != NULL) {
     sscanf(buf,"%d%d%s%s%lf%lf%lf%lf%lf%lf",
           &anr,&rnr,rnm,anm,&f1,&f2,&f3,&f4,&f5,&f6);
@@ -71,7 +71,7 @@ void cat(FILE *out,char *fn,real t)
   /*if ((int)strlen(buf) > 0) 
     fprintf(out,"%s\n",buf);*/
   fflush(out);
-  ffclose(in);
+  gmx_ffclose(in);
 }
 
 int main(int argc,char *argv[])
@@ -158,10 +158,10 @@ int main(int argc,char *argv[])
   do {
     if (t >= nt) {
       rm_pbc(&(top->idef),top->atoms.nr,box,x,x_s);
-      fp=ffopen(pdbfile,"w");
+      fp=gmx_ffopen(pdbfile,"w");
       write_pdbfile_indexed(fp,"Generated by do_shift",
                            atoms,x_s,box,0,-1,gnx,index);
-      ffclose(fp);
+      gmx_ffclose(fp);
       
       if ((tot=popen(total,"w")) == NULL)
        perror("opening pipe to total");
@@ -182,7 +182,7 @@ int main(int argc,char *argv[])
     }
   } while(read_next_x(status,&t,natoms,x,box));
   close_trj(status);
-  ffclose(out);
+  gmx_ffclose(out);
   
   gmx_thanx(stderr);
   
index 2f98fb3d5afe0dc99201a99355392d78238524c6..e781f6331df96877495ac7343f717b600192f3c5 100644 (file)
@@ -119,7 +119,7 @@ void dump_histo(t_histo *h,char *fn,char *title,char *xaxis,char *yaxis,
       gmx_fatal(FARGS,"Wrong value for enorm (%d)",enorm);
     }
   }
-  ffclose(fp);
+  gmx_ffclose(fp);
 }
 
 /*******************************************************************
@@ -351,10 +351,10 @@ void dump_ana_struct(char *rmax,char *nion,char *gyr_com,char *gyr_origin,
            sqrt(anal->d2_origin[i][YY]/nsim),
            sqrt(anal->d2_origin[i][ZZ]/nsim));
   }
-  ffclose(hp);
-  ffclose(gp);
-  ffclose(fp);
-  ffclose(kp);
+  gmx_ffclose(hp);
+  gmx_ffclose(gp);
+  gmx_ffclose(fp);
+  gmx_ffclose(kp);
 }
 
 void dump_as_pdb(char *pdb,t_ana_struct *anal)
@@ -363,7 +363,7 @@ void dump_as_pdb(char *pdb,t_ana_struct *anal)
   int  i,j;
   real t;
   
-  kp = ffopen(pdb,"w");
+  kp = gmx_ffopen(pdb,"w");
   for(i=0; (i<anal->nstruct); i++) {
     t = 1000*anal->t[i];
     fprintf(kp,"MODEL  %d  time %g fs\n",i+1,t);
@@ -377,7 +377,7 @@ void dump_as_pdb(char *pdb,t_ana_struct *anal)
     }
     fprintf(kp,"ENDMDL\n");
   }
-  ffclose(kp);
+  gmx_ffclose(kp);
 }
 
 char *enms[eNR] = {
@@ -425,6 +425,6 @@ void dump_ana_ener(t_ana_ener *ae,int nsim,real dt,char *edump,
     fprintf(fp,"  %8.3f\n",ae->e[i][eELECTRON]/(ELECTRONVOLT*total->nion[i]));
   }    
   fprintf(fp,"&\n");
-  ffclose(fp);
+  gmx_ffclose(fp);
 }
 
index 3ed98f87e925878a2f391c05a59deab6890f54d7..0f9bec9cc18295ac50f93edb1a3ce741c4b63a58 100644 (file)
@@ -83,7 +83,7 @@ static t_p2Ddata *read_p2Ddata(char *fn)
   double  e,p,o;
   
   fprintf(stdout,"Going to read %s\n",fn);
-  fp = ffopen(fn,"r");
+  fp = gmx_ffopen(fn,"r");
 
   /* Allocate memory and set constants */
   snew(p2Ddata,1);
@@ -121,7 +121,7 @@ static t_p2Ddata *read_p2Ddata(char *fn)
   }
   fprintf(stderr,"\n");
   
-  ffclose(fp);
+  gmx_ffclose(fp);
   
   return p2Ddata;
 }
@@ -134,7 +134,7 @@ static t_pq_inel *read_pq(char *fn)
   double    e,p,o,t;
   
   fprintf(stdout,"Going to read %s\n",fn);
-  fp = ffopen(fn,"r");
+  fp = gmx_ffopen(fn,"r");
 
   /* Allocate memory and set constants */
   snew(pq,1);
@@ -178,7 +178,7 @@ static t_pq_inel *read_pq(char *fn)
   }
   fprintf(stderr,"\n");
   
-  ffclose(fp);
+  gmx_ffclose(fp);
   
   return pq;
 }
index c6bd330127fb07431fb9b5abdf291090164a1cb7..740546cbcef63e1e23388b7d5268327f0ef5bd71 100644 (file)
@@ -527,7 +527,7 @@ void do_sims(int NFILE,t_filenm fnm[],t_eh_params *ehp)
   helec = init_histo(500,0,500);
   snew(ae,1);
 
-  logfp = ffopen(ftp2fn(efLOG,NFILE,fnm),"w");
+  logfp = gmx_ffopen(ftp2fn(efLOG,NFILE,fnm),"w");
   print_header(logfp,ehp);
     
   for(i=0; (i<ehp->nsim); i++) {
@@ -538,7 +538,7 @@ void do_sims(int NFILE,t_filenm fnm[],t_eh_params *ehp)
     fprintf(stderr,"\rSim: %d/%d",i+1,ehp->nsim);
   }
   fprintf(stderr,"\n");
-  ffclose(logfp);
+  gmx_ffclose(logfp);
   
   sfree(rptr);
   sfree(pdbbuf);
index 7c6508c2aec63ad6485b8689c61d5e2e699d14c4..a0942f7cb883a2aeab75e9bb09a8be2637cf379f 100644 (file)
@@ -453,7 +453,7 @@ static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double
          ((strcmp(atype[j],"OW") == 0) && (strcmp(atype[k],"HW") == 0)) ||
          ((strcmp(atype[j],"OW") == 0) && (strcmp(atype[k],"OW") == 0))) {
 
-       fp = ffopen(buf,"w");
+       fp = gmx_ffopen(buf,"w");
   
        imax = 3*pts_nm;
        for(i=0; (i<=imax); i++) {
@@ -473,7 +473,7 @@ static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double
                  r,vc,fc,vd,fd,vr,fr);
          
        }
-       ffclose(fp);
+       gmx_ffclose(fp);
      
        /* Guillot eqn 4 and 5 */
       } else if (((strcmp(atype[j],"HWd") == 0) && (strcmp(atype[k],"HW") == 0)) ||
@@ -481,7 +481,7 @@ static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double
                 ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"HW") == 0)) ||
                 ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"OW") == 0))) {
        
-       fp = ffopen(buf,"w");
+       fp = gmx_ffopen(buf,"w");
   
        imax = 3*pts_nm;
        for(i=0; (i<=imax); i++) {
@@ -501,14 +501,14 @@ static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double
                  r,vc,fc,vd,fd,vr,fr);
          
        }
-       ffclose(fp);
+       gmx_ffclose(fp);
 
        /* Guillot2001a eqn 3 */
       } else if (((strcmp(atype[j],"HWd") == 0) && (strcmp(atype[k],"HWd") == 0)) ||
                 ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"HWd") == 0)) ||
                 ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"OWd") == 0))) {
 
-       fp = ffopen(buf,"w");
+       fp = gmx_ffopen(buf,"w");
   
        imax = 3*pts_nm;
        for(i=0; (i<=imax); i++) {
@@ -528,7 +528,7 @@ static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double
                  r,vc,fc,vd,fd,vr,fr);
          
        }
-       ffclose(fp);
+       gmx_ffclose(fp);
 
       } else 
        gmx_fatal(FARGS,"Invalid atom type: %s %s", atype[j], atype[k]);
@@ -795,7 +795,7 @@ int main(int argc,char *argv[])
     
   fn = opt2fn("-o",NFILE,fnm);
   if ((m != mGuillot2001a)) 
-    fp = ffopen(fn,"w");
+    fp = gmx_ffopen(fn,"w");
   switch (m) {
   case mGuillot2001a:
     do_guillot2001a(fn,eel,pts_nm,rc,rtol,xi,xir);
@@ -840,7 +840,7 @@ int main(int argc,char *argv[])
     gmx_fatal(FARGS,"Model %s not supported yet",model[0]);
   }  
   if ((m != mGuillot2001a)) 
-    ffclose(fp);
+    gmx_ffclose(fp);
   
   gmx_thanx(stdout);
   
index 7e39126de2117519e0ce1d4eecb969b50ae8612f..656f973aa63702d7a7411b89aae5be366894baf0 100644 (file)
@@ -552,7 +552,7 @@ structure if needed */
   /* write the reference strcture*/
   if ( bRef )
     {
-      fp=ffopen(fnREF,"w"); 
+      fp=gmx_ffopen(fnREF,"w"); 
       fprintf(fp,"%s\n",title);
       fprintf(fp,"  %d\n",isize[G_REFMOL]);
 
@@ -565,7 +565,7 @@ structure if needed */
                 -1*x_refmol[i][XX],-1*x_refmol[i][YY],-1*x_refmol[i][ZZ]);
       /* Inserted -1* on the line above three times */
       fprintf(fp,"   10.00000   10.00000   10.00000\n");
-      ffclose(fp);
+      gmx_ffclose(fp);
       fprintf(stderr,"\nWrote reference structure. (%d Atoms)\n",isize[G_REFMOL]);
     }
 
@@ -582,7 +582,7 @@ structure if needed */
 
   /* normalize the SDF and write output */
   /* see http://www.csc.fi/gopenmol/index.phtml for documentation */
-  fp=ffopen(fnSDF,"wb"); 
+  fp=gmx_ffopen(fnSDF,"wb"); 
 
 
   /* rank */
@@ -630,7 +630,7 @@ structure if needed */
   fprintf(stderr,"\nMin: %f Max: %f\n",min_sdf,max_sdf);
 
 
-  ffclose(fp); 
+  gmx_ffclose(fp); 
 
 
   /* Give back the mem */
index 0fc4c7e60ab975368d695cc10cbe554fd56b1dfd..07fd6d58bb858adb7f9c316f3cf9651b83926e41 100644 (file)
@@ -199,14 +199,14 @@ int main(int argc, char *argv[])
   if (bCenter) 
     prep_x(atoms.nr,xin,rDist,rAngleZ,rAngleX);
   
-  fp = ffopen(outfile,"w");
+  fp = gmx_ffopen(outfile,"w");
   for(i=0; (i<(bTrimer ? 3 : 6)); i++) {
     rotate_x(atoms.nr,xin,i*(bTrimer ? 120.0 : 60.0),xout,TRUE,
             bAlternate && ((i % 2) != 0),alterz*(((i % 2) == 0) ? 0 : 1));
     sprintf(buf,"Rotated %d degrees",i*(bTrimer ? 120 : 60));
     write_pdbfile(fp,buf,&atoms,xout,box,'A'+i,1+i);
   }
-  ffclose(fp);
+  gmx_ffclose(fp);
   
   gmx_thanx(stderr);
   
index 6e3c4d25dfa7ccfca126c7b2130d4ab716e80297..cec40f4f897d54370a36aed2f8f2f7256408de6c 100644 (file)
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
   else
     fprintf(stderr,"Adding '%s' to href's\n",link_text);
 
-  fp=ffopen(out,"w");
+  fp=gmx_ffopen(out,"w");
 
   n_repl=0;
   i_str=-1;
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
     fprintf(fp,"%s\n",line);
   }
 
-  ffclose(fp);
+  gmx_ffclose(fp);
   
   fprintf(stderr,"Added %d HTML references\n",n_repl);
 
index c92ee5402d6dcadb275898267c751ac68605b3f7..e89f8415f550d4bc8668b255f24b85a273ecb820 100644 (file)
@@ -635,7 +635,7 @@ int main(int argc,char *argv[])
 
   fn = ftp2fn(efSTO,NFILE,fnm);
   if (fn2ftp(fn) == efPDB) {
-    fp = ffopen(fn,"w");
+    fp = gmx_ffopen(fn,"w");
     if (bDiamond)
       fprintf(fp,"HEADER    This is a *diamond*\n");
     else
@@ -645,7 +645,7 @@ int main(int argc,char *argv[])
            nx,ny,nz,odist,hdist);
        bromacs(quote,255);
     write_pdbfile(fp,quote,pdba,xx,boxje,' ',-1);
-    ffclose(fp);
+    gmx_ffclose(fp);
   }
   else {
     bromacs(quote,255);
index e48471522c3336e1dc1f0ff49a69c9534bff371b..63d6ef14ff3d6a23ea2d6c78d4e30845508805ed 100644 (file)
@@ -453,7 +453,7 @@ int main(int argc,char *argv[])
     /* Finish I/O, close files */
     if (MASTER(cr)) {
       close_trx(status);
-      ffclose(fp);
+      gmx_ffclose(fp);
     }
   }
   
index ddd50ee71feb89f9a66caeede50bcee1af053136..a4c1c7acab97fc78d47f4c3d1b8fbf5a3ebf1119 100644 (file)
@@ -135,7 +135,7 @@ int main(int argc,char *argv[])
     oldx = x;
       
   }
-  ffclose(fp);
+  gmx_ffclose(fp);
   
   do_view(ftp2fn(efXVG,NFILE,fnm),NULL);
 
index f862b6db9293131380b853bb5a0e810ecd3253e8..e2af0de609e5bfe15a7152f34fe3a3e7c6b75737 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -470,7 +470,7 @@ static void dump_edi(t_edpar *edpars, t_commrec *cr, int nr_edi)
 
 
     sprintf(fn, "EDdump_node%d_edi%d", cr->nodeid, nr_edi);
-    out = ffopen(fn, "w");
+    out = gmx_ffopen(fn, "w");
 
     fprintf(out, "#NINI\n %d\n#FITMAS\n %d\n#ANALYSIS_MAS\n %d\n",
             edpars->nini, edpars->fitmas, edpars->pcamas);
@@ -502,7 +502,7 @@ static void dump_edi(t_edpar *edpars, t_commrec *cr, int nr_edi)
     fprintf(out, "buf->do_edsam         =%p\n", (void*)edpars->buf->do_edsam  );
     fprintf(out, "buf->do_radcon        =%p\n", (void*)edpars->buf->do_radcon );
 
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 
index 438966537b5c3b372dfec86f8bab317e6c8f2e4d..74274628cf9ec9f9f41c7059efa55fec9ba1cb36 100644 (file)
@@ -138,7 +138,7 @@ int opt2fns(char **fns[], const char *opt, int nfile,
 /* Return the filenames belonging to cmd-line option opt, or NULL when
  * no such option. */
 
-#define opt2FILE(opt, nfile, fnm, mode) ffopen(opt2fn(opt, nfile, fnm), mode)
+#define opt2FILE(opt, nfile, fnm, mode) gmx_ffopen(opt2fn(opt, nfile, fnm), mode)
 /* Return a file pointer from the filename (see above) */
 
 int fn2ftp(const char *fn);
@@ -151,7 +151,7 @@ int ftp2fns(char **fns[], int ftp, int nfile, const t_filenm fnm[]);
 /* Return the number of files for the first option with type ftp
    and the files in **fns[] (will be allocated), or NULL when none found. */
 
-#define ftp2FILE(ftp, nfile, fnm, mode) ffopen(ftp2fn(ftp, nfile, fnm), mode)
+#define ftp2FILE(ftp, nfile, fnm, mode) gmx_ffopen(ftp2fn(ftp, nfile, fnm), mode)
 /* Return a file pointer from the filename (see above) */
 
 gmx_bool ftp2bSet(int ftp, int nfile, const t_filenm fnm[]);
index a450b56cf7cc9a94f2d17b883af9c85ed97d358d..0f89c574ea671a6b596755d44ef28c493852aab2 100644 (file)
@@ -119,8 +119,8 @@ void push_ps(FILE *fp)
 #define pclose fah_fclose
 #define SKIP_FFOPS 1
 #else
-#ifdef ffclose
-#undef ffclose
+#ifdef gmx_ffclose
+#undef gmx_ffclose
 #endif
 #if (!defined(HAVE_PIPES) && !defined(__native_client__))
 static FILE *popen(const char *nm, const char *mode)
@@ -139,7 +139,7 @@ static int pclose(FILE *fp)
 #endif /* !defined(HAVE_PIPES) && !defined(__native_client__) */
 #endif /* GMX_FAHCORE */
 
-int ffclose(FILE *fp)
+int gmx_ffclose(FILE *fp)
 {
 #ifdef SKIP_FFOPS
     return fclose(fp);
@@ -461,7 +461,7 @@ gmx_bool make_backup(const char * name)
 #endif
 }
 
-FILE *ffopen(const char *file, const char *mode)
+FILE *gmx_ffopen(const char *file, const char *mode)
 {
 #ifdef SKIP_FFOPS
     return fopen(file, mode);
index 9e7ae9f2bef38a18d306803996e8334375d63eef..7d214e04dbb2eb9191e13dbc29f4b6406d30eaad 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -101,20 +101,20 @@ gmx_bool gmx_eof(FILE *fp);
 /* Return TRUE on end-of-file, FALSE otherwise */
 
 gmx_bool is_pipe(FILE *fp);
-/* Check whether the file (opened by ffopen) is a pipe */
+/* Check whether the file (opened by gmx_ffopen) is a pipe */
 
 /*  Make a backup of file if necessary.
     Return false if there was a problem.
  */
 gmx_bool make_backup(const char * file);
 
-FILE *ffopen(const char *file, const char *mode);
+FILE *gmx_ffopen(const char *file, const char *mode);
 /* Return a valid file pointer when successful, exits otherwise
  * If the file is in compressed format, open a pipe which uncompresses
- * the file! Therefore, files must be closed with ffclose (see below)
+ * the file! Therefore, files must be closed with gmx_ffclose (see below)
  */
 
-int ffclose(FILE *fp);
+int gmx_ffclose(FILE *fp);
 /* Close files or pipes */
 
 
index 0c8931847e85fbb06eed9ab06e4fc92cbe9a6b30..3325a3605b073264171f87e3abe6d0294726956e 100644 (file)
@@ -518,7 +518,7 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
                 gmx_incons("gmx_fio_open may not be used to open TNG files");
             }
             /* Open the file */
-            fio->fp = ffopen(fn, newmode);
+            fio->fp = gmx_ffopen(fn, newmode);
 
             /* determine the XDR direction */
             if (newmode[0] == 'w' || newmode[0] == 'a')
@@ -536,7 +536,7 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
         else
         {
             /* If it is not, open it as a regular file */
-            fio->fp = ffopen(fn, newmode);
+            fio->fp = gmx_ffopen(fn, newmode);
         }
 
         /* for appending seek to end of file to make sure ftell gives correct position
@@ -586,7 +586,7 @@ static int gmx_fio_close_locked(t_fileio *fio)
     /* Don't close stdin and stdout! */
     if (!fio->bStdio && fio->fp != NULL)
     {
-        rc = ffclose(fio->fp); /* fclose returns 0 if happy */
+        rc = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
 
     }
     fio->bOpen = FALSE;
@@ -627,7 +627,7 @@ int gmx_fio_fp_close(t_fileio *fio)
     gmx_fio_lock(fio);
     if (!in_ftpset(fio->iFTP, asize(ftpXDR), ftpXDR) && !fio->bStdio)
     {
-        rc      = ffclose(fio->fp); /* fclose returns 0 if happy */
+        rc      = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
         fio->fp = NULL;
     }
     gmx_fio_unlock(fio);
index 41ad46533c510a457f73be8b084537c765a5d523..b577c42457bfb009650f02ec0ac64de93a9a9b5c 100644 (file)
@@ -132,7 +132,7 @@ int get_strings(const char *db, char ***strings)
     if (fscanf(in, "%d", &nstr) != 1)
     {
         gmx_warning("File %s is empty", db);
-        ffclose(in);
+        gmx_ffclose(in);
         return 0;
     }
     snew(ptr, nstr);
@@ -147,7 +147,7 @@ int get_strings(const char *db, char ***strings)
 #endif
         ptr[i] = strdup(buf);
     }
-    ffclose(in);
+    gmx_ffclose(in);
 
     *strings = ptr;
 
@@ -181,7 +181,7 @@ int fget_lines(FILE *in, char ***strings)
     if (pret == NULL  || sscanf(buf, "%d", &nstr) != 1)
     {
         gmx_warning("File is empty");
-        ffclose(in);
+        gmx_ffclose(in);
 
         return 0;
     }
@@ -204,7 +204,7 @@ int get_lines(const char *db, char ***strings)
 
     in   = libopen(db);
     nstr = fget_lines(in, strings);
-    ffclose(in);
+    gmx_ffclose(in);
 
     return nstr;
 }
@@ -230,7 +230,7 @@ int get_file(const char *db, char ***strings)
         i++;
     }
     nstr = i;
-    ffclose(in);
+    gmx_ffclose(in);
     srenew(ptr, nstr);
     *strings = ptr;
 
index 2d43009309bc5b77d05a58b8e875b687f44f28e2..8ae35c8ee16757aee2801d25434ebcedecbec3c6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,7 +69,7 @@ void print_one(const output_env_t oenv, const char *base, const char *name,
     {
         fprintf(fp, "%10g  %10g\n", time[k], data[k]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static int calc_RBbin(real phi, int gmx_unused multiplicity, real gmx_unused core_frac)
@@ -299,7 +299,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
         {
             fprintf(fp, "%10.3f  %10d\n", time[j], tr_f[j]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     /* Compute histogram from # transitions per dihedral */
@@ -329,7 +329,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
                 fprintf(fp, "%10.3f  %10d\n", ttime/i, tr_f[i]);
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     sfree(tr_f);
@@ -583,7 +583,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
                     }
                 }
                 fprintf(fp, "&\n");
-                ffclose(fp);
+                gmx_ffclose(fp);
             }
 
             /* and finally print out occupancies to a single file */
@@ -610,7 +610,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
     }
 
     sfree(chi_prtrj);
-    ffclose(fpall);
+    gmx_ffclose(fpall);
     fprintf(stderr, "\n");
 
 }
index f98a670e20c53b4520185ab1eb6ca420c5658215..3b43b518ea854e083bf1444ccfda7a2bfbdb47ba 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -340,12 +340,12 @@ void dump_tmp(char *s, int n, real c[])
     FILE *fp;
     int   i;
 
-    fp = ffopen(s, "w");
+    fp = gmx_ffopen(s, "w");
     for (i = 0; (i < n); i++)
     {
         fprintf(fp, "%10d  %10g\n", i, c[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 real print_and_integrate(FILE *fp, int n, real dt, real c[], real *fit, int nskip)
@@ -950,7 +950,7 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
         }
         if (debug)
         {
-            ffclose(gp);
+            gmx_ffclose(gp);
         }
         if (nitem > 1)
         {
@@ -963,7 +963,7 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
     }
     if (fp)
     {
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     sfree(fit);
 }
index c0029e27d5c4797ea286c34955e5ae698ad83301..e8374fd547ec02d1e7af74bc2a9df64efffcc2f8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -232,7 +232,7 @@ void low_rmsd_dist(const char *fn, real maxrms, int nn, real **mat,
     {
         fprintf(fp, "%10g  %10d\n", i/fac, histo[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     sfree(histo);
 }
 
index 58331c274bda7c5ef2e3012cd1cbfeeb671cf356..806e754d3339d52009738437d0179a31a358dbaa 100644 (file)
@@ -75,7 +75,7 @@ static t_pdbfile *read_pdbf(const char *fn)
     init_t_atoms(&(pdbf->atoms), natoms, FALSE);
     snew(pdbf->x, natoms);
     read_stx_conf(fn, buf, &pdbf->atoms, pdbf->x, NULL, &pdbf->ePBC, pdbf->box);
-    fp = ffopen(fn, "r");
+    fp = gmx_ffopen(fn, "r");
     do
     {
         ptr = fgets2(buf, 255, fp);
@@ -96,7 +96,7 @@ static t_pdbfile *read_pdbf(const char *fn)
         }
     }
     while (ptr != NULL);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     return pdbf;
 }
@@ -195,7 +195,7 @@ static void analyse_em_all(int npdb, t_pdbfile *pdbf[], const char *edocked,
         {
             fprintf(fp, "%12lf\n", bFreeSort ? pdbf[i]->efree : pdbf[i]->edocked);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 }
 
@@ -380,7 +380,7 @@ int gmx_anadock(int argc, char *argv[])
         return 0;
     }
 
-    fp = ffopen(opt2fn("-g", NFILE, fnm), "w");
+    fp = gmx_ffopen(opt2fn("-g", NFILE, fnm), "w");
     please_cite(stdout, "Hetenyi2002b");
     please_cite(fp, "Hetenyi2002b");
 
@@ -392,7 +392,7 @@ int gmx_anadock(int argc, char *argv[])
     cluster_em_all(fp, npdbf, pdbf, bFree, bRMS, cutoff);
 
     gmx_thanx(fp);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     return 0;
 }
index 412030408e1c4f0ae5b2aff7de645662dd882f60..eef2ef1b99102429807850c9ae30cbac6c08ee85 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -154,7 +154,7 @@ static void write_xvgr_graphs(const char *file, int ngraphs, int nsetspergraph,
     int   g, s, i;
     real  min, max, xsp, ysp;
 
-    out = ffopen(file, "w");
+    out = gmx_ffopen(file, "w");
     if (output_env_get_xvg_format(oenv) == exvgXMGRACE)
     {
         fprintf(out, "@ autoscale onread none\n");
@@ -272,7 +272,7 @@ static void write_xvgr_graphs(const char *file, int ngraphs, int nsetspergraph,
             }
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 static void
@@ -446,10 +446,10 @@ static void inprod_matrix(const char *matfile, int natoms,
     rlo.r   = 1; rlo.g = 1; rlo.b = 1;
     rhi.r   = 0; rhi.g = 0; rhi.b = 0;
     nlevels = 41;
-    out     = ffopen(matfile, "w");
+    out     = gmx_ffopen(matfile, "w");
     write_xpm(out, 0, "Eigenvector inner-products", "in.prod.", "run 1", "run 2",
               nx, ny, t_x, t_y, mat, 0.0, max, rlo, rhi, &nlevels);
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 static void overlap(const char *outfile, int natoms,
@@ -489,7 +489,7 @@ static void overlap(const char *outfile, int natoms,
         fprintf(out, "%5d  %5.3f\n", eignr2[x]+1, overlap/noutvec);
     }
 
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 static void project(const char *trajfile, t_topology *top, int ePBC, matrix topbox,
@@ -675,7 +675,7 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
             }
             fprintf(xvgrout, "%10.5f %10.5f\n", inprod[0][i], inprod[noutvec-1][i]);
         }
-        ffclose(xvgrout);
+        gmx_ffclose(xvgrout);
     }
 
     if (threedplotfile)
@@ -748,7 +748,7 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
             strcpy(pdbform, get_pdbformat());
             strcat(pdbform, "%8.4f%8.4f\n");
 
-            out = ffopen(threedplotfile, "w");
+            out = gmx_ffopen(threedplotfile, "w");
             fprintf(out, "HEADER    %s\n", str);
             if (b4D)
             {
@@ -771,7 +771,7 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
                 j++;
             }
             fprintf(out, "TER\n");
-            ffclose(out);
+            gmx_ffclose(out);
         }
         else
         {
index 6551ef98c4412758417bc80d318bfb41c2f80025..379574cc4fd641d923e15c37cefe3dec756feb17 100644 (file)
@@ -153,7 +153,7 @@ static void plot_coscont(const char *ccfile, int n, int nset, real **val,
     }
     fprintf(stdout, "\n");
 
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static void regression_analysis(int n, gmx_bool bXYdy,
@@ -293,7 +293,7 @@ void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
             fprintf(fp, "&\n");
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static int real_comp(const void *a, const void *b)
@@ -322,7 +322,7 @@ static void average(const char *avfile, int avbar_opt,
     double  av, var, err;
     real   *tmp = NULL;
 
-    fp = ffopen(avfile, "w");
+    fp = gmx_ffopen(avfile, "w");
     if ((avbar_opt == avbarERROR) && (nset == 1))
     {
         avbar_opt = avbarNONE;
@@ -383,7 +383,7 @@ static void average(const char *avfile, int avbar_opt,
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     if (avbar_opt == avbar90)
     {
@@ -685,7 +685,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
     sfree(fitsig);
     sfree(ybs);
     sfree(tbs);
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static void luzar_correl(int nn, real *time, int nset, real **val, real temp,
@@ -1265,7 +1265,7 @@ int gmx_analyze(int argc, char *argv[])
 
     if (fitfile != NULL)
     {
-        out_fit = ffopen(fitfile, "w");
+        out_fit = gmx_ffopen(fitfile, "w");
         if (bXYdy && nset >= 2)
         {
             do_fit(out_fit, 0, TRUE, n, t, val, npargs, ppa, oenv);
@@ -1277,7 +1277,7 @@ int gmx_analyze(int argc, char *argv[])
                 do_fit(out_fit, s, FALSE, n, t, val, npargs, ppa, oenv);
             }
         }
-        ffclose(out_fit);
+        gmx_ffclose(out_fit);
     }
 
     printf("                                      std. dev.    relative deviation of\n");
@@ -1355,7 +1355,7 @@ int gmx_analyze(int argc, char *argv[])
                 fprintf(out, "&\n");
             }
         }
-        ffclose(out);
+        gmx_ffclose(out);
         fprintf(stderr, "\r%d, time=%g\n", j-1, (j-1)*dt);
     }
     if (ccfile)
index e4ef6bbf4da639ee33c6a92ec4fa2cfd4c9958e7..8d4d9111c67c3bfef3deba1f17d8e37f13d9d0a0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -306,7 +306,7 @@ int gmx_g_angle(int argc, char *argv[])
             }
             fprintf(out, "\n");
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     if (opt2bSet("-or", NFILE, fnm))
     {
@@ -324,7 +324,7 @@ int gmx_g_angle(int argc, char *argv[])
             fprintf(out, "%10.5f  %10.3f\n", time[i], trans_frac[i]);
             tfrac += trans_frac[i];
         }
-        ffclose(out);
+        gmx_ffclose(out);
 
         tfrac /= nframes;
         fprintf(stderr, "Average trans fraction: %g\n", tfrac);
@@ -463,7 +463,7 @@ int gmx_g_angle(int argc, char *argv[])
         fprintf(out, "%10g  %10f\n", 180.0, angstat[0]*norm_fac);
     }
 
-    ffclose(out);
+    gmx_ffclose(out);
 
     do_view(oenv, opt2fn("-od", NFILE, fnm), "-nxy");
     if (bAver)
index 59691a05dcaa7c6e4da183d219801ae590d54fef..8db26c9c8a470c29749da15b8201b9eef78d2d77 100644 (file)
@@ -3938,7 +3938,7 @@ int gmx_bar(int argc, char *argv[])
     {
         lambda_vec_print_short(results[nresults-1].b->native_lambda, buf);
         fprintf(fpi, xvg2format, buf, dg_tot);
-        ffclose(fpi);
+        gmx_ffclose(fpi);
     }
 
     do_view(oenv, opt2fn_null("-o", NFILE, fnm), "-xydy");
index b6ad8fd08c127f0349915ac72aa9fb46302c27f3..7ce5dc0edc6314ef8ce496702d32b0f33a58564f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -427,17 +427,17 @@ int gmx_bundle(int argc, char *argv[])
     {
         close_trx(fpdb);
     }
-    ffclose(flen);
-    ffclose(fdist);
-    ffclose(fz);
-    ffclose(ftilt);
-    ffclose(ftiltr);
-    ffclose(ftiltl);
+    gmx_ffclose(flen);
+    gmx_ffclose(fdist);
+    gmx_ffclose(fz);
+    gmx_ffclose(ftilt);
+    gmx_ffclose(ftiltr);
+    gmx_ffclose(ftiltl);
     if (bKink)
     {
-        ffclose(fkink);
-        ffclose(fkinkr);
-        ffclose(fkinkl);
+        gmx_ffclose(fkink);
+        gmx_ffclose(fkinkr);
+        gmx_ffclose(fkinkl);
     }
 
     return 0;
index b26b6aef53f4ba5aea3a2bb39fc9c20e67a522e0..62c14cbe6c83b55bff337a8202d653580ea098a9 100644 (file)
@@ -487,7 +487,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
     rt_size = gmx_residuetype_get_size(rt);
     if (bSSHisto)
     {
-        fp = ffopen(ssdump, "r");
+        fp = gmx_ffopen(ssdump, "r");
         if (1 != fscanf(fp, "%d", &nres))
         {
             gmx_fatal(FARGS, "Error reading from file %s", ssdump);
@@ -499,7 +499,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
             gmx_fatal(FARGS, "Error reading from file %s", ssdump);
         }
 
-        ffclose(fp);
+        gmx_ffclose(fp);
         /* Four dimensional array... Very cool */
         snew(his_aa_ss, 3);
         for (i = 0; (i < 3); i++)
@@ -708,7 +708,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         for (i = 0; (i < NJC); i++)
         {
             sfree(leg[i]);
@@ -778,7 +778,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
                     for (k = 0; (k < 3); k++)
                     {
                         sprintf(sshisfile, "%s-%s.xvg", hisfile, sss[k]);
-                        ssfp[k] = ffopen(sshisfile, "w");
+                        ssfp[k] = gmx_ffopen(sshisfile, "w");
                     }
                 }
                 for (j = 0; (j < nbin); j++)
@@ -802,13 +802,13 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
                     }
                 }
                 fprintf(fp, "&\n");
-                ffclose(fp);
+                gmx_ffclose(fp);
                 if (bSSHisto)
                 {
                     for (k = 0; (k < 3); k++)
                     {
                         fprintf(ssfp[k], "&\n");
-                        ffclose(ssfp[k]);
+                        gmx_ffclose(ssfp[k]);
                     }
                 }
             }
@@ -904,7 +904,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
             if (bViol)
             {
                 sprintf(fn, "violPhiPsi%s.xvg", dlist[i].name);
-                gp = ffopen(fn, "w");
+                gp = gmx_ffopen(fn, "w");
             }
             Phi = dlist[i].j0[edPhi];
             Psi = dlist[i].j0[edPsi];
@@ -926,13 +926,13 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
             }
             if (bViol)
             {
-                ffclose(gp);
+                gmx_ffclose(gp);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
             if (bOm)
             {
                 sprintf(fn, "ramomega%s.xpm", dlist[i].name);
-                fp = ffopen(fn, "w");
+                fp = gmx_ffopen(fn, "w");
                 lo = hi = 0;
                 for (j = 0; (j < NMAT); j++)
                 {
@@ -965,7 +965,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
                 nlevels = 20;
                 write_xpm3(fp, 0, "Omega/Ramachandran Plot", "Deg", "Phi", "Psi",
                            NMAT, NMAT, axis, axis, mat, lo, 180.0, hi, rlo, rmid, rhi, &nlevels);
-                ffclose(fp);
+                gmx_ffclose(fp);
                 for (j = 0; (j < NMAT); j++)
                 {
                     sfree(mat[j]);
@@ -985,7 +985,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
             {
                 fprintf(fp, "%10g  %10g\n", RAD2DEG*dih[Xi1][j], RAD2DEG*dih[Xi2][j]);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
         }
         else
         {
@@ -1046,7 +1046,7 @@ static void print_transitions(const char *fn, int maxchi, int nlist,
         /* fprintf(fp,"%12s\n",dlist[i].name);  this confuses xmgrace */
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static void order_params(FILE *log,
@@ -1125,7 +1125,7 @@ static void order_params(FILE *log,
         fprintf(fp, "\n");
         /* fprintf(fp,"%12s\n",dlist[i].name);  this confuses xmgrace */
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     if (NULL != pdbfn)
     {
@@ -1155,7 +1155,7 @@ static void order_params(FILE *log,
             }
         }
 
-        fp = ffopen(pdbfn, "w");
+        fp = gmx_ffopen(pdbfn, "w");
         fprintf(fp, "REMARK generated by g_chi\n");
         fprintf(fp, "REMARK "
                 "B-factor field contains negative of dihedral order parameters\n");
@@ -1176,7 +1176,7 @@ static void order_params(FILE *log,
             fprintf(fp, buf, "ATOM  ", atoms->nr+1+i, "CA", "LEG", ' ',
                     atoms->nres+1, ' ', x0, y0, z0+(1.2*i), 0.0, -0.1*i);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     fprintf(log, "Dihedrals with S2 > 0.8\n");
@@ -1392,7 +1392,7 @@ int gmx_chi(int argc, char *argv[])
     sscanf(maxchistr[0], "%d", &maxchi);
     bChi = (maxchi > 0);
 
-    log = ffopen(ftp2fn(efLOG, NFILE, fnm), "w");
+    log = gmx_ffopen(ftp2fn(efLOG, NFILE, fnm), "w");
 
     if (bRamOmega)
     {
@@ -1537,7 +1537,7 @@ int gmx_chi(int argc, char *argv[])
     traj_t_ns = 0.001 * (time[nf-1]-time[0]);
     pr_dlist(log, nlist, dlist, traj_t_ns, edPrintST, bPhi, bPsi, bChi, bOmega, maxchi);
     pr_dlist(log, nlist, dlist, traj_t_ns, edPrintRO, bPhi, bPsi, bChi, bOmega, maxchi);
-    ffclose(log);
+    gmx_ffclose(log);
     /* transitions to xvg */
     if (bDo_rt)
     {
index 7f178abc0cf4d8052c23cde2aaa664496432e484..565f06c9b37764d1ab7d02c6872cc3077a5912c2 100644 (file)
@@ -980,13 +980,13 @@ static void ana_trans(t_clusters *clust, int nf,
                 "max %d between two specific clusters\n", ntranst, maxtrans);
     if (transfn)
     {
-        fp = ffopen(transfn, "w");
+        fp = gmx_ffopen(transfn, "w");
         i  = min(maxtrans+1, 80);
         write_xpm(fp, 0, "Cluster Transitions", "# transitions",
                   "from cluster", "to cluster",
                   clust->ncl, clust->ncl, axis, axis, trans,
                   0, maxtrans, rlo, rhi, &i);
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (ntransfn)
     {
@@ -996,7 +996,7 @@ static void ana_trans(t_clusters *clust, int nf,
         {
             fprintf(fp, "%5d %5d\n", i+1, ntrans[i]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     sfree(ntrans);
     for (i = 0; i < clust->ncl; i++)
@@ -1102,7 +1102,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
         {
             fprintf(fp, "%8g %8d\n", time[i], clust->cl[i]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (sizefn)
     {
@@ -1865,7 +1865,7 @@ int gmx_cluster(int argc, char *argv[])
             {
                 fprintf(fp, "%10d  %10g\n", i, eigenvalues[i]);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
             break;
         case m_monte_carlo:
             orig     = init_mat(rms->nn, FALSE);
@@ -1921,7 +1921,7 @@ int gmx_cluster(int argc, char *argv[])
                          bAverage, write_ncl, write_nst, rmsmin, bFit, log,
                          rlo_bot, rhi_bot, oenv);
     }
-    ffclose(log);
+    gmx_ffclose(log);
 
     if (bBinary && !bAnalyze)
     {
@@ -1966,7 +1966,7 @@ int gmx_cluster(int argc, char *argv[])
         }
     }
     fprintf(stderr, "\n");
-    ffclose(fp);
+    gmx_ffclose(fp);
     if (NULL != orig)
     {
         fp = opt2FILE("-om", NFILE, fnm, "w");
@@ -1975,7 +1975,7 @@ int gmx_cluster(int argc, char *argv[])
         write_xpm(fp, 0, title, "RMSD (nm)", buf, buf,
                   nf, nf, time, time, orig->mat, 0.0, orig->maxrms,
                   rlo_top, rhi_top, &nlevels);
-        ffclose(fp);
+        gmx_ffclose(fp);
         done_mat(&orig);
         sfree(orig);
     }
index 72ac220a185dd9f69832c7848593af6e89911df6..d55fcfae5c00cd4066777f21c27123d4d28387d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -339,16 +339,16 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     while (read_next_frame(oenv, status, &fr));
     close_trx(status);
-    ffclose(fp);
-    ffclose(gp);
-    ffclose(hp);
-    ffclose(tp);
+    gmx_ffclose(fp);
+    gmx_ffclose(gp);
+    gmx_ffclose(hp);
+    gmx_ffclose(tp);
 
     gmx_mtop_atomlookup_destroy(alook);
 
     if (max_clust_ind >= 0)
     {
-        fp = ffopen(mcn, "w");
+        fp = gmx_ffopen(mcn, "w");
         fprintf(fp, "[ max_clust ]\n");
         for (i = 0; (i < nindex); i++)
         {
@@ -367,7 +367,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                 }
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     /* Print the real distribution cluster-size/numer, averaged over the trajectory. */
@@ -385,7 +385,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
         nhisto += (int)((j+1)*nelem/n_x);
     }
     fprintf(fp, "%5d  %8.3f\n", j+1, 0.0);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     fprintf(stderr, "Total number of atoms in clusters =  %d\n", nhisto);
 
@@ -407,11 +407,11 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     fprintf(stderr, "cmid: %g, cmax: %g, max_size: %d\n", cmid, cmax, max_size);
     cmid = 1;
-    fp   = ffopen(xpm, "w");
+    fp   = gmx_ffopen(xpm, "w");
     write_xpm3(fp, 0, "Cluster size distribution", "# clusters", timebuf, "Size",
                n_x, max_size, t_x, t_y, cs_dist, 0, cmid, cmax,
                rlo, rmid, rhi, &nlevels);
-    ffclose(fp);
+    gmx_ffclose(fp);
     cmid = 100.0;
     cmax = 0.0;
     for (i = 0; (i < n_x); i++)
@@ -427,11 +427,11 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
         }
     }
     fprintf(stderr, "cmid: %g, cmax: %g, max_size: %d\n", cmid, cmax, max_size);
-    fp = ffopen(xpmw, "w");
+    fp = gmx_ffopen(xpmw, "w");
     write_xpm3(fp, 0, "Weighted cluster size distribution", "Fraction", timebuf,
                "Size", n_x, max_size, t_x, t_y, cs_dist, 0, cmid, cmax,
                rlo, rmid, rhi, &nlevels);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     sfree(clust_index);
     sfree(clust_size);
index d242b8edb5b9cc865c75c86db381e08f906644be..40e4e722d5ebf164d25e7c28c47a89287fa18b9e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -609,7 +609,7 @@ int gmx_confrms(int argc, char *argv[])
         find_matching_names(&isize1, index1, atoms1, &isize2, index2, atoms2);
         if (matchndxfile)
         {
-            fp = ffopen(matchndxfile, "w");
+            fp = gmx_ffopen(matchndxfile, "w");
             fprintf(fp, "; Matching atoms between %s from %s and %s from %s\n",
                     groupnames1, conf1file, groupnames2, conf2file);
             fprintf(fp, "[ Match_%s_%s ]\n", conf1file, groupnames1);
@@ -798,26 +798,26 @@ int gmx_confrms(int argc, char *argv[])
 /*    atoms2->resinfo[atoms2->atom[index2[i]].resind].chain = 'B'; */
                 }
             }
-            fp = ffopen(outfile, "w");
+            fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
                 write_pdbfile(fp, title1, atoms1, x1, ePBC1, box1, ' ', 1, NULL, TRUE);
             }
             write_pdbfile(fp, title2, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, NULL, TRUE);
-            ffclose(fp);
+            gmx_ffclose(fp);
             break;
         case efGRO:
             if (bBfac)
             {
                 fprintf(stderr, "WARNING: cannot write B-factor values to gro file\n");
             }
-            fp = ffopen(outfile, "w");
+            fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
                 write_hconf_p(fp, title1, atoms1, 3, x1, v1, box1);
             }
             write_hconf_p(fp, title2, atoms2, 3, x2, v2, box2);
-            ffclose(fp);
+            gmx_ffclose(fp);
             break;
         default:
             if (bBfac)
index c3d2c818741134b2b8bf9584a1404fadfaee51ec..dfeb48ee2abfa937871627726a294ce0f94d19dc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -422,7 +422,7 @@ int gmx_covar(int argc, char *argv[])
 
     if (asciifile)
     {
-        out = ffopen(asciifile, "w");
+        out = gmx_ffopen(asciifile, "w");
         for (j = 0; j < ndim; j++)
         {
             for (i = 0; i < ndim; i += 3)
@@ -431,7 +431,7 @@ int gmx_covar(int argc, char *argv[])
                         mat[ndim*j+i], mat[ndim*j+i+1], mat[ndim*j+i+2]);
             }
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
 
     if (xpmfile)
@@ -462,12 +462,12 @@ int gmx_covar(int argc, char *argv[])
         rlo.r   = 0; rlo.g = 0; rlo.b = 1;
         rmi.r   = 1; rmi.g = 1; rmi.b = 1;
         rhi.r   = 1; rhi.g = 0; rhi.b = 0;
-        out     = ffopen(xpmfile, "w");
+        out     = gmx_ffopen(xpmfile, "w");
         nlevels = 80;
         write_xpm3(out, 0, "Covariance", bM ? "u nm^2" : "nm^2",
                    "dim", "dim", ndim, ndim, axis, axis,
                    mat2, min, 0.0, max, rlo, rmi, rhi, &nlevels);
-        ffclose(out);
+        gmx_ffclose(out);
         sfree(axis);
         sfree(mat2);
     }
@@ -509,12 +509,12 @@ int gmx_covar(int argc, char *argv[])
         rlo.r   = 0; rlo.g = 0; rlo.b = 1;
         rmi.r   = 1; rmi.g = 1; rmi.b = 1;
         rhi.r   = 1; rhi.g = 0; rhi.b = 0;
-        out     = ffopen(xpmafile, "w");
+        out     = gmx_ffopen(xpmafile, "w");
         nlevels = 80;
         write_xpm3(out, 0, "Covariance", bM ? "u nm^2" : "nm^2",
                    "atom", "atom", ndim/DIM, ndim/DIM, axis, axis,
                    mat2, min, 0.0, max, rlo, rmi, rhi, &nlevels);
-        ffclose(out);
+        gmx_ffclose(out);
         sfree(axis);
         for (i = 0; i < ndim/DIM; i++)
         {
@@ -559,7 +559,7 @@ int gmx_covar(int argc, char *argv[])
     {
         fprintf (out, "%10d %g\n", (int)i+1, eigenvalues[ndim-1-i]);
     }
-    ffclose(out);
+    gmx_ffclose(out);
 
     if (end == -1)
     {
@@ -597,7 +597,7 @@ int gmx_covar(int argc, char *argv[])
     write_eigenvectors(eigvecfile, natoms, mat, TRUE, 1, end,
                        WriteXref, x, bDiffMass1, xproj, bM, eigenvalues);
 
-    out = ffopen(logfile, "w");
+    out = gmx_ffopen(logfile, "w");
 
     time(&now);
     gmx_ctime_r(&now, timebuf, STRLEN);
@@ -648,7 +648,7 @@ int gmx_covar(int argc, char *argv[])
     fprintf(out, "Wrote average structure to %s and %s\n", averfile, eigvecfile);
     fprintf(out, "Wrote eigenvectors %d to %d to %s\n", 1, end, eigvecfile);
 
-    ffclose(out);
+    gmx_ffclose(out);
 
     fprintf(stderr, "Wrote the log to %s\n", logfile);
 
index 66825b4a3db52bb9c6f21759bbcdab7f9969bde6..bd053807a9d061521aa1189eca765c8c33500f3b 100644 (file)
@@ -991,16 +991,16 @@ int gmx_current(int argc, char *argv[])
                temp, trust, bfit, efit, bvit, evit, status, isize, nmols, nshift,
                index0, indexm, mass2, qmol, eps_rf, oenv);
 
-    ffclose(fmj);
-    ffclose(fmd);
-    ffclose(fmjdsp);
+    gmx_ffclose(fmj);
+    gmx_ffclose(fmd);
+    gmx_ffclose(fmjdsp);
     if (bACF)
     {
-        ffclose(outf);
+        gmx_ffclose(outf);
     }
     if (bINT)
     {
-        ffclose(mcor);
+        gmx_ffclose(mcor);
     }
 
     return 0;
index f3891fcceb424a36e2f31a64e525c65e357017a5..33fac9beb00482e33b9132ba9cb9f4b8cfb6842f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -88,7 +88,7 @@ int get_electrons(t_electron **eltab, const char *fn)
     int   nr;        /* number of atomstypes to read */
     int   i;
 
-    if (!(in = ffopen(fn, "r")))
+    if (!(in = gmx_ffopen(fn, "r")))
     {
         gmx_fatal(FARGS, "Couldn't open %s. Exiting.\n", fn);
     }
@@ -118,7 +118,7 @@ int get_electrons(t_electron **eltab, const char *fn)
         (*eltab)[i].nr_el    = tempnr;
         (*eltab)[i].atomname = strdup(tempname);
     }
-    ffclose(in);
+    gmx_ffclose(in);
 
     /* sort the list */
     fprintf(stderr, "Sorting list..\n");
@@ -431,7 +431,7 @@ void plot_density(double *slDensity[], const char *afile, int nslices,
         fprintf(den, "\n");
     }
 
-    ffclose(den);
+    gmx_ffclose(den);
 }
 
 int gmx_density(int argc, char *argv[])
index b58dea0c99704deb6dcfb05fd303951a2aa8cff7..0206280fa341b1ec74975d9ac9085184b47dfc34 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -499,7 +499,7 @@ int gmx_densmap(int argc, char *argv[])
     }
     if (ftp2bSet(efDAT, NFILE, fnm))
     {
-        fp = ffopen(ftp2fn(efDAT, NFILE, fnm), "w");
+        fp = gmx_ffopen(ftp2fn(efDAT, NFILE, fnm), "w");
         /*optional text form output:  first row is tickz; first col is tickx */
         fprintf(fp, "0\t");
         for (j = 0; j < n2; ++j)
@@ -517,15 +517,15 @@ int gmx_densmap(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     else
     {
-        fp = ffopen(ftp2fn(efXPM, NFILE, fnm), "w");
+        fp = gmx_ffopen(ftp2fn(efXPM, NFILE, fnm), "w");
         write_xpm(fp, MAT_SPATIAL_X | MAT_SPATIAL_Y, buf, unit,
                   bRadial ? "axial (nm)" : label[c1], bRadial ? "r (nm)" : label[c2],
                   n1, n2, tickx, tickz, grid, dmin, maxgrid, rlo, rhi, &nlev);
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
index 37ea9a3013ec600dfc977c38620e72f1385a5707..2f32968c9e80f55a6d90f2db69cceaf527dca96e 100644 (file)
@@ -302,7 +302,7 @@ static void outputfield(const char *fldfn, real ****Densmap,
     dim[2] = yslices;
     dim[3] = zslices;
 
-    fldH = ffopen(fldfn, "w");
+    fldH = gmx_ffopen(fldfn, "w");
     fwrite(dim, sizeof(int), 4, fldH);
     for (n = 0; n < tdim; n++)
     {
@@ -320,7 +320,7 @@ static void outputfield(const char *fldfn, real ****Densmap,
     }
     totdens /= (xslices*yslices*zslices*tdim);
     fprintf(stderr, "Total density [kg/m^3]  %8f", totdens);
-    ffclose(fldH);
+    gmx_ffclose(fldH);
 }
 
 static void filterdensmap(real ****Densmap, int xslices, int yslices, int zslices, int tblocks, int ftsize)
@@ -562,8 +562,8 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
         yticks[j] += bw;
     }
 
-    xpmfile1 = ffopen(outfiles[0], "w");
-    xpmfile2 = ffopen(outfiles[1], "w");
+    xpmfile1 = gmx_ffopen(outfiles[0], "w");
+    xpmfile2 = gmx_ffopen(outfiles[1], "w");
 
     max1 = max2 = 0.0;
     min1 = min2 = zbins*bwz;
@@ -602,8 +602,8 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
         write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile2, min2, max2, lo, hi, &maplevels);
     }
 
-    ffclose(xpmfile1);
-    ffclose(xpmfile2);
+    gmx_ffclose(xpmfile1);
+    gmx_ffclose(xpmfile2);
 
 
     sfree(profile1);
@@ -617,8 +617,8 @@ static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins,
     FILE *raw1, *raw2;
     int   i, j, n;
 
-    raw1 = ffopen(fnms[0], "w");
-    raw2 = ffopen(fnms[1], "w");
+    raw1 = gmx_ffopen(fnms[0], "w");
+    raw2 = gmx_ffopen(fnms[1], "w");
     try
     {
         gmx::BinaryInformationSettings settings;
@@ -644,8 +644,8 @@ static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins,
         }
     }
 
-    ffclose(raw1);
-    ffclose(raw2);
+    gmx_ffclose(raw1);
+    gmx_ffclose(raw2);
 }
 
 
index 37714d3e276628c7569b88bfaa7a9ee82940e211..2a8fd8060558a69b104f03e38b57ea9f9ce27022 100644 (file)
@@ -132,7 +132,7 @@ real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], r
         }
     }
 
-    tmpfp        = ffopen("integral_smth.xvg", "w");
+    tmpfp        = gmx_ffopen("integral_smth.xvg", "w");
     integralSmth = print_and_integrate(tmpfp, nx, x[1]-x[0], combined, NULL, 1);
     printf("SMOOTH integral = %10.5e\n", integralSmth);
 
@@ -224,8 +224,8 @@ void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
     }
     printf("MAXEPS = %10.5e at frequency %10.5e GHz (tauD = %8.1f ps)\n",
            maxeps, numax, 1000/(2*M_PI*numax));
-    ffclose(fp);
-    ffclose(cp);
+    gmx_ffclose(fp);
+    gmx_ffclose(cp);
     sfree(tmp);
 }
 
index 14d32a48a31270eefa8c2b6a4de905480b636ba8..dc0c0982fb8bf3844a154827f8a1c9476519b233 100644 (file)
@@ -320,13 +320,13 @@ static void print_cmap(const char *cmap, t_gkrbin *gb, int *nlevels)
         }
         /*2.0*j/(gb->ny-1.0)-1.0;*/
     }
-    out = ffopen(cmap, "w");
+    out = gmx_ffopen(cmap, "w");
     write_xpm(out, 0,
               "Dipole Orientation Distribution", "Fraction", "r (nm)",
               gb->bPhi ? "Phi" : "Alpha",
               gb->nx, gb->ny, xaxis, yaxis,
               gb->cmap, 0, hi, rlo, rhi, nlevels);
-    ffclose(out);
+    gmx_ffclose(out);
     sfree(xaxis);
     sfree(yaxis);
 }
@@ -405,7 +405,7 @@ static void print_gkrbin(const char *fn, t_gkrbin *gb,
         /* Swap x0 and x1 */
         x0 = x1;
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
@@ -687,7 +687,7 @@ static void dump_slab_dipoles(const char *fn, int idim, int nslice,
                 slab_dipole[i][ZZ]/nframes,
                 mutot);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     do_view(oenv, fn, "-autoscale xy -nxy");
 }
 
@@ -943,11 +943,11 @@ static void do_dip(t_topology *top, int ePBC, real volume,
         snew(dipsp, gnx_tot);
 
         /* we need a dummy file for gnuplot */
-        dip3d = (FILE *)ffopen("dummy.dat", "w");
+        dip3d = (FILE *)gmx_ffopen("dummy.dat", "w");
         fprintf(dip3d, "%f %f %f", 0.0, 0.0, 0.0);
-        ffclose(dip3d);
+        gmx_ffclose(dip3d);
 
-        dip3d = (FILE *)ffopen(fndip3d, "w");
+        dip3d = (FILE *)gmx_ffopen(fndip3d, "w");
         try
         {
             gmx::BinaryInformationSettings settings;
@@ -1337,18 +1337,18 @@ static void do_dip(t_topology *top, int ePBC, real volume,
         close_trj(status);
     }
 
-    ffclose(outmtot);
-    ffclose(outaver);
-    ffclose(outeps);
+    gmx_ffclose(outmtot);
+    gmx_ffclose(outaver);
+    gmx_ffclose(outeps);
 
     if (fnadip)
     {
-        ffclose(adip);
+        gmx_ffclose(adip);
     }
 
     if (cosaver)
     {
-        ffclose(caver);
+        gmx_ffclose(caver);
     }
 
     if (dip3d)
@@ -1358,7 +1358,7 @@ static void do_dip(t_topology *top, int ePBC, real volume,
         fprintf(dip3d, "set zrange [0.0:%4.2f]\n\n", box[ZZ][ZZ]);
         fprintf(dip3d, "splot 'dummy.dat' using 1:2:3 w vec\n");
         fprintf(dip3d, "pause -1 'Hit return to continue'\n");
-        ffclose(dip3d);
+        gmx_ffclose(dip3d);
     }
 
     if (bSlab)
@@ -1457,7 +1457,7 @@ static void do_dip(t_topology *top, int ePBC, real volume,
             fprintf(outdd, "%10g  %10f\n",
                     (i*mu_max)/ndipbin, dipole_bin[i]/(double)teller);
         }
-        ffclose(outdd);
+        gmx_ffclose(outdd);
         sfree(dipole_bin);
     }
     if (bGkr)
index 6f05124b440f6ae85edcb5405260c4574661463c..09c1533bc7fa8b422d48d6ee6dfb471a54f17d78 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -639,10 +639,10 @@ static void dump_disre_matrix(const char *fn, t_dr_result *dr, int ndr,
         hi = max_dr;
     }
     printf("Highest level in the matrix will be %g\n", hi);
-    fp = ffopen(fn, "w");
+    fp = gmx_ffopen(fn, "w");
     write_xpm(fp, 0, "Distance Violations", "<V> (nm)", "Residue", "Residue",
               n_res, n_res, t_res, t_res, matrix, 0, hi, rlo, rhi, &nlevels);
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 int gmx_disre(int argc, char *argv[])
@@ -929,13 +929,13 @@ int gmx_disre(int argc, char *argv[])
         }
         dump_disre_matrix(opt2fn_null("-x", NFILE, fnm), &dr, fcd.disres.nres,
                           j, &top->idef, &mtop, max_dr, nlevels, bThird);
-        ffclose(out);
-        ffclose(aver);
-        ffclose(numv);
-        ffclose(maxxv);
+        gmx_ffclose(out);
+        gmx_ffclose(aver);
+        gmx_ffclose(numv);
+        gmx_ffclose(maxxv);
         if (isize > 0)
         {
-            ffclose(xvg);
+            gmx_ffclose(xvg);
             do_view(oenv, opt2fn("-dr", NFILE, fnm), "-nxy");
         }
         do_view(oenv, opt2fn("-dn", NFILE, fnm), "-nxy");
index 3b34c71bafc177f969cffca3aa74158ff97569db..77e143348029ee62715f134b4e2ddcf4ab57d8cf 100644 (file)
@@ -74,7 +74,7 @@ static int strip_dssp(char *dsspfile, int nres,
     real            iaccf, iaccb;
     t_xpmelmt       c;
 
-    tapeout = ffopen(dsspfile, "r");
+    tapeout = gmx_ffopen(dsspfile, "r");
 
     /* Skip header */
     do
@@ -179,7 +179,7 @@ static int strip_dssp(char *dsspfile, int nres,
     {
         fprintf(fTArea, "%10g  %10g  %10g\n", t, 0.01*iaccb, 0.01*iaccf);
     }
-    ffclose(tapeout);
+    gmx_ffclose(tapeout);
 
     /* Return the number of lines found in the dssp file (i.e. number
      * of redidues plus chain separator lines).
@@ -328,12 +328,12 @@ void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *
                 hi = max(hi, accr[i][j]);
             }
         }
-        fp   = ffopen(fn, "w");
+        fp   = gmx_ffopen(fn, "w");
         nlev = hi-lo+1;
         write_xpm(fp, 0, "Solvent Accessible Surface", "Surface (A^2)",
                   "Time", "Residue Index", nframe, nres,
                   mat->axis_x, mat->axis_y, accr, lo, hi, rlo, rhi, &nlev);
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 }
 
@@ -427,7 +427,7 @@ void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
     }
     fprintf(fp, "\n");
 
-    ffclose(fp);
+    gmx_ffclose(fp);
     sfree(leg);
     sfree(count);
 }
@@ -656,9 +656,9 @@ int gmx_do_dssp(int argc, char *argv[])
             }
         }
         gmx_rmpbc(gpbc, natoms, box, x);
-        tapein = ffopen(pdbfile, "w");
+        tapein = gmx_ffopen(pdbfile, "w");
         write_pdbfile_indexed(tapein, NULL, atoms, x, ePBC, box, ' ', -1, gnx, index, NULL, TRUE);
-        ffclose(tapein);
+        gmx_ffclose(tapein);
 
 #ifdef GMX_NO_SYSTEM
         printf("Warning-- No calls to system(3) supported on this platform.");
@@ -691,7 +691,7 @@ int gmx_do_dssp(int argc, char *argv[])
     close_trj(status);
     if (fTArea)
     {
-        ffclose(fTArea);
+        gmx_ffclose(fTArea);
     }
     gmx_rmpbc_done(gpbc);
 
@@ -700,7 +700,7 @@ int gmx_do_dssp(int argc, char *argv[])
     ss        = opt2FILE("-o", NFILE, fnm, "w");
     mat.flags = 0;
     write_xpm_m(ss, mat);
-    ffclose(ss);
+    gmx_ffclose(ss);
 
     if (opt2bSet("-ssdump", NFILE, fnm))
     {
@@ -716,7 +716,7 @@ int gmx_do_dssp(int argc, char *argv[])
             ss_str[i] = '\0';
             fprintf(ss, "%s\n", ss_str);
         }
-        ffclose(ss);
+        gmx_ffclose(ss);
         sfree(ss_str);
     }
     analyse_ss(fnSCount, &mat, ss_string, oenv);
@@ -740,7 +740,7 @@ int gmx_do_dssp(int argc, char *argv[])
             {
                 fprintf(acc, "%5d  %10g %10g\n", i+1, av_area[i], norm_av_area[i]);
             }
-            ffclose(acc);
+            gmx_ffclose(acc);
         }
     }
 
index cce60f90cdd61e5d891042f5c6d53b91c97c54d3..9577dc895ab494dda0e3a262982af8905d1d3109 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -354,17 +354,17 @@ int gmx_dyecoupl(int argc, char *argv[])
 
             if (bRKout)
             {
-                ffclose(rkfp);
+                gmx_ffclose(rkfp);
             }
 
             if (bDatout)
             {
-                ffclose(datfp);
+                gmx_ffclose(datfp);
             }
 
             if (bInstEffout)
             {
-                ffclose(iefp);
+                gmx_ffclose(iefp);
             }
 
 
@@ -415,7 +415,7 @@ int gmx_dyecoupl(int argc, char *argv[])
                     fprintf(rhfp, "%12.7f %12.7f\n", (i + 0.5) * rincr + rmin,
                             rhist[i]);
                 }
-                ffclose(rhfp);
+                gmx_ffclose(rhfp);
             }
 
             if (bKhistout)
@@ -452,7 +452,7 @@ int gmx_dyecoupl(int argc, char *argv[])
                     fprintf(khfp, "%12.7f %12.7f\n", (i + 0.5) * kincr + kmin,
                             khist[i]);
                 }
-                ffclose(khfp);
+                gmx_ffclose(khfp);
             }
 
             printf("\nAverages:\n");
index 48f0f07a3f3c83f21d1f16140be24954b558720d..a28cb57450a9eabb0f1dda94f3a43a0e8a20d9e3 100644 (file)
@@ -1273,9 +1273,9 @@ int gmx_editconf(int argc, char *argv[])
 
         if (outftp == efPDB)
         {
-            out = ffopen(outfile, "w");
+            out = gmx_ffopen(outfile, "w");
             write_pdbfile_indexed(out, title, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE);
-            ffclose(out);
+            gmx_ffclose(out);
         }
         else
         {
@@ -1291,7 +1291,7 @@ int gmx_editconf(int argc, char *argv[])
 
         if ((outftp == efPDB) || (outftp == efPQR))
         {
-            out = ffopen(outfile, "w");
+            out = gmx_ffopen(outfile, "w");
             if (bMead)
             {
                 set_pdb_wide_format(TRUE);
@@ -1331,7 +1331,7 @@ int gmx_editconf(int argc, char *argv[])
                 visualize_box(out, bLegend ? atoms.nr+12 : atoms.nr,
                               bLegend ? atoms.nres = 12 : atoms.nres, box, visbox);
             }
-            ffclose(out);
+            gmx_ffclose(out);
         }
         else
         {
index 6ca3a0fea42d3c5ea1dcf1486bcc8be5c922af95..d2ff0eb9706d3f25511f799cc42abec7d7140b3b 100644 (file)
@@ -470,7 +470,7 @@ int gmx_enemat(int argc, char *argv[])
 
                     sprintf(fn, "%s%s", egrp_nm[m], ftp2fn(efXPM, NFILE, fnm));
                     sprintf(label, "%s Interaction Energies", egrp_nm[m]);
-                    out = ffopen(fn, "w");
+                    out = gmx_ffopen(fn, "w");
                     if (emin >= emid)
                     {
                         write_xpm(out, 0, label, "Energy (kJ/mol)",
@@ -492,7 +492,7 @@ int gmx_enemat(int argc, char *argv[])
                                    ngroups, ngroups, groupnr, groupnr, emat[m],
                                    emin, emid, emax, rlo, rmid, rhi, &nlevels);
                     }
-                    ffclose(out);
+                    gmx_ffclose(out);
                 }
             }
         }
@@ -566,7 +566,7 @@ int gmx_enemat(int argc, char *argv[])
             }
             fprintf(out, "\n");
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     else
     {
@@ -584,7 +584,7 @@ int gmx_enemat(int argc, char *argv[])
       write_matrix(out,ngroups,1,ngroups,groupnr,emat,label,emin,emax,nlevels);
       n++;
     }
-    ffclose(out);
+    gmx_ffclose(out);
  */
     }
     close_enx(in);
index 6ea86f10809d0177c13178ac926f9082cc93eb0a..f1ca2c16ed64847755f93ade64f5888ce65846ba 100644 (file)
@@ -560,7 +560,7 @@ static void analyse_disre(const char *voutfn,    int nframes,
         fprintf(vout, "%10d  %10.5e\n", j, mypow(violaver[j]/nframes, minthird));
     }
 #endif
-    ffclose(vout);
+    gmx_ffclose(vout);
 
     fprintf(stdout, "\nSum of violations averaged over simulation: %g nm\n",
             sumt);
@@ -629,8 +629,8 @@ static void einstein_visco(const char *fn, const char *fni, int nsets,
         }
         fprintf(fp1, "\n");
     }
-    ffclose(fp0);
-    ffclose(fp1);
+    gmx_ffclose(fp0);
+    gmx_ffclose(fp1);
 }
 
 typedef struct {
@@ -1414,7 +1414,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
                 intBulk  += 0.5*(eneset[11][i-1] + eneset[11][i])*factor;
                 fprintf(fp, "%10g  %10g  %10g\n", (i*Dt), integral, intBulk);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
         }
         else if (bCorr)
         {
@@ -1571,7 +1571,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
     }
     if (fp)
     {
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     sfree(fr);
 }
@@ -2697,21 +2697,21 @@ int gmx_energy(int argc, char *argv[])
     close_enx(fp);
     if (out)
     {
-        ffclose(out);
+        gmx_ffclose(out);
     }
 
     if (bDRAll)
     {
-        ffclose(fp_pairs);
+        gmx_ffclose(fp_pairs);
     }
 
     if (bORT)
     {
-        ffclose(fort);
+        gmx_ffclose(fort);
     }
     if (bODT)
     {
-        ffclose(fodt);
+        gmx_ffclose(fodt);
     }
     if (bORA)
     {
@@ -2726,7 +2726,7 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], orient[i]/norfr);
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     if (bODA)
     {
@@ -2741,7 +2741,7 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], orient[i]/norfr-oobs[i]);
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     if (bODR)
     {
@@ -2756,11 +2756,11 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], sqrt(odrms[i]/norfr));
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     if (bOTEN)
     {
-        ffclose(foten);
+        gmx_ffclose(foten);
     }
 
     if (bDisRe)
@@ -2772,7 +2772,7 @@ int gmx_energy(int argc, char *argv[])
     {
         if (fp_dhdl)
         {
-            ffclose(fp_dhdl);
+            gmx_ffclose(fp_dhdl);
             printf("\n\nWrote %d lambda values with %d samples as ",
                    dh_lambdas, dh_samples);
             if (dh_hists > 0)
index 8526f254727a96c142d6edb5e4d36d947d29fe39..e6f7011bcf677f576b268a69d216c41f613d5f4d 100644 (file)
@@ -243,8 +243,8 @@ static void update_topol(const char *topinout, int p_num, int n_num,
     gmx_bool bMolecules;
 
     printf("\nProcessing topology\n");
-    fpin  = ffopen(topinout, "r");
-    fpout = ffopen(TEMP_FILENM, "w");
+    fpin  = gmx_ffopen(topinout, "r");
+    fpout = gmx_ffopen(TEMP_FILENM, "w");
 
     line       = 0;
     bMolecules = FALSE;
@@ -296,16 +296,16 @@ static void update_topol(const char *topinout, int p_num, int n_num,
             nmol_line++;
         }
     }
-    ffclose(fpin);
+    gmx_ffclose(fpin);
 
     if (sol_line == -1)
     {
-        ffclose(fpout);
+        gmx_ffclose(fpout);
         gmx_fatal(FARGS, "No line with moleculetype '%s' found the [ molecules ] section of file '%s'", grpname, topinout);
     }
     if (nsol_last < p_num+n_num)
     {
-        ffclose(fpout);
+        gmx_ffclose(fpout);
         gmx_fatal(FARGS, "The last entry for moleculetype '%s' in the [ molecules ] section of file '%s' has less solvent molecules (%d) than were replaced (%d)", grpname, topinout, nsol_last, p_num+n_num);
     }
 
@@ -336,10 +336,10 @@ static void update_topol(const char *topinout, int p_num, int n_num,
             }
         }
     }
-    ffclose(fpout);
-    /* use ffopen to generate backup of topinout */
-    fpout = ffopen(topinout, "w");
-    ffclose(fpout);
+    gmx_ffclose(fpout);
+    /* use gmx_ffopen to generate backup of topinout */
+    fpout = gmx_ffopen(topinout, "w");
+    gmx_ffclose(fpout);
     rename(TEMP_FILENM, topinout);
 #undef TEMP_FILENM
 }
index 81aafc9df84d1b3c8e3f8bd74e8d0c252af12f05..bb56226e0b247b7e9cc7fa2133ecd0265e0e3a6e 100644 (file)
@@ -183,7 +183,7 @@ int gmx_genpr(int argc, char *argv[])
                 fprintf(out, "%d\n", i+1);
             }
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     else if ((bDisre || bConstr) && x)
     {
@@ -236,7 +236,7 @@ int gmx_genpr(int argc, char *argv[])
                 }
             }
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     else
     {
@@ -252,7 +252,7 @@ int gmx_genpr(int argc, char *argv[])
             fprintf(out, "%4d %4d %10g %10g %10g\n",
                     ind_grp[i]+1, 1, fc[XX], fc[YY], fc[ZZ]);
         }
-        ffclose(out);
+        gmx_ffclose(out);
     }
     if (xfn)
     {
index ed062dffaf2a52edb03a019b4092bb3a19776d63..dca936d1c0bba759e763c64821ab32ba275508ce 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -379,7 +379,7 @@ int gmx_gyrate(int argc, char *argv[])
         gmx_rmpbc_done(gpbc);
     }
 
-    ffclose(out);
+    gmx_ffclose(out);
 
     if (bACF)
     {
index 4a186c5644b30e3192717fa4d20709ddff712800..17a0bf5abcd1d50f0426c33abc208905d10ca437 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -257,7 +257,7 @@ void h2order_plot(rvec dipole[], real order[], const char *afile,
                 factor*dipole[slice][ZZ], order[slice]);
     }
 
-    ffclose(ord);
+    gmx_ffclose(ord);
 }
 
 int gmx_h2order(int argc, char *argv[])
index 90cc05ab44b8ee49ddf98077dffa831080222c10..03b904c54edc52e64b0ffe19449331c0547cbcaf 100644 (file)
@@ -2229,7 +2229,7 @@ static void do_hblife(const char *fn, t_hbdata *hb, gmx_bool bMerge, gmx_bool bC
         integral += x1;
     }
     integral *= dt;
-    ffclose(fp);
+    gmx_ffclose(fp);
     printf("%s lifetime = %.2f ps\n", bContact ? "Contact" : "HB", integral);
     printf("Note that the lifetime obtained in this manner is close to useless\n");
     printf("Use the -ac option instead and check the Forward lifetime\n");
@@ -2253,7 +2253,7 @@ static void dump_ac(t_hbdata *hb, gmx_bool oneHB, int nDump)
     {
         return;
     }
-    fp = ffopen("debug-ac.xvg", "w");
+    fp = gmx_ffopen("debug-ac.xvg", "w");
     for (j = 0; (j < nframes); j++)
     {
         fprintf(fp, "%10.3f", hb->time[j]);
@@ -2293,7 +2293,7 @@ static void dump_ac(t_hbdata *hb, gmx_bool oneHB, int nDump)
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static real calc_dg(real tau, real temp)
@@ -3415,7 +3415,7 @@ static void do_hbac(const char *fn, t_hbdata *hb,
                 fprintf(fp, "%10g  %10g  %10g  %10g  %10g\n",
                         hb->time[j]-hb->time[0], ct[j], cct[j], ght[j], kt[j]);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
 
             analyse_corr(nn, hb->time, ct, ght, kt, NULL, NULL, NULL,
                          fit_start, temp, smooth_tail_start, oenv);
@@ -3521,7 +3521,7 @@ static void dump_hbmap(t_hbdata *hb,
     fp = opt2FILE("-hbn", nfile, fnm, "w");
     if (opt2bSet("-g", nfile, fnm))
     {
-        fplog = ffopen(opt2fn("-g", nfile, fnm), "w");
+        fplog = gmx_ffopen(opt2fn("-g", nfile, fnm), "w");
         fprintf(fplog, "# %10s  %12s  %12s\n", "Donor", "Hydrogen", "Acceptor");
     }
     else
@@ -3614,10 +3614,10 @@ static void dump_hbmap(t_hbdata *hb,
             }
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     if (fplog)
     {
-        ffclose(fplog);
+        gmx_ffclose(fplog);
     }
 }
 
@@ -4595,7 +4595,7 @@ int gmx_hbond(int argc, char *argv[])
     close_trj(status);
     if (fpnhb)
     {
-        ffclose(fpnhb);
+        gmx_ffclose(fpnhb);
     }
 
     /* Compute maximum possible number of different hbonds */
@@ -4661,7 +4661,7 @@ int gmx_hbond(int argc, char *argv[])
         aver_nhb  += hb->nhb[i];
         aver_dist += hb->ndist[i];
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     aver_nhb  /= nframes;
     aver_dist /= nframes;
     /* Print HB distance distribution */
@@ -4684,7 +4684,7 @@ int gmx_hbond(int argc, char *argv[])
         {
             fprintf(fp, "%10g %10g\n", (i+0.5)*rbin, rdist[i]/(rbin*(real)sum));
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     /* Print HB angle distribution */
@@ -4705,7 +4705,7 @@ int gmx_hbond(int argc, char *argv[])
         {
             fprintf(fp, "%10g %10g\n", (i+0.5)*abin, adist[i]/(abin*(real)sum));
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     /* Print HB in alpha-helix */
@@ -4723,7 +4723,7 @@ int gmx_hbond(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (!bNN)
     {
@@ -4834,7 +4834,7 @@ int gmx_hbond(int argc, char *argv[])
                 }
                 fp = opt2FILE("-hbm", NFILE, fnm, "w");
                 write_xpm_m(fp, mat);
-                ffclose(fp);
+                gmx_ffclose(fp);
                 for (x = 0; x < mat.nx; x++)
                 {
                     sfree(mat.matrix[x]);
@@ -4919,7 +4919,7 @@ int gmx_hbond(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     return 0;
index e3d8bfcec69dcac0496a5eaf7d4f012e070d038d..a16875c31dbdbc84c64b2eab869b7b4a31037984 100644 (file)
@@ -205,7 +205,7 @@ int gmx_helix(int argc, char *argv[])
         {
             sprintf(buf, "%s.out", xf[i].filenm);
             remove(buf);
-            xf[i].fp2 = ffopen(buf, "w");
+            xf[i].fp2 = gmx_ffopen(buf, "w");
         }
     }
 
@@ -293,10 +293,10 @@ int gmx_helix(int argc, char *argv[])
 
     for (i = 0; (i < efhNR); i++)
     {
-        ffclose(xf[i].fp);
+        gmx_ffclose(xf[i].fp);
         if (xf[i].bfp2)
         {
-            ffclose(xf[i].fp2);
+            gmx_ffclose(xf[i].fp2);
         }
         do_view(oenv, xf[i].filenm, "-nxy");
     }
index 29a44bb1a94db871c514daf7cd9e8a20a331f377..15334083a149b28d4933289d703a394d87549b0c 100644 (file)
@@ -223,16 +223,16 @@ int gmx_helixorient(int argc, char *argv[])
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
 
-    fpaxis    = ffopen(opt2fn("-oaxis", NFILE, fnm), "w");
-    fpcenter  = ffopen(opt2fn("-ocenter", NFILE, fnm), "w");
-    fprise    = ffopen(opt2fn("-orise", NFILE, fnm), "w");
-    fpradius  = ffopen(opt2fn("-oradius", NFILE, fnm), "w");
-    fptwist   = ffopen(opt2fn("-otwist", NFILE, fnm), "w");
-    fpbending = ffopen(opt2fn("-obending", NFILE, fnm), "w");
+    fpaxis    = gmx_ffopen(opt2fn("-oaxis", NFILE, fnm), "w");
+    fpcenter  = gmx_ffopen(opt2fn("-ocenter", NFILE, fnm), "w");
+    fprise    = gmx_ffopen(opt2fn("-orise", NFILE, fnm), "w");
+    fpradius  = gmx_ffopen(opt2fn("-oradius", NFILE, fnm), "w");
+    fptwist   = gmx_ffopen(opt2fn("-otwist", NFILE, fnm), "w");
+    fpbending = gmx_ffopen(opt2fn("-obending", NFILE, fnm), "w");
 
-    fptheta1 = ffopen("theta1.xvg", "w");
-    fptheta2 = ffopen("theta2.xvg", "w");
-    fptheta3 = ffopen("theta3.xvg", "w");
+    fptheta1 = gmx_ffopen("theta1.xvg", "w");
+    fptheta2 = gmx_ffopen("theta2.xvg", "w");
+    fptheta3 = gmx_ffopen("theta3.xvg", "w");
 
     if (bIncremental)
     {
@@ -513,17 +513,17 @@ int gmx_helixorient(int argc, char *argv[])
 
     gmx_rmpbc_done(gpbc);
 
-    ffclose(fpaxis);
-    ffclose(fpcenter);
-    ffclose(fptilt);
-    ffclose(fprotation);
-    ffclose(fprise);
-    ffclose(fpradius);
-    ffclose(fptwist);
-    ffclose(fpbending);
-    ffclose(fptheta1);
-    ffclose(fptheta2);
-    ffclose(fptheta3);
+    gmx_ffclose(fpaxis);
+    gmx_ffclose(fpcenter);
+    gmx_ffclose(fptilt);
+    gmx_ffclose(fprotation);
+    gmx_ffclose(fprise);
+    gmx_ffclose(fpradius);
+    gmx_ffclose(fptwist);
+    gmx_ffclose(fpbending);
+    gmx_ffclose(fptheta1);
+    gmx_ffclose(fptheta2);
+    gmx_ffclose(fptheta3);
 
     close_trj(status);
 
index bd093427b72bed98d150df8f079f9809a62bd2c4..6a58d32e8dcdc600ab2faf664bc36d5943de1855 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -505,8 +505,8 @@ static void writesurftoxpms(real ***surf, int tblocks, int xbins, int ybins, rea
         yticks[j] += bw;
     }
 
-    xpmfile1 = ffopen(outfiles[0], "w");
-    xpmfile2 = ffopen(outfiles[1], "w");
+    xpmfile1 = gmx_ffopen(outfiles[0], "w");
+    xpmfile2 = gmx_ffopen(outfiles[1], "w");
 
     max1 = max2 = 0.0;
     min1 = min2 = 1000.00;
@@ -545,8 +545,8 @@ static void writesurftoxpms(real ***surf, int tblocks, int xbins, int ybins, rea
         write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile2, min2, max2, lo, hi, &maplevels);
     }
 
-    ffclose(xpmfile1);
-    ffclose(xpmfile2);
+    gmx_ffclose(xpmfile1);
+    gmx_ffclose(xpmfile2);
 
 
 
@@ -562,8 +562,8 @@ static void writeraw(real ***surf, int tblocks, int xbins, int ybins, char **fnm
     FILE *raw1, *raw2;
     int   i, j, n;
 
-    raw1 = ffopen(fnms[0], "w");
-    raw2 = ffopen(fnms[1], "w");
+    raw1 = gmx_ffopen(fnms[0], "w");
+    raw2 = gmx_ffopen(fnms[1], "w");
     fprintf(raw1, "#Legend\n#TBlock\n#Xbin Ybin Z t\n");
     fprintf(raw2, "#Legend\n#TBlock\n#Xbin Ybin Z t\n");
     for (n = 0; n < tblocks; n++)
@@ -580,8 +580,8 @@ static void writeraw(real ***surf, int tblocks, int xbins, int ybins, char **fnm
         }
     }
 
-    ffclose(raw1);
-    ffclose(raw2);
+    gmx_ffclose(raw1);
+    gmx_ffclose(raw2);
 }
 
 
index fabada34e5381043515944ab722739c911d8347b..aae29b9ca88b4646f0eab4287785a6665563cd21 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -725,7 +725,7 @@ static void dump_remd_parameters(FILE *gp, t_remd_data *d, const char *fn,
                         (d->sumft[i]-d->sumfct[i])*norm);
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (!d->bSum && rfn)
     {
@@ -751,7 +751,7 @@ static void dump_remd_parameters(FILE *gp, t_remd_data *d, const char *fn,
                 fprintf(fp, "\n");
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (fn2 && (d->nstate > 2))
@@ -768,7 +768,7 @@ static void dump_remd_parameters(FILE *gp, t_remd_data *d, const char *fn,
                         (d->sumit[i]-d->sumict[i])*norm);
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (mfn)
     {
@@ -784,7 +784,7 @@ static void dump_remd_parameters(FILE *gp, t_remd_data *d, const char *fn,
                 DG   = BOLTZ*i*log(fff/(1-fff));
                 fprintf(fp, "%5d  %8.3f  %8.3f\n", i, fff, DG);
             }
-            ffclose(fp);
+            gmx_ffclose(fp);
         }
     }
 
@@ -816,7 +816,7 @@ static void dump_remd_parameters(FILE *gp, t_remd_data *d, const char *fn,
             }
             fprintf(hp, "&\n");
         }
-        ffclose(hp);
+        gmx_ffclose(hp);
         for (i = 0; (i < d->nparams); i++)
         {
             d->params[i] = params[i];
@@ -960,7 +960,7 @@ int gmx_kinetics(int argc, char *argv[])
     dfile   = opt2fn("-d", NFILE, fnm);
     dfile2  = opt2fn_null("-d2", NFILE, fnm);
 
-    fp = ffopen(opt2fn("-g", NFILE, fnm), "w");
+    fp = gmx_ffopen(opt2fn("-g", NFILE, fnm), "w");
 
     remd.temp = read_xvg_time(tfile, bHaveT,
                               opt2parg_bSet("-b", NPA, pa), tb,
@@ -1069,7 +1069,7 @@ int gmx_kinetics(int argc, char *argv[])
         optimize_remd_parameters(&remd, maxiter, tol);
         dump_remd_parameters(fp, &remd, "test1.xvg", NULL, NULL, NULL, NULL, skip, tref, oenv);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     view_all(oenv, NFILE, fnm);
 
index de5fcf672f3053ad27297a5621818c706c0e7a8c..f838c87fbd694f382d2ebeee34426d62c6ac988b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -205,7 +205,7 @@ int gmx_lie(int argc, char *argv[])
         }
     }
     close_enx(fp);
-    ffclose(out);
+    gmx_ffclose(out);
     fprintf(stderr, "\n");
 
     if (nframes > 0)
index a732f1e04b6789477277963f0a8f974a3038c41b..d1c5f5eb5f3527469e63a29f8655fc6203f563de 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -983,7 +983,7 @@ int gmx_make_edi(int argc, char *argv[])
     }
 
     /* Write edi-file */
-    write_the_whole_thing(ffopen(EdiFile, "w"), &edi_params, eigvec1, nvec1, listen, evStepList);
+    write_the_whole_thing(gmx_ffopen(EdiFile, "w"), &edi_params, eigvec1, nvec1, listen, evStepList);
 
     return 0;
 }
index aa710c68d66d52838d80366c8154ed8def1255e4..43a9f0d21d1e37d8d0bc3a4d7d24b12ce8002b94 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -350,7 +350,7 @@ int gmx_mdmat(int argc, char *argv[])
     gmx_rmpbc_done(gpbc);
     if (bFrames)
     {
-        ffclose(out);
+        gmx_ffclose(out);
     }
 
     fprintf(stderr, "Processed %d frames\n", nframes);
@@ -395,7 +395,7 @@ int gmx_mdmat(int argc, char *argv[])
             fprintf(fp, "%3d  %8.3f  %3d  %8.3f  %3d  %8.3f\n",
                     i+1, ratio, tot_n[i], mean_n[i], natm[i], mean_n[i]/natm[i]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     return 0;
index 39caf539ebcb88086464df28b542f9d09cbb85ca..c7cec72b8642e6d64069d5a3284e1149fdfd2b0b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -185,7 +185,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
         gmx_rmpbc_done(gpbc);
     }
 
-    ffclose(out);
+    gmx_ffclose(out);
 
     fprintf(stdout,
             "\nThe shortest periodic distance is %g (nm) at time %g (%s),\n"
@@ -336,7 +336,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     dist = xvgropen(dfile, buf, output_env_get_time_label(oenv), "Distance (nm)", oenv);
     sprintf(buf, "Number of Contacts %s %g nm", bMin ? "<" : ">", rcut);
     num    = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : NULL;
-    atm    = afile ? ffopen(afile, "w") : NULL;
+    atm    = afile ? gmx_ffopen(afile, "w") : NULL;
     trxout = xfile ? open_trx(xfile, "w") : NULL;
 
     if (bMat)
@@ -534,14 +534,14 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     while (read_next_x(oenv, status, &t, x0, box));
 
     close_trj(status);
-    ffclose(dist);
+    gmx_ffclose(dist);
     if (num)
     {
-        ffclose(num);
+        gmx_ffclose(num);
     }
     if (atm)
     {
-        ffclose(atm);
+        gmx_ffclose(atm);
     }
     if (trxout)
     {
index 09f7018980421ffb2464dde85451b4a918275aac..98c7d058af19514e94adbcccf3935f5d4f7355a4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -305,7 +305,7 @@ int gmx_mk_angndx(int argc, char *argv[])
             fprintf(out, "\n");
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
 
     return 0;
 }
index 2a6da609bb1792ad3a8c9c26bfdd59a05d679746..fc452a961399732213f740927a7b072878eb99b2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -198,7 +198,7 @@ int gmx_morph(int argc, char *argv[])
 
     if (bRMS)
     {
-        ffclose(fp);
+        gmx_ffclose(fp);
         do_view(oenv, opt2fn("-or", NFILE, fnm), "-nxy");
     }
 
index bbb6c6c36a3d40390111d8e05d8510ca35cafccd..c50daab370dd5cbfd7a792ce3735c38d31c983de 100644 (file)
@@ -216,7 +216,7 @@ static void corr_print(t_corr *curr, gmx_bool bTen, const char *fn, const char *
         }
         fprintf(out, "\n");
     }
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 /* called from corr_loop, to do the main calculations */
@@ -610,7 +610,7 @@ void printmol(t_corr *curr, const char *fn,
             }
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
     do_view(oenv, fn, "-graphtype bar");
 
     /* Compute variance, stddev and error */
index ed2be1ace0b3a8c2d30ed9142bdc1889da61e898..597377aec0383ecd0a5151d2caf692894fbe69b2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -496,7 +496,7 @@ int gmx_nmeig(int argc, char *argv[])
     {
         fprintf (out, "%6d %15g\n", begin+i, eigenvalues[i]);
     }
-    ffclose(out);
+    gmx_ffclose(out);
 
 
     if (opt2bSet("-qc", NFILE, fnm))
@@ -585,14 +585,14 @@ int gmx_nmeig(int argc, char *argv[])
             qutot  += qu;
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
     if (NULL != spec)
     {
         for (j = 0; (j < maxspec); j++)
         {
             fprintf(spec, "%10g  %10g\n", 1.0*j, spectrum[j]);
         }
-        ffclose(spec);
+        gmx_ffclose(spec);
     }
     if (NULL != qc)
     {
@@ -602,7 +602,7 @@ int gmx_nmeig(int argc, char *argv[])
                nharm, nvsite);
         printf("Total correction to cV = %g J/mol K\n", qcvtot);
         printf("Total correction to  H = %g kJ/mol\n", qutot);
-        ffclose(qc);
+        gmx_ffclose(qc);
         please_cite(stdout, "Caleman2011b");
     }
     /* Writing eigenvectors. Note that if mass scaling was used, the eigenvectors
index ecb42bccfd6197666545f3bedce68ed8024d7b5a..52db66114c57d295259ce4e3c18ad8ad51b664c9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -327,8 +327,8 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     sfree(index);
     sfree(isize);
 
-    ffclose(fpsg);
-    ffclose(fpsk);
+    gmx_ffclose(fpsg);
+    gmx_ffclose(fpsk);
 
     fpsg = xvgropen(sgslfn,
                     "S\\sg\\N Angle Order Parameter / Slab", "(nm)", "S\\sg\\N",
@@ -343,8 +343,8 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
         fprintf(fpsk, "%10g  %10g\n", (i+0.5)*box[slice_dim][slice_dim]/nslice,
                 sk_slice_tot[i]/nframes);
     }
-    ffclose(fpsg);
-    ffclose(fpsk);
+    gmx_ffclose(fpsg);
+    gmx_ffclose(fpsk);
 }
 
 
@@ -832,8 +832,8 @@ void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bf
                                                         0.333 * order[atom][YY]));
         }
 
-        ffclose(ord);
-        ffclose(slOrd);
+        gmx_ffclose(ord);
+        gmx_ffclose(slOrd);
     }
 }
 
index 66c3887a46640d837fe233a2abe796c97bb98569..ef69e3b48024c9bf22dc9a5db3b9a457e490d517 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -468,14 +468,14 @@ int gmx_polystat(int argc, char *argv[])
 
     close_trx(status);
 
-    ffclose(out);
+    gmx_ffclose(out);
     if (outv)
     {
-        ffclose(outv);
+        gmx_ffclose(outv);
     }
     if (outp)
     {
-        ffclose(outp);
+        gmx_ffclose(outp);
     }
 
     sum_eed2_tot /= frame;
@@ -515,7 +515,7 @@ int gmx_polystat(int argc, char *argv[])
         {
             fprintf(outi, "%d  %8.4f\n", i+1, intd[i]);
         }
-        ffclose(outi);
+        gmx_ffclose(outi);
     }
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy");
index 88fdfa31a1bb51fc1d45963ed539ce828688873e..3ccb728231983ac22965afc4641ddc5e858eab22 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -400,9 +400,9 @@ void plot_potential(double *potential[], double *charge[], double *field[],
         fprintf(fie, "\n");
     }
 
-    ffclose(pot);
-    ffclose(cha);
-    ffclose(fie);
+    gmx_ffclose(pot);
+    gmx_ffclose(cha);
+    gmx_ffclose(fie);
 }
 
 int gmx_potential(int argc, char *argv[])
index ae1c6d35f99731fabacf5d81081ddaf84515a314..7fe4c3c5b109f5456a367a1c1c9a0d0e723d9f2d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,10 +124,10 @@ int gmx_principal(int argc, char *argv[])
         return 0;
     }
 
-    axis1 = ffopen(opt2fn("-a1", NFILE, fnm), "w");
-    axis2 = ffopen(opt2fn("-a2", NFILE, fnm), "w");
-    axis3 = ffopen(opt2fn("-a3", NFILE, fnm), "w");
-    fmoi  = ffopen(opt2fn("-om", NFILE, fnm), "w");
+    axis1 = gmx_ffopen(opt2fn("-a1", NFILE, fnm), "w");
+    axis2 = gmx_ffopen(opt2fn("-a2", NFILE, fnm), "w");
+    axis3 = gmx_ffopen(opt2fn("-a3", NFILE, fnm), "w");
+    fmoi  = gmx_ffopen(opt2fn("-om", NFILE, fnm), "w");
 
     read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, TRUE);
 
@@ -154,10 +154,10 @@ int gmx_principal(int argc, char *argv[])
 
 
     close_trj(status);
-    ffclose(axis1);
-    ffclose(axis2);
-    ffclose(axis3);
-    ffclose(fmoi);
+    gmx_ffclose(axis1);
+    gmx_ffclose(axis2);
+    gmx_ffclose(axis3);
+    gmx_ffclose(fmoi);
 
     return 0;
 }
index 3a86410ab22e5fb3925d12b592016e5a973f2452..8e2a74d0c75bed6ac47eb95ba6d8494d3ce58547 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -114,7 +114,7 @@ int gmx_rama(int argc, char *argv[])
     }
     while (new_data(xr));
     fprintf(stderr, "\n");
-    ffclose(out);
+    gmx_ffclose(out);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
 
index 0d2c80fa02f38775cfdbbb56210a0aa771275f9a..cfb64050bc8fb0db97678b8b53c1e695523a73c7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -742,7 +742,7 @@ static void do_rdf(const char *fnNDX, const char *fnTPS, const char *fnTRX,
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     do_view(oenv, fnRDF, NULL);
 
@@ -773,7 +773,7 @@ static void do_rdf(const char *fnNDX, const char *fnTPS, const char *fnTRX,
         {
             fprintf(fp, "%10g %10g\n", i*0.5, hq[i]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         do_view(oenv, fnHQ, NULL);
         sfree(hq);
         sfree(integrand);
@@ -812,7 +812,7 @@ static void do_rdf(const char *fnNDX, const char *fnTPS, const char *fnTRX,
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         sfree(sum);
 
         do_view(oenv, fnCNRDF, NULL);
index 0670e75607e75bf1ded2de4a2cfd081d1824431a..d75becc4fb94ab86c279a62bae8d6502c302a957 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1064,11 +1064,11 @@ int gmx_rms(int argc, char *argv[])
                     del_yaxis[i] = delta_maxy*i/del_lev;
                 }
                 sprintf(buf, "%s %s vs. delta t", gn_rms[0], whatname[ewhat]);
-                fp = ffopen("delta.xpm", "w");
+                fp = gmx_ffopen("delta.xpm", "w");
                 write_xpm(fp, 0, buf, "density", output_env_get_time_label(oenv), whatlabel[ewhat],
                           delta_xsize, del_lev+1, del_xaxis, del_yaxis,
                           delta, 0.0, delta_max, rlo, rhi, &nlevels);
-                ffclose(fp);
+                gmx_ffclose(fp);
             }
             if (opt2bSet("-bin", NFILE, fnm))
             {
@@ -1081,7 +1081,7 @@ int gmx_rms(int argc, char *argv[])
                         gmx_fatal(FARGS, "Error writing to output file");
                     }
                 }
-                ffclose(fp);
+                gmx_ffclose(fp);
             }
         }
         if (bBond)
@@ -1151,7 +1151,7 @@ int gmx_rms(int argc, char *argv[])
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     if (bMirror)
     {
@@ -1189,7 +1189,7 @@ int gmx_rms(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (bAv)
@@ -1201,7 +1201,7 @@ int gmx_rms(int argc, char *argv[])
         {
             fprintf(fp, "%10d  %10g\n", j, rlstot/teller);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (bNorm)
@@ -1211,7 +1211,7 @@ int gmx_rms(int argc, char *argv[])
         {
             fprintf(fp, "%10d  %10g\n", j, rlsnorm[j]/teller);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     do_view(oenv, opt2fn_null("-a", NFILE, fnm), "-graphtype bar");
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
index e34367b836f8672f7b6b91bfd9ba20bfcd0096b0..7de88c69a960e3b6a574bbcb32f12db4792a6015 100644 (file)
@@ -175,7 +175,7 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
     int       neq, na, n, resnr;
     t_equiv **equiv;
 
-    fp    = ffopen(eq_fn, "r");
+    fp    = gmx_ffopen(eq_fn, "r");
     neq   = 0;
     equiv = NULL;
     while (get_a_line(fp, line, STRLEN))
@@ -214,7 +214,7 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
         /* next */
         neq++;
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     *equivptr = equiv;
 
@@ -800,7 +800,7 @@ int gmx_rmsdist(int argc, char *argv[])
     while (read_next_x(oenv, status, &t, x, box));
     fprintf(stderr, "\n");
 
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     teller = nframes_read(status);
 
index 7d52abe5d44076defac3139c362f520fdb410b17..90249b12834c354300e62de094524d30744bf2e5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -106,7 +106,7 @@ void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
             }
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static void average_residues(double f[], double **U, int uind,
@@ -469,9 +469,9 @@ int gmx_rmsf(int argc, char *argv[])
     {
         fprintf(stdout, "\n");
         print_dir(stdout, Uaver);
-        fp = ffopen(dirfn, "w");
+        fp = gmx_ffopen(dirfn, "w");
         print_dir(fp, Uaver);
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     for (i = 0; i < isize; i++)
@@ -501,7 +501,7 @@ int gmx_rmsf(int argc, char *argv[])
                         pdb_bfac);
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     else
     {
@@ -515,7 +515,7 @@ int gmx_rmsf(int argc, char *argv[])
                         bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1, sqrt(rmsf[i]));
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     for (i = 0; i < isize; i++)
@@ -544,7 +544,7 @@ int gmx_rmsf(int argc, char *argv[])
                         bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1, sqrt(rmsf[i]));
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (opt2bSet("-oq", NFILE, fnm))
index a73eb499957a5737a549071ca93ec9dcc400abf5..d323f1a0c46d2527bff203877a320b1d30657aab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -309,7 +309,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     close_trj(status);
 
-    ffclose(out);
+    gmx_ffclose(out);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), "-nxy");
 
index 3fac904139d9d7629a51ed88f7e452e8df1a2c9f..a9cd92383da3ad7d6ef9af851e32b14f9966c6b9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -247,7 +247,7 @@ int gmx_saltbr(int argc, char *argv[])
                     {
                         fprintf(fp, "%10g  %10g\n", time[k], cgdist[i][j][k]);
                     }
-                    ffclose(fp);
+                    gmx_ffclose(fp);
                 }
             }
         }
@@ -329,7 +329,7 @@ int gmx_saltbr(int argc, char *argv[])
         }
         for (m = 0; (m < 3); m++)
         {
-            ffclose(out[m]);
+            gmx_ffclose(out[m]);
             if (nset[m] == 0)
             {
                 remove(fn[m]);
index 6715fa6e1dc5e902b20d290897f6e03d1a91e5c3..64d0cfc303b2b1d17615d9e7138a8f67b9ce4727 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,7 +128,7 @@ void do_conect(const char *fn, int n, rvec x[])
             add_rec(c, j, i, d2);
         }
     }
-    fp = ffopen(fn, "a");
+    fp = gmx_ffopen(fn, "a");
     for (i = 0; (i < n); i++)
     {
         if ((c[i].aa == NO_ATID) || (c[i].ab == NO_ATID))
@@ -137,7 +137,7 @@ void do_conect(const char *fn, int n, rvec x[])
         }
         fprintf(fp, "CONECT%5d%5d%5d\n", i+1, c[i].aa+1, c[i].ab+1);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     sfree(c);
 }
 
@@ -597,10 +597,10 @@ void sas_plot(int nfile, t_filenm fnm[], real solsize, int ndots,
 
     fprintf(stderr, "\n");
     close_trj(status);
-    ffclose(fp);
+    gmx_ffclose(fp);
     if (vp)
     {
-        ffclose(vp);
+        gmx_ffclose(vp);
     }
 
     /* if necessary, print areas per atom to file too: */
@@ -659,9 +659,9 @@ void sas_plot(int nfile, t_filenm fnm[], real solsize, int ndots,
         }
         if (bITP)
         {
-            ffclose(fp3);
+            gmx_ffclose(fp3);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     /* Be a good citizen, keep our memory free! */
index 9cb4f8437713bbee71a2d20fe43c831624748630..22545b9a5d7da65cea2648a159e74a3323dadce1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -101,7 +101,7 @@ static void lo_write_xplor(XplorMap * map, const char * file)
     FILE * fp;
     int    z, i, j, n;
 
-    fp = ffopen(file, "w");
+    fp = gmx_ffopen(file, "w");
     /* The REMARKS part is the worst part of the XPLOR format
      * and may cause problems with some programs
      */
@@ -134,7 +134,7 @@ static void lo_write_xplor(XplorMap * map, const char * file)
         }
     }
     fprintf(fp, "   -9999\n");
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 static void write_xplor(const char *file, real *data, int *ibox, real dmin[], real dmax[])
@@ -277,7 +277,7 @@ static void pick_minima(const char *logfile, int *ibox, int ndim, int len, real
 
     snew(mm, len);
     nmin = 0;
-    fp   = ffopen(logfile, "w");
+    fp   = gmx_ffopen(logfile, "w");
     /* Loop over each element in the array of dimenion ndim seeking
      * minima with respect to every dimension. Specialized loops for
      * speed with ndim == 2 and ndim == 3. */
@@ -405,7 +405,7 @@ static void pick_minima(const char *logfile, int *ibox, int ndim, int len, real
     {
         print_minimum(fp, i, &mm[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     sfree(mm);
 }
 
@@ -623,7 +623,7 @@ static void do_sham(const char *fn, const char *ndx,
     Smax = Emax-Smin;
     Sinf = Smax+1;
     /* Write out the free energy as a function of bin index */
-    fp = ffopen(fn, "w");
+    fp = gmx_ffopen(fn, "w");
     for (i = 0; (i < len); i++)
     {
         if (P[i] != 0)
@@ -639,7 +639,7 @@ static void do_sham(const char *fn, const char *ndx,
             S[i] = Sinf;
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     /* Organize the structures in the bins */
     snew(b, 1);
     snew(b->index, len+1);
@@ -666,7 +666,7 @@ static void do_sham(const char *fn, const char *ndx,
        }
      */
     /* Write the index file */
-    fp = ffopen(ndx, "w");
+    fp = gmx_ffopen(ndx, "w");
     for (i = 0; (i < len); i++)
     {
         if (nbin[i] > 0)
@@ -678,7 +678,7 @@ static void do_sham(const char *fn, const char *ndx,
             }
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     snew(axis_x, ibox[0]+1);
     snew(axis_y, ibox[1]+1);
     snew(axis_z, ibox[2]+1);
@@ -761,35 +761,35 @@ static void do_sham(const char *fn, const char *ndx,
             EE[i] = &(E[i*ibox[1]]);
             SS[i] = &(S[i*ibox[1]]);
         }
-        fp = ffopen(xpmP, "w");
+        fp = gmx_ffopen(xpmP, "w");
         write_xpm(fp, flags, "Probability Distribution", "", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, PP, 0, Pmax, rlo, rhi, &nlevels);
-        ffclose(fp);
-        fp = ffopen(xpm, "w");
+        gmx_ffclose(fp);
+        fp = gmx_ffopen(xpm, "w");
         write_xpm(fp, flags, "Gibbs Energy Landscape", "G (kJ/mol)", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, WW, 0, gmax, rlo, rhi, &nlevels);
-        ffclose(fp);
-        fp = ffopen(xpm2, "w");
+        gmx_ffclose(fp);
+        fp = gmx_ffopen(xpm2, "w");
         write_xpm(fp, flags, "Enthalpy Landscape", "H (kJ/mol)", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, EE,
                   emin ? *emin : Emin, emax ? *emax : Einf, rlo, rhi, &nlevels);
-        ffclose(fp);
-        fp = ffopen(xpm3, "w");
+        gmx_ffclose(fp);
+        fp = gmx_ffopen(xpm3, "w");
         write_xpm(fp, flags, "Entropy Landscape", "TDS (kJ/mol)", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, SS, 0, Sinf, rlo, rhi, &nlevels);
-        ffclose(fp);
+        gmx_ffclose(fp);
         if (map)
         {
-            fp = ffopen(xpm4, "w");
+            fp = gmx_ffopen(xpm4, "w");
             write_xpm(fp, flags, "Custom Landscape", mname, "PC1", "PC2",
                       ibox[0], ibox[1], axis_x, axis_y, MM, 0, Minf, rlo, rhi, &nlevels);
-            ffclose(fp);
+            gmx_ffclose(fp);
         }
     }
     else if (neig == 3)
     {
         /* Dump to PDB file */
-        fp = ffopen(pdb, "w");
+        fp = gmx_ffopen(pdb, "w");
         for (i = 0; (i < ibox[0]); i++)
         {
             xxx[XX] = 3*(i+0.5-ibox[0]/2);
@@ -809,7 +809,7 @@ static void do_sham(const char *fn, const char *ndx,
                 }
             }
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         write_xplor("out.xplor", W, ibox, min_eig, max_eig);
         if (map)
         {
@@ -829,10 +829,10 @@ static void do_sham(const char *fn, const char *ndx,
         snew(buf, strlen(xpm)+4);
         sprintf(buf, "%s", xpm);
         sprintf(&buf[strlen(xpm)-4], "12.xpm");
-        fp = ffopen(buf, "w");
+        fp = gmx_ffopen(buf, "w");
         write_xpm(fp, flags, "Gibbs Energy Landscape", "W (kJ/mol)", "PC1", "PC2",
                   ibox[0], ibox[1], axis_x, axis_y, WW, 0, gmax, rlo, rhi, &nlevels);
-        ffclose(fp);
+        gmx_ffclose(fp);
         for (i = 0; (i < ibox[0]); i++)
         {
             for (j = 0; (j < ibox[2]); j++)
@@ -841,10 +841,10 @@ static void do_sham(const char *fn, const char *ndx,
             }
         }
         sprintf(&buf[strlen(xpm)-4], "13.xpm");
-        fp = ffopen(buf, "w");
+        fp = gmx_ffopen(buf, "w");
         write_xpm(fp, flags, "SHAM Energy Landscape", "kJ/mol", "PC1", "PC3",
                   ibox[0], ibox[2], axis_x, axis_z, WW, 0, gmax, rlo, rhi, &nlevels);
-        ffclose(fp);
+        gmx_ffclose(fp);
         for (i = 0; (i < ibox[1]); i++)
         {
             for (j = 0; (j < ibox[2]); j++)
@@ -853,10 +853,10 @@ static void do_sham(const char *fn, const char *ndx,
             }
         }
         sprintf(&buf[strlen(xpm)-4], "23.xpm");
-        fp = ffopen(buf, "w");
+        fp = gmx_ffopen(buf, "w");
         write_xpm(fp, flags, "SHAM Energy Landscape", "kJ/mol", "PC2", "PC3",
                   ibox[1], ibox[2], axis_y, axis_z, WW, 0, gmax, rlo, rhi, &nlevels);
-        ffclose(fp);
+        gmx_ffclose(fp);
         sfree(buf);
     }
     if (map)
@@ -920,7 +920,7 @@ static void ehisto(const char *fh, int n, real **enerT, const output_env_t oenv)
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 int gmx_sham(int argc, char *argv[])
index 7fbb3d74e7f5dcd41b4cbf792dec56774efa0b64..8a2b36050a18d9525182ad33deca152d0b1e1d3e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -190,7 +190,7 @@ int gmx_sigeps(int argc, char *argv[])
         oldx = x;
 
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
 
index ee20a4907fd956127360f70072d3ca698362677d..d9675030991b602739ef4fbfa055151169fa8e54 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -397,7 +397,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*binwidth-1, 2*normfac*hist1[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     sprintf(str, "Solvent normal orientation between %g and %g nm", rmin, rmax);
     fp = xvgropen(opt2fn("-no", NFILE, fnm), str, "cos(\\8q\\4\\s2\\N)", "", oenv);
@@ -409,7 +409,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*binwidth, normfac*hist2[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
 
     sprintf(str, "Solvent orientation");
@@ -425,7 +425,7 @@ int gmx_sorient(int argc, char *argv[])
                 histn[i] ? histi1[i]/histn[i] : 0,
                 histn[i] ? histi2[i]/histn[i] : 0);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     sprintf(str, "Cumulative solvent orientation");
     fp = xvgropen(opt2fn("-co", NFILE, fnm), str, "r (nm)", "", oenv);
@@ -444,7 +444,7 @@ int gmx_sorient(int argc, char *argv[])
         c2 += histi2[i]*normfac;
         fprintf(fp, "%g %g %g\n", (i+1)*rbinw, c1, c2);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     sprintf(str, "Solvent distribution");
     fp = xvgropen(opt2fn("-rc", NFILE, fnm), str, "r (nm)", "molecules/nm", oenv);
@@ -457,7 +457,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*rbinw, histn[i]*normfac);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
     do_view(oenv, opt2fn("-no", NFILE, fnm), NULL);
index 78a64e4cf0f82ff766b874466978dd2ef0719dde..93354fa7d3ffdd91966ab9961fd38797e231871e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2007,2008,2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -320,7 +320,7 @@ int gmx_spatial(int argc, char *argv[])
     }
 
     /* OUTPUT */
-    flp = ffopen("grid.cube", "w");
+    flp = gmx_ffopen("grid.cube", "w");
     fprintf(flp, "Spatial Distribution Function\n");
     fprintf(flp, "test\n");
     fprintf(flp, "%5d%12.6f%12.6f%12.6f\n", nidxp, (MINBIN[XX]+(minx+iIGNOREOUTER)*rBINWIDTH)*10./bohr, (MINBIN[YY]+(miny+iIGNOREOUTER)*rBINWIDTH)*10./bohr, (MINBIN[ZZ]+(minz+iIGNOREOUTER)*rBINWIDTH)*10./bohr);
@@ -449,7 +449,7 @@ int gmx_spatial(int argc, char *argv[])
         }
         fprintf(flp, "\n");
     }
-    ffclose(flp);
+    gmx_ffclose(flp);
 
     /* printf("x=%d to %d\n",minx,maxx); */
     /* printf("y=%d to %d\n",miny,maxy); */
index 62b1569857b0e940afe1e7736e4d8c21b0796f3e..5c5eb710a12673a4d8eb47e6f3064fdab7561150 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -380,7 +380,7 @@ int gmx_spol(int argc, char *argv[])
         nmol += hist[i];
         fprintf(fp, "%g %g\n", i*bw, nmol/nf);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
 
index 6d0e9048f7245e81e19b25cedbfb4a7ed3f1c3a8..6177bba7d128e9655beec1565dd8a5182b27df1e 100644 (file)
@@ -101,7 +101,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         do_view(oenv, fn_trans, "-nxy");
     }
 
@@ -169,7 +169,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         }
         fprintf(fp, "\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     do_view(oenv, fn_tc, "-nxy");
 
     if (fn_cub)
@@ -217,7 +217,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         }
         fprintf(fp, "&\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     do_view(oenv, fn_tcf, "-nxy");
 
     if (fn_cub)
@@ -244,10 +244,10 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             fprintf(fp_cub, "&\n");
         }
         fprintf(fp_vk, "&\n");
-        ffclose(fp_cub);
+        gmx_ffclose(fp_cub);
         do_view(oenv, fn_cub, "-nxy");
     }
-    ffclose(fp_vk);
+    gmx_ffclose(fp_vk);
     do_view(oenv, fn_vk, "-nxy");
 }
 
index 31f90f294634766db0aafe977cd67cf2a36f5f5c..a76ffc1023630cef422da964b165f17523402fac 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -466,7 +466,7 @@ static void write_pdb_bfac(const char *fname, const char *xname,
             fprintf(fp, "%-5d  %10.3f  %10.3f  %10.3f\n", 1+i,
                     sum[index[i]][XX], sum[index[i]][YY], sum[index[i]][ZZ]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         max  = 0;
         maxi = 0;
         for (i = 0; i < isize; i++)
@@ -586,7 +586,7 @@ static void print_histo(const char *fn, int nhisto, int histo[], real binwidth,
     {
         fprintf(fp, "%10.3e  %10d\n", i*binwidth, histo[i]);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 }
 
 int gmx_traj(int argc, char *argv[])
@@ -1051,7 +1051,7 @@ int gmx_traj(int argc, char *argv[])
 
     if (bOX)
     {
-        ffclose(outx);
+        gmx_ffclose(outx);
     }
     if (bOXT)
     {
@@ -1059,27 +1059,27 @@ int gmx_traj(int argc, char *argv[])
     }
     if (bOV)
     {
-        ffclose(outv);
+        gmx_ffclose(outv);
     }
     if (bOF)
     {
-        ffclose(outf);
+        gmx_ffclose(outf);
     }
     if (bOB)
     {
-        ffclose(outb);
+        gmx_ffclose(outb);
     }
     if (bOT)
     {
-        ffclose(outt);
+        gmx_ffclose(outt);
     }
     if (bEKT)
     {
-        ffclose(outekt);
+        gmx_ffclose(outekt);
     }
     if (bEKR)
     {
-        ffclose(outekr);
+        gmx_ffclose(outekr);
     }
 
     if (bVD)
index cda3df845597359a99e7938281f0870974e0cbfc..fa5f0561eb5a8b68fd812f064d49e7e8df0eb274 100644 (file)
@@ -1351,7 +1351,7 @@ int gmx_trjconv(int argc, char *argv[])
                 case efPDB:
                     if (( !bSeparate && !bSplit ) && !bSubTraj)
                     {
-                        out = ffopen(out_file, filemode);
+                        out = gmx_ffopen(out_file, filemode);
                     }
                     break;
                 default:
@@ -1789,7 +1789,7 @@ int gmx_trjconv(int argc, char *argv[])
                                         top_title, fr.time);
                                 if (bSeparate || bSplitHere)
                                 {
-                                    out = ffopen(out_file2, "w");
+                                    out = gmx_ffopen(out_file2, "w");
                                 }
                                 switch (ftp)
                                 {
@@ -1838,7 +1838,7 @@ int gmx_trjconv(int argc, char *argv[])
                                 }
                                 if (bSeparate)
                                 {
-                                    ffclose(out);
+                                    gmx_ffclose(out);
                                     out = NULL;
                                 }
                                 break;
@@ -1896,7 +1896,7 @@ int gmx_trjconv(int argc, char *argv[])
         }
         else if (out != NULL)
         {
-            ffclose(out);
+            gmx_ffclose(out);
         }
         if (bSubTraj)
         {
index 4d089c8274f8be4a8612e479df4c2226349ec2e7..b16b4fc01cc86554cc17842ffc7af281620e2df6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -376,7 +376,7 @@ int gmx_trjorder(int argc, char *argv[])
     }
     if (fp)
     {
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     gmx_rmpbc_done(gpbc);
 
index e63be167e18cbb6dff8c15422c00042d0a0f44ab..25f4c30065c6f3fa6b06874edbbbeb86ea53fd8c 100644 (file)
@@ -1429,7 +1429,7 @@ static void do_the_tests(
     if (0 == repeats)
     {
         fprintf(fp, "\nNo benchmarks done since number of repeats (-r) is 0.\n");
-        ffclose(fp);
+        gmx_ffclose(fp);
         finalize(opt2fn("-p", nfile, fnm));
         exit(0);
     }
@@ -2313,7 +2313,7 @@ int gmx_tune_pme(int argc, char *argv[])
     }
 
     /* Open performance output file and write header info */
-    fp = ffopen(opt2fn("-p", NFILE, fnm), "w");
+    fp = gmx_ffopen(opt2fn("-p", NFILE, fnm), "w");
 
     /* Make a quick consistency check of command line parameters */
     check_input(nnodes, repeats, &ntprs, &rmin, rcoulomb, &rmax,
@@ -2496,7 +2496,7 @@ int gmx_tune_pme(int argc, char *argv[])
         launch_simulation(bLaunch, fp, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
                           cmd_args_launch, simulation_tpr, best_npme);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     /* ... or simply print the performance results to screen: */
     if (!bLaunch)
index a8cef29b256403a84472481d29053433f6aa9418..78762331644be72fff4ea84ea80e20bb56922d10 100644 (file)
@@ -425,11 +425,11 @@ int gmx_vanhove(int argc, char *argv[])
         {
             ticky[i] = i*rbin;
         }
-        fp = ffopen(matfile, "w");
+        fp = gmx_ffopen(matfile, "w");
         write_xpm(fp, MAT_SPATIAL_Y, "Van Hove function", "G (1/nm)",
                   sbin == 0 ? "time (ps)" : "sqrt(time) (ps^1/2)", "r (nm)",
                   mat_nx, nbin, tickx, ticky, mat, 0, matmax, rlo, rhi, &nlev);
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (orfile)
@@ -453,7 +453,7 @@ int gmx_vanhove(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     if (otfile)
@@ -465,7 +465,7 @@ int gmx_vanhove(int argc, char *argv[])
         {
             fprintf(fp, "%g %g\n", f*dt, (real)pt[f]/(tcount[f]*isize));
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     do_view(oenv, matfile, NULL);
index e1bc36fba01bff7dfad2309f02ef48bf32321a30..9483baaab4996886f444e205441e46a7a7bdbcdf 100644 (file)
@@ -1245,7 +1245,7 @@ void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
             fprintf(fp, "\n");
         }
         printf("Wrote cumulative distribution functions to %s\n", fn);
-        ffclose(fp);
+        gmx_ffclose(fp);
         sfree(fn);
         sfree(buf);
     }
@@ -1471,7 +1471,7 @@ void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindow
         fprintf(fp, "\n");
     }
 
-    ffclose(fp);
+    gmx_ffclose(fp);
     printf("Wrote %s\n", fn);
     if (bs_index >= 0)
     {
@@ -1715,7 +1715,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
         }
         fprintf(fp, "&\n");
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     /* write average and stddev */
     fp = xvgropen(fnres, "Average and stddev from bootstrapping", "z", ylabel, opt->oenv);
@@ -1728,7 +1728,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
         stddev             = (tmp >= 0.) ? sqrt(tmp) : 0.; /* Catch rouding errors */
         fprintf(fp, "%e\t%e\t%e\n", (i+0.5)*opt->dz+opt->min, bsProfiles_av [i], stddev);
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     printf("Wrote boot strap result to %s\n", fnres);
 }
 
@@ -1764,7 +1764,7 @@ void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
     int    nread, sizenow, i, block = 1;
     FILE  *fp;
 
-    fp      = ffopen(fn, "r");
+    fp      = gmx_ffopen(fn, "r");
     nread   = 0;
     sizenow = 0;
     while (fgets(tmp, sizeof(tmp), fp) != NULL)
@@ -1861,7 +1861,7 @@ FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
     }
     else
     {
-        pipe       = ffopen(fn, "r");
+        pipe       = gmx_ffopen(fn, "r");
         *bPipeOpen = FALSE;
     }
 
@@ -1874,7 +1874,7 @@ void pdo_close_file(FILE *fp)
 #ifdef HAVE_PIPES
     pclose(fp);
 #else
-    ffclose(fp);
+    gmx_ffclose(fp);
 #endif
 }
 
@@ -1927,7 +1927,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
             }
             else
             {
-                ffclose(file);
+                gmx_ffclose(file);
             }
         }
         printf("\n");
@@ -1965,7 +1965,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
         }
         else
         {
-            ffclose(file);
+            gmx_ffclose(file);
         }
     }
     printf("\n");
@@ -2703,7 +2703,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
     printf(" done\n");
     if (fpcorr)
     {
-        ffclose(fpcorr);
+        gmx_ffclose(fpcorr);
     }
 
     /* plot IACT along reaction coordinate */
@@ -2742,7 +2742,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
             }
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     printf("Wrote %s\n", fn);
 }
 
@@ -2981,7 +2981,7 @@ void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOpt
         {
             fprintf(fp, "%g  %g\n", (j+0.5)*dz+opt->min, pot[j]);
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
         printf("verbose mode: wrote %s with PMF from interated forces\n", "pmfintegrated.xvg");
     }
 
@@ -3035,7 +3035,7 @@ void readPullGroupSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
     char  fmt[1024], fmtign[1024];
     int   block = 1, sizenow;
 
-    fp            = ffopen(opt->fnGroupsel, "r");
+    fp            = gmx_ffopen(opt->fnGroupsel, "r");
     opt->groupsel = NULL;
 
     snew(tmpbuf, len);
@@ -3500,7 +3500,7 @@ int gmx_wham(int argc, char *argv[])
         }
         fprintf(histout, "\n");
     }
-    ffclose(histout);
+    gmx_ffclose(histout);
     printf("Wrote %s\n", opt2fn("-hist", NFILE, fnm));
     if (opt.bHistOnly)
     {
@@ -3601,7 +3601,7 @@ int gmx_wham(int argc, char *argv[])
     {
         fprintf(profout, "%e\t%e\n", (double)(i+0.5)/opt.bins*(opt.max-opt.min)+opt.min, profile[i]);
     }
-    ffclose(profout);
+    gmx_ffclose(profout);
     printf("Wrote %s\n", opt2fn("-o", NFILE, fnm));
 
     /* Bootstrap Method */
index b0519d49d1e4000b8b06eac6a063d4bf034f64d8..38df488f1f9f38cbbb94a9e3ee49ca9f41f919a6 100644 (file)
@@ -677,7 +677,7 @@ void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
     int        nmap;
     t_mapping *map = NULL;
 
-    out = ffopen(outf, "w");
+    out = gmx_ffopen(outf, "w");
 
     for (i = 0; i < nmat; i++)
     {
@@ -724,7 +724,7 @@ void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
             write_xpm_m(out, mat[i]);
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 static void tick_spacing(int n, real axis[], real offset, char axisnm,
@@ -1169,7 +1169,7 @@ void write_combined_matrix(int ecombine, const char *fn,
     real     **rmat1, **rmat2;
     real       rhi, rlo;
 
-    out = ffopen(fn, "w");
+    out = gmx_ffopen(fn, "w");
     for (k = 0; k < nmat; k++)
     {
         if (mat2[k].nx != mat1[k].nx || mat2[k].ny != mat1[k].ny)
@@ -1240,7 +1240,7 @@ void write_combined_matrix(int ecombine, const char *fn,
                       rmat1, rlo, rhi, white, black, &nlevels);
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
index 2acc5219141d9bf809536f9e91350b8f9d772956..277d33fa020783b84e3b0d5ecea3c433ed9575b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -99,8 +99,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
     }
     /*Print out average energy-spectrum to outfiles[0] and outfiles[1];*/
 
-    datfile1 = ffopen(outfiles[0], "w");
-    datfile2 = ffopen(outfiles[1], "w");
+    datfile1 = gmx_ffopen(outfiles[0], "w");
+    datfile2 = gmx_ffopen(outfiles[1], "w");
 
 /*Filling dat files with spectral data*/
     fprintf(datfile1, "%s\n", "kx\t ky\t\tPower(kx,ky)");
@@ -110,8 +110,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
         fprintf(datfile1, "%d\t%d\t %8.6f\n", (n / fy), (n % fy), pspectavg1[n]);
         fprintf(datfile2, "%d\t%d\t %8.6f\n", (n /fy), (n % fy), pspectavg2[n]);
     }
-    ffclose(datfile1);
-    ffclose(datfile2);
+    gmx_ffclose(datfile1);
+    gmx_ffclose(datfile2);
 
     free(ftspect1);
     free(ftspect2);
index aec07370c057614503a89795c81f3cafc96d8c4d..a5284e1569a792f174a3fe5171147f92e3f6ac7f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -137,7 +137,7 @@ static void dump_sd(const char *fn, t_shiftdata *sd)
         }
     }
     sprintf(buf, "%s.xpm", fn);
-    fp = ffopen(buf, "w");
+    fp = gmx_ffopen(buf, "w");
     write_xpm(fp, 0, fn, fn, "Phi", "Psi", nnx, nny,
               x_phi, y_psi, newdata, lo, hi, rlo, rhi, &nlevels);
     for (i = 0; (i < nnx); i++)
@@ -188,7 +188,7 @@ static t_shiftdata *read_shifts(const char *fn)
         }
         sd->data[i][j] = sd->data[i][0];
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     if (bDebugMode())
     {
index cbce2a6bb2e0467eafe002018c8727dfa8cd0d21..41ee4e18eb6e4044f77c6e68356fd0c68d84758b 100644 (file)
@@ -238,7 +238,7 @@ static void read_prop(gmx_atomprop_t aps, int eprop, double factor)
     }
 
     /* for libraries we can use the low-level close routines */
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     ap->bSet = TRUE;
 }
index b59d759f1ee6e7d4c1caf6f085376f5e7d58dc1c..e0cab08de394b2f103511d563f13568f4e0163cf 100644 (file)
@@ -94,7 +94,7 @@ static void pukeit(const char *db, const char *defstring, char *retstring,
     {
         nhlp = fget_lines(fp, &help);
         /* for libraries we can use the low-level close routines */
-        ffclose(fp);
+        gmx_ffclose(fp);
         rng    = gmx_rng_init(gmx_rng_make_seed());
         *cqnum = static_cast<int>(nhlp*gmx_rng_uniform_real(rng));
         gmx_rng_destroy(rng);
index a8a46d66b00aa32e0b7735f4f322668ea1e6e226..cd665652b46af74e6b86a895ab0cd93d140622d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
         fprintf(debug, "Reading MDP file %s\n", fn);
     }
 
-    in = ffopen(fn, "r");
+    in = gmx_ffopen(fn, "r");
 
     nin = lc  = 0;
     do
@@ -201,7 +201,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
     }
     while (ptr);
 
-    ffclose(in);
+    gmx_ffclose(in);
 
     if (debug)
     {
index 51a39d872cc0d8b4ee030b2f308b4ade6505c36c..6b2159e3b51f532e157e6cc85b25bc1e19e621b3 100644 (file)
@@ -610,7 +610,7 @@ extern void save_data (structure_factor_t *sft, const char *file, int ngrps,
         }
     }
 
-    ffclose (fp);
+    gmx_ffclose (fp);
 }
 
 
index a4c9dfe78b31786a9144884af360f9db6db63da5..b9928cdcf2edd84b5b652de0463fa5376cc21062 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -343,7 +343,7 @@ FILE *fflib_open(const char *file)
 
     file_fullpath = gmxlibfn(file);
     fprintf(stderr, "Opening force field file %s\n", file_fullpath);
-    fp = ffopen(file_fullpath, "r");
+    fp = gmx_ffopen(file_fullpath, "r");
     sfree(file_fullpath);
 
     return fp;
index f3ad7fa4e4c6b8ed92bf9d3af1c13c920c1cadbe..dade614bbb45eb868957eb75f2463f3e86ff7743 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -312,7 +312,7 @@ static void read_vsite_database(const char *ddbname,
     *nvsiteconf     = nvsite;
     *nvsitetop      = ntop;
 
-    ffclose(ddb);
+    gmx_ffclose(ddb);
 }
 
 static int nitrogen_is_planar(t_vsiteconf vsiteconflist[], int nvsiteconf, char atomtype[])
index ed7fe4f39b0896a5aacb72bd388064a9bf82c416..4bd2e5f06752fcaaab3059e372f88848e6b00451 100644 (file)
@@ -191,7 +191,7 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
         }
         nah++;
     }
-    ffclose(in);
+    gmx_ffclose(in);
 
     /* Sort the list (necessary to be able to use bsearch */
     qsort(aah, nah, (size_t)sizeof(**ah), compaddh);
index 8e1dac95d581c921720235c94d6f476d5cd5211a..1118100847ef9873afd7d2b03338b388cdd9de74 100644 (file)
@@ -126,7 +126,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
         }
     }
     while (bCont);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     *nnm = nnnm;
     *nmp = nm2t;
index f64c93f4ddabd1709d84e3a0f87794ef3001d75c..f7207a898c610f5f07f99ca41a60628555cd5d73 100644 (file)
@@ -1458,7 +1458,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     {
         fp = fflib_open(rrn[i]);
         read_rtprename(rrn[i], fp, &nrtprename, &rtprename);
-        ffclose(fp);
+        gmx_ffclose(fp);
         sfree(rrn[i]);
     }
     sfree(rrn);
index 822b6a7ab48d79a37360f3c922517a5e324e2d1a..baba4b46255df1c5ab8dbc125c25e4bbad4f9ab7 100644 (file)
@@ -250,10 +250,10 @@ choose_ff(const char *ffsel,
             if (gmx_fexist(buf))
             {
                 /* We don't use fflib_open, because we don't want printf's */
-                fp = ffopen(buf, "r");
+                fp = gmx_ffopen(buf, "r");
                 snew(desc[i], STRLEN);
                 get_a_line(fp, desc[i], STRLEN);
-                ffclose(fp);
+                gmx_ffclose(fp);
             }
             else
             {
@@ -410,7 +410,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
             sfree(model[nwm]);
         }
     }
-    ffclose(fp);
+    gmx_ffclose(fp);
     fprintf(stderr, "%2d: %s\n", nwm+1, "None");
 
     sel = -1;
index 3b643ffe02367916aa34b8e7a8ace7edc18c03f5..b09f0819c20fc2d580f241d406fd72fea21ad72d 100644 (file)
@@ -93,7 +93,7 @@ gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
                 fprintf(stderr, "\rAtomtype %d", nratt+1);
             }
         }
-        ffclose(in);
+        gmx_ffclose(in);
         sfree(file[f]);
     }
     fprintf(stderr, "\n");
@@ -539,7 +539,7 @@ void read_resall(char *rrdb, int *nrtpptr, t_restp **rtp,
             }
         }
     }
-    ffclose(in);
+    gmx_ffclose(in);
     /* give back unused memory */
     srenew(rrtp, nrtp);
 
index 41cc0db1d40d5cb370de1d8ff956f1534cbb80c3..3cbd5556a602cd2320154b3dffeeb2a3439dbcd8 100644 (file)
@@ -525,8 +525,8 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
     if (ftp2bSet(efTOP, NFILE, fnm) )
     {
         fprintf(stderr, "Processing topology\n");
-        fpin    = ffopen(topinout, "r");
-        fpout   = ffopen(TEMP_FILENM, "w");
+        fpin    = gmx_ffopen(topinout, "r");
+        fpout   = gmx_ffopen(TEMP_FILENM, "w");
         line    = 0;
         bSystem = bMolecules = FALSE;
         while (fgets(buf, STRLEN, fpin))
@@ -595,17 +595,17 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
                 fprintf(fpout, "%s", buf);
             }
         }
-        ffclose(fpin);
+        gmx_ffclose(fpin);
         if (nsol)
         {
             fprintf(stdout, "Adding line for %d solvent molecules to "
                     "topology file (%s)\n", nsol, topinout);
             fprintf(fpout, "%-15s %5d\n", "SOL", nsol);
         }
-        ffclose(fpout);
-        /* use ffopen to generate backup of topinout */
-        fpout = ffopen(topinout, "w");
-        ffclose(fpout);
+        gmx_ffclose(fpout);
+        /* use gmx_ffopen to generate backup of topinout */
+        fpout = gmx_ffopen(topinout, "w");
+        gmx_ffclose(fpout);
         rename(TEMP_FILENM, topinout);
     }
 #undef TEMP_FILENM
index 0261410e8d17d2d558df0b16720603a878ea3b35..e1390987e9e87bcff27ad066bb0f46281001d28e 100644 (file)
@@ -398,7 +398,7 @@ static void read_ter_db_file(char *fn,
     nb++;
     srenew(tb, nb);
 
-    ffclose(in);
+    gmx_ffclose(in);
 
     *ntbptr = nb;
     *tbptr  = tb;
index e3b1ed7fdea6962d375a6984895f56a2c4cb78fa..fc2727df6077a24e68c780ca20c37e6d420faf76 100644 (file)
@@ -94,7 +94,7 @@ static t_2morse *read_dissociation_energies(int *n2morse)
         /* If we did not read three items, quit reading */
     }
     while (nread == 3);
-    ffclose(fp);
+    gmx_ffclose(fp);
 
     /* Set the return values */
     *n2morse = n2m;
index c5b75e99e42c10c45f5032007719c25765c602da..4246eb7ee74bab66cf94c3bb136af0b60318e675 100644 (file)
@@ -618,7 +618,7 @@ int gmx_x2top(int argc, char *argv[])
                   cgnr, rtp_header_settings.nrexcl);
         print_top_mols(fp, mymol.name, ffdir, NULL, 0, NULL, 1, &mymol);
 
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
     if (bRTP)
     {
index 36aeda4fba52ca3365952f3b649737668ed09794..fed4c8b73e3a2ac05767ede79bdbb1a36ee5658f 100644 (file)
@@ -163,7 +163,7 @@ void rename_atoms(const char *xlfile, const char *ffdir,
         {
             fp = fflib_open(f[i]);
             get_xlatoms(f[i], fp, &nxlate, &xlatom);
-            ffclose(fp);
+            gmx_ffclose(fp);
             sfree(f[i]);
         }
         sfree(f);
index 34ebe16bbe9fc3fa62c34a0e70785f4d191b5150..8036486ca87c4357d7754f1c4429cbfb3c4b6a43 100644 (file)
@@ -1221,9 +1221,9 @@ static int copy_pmegrid_to_fftgrid(gmx_pme_t pme, real *pmegrid, real *fftgrid,
         char  fn[STRLEN], format[STRLEN];
         real  val;
         sprintf(fn, "pmegrid%d.pdb", pme->nodeid);
-        fp = ffopen(fn, "w");
+        fp = gmx_ffopen(fn, "w");
         sprintf(fn, "pmegrid%d.txt", pme->nodeid);
-        fp2 = ffopen(fn, "w");
+        fp2 = gmx_ffopen(fn, "w");
         sprintf(format, "%s%s\n", pdbformat, "%6.2f%6.2f");
 #endif
 
@@ -1257,8 +1257,8 @@ static int copy_pmegrid_to_fftgrid(gmx_pme_t pme, real *pmegrid, real *fftgrid,
             }
         }
 #ifdef DEBUG_PME
-        ffclose(fp);
-        ffclose(fp2);
+        gmx_ffclose(fp);
+        gmx_ffclose(fp2);
 #endif
     }
     return 0;
index 7cfce0bc24d6c72942b62c0e3f18b23153c88932..464f82ac3bb74283c3b420622f4ed7b5273502f8 100644 (file)
@@ -1602,7 +1602,7 @@ t_forcetable make_atf_table(FILE *out, const output_env_t oenv,
             fprintf(fp, "%15.10e  %15.10e  %15.10e\n", x0, y0, yp);
 
         }
-        ffclose(fp);
+        gmx_ffclose(fp);
     }
 
     done_tabledata(&(td[0]));
index edd84a4f3ebb3796b0a6062912b22cc080bd6cad..6ae8510d4867c72d507453e37227854260cb7d20 100644 (file)
@@ -771,7 +771,7 @@ static FILE *open_output_file(const char *fn, int steps, const char what[])
     FILE *fp;
 
 
-    fp = ffopen(fn, "w");
+    fp = gmx_ffopen(fn, "w");
 
     fprintf(fp, "# Output of %s is written in intervals of %d time step%s.\n#\n",
             what, steps, steps > 1 ? "s" : "");
index 59f5a3d36301e194fb37490ce4d24408f052793c..b0adbce9d9050fde8c831c69a6710b2729ec5448 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,7 +128,7 @@ void File::open(const char *filename, const char *mode)
 {
     GMX_RELEASE_ASSERT(impl_->fp_ == NULL,
                        "Attempted to open the same file object twice");
-    // TODO: Port all necessary functionality from ffopen() here.
+    // TODO: Port all necessary functionality from gmx_ffopen() here.
     impl_->fp_ = fopen(filename, mode);
     if (impl_->fp_ == NULL)
     {
index 738cb3fe30b50daae91de56f81ee0874c8577362..77231a113084d7706ff889102f25941f7eda8915 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -895,8 +895,8 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
     char       buf[STRLEN], buf2[STRLEN], *temp;
     int        i, *nmol_rm, nmol, line;
 
-    fpin  = ffopen(topfile, "r");
-    fpout = ffopen(TEMP_FILENM, "w");
+    fpin  = gmx_ffopen(topfile, "r");
+    fpout = gmx_ffopen(TEMP_FILENM, "w");
 
     snew(nmol_rm, mtop->nmoltype);
     for (i = 0; i < rm_p->nr; i++)
@@ -961,10 +961,10 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
         }
     }
 
-    ffclose(fpout);
-    /* use ffopen to generate backup of topinout */
-    fpout = ffopen(topfile, "w");
-    ffclose(fpout);
+    gmx_ffclose(fpout);
+    /* use gmx_ffopen to generate backup of topinout */
+    fpout = gmx_ffopen(topfile, "w");
+    gmx_ffclose(fpout);
     rename(TEMP_FILENM, topfile);
 #undef TEMP_FILENM
 }
index 09eec37fbd827fa17e9b321ea6f37386443b3c40..7eee65889f4be9806b92121a5c2cb28c8d8f0451 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -438,7 +438,7 @@ t_fgrid *FGridFromFile(const char *infile)
         }
         fscanf(in, "%15s", buf);
     }
-    ffclose(in);
+    gmx_ffclose(in);
 
     return fgrid;
 }