fatal.h clashes with system headers on AIX. Renamed to gmx_fatal.h
authorlindahl <lindahl>
Wed, 19 Apr 2006 09:04:52 +0000 (09:04 +0000)
committerlindahl <lindahl>
Wed, 19 Apr 2006 09:04:52 +0000 (09:04 +0000)
177 files changed:
include/Makefile.am
include/binio.h
include/gmx_fatal.h [moved from include/fatal.h with 100% similarity]
include/network.h
include/qmmm.h
include/types/enums.h
include/types/graph.h
include/types/mdatom.h
include/vec.h
src/contrib/anaf.c
src/contrib/do_shift.c
src/contrib/ehanal.c
src/contrib/ehdata.c
src/contrib/ehole.c
src/contrib/glasmd.c
src/contrib/mkice.c
src/contrib/pmetest.c
src/contrib/sigeps.c
src/contrib/test.c
src/gmxlib/atomprop.c
src/gmxlib/block_tx.c
src/gmxlib/bondfree.c
src/gmxlib/calcgrid.c
src/gmxlib/confio.c
src/gmxlib/dihres.c
src/gmxlib/disre.c
src/gmxlib/enxio.c
src/gmxlib/ewald_util.c
src/gmxlib/filenm.c
src/gmxlib/futil.c
src/gmxlib/gbutil.c
src/gmxlib/gmxfio.c
src/gmxlib/index.c
src/gmxlib/invblock.c
src/gmxlib/libxdrf.c
src/gmxlib/main.c
src/gmxlib/matio.c
src/gmxlib/mshift.c
src/gmxlib/mtxio.c
src/gmxlib/mvdata.c
src/gmxlib/mvxvf.c
src/gmxlib/names.c
src/gmxlib/network.c
src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel010_ia32_3dnow.s
src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel030_ia32_3dnow.s
src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel101_ia32_3dnow.s
src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel112_ia32_3dnow.s
src/gmxlib/nonbonded/nb_kernel_ia64_double/nb_kernel_ia64_single.h
src/gmxlib/nonbonded/nonbonded.c
src/gmxlib/nrama.c
src/gmxlib/nrnb.c
src/gmxlib/pargs.c
src/gmxlib/pbc.c
src/gmxlib/shift_util.c
src/gmxlib/smalloc.c
src/gmxlib/stat.c
src/gmxlib/statutil.c
src/gmxlib/strdb.c
src/gmxlib/string2.c
src/gmxlib/symtab.c
src/gmxlib/tcontrol.c
src/gmxlib/test_fatal.c
src/gmxlib/tpxio.c
src/gmxlib/trnio.c
src/gmxlib/widget.c
src/gmxlib/wman.c
src/gmxlib/writeps.c
src/gmxlib/xmlio.c
src/gmxlib/xtcio.c
src/kernel/convparm.c
src/kernel/gen_ad.c
src/kernel/genalg.c
src/kernel/genhydro.c
src/kernel/gmxcheck.c
src/kernel/gmxdump.c
src/kernel/grompp.c
src/kernel/md.c
src/kernel/mdrun.c
src/kernel/mk_ghat.c
src/kernel/pdb2gmx.c
src/kernel/pdb2top.c
src/kernel/readir.c
src/kernel/relax_sh.c
src/kernel/repl_ex.c
src/kernel/resall.c
src/kernel/rtp2xml.c
src/kernel/ter_db.c
src/kernel/tomorse.c
src/kernel/topio.c
src/kernel/topio.h
src/kernel/toppush.c
src/kernel/toputil.c
src/kernel/tpbcmp.c
src/kernel/tpbconv.c
src/kernel/vsite_parm.c
src/mdlib/Makefile.am
src/mdlib/calcmu.c
src/mdlib/coupling.c
src/mdlib/csettle.c
src/mdlib/ebin.c
src/mdlib/ewald.c
src/mdlib/fftgrid.c
src/mdlib/force.c
src/mdlib/ghat.c
src/mdlib/init.c
src/mdlib/minimize.c
src/mdlib/ns.c
src/mdlib/nsgrid.c
src/mdlib/pme.c
src/mdlib/pppm.c
src/mdlib/pullinit.c
src/mdlib/pullio.c
src/mdlib/pullutil.c
src/mdlib/qm_gamess.c
src/mdlib/qm_gaussian.c
src/mdlib/qm_mopac.c
src/mdlib/qmmm.c
src/mdlib/sim_util.c
src/mdlib/splittop.c
src/mdlib/tables.c
src/mdlib/timefft.c
src/mdlib/update.c
src/mdlib/wnblist.c
src/ngmx/dialogs.c
src/ngmx/highway.c
src/ngmx/molps.c
src/ngmx/ngmx.c
src/ngmx/nmol.c
src/ngmx/xdlg.c
src/ngmx/xdlghi.c
src/ngmx/xdlgitem.c
src/ngmx/xmb.c
src/tools/anadock.c
src/tools/autocorr.c
src/tools/calcpot.c
src/tools/do_dssp.c
src/tools/edittop.c
src/tools/eigensolver.c
src/tools/g_kinetics.c [moved from src/gmxlib/xdrd.c with 62% similarity]
src/tools/gmx_anaeig.c
src/tools/gmx_analyze.c
src/tools/gmx_angle.c
src/tools/gmx_bond.c
src/tools/gmx_chi.c
src/tools/gmx_confrms.c
src/tools/gmx_density.c
src/tools/gmx_dist.c
src/tools/gmx_dyndom.c
src/tools/gmx_editconf.c
src/tools/gmx_eneconv.c
src/tools/gmx_enemat.c
src/tools/gmx_energy.c
src/tools/gmx_genbox.c
src/tools/gmx_genion.c
src/tools/gmx_genpr.c
src/tools/gmx_hbond.c
src/tools/gmx_helix.c
src/tools/gmx_kinetics.c [new file with mode: 0644]
src/tools/gmx_lie.c
src/tools/gmx_mdmat.c
src/tools/gmx_nmens.c
src/tools/gmx_nmtraj.c
src/tools/gmx_rdf.c
src/tools/gmx_rms.c
src/tools/gmx_rmsf.c
src/tools/gmx_rotacf.c
src/tools/gmx_saltbr.c
src/tools/gmx_sham.c
src/tools/gmx_tcaf.c
src/tools/gmx_velacc.c
src/tools/gmx_wheel.c
src/tools/gmx_xpm2ps.c
src/tools/make_edi.c
src/tools/mk_angndx.c
src/tools/orise.c
src/tools/polynomials.c
src/tools/proptim.c

index fccad527ba14c6bfbb4d05cae734e343ba11862a..e28663dd6851381a570e89056c1e1e86ffa9b11b 100644 (file)
@@ -1,4 +1,4 @@
-## Process this file with automake to produce Makefile.in
+'## Process this file with automake to produce Makefile.in
 #
 # Don't edit - this file is generated automatically from Makefile.am
 #
@@ -25,7 +25,7 @@ do_fit.h \
 ebin.h \
 edsam.h \
 enxio.h \
-fatal.h \
+gmx_fatal.h \
 ffscanf.h \
 fftgrid.h \
 filenm.h \
@@ -43,6 +43,7 @@ gmx_random.h \
 gmx_parallel_3dfft.h \
 gmx_system_xdr.h \
 gmx_thread.h \
+gmx_parallel_3dfft.h \
 grompp.h \
 gstat.h \
 index.h \
index dd922b19fc23c6230162d62bb9ef735489cd96d8..ad2b0767a50e0a7866822d7bc5c96385e0d3d2ee 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <stdio.h>
 #include "sysstuff.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 /*
  *    Module to binary write and read.
similarity index 100%
rename from include/fatal.h
rename to include/gmx_fatal.h
index 3599307a0686532c136755b5dc77ccfdb328c236..7b191af823084b5a412c40e3fde567132ba03fe8 100644 (file)
@@ -49,7 +49,7 @@
 #include <stdio.h>
 #include "typedefs.h"
 #include "main.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #define LEFT     0          /* channel to the left processor  */
 #define RIGHT    1          /* channel to the right processor */
index 7c2f9eab658bf0b542942204524cc1fbb80f593e..0f28010ecec814f03090e5328060f651904f121b 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _QMMM_h
 #define _QMMM_h
 
-static char *SRCID_QMMM_h = "$Id$";
 
 #ifdef HAVE_IDENT
 #ident "@(#) QMMM.h 1 28/2/01"
index c476e1f4f9e46408c1e1c8050c1b533dde2bd2d7..8ce941d44f2536007638127eedb380d35ef95a3d 100644 (file)
@@ -159,7 +159,7 @@ enum {
 
 enum {
   eQMmethodAM1, eQMmethodPM3, eQMmethodRHF, 
-  eQMmethodUHF, eQMmethodDFT, eQMmethodB3LYP, eQMmethodMP2, eQMmethodCASSCF,
+  eQMmethodUHF, eQMmethodDFT, eQMmethodB3LYP, eQMmethodMP2, eQMmethodCASSCF, eQMmethodB3LYPLAN,
   eQMmethodDIRECT, eQMmethodNR
 };
 
index 2734e8d7ccf51f185a6b465d1daa288c7e625b7b..fdbcfb23fcf9ba692da0d529e672dcf5006f40d6 100644 (file)
@@ -37,7 +37,7 @@
 #include <config.h>
 #endif
 
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 typedef enum { egcolWhite, egcolGrey, egcolBlack, egcolNR } egCol;
 
index f662150cdf84448708f0b5fdf74cbe602f4a8960..68b1f7ba2ecc25d84ee9f2cbd034f8beec16758a 100644 (file)
@@ -55,9 +55,10 @@ typedef struct {
   bool          *bPerturbed;
   int           *typeA,*typeB;
   unsigned short        *ptype;
-  unsigned short        *cTC,*cENER,*cACC,*cFREEZE,*cVCM;
-  unsigned short        *cU1,*cU2,*cORF;
+  unsigned short        *cTC,*cENER,*cACC,*cFREEZE,*cXTC,*cVCM;
+  unsigned short        *cU1,*cU2,*cORF,*cQMMM;
   /* for QMMM, atomnumber contains atomic number of the atoms */
+  int           *atomnumber;
   bool          *bQM;
 } t_mdatoms;
 
index 1fd94562546be6c785ad2308be05f936eb2eaffa..8a99d62b8b26fd8dc6c15623d65e9b31e0a90c44 100644 (file)
 #include "typedefs.h"
 #include "sysstuff.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #define EXP_LSB         0x00800000
 #define EXP_MASK        0x7f800000
@@ -629,9 +629,9 @@ static inline void msmul(matrix m1,real r1,matrix dest)
 
 static inline void m_inv_lowerleft0(matrix src,matrix dest)
 {
-    double tmp = src[XX][XX]*src[YY][YY]*src[ZZ][ZZ];
-    if(gmx_within_tol(tmp,0.0,100*GMX_REAL_MIN));
-       gmx_fatal(FARGS,"Can not invert matrix, determinant is zero");
+  double tmp = src[XX][XX]*src[YY][YY]*src[ZZ][ZZ];
+  if (gmx_within_tol(tmp,0.0,100*GMX_REAL_MIN))
+    gmx_fatal(FARGS,"Can not invert matrix, determinant is zero");
 
   dest[XX][XX] = 1/src[XX][XX];
   dest[YY][YY] = 1/src[YY][YY];
index 5a4d2f00b4212d741019bb57b89027761148faac..bfd6a4867c3e94441c34a15158e634708ffca6c8 100644 (file)
@@ -47,7 +47,7 @@
 #include "copyrite.h"
 #include "sysstuff.h"
 #include "txtdump.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xtcio.h"
 #include "enxio.h"
 #include "smalloc.h"
index 21182c4e1a19ec41bbc8486288142b94ad05645a..070b5df107856f7c4df680cc136d725e01bb54cf 100644 (file)
@@ -49,7 +49,7 @@
 #include "statutil.h"
 #include "copyrite.h"
 #include "confio.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "gstat.h"
 #include "index.h"
index 73768552d66cfdfd2c89882596d13c18f8233ae8..255c6d0fa488d8ff96cd4fe6fd6d1ce62b802e11 100644 (file)
@@ -45,7 +45,7 @@
 #include "macros.h"
 #include "copyrite.h"
 #include "statutil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "random.h"
 #include "pdbio.h"
 #include "futil.h"
index dffac12439a6394595c9538dfcd31413b35e83ab..0a822e392dc656e1e8a58c6da8bc3d5e9fbd1e17 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "copyrite.h"
 #include "statutil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "random.h"
 #include "strdb.h"
 #include "futil.h"
index e7860751956652e7a32fee821da31e1f0bb0d34b..6c1d6251c4abe2d3f291456b9b2ee54baffb236e 100644 (file)
@@ -45,7 +45,7 @@
 #include "macros.h"
 #include "copyrite.h"
 #include "statutil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "random.h"
 #include "pdbio.h"
 #include "futil.h"
index c12d34d2ff926d170f01b295aa1e89eab86abce4..ff13d83cf4fe71af83ec272bfdd87edb9a6546ec 100644 (file)
@@ -55,7 +55,7 @@
 #include "macros.h"
 #include "names.h"
 #include "stat.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "txtdump.h"
 #include "futil.h"
 #include "typedefs.h"
index 5b8e9c1bedc11f7b22f09c44b0f4de54f355ad2b..19d918509435134cccb2693479a9ebce7835d03e 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "statutil.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pdbio.h"
 #include "macros.h"
 #include "smalloc.h"
index e10011d96021b67171c3dd47584fe85a1cd1e73e..1c198efbdb680124f83de841f5b237b4e990a36d 100644 (file)
@@ -47,7 +47,7 @@
 #include "tpxio.h"
 #include "statutil.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "mdatoms.h"
 #include "coulomb.h"
 #include "force.h"
 #include "xvgr.h"
 #include "pbc.h"
+
+#ifdef GMX_MPI
 #include "mpi.h"
+#endif
+
 #include "block_tx.h"
 
 rvec *xptr=NULL;
@@ -340,12 +344,15 @@ int main(int argc,char *argv[])
       top.blocks[ebCGS].multinr[i] = ncg;
   }
   if (PAR(cr)) {
-    /* Distribute the data over processors */
-    MPI_Bcast(&natoms,1,MPI_INT,root,MPI_COMM_WORLD);
     /* Set some variables to zero to avoid core dumps */
     ir->opts.ngtc = ir->opts.ngacc = ir->opts.ngfrz = ir->opts.ngener = 0;
+#ifdef GMX_MPI
+    /* Distribute the data over processors */
+    MPI_Bcast(&natoms,1,MPI_INT,root,MPI_COMM_WORLD);
     MPI_Bcast(ir,sizeof(*ir),MPI_BYTE,root,MPI_COMM_WORLD);
     MPI_Bcast(&qtot,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
+#endif
+
     /* Call some dedicated communication routines, master sends n-1 times */
     if (MASTER(cr)) {
       for(i=1; (i<cr->nnodes); i++) {
@@ -361,7 +368,9 @@ int main(int argc,char *argv[])
       snew(charge,natoms);
       snew(x,natoms);
     }
+#ifdef GMX_MPI
     MPI_Bcast(charge,natoms,GMX_MPI_REAL,root,MPI_COMM_WORLD);
+#endif
   }
   ewaldcoeff = calc_ewaldcoeff(ir->rcoulomb,ir->ewald_rtol);
   
@@ -392,7 +401,7 @@ int main(int argc,char *argv[])
   mdatoms = atoms2md(stdlog,&top.atoms,ir->opts.nFreeze,ir->eI,
                     ir->delta_t,0,ir->opts.tau_t,FALSE,FALSE);
   snew(fr,1);
-  init_forcerec(stdlog,fr,ir,&top,cr,mdatoms,nsb,box,FALSE,NULL,FALSE);
+  init_forcerec(stdlog,fr,ir,&top,cr,mdatoms,nsb,box,FALSE,NULL,NULL,FALSE);
   
   /* First do PME based on coordinates in tpr file, send them to
    * other processors if needed.
@@ -400,11 +409,13 @@ int main(int argc,char *argv[])
   if (MASTER(cr))
     fprintf(stdlog,"-----\n"
            "Results based on tpr file %s\n",ftp2fn(efTPX,NFILE,fnm));
+#ifdef GMX_MPI
   if (PAR(cr)) {
     MPI_Bcast(x[0],natoms*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
     MPI_Bcast(box[0],DIM*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
     MPI_Bcast(&t,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
   }
+#endif
   do_my_pme(stdlog,0,bVerbose,ir,x,xbuf,f,charge,qbuf,qqbuf,box,bSort,
            cr,nsb,&nrnb,&(top.atoms.excl),qtot,fr,index,NULL,
            bGroups ? ir->opts.ngener : 1,mdatoms->cENER);
@@ -426,11 +437,13 @@ int main(int argc,char *argv[])
       fp = NULL;
     do {
       /* Send coordinates, box and time to the other nodes */
+#ifdef GMX_MPI
       if (PAR(cr)) {
        MPI_Bcast(x[0],natoms*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
        MPI_Bcast(box[0],DIM*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
        MPI_Bcast(&t,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
       }
+#endif
       rm_pbc(&top.idef,nsb->natoms,box,x,x);
       /* Call the PME wrapper function */
       do_my_pme(stdlog,t,bVerbose,ir,x,xbuf,f,charge,qbuf,qqbuf,box,bSort,cr,
@@ -438,10 +451,13 @@ int main(int argc,char *argv[])
                bGroups ? ir->opts.ngener : 1,mdatoms->cENER);
       /* Only the master processor reads more data */
       if (MASTER(cr))
-       bCont = read_next_x(status,&t,natoms,x,box);
+          bCont = read_next_x(status,&t,natoms,x,box);
       /* Check whether we need to continue */
+#ifdef GMX_MPI
       if (PAR(cr))
-       MPI_Bcast(&bCont,1,MPI_INT,root,MPI_COMM_WORLD);
+          MPI_Bcast(&bCont,1,MPI_INT,root,MPI_COMM_WORLD);
+#endif
+      
     } while (bCont);
     
     /* Finish I/O, close files */
index 7fc53d44277c5c7a47f133c277a94cc3c24d40ee..8d95083f7dea36cde3ab7aaceeb11e472970f51e 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "statutil.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "pdbio.h"
 #include "macros.h"
index 73b84e44f3ed0477659cd65ebcd80dbbeae97f4a..eccab5a9438050b5698e5ef40245d649e99419d3 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "statutil.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "pdbio.h"
 #include "macros.h"
index 8fe222d7b1a18a3fc6ea9753d3bc096bb363faa1..e1fa55659c1b25dc3e19e01a3263384331cb5dd4 100644 (file)
@@ -42,7 +42,7 @@
 #include "smalloc.h"
 #include "string2.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "atomprop.h"
 #include "macros.h"
 #include "index.h"
index 380d49755a640f3ad1a86279d279d95525cefcfc..9586be6acbebe09e9c4c2387816b1c1a28e77698 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "network.h"
 #include "block_tx.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "main.h"
         
index 3b8040d7721f4865002e22e60a9a5423afa73111..dd4ca7204b2cbdd4ea840f399f794d1e7155d99b 100644 (file)
@@ -48,7 +48,7 @@
 #include "ns.h"
 #include "macros.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "mshift.h"
 #include "main.h"
 #include "disre.h"
@@ -91,7 +91,7 @@ void calc_bonds(FILE *fplog,const gmx_multisim_t *ms,
     fprintf(fplog,"Step %d: bonded V and dVdl for this node\n",step);
 
 #ifdef DEBUG
-  if (g)
+  if (g && debug)
     p_graph(debug,"Bondage is fun",g);
 #endif
   
@@ -1168,8 +1168,9 @@ real idihs(int nbonds,
               f,fshift,pbc,g,x,t1,t2,t3);                      /* 112          */
     /* 217 TOTAL       */
 #ifdef DEBUG
-    fprintf("idih: (%d,%d,%d,%d) cp=%g, phi=%g\n",
-           ai,aj,ak,al,cos_phi,phi);
+    if (debug)
+      fprintf(debug,"idih: (%d,%d,%d,%d) cp=%g, phi=%g\n",
+             ai,aj,ak,al,cos_phi,phi);
 #endif
   }
   
index a24c929de513182ffb3edb3fca9bd0950d84c012..af827adfa4a5c675ab969e7ffd20c6515d152fac 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "typedefs.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "calcgrid.h"
 
 #define facNR 6
index d2af158e8bc4bbf00f00d8fa30e24a6367aaa8a3..5e0298e4db098cf993f6c4109504c83e3e1846c2 100644 (file)
@@ -53,7 +53,7 @@
 #include "filenm.h"
 #include "pdbio.h"
 #include "tpxio.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "copyrite.h"
 #include "filenm.h"
 #include "statutil.h"
index 32a381dc2de4f11278db70956c1a93dffad2bb53..deb6fc9f4c1bb72d97fcb7cd9914373c63ca885e 100644 (file)
@@ -46,7 +46,7 @@
 #include "vec.h"
 #include "futil.h"
 #include "xvgr.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "bondf.h"
 #include "copyrite.h"
 #include "disre.h"
index 6ca58322e2a97ebd170cfe2ba2914cf7faaa38c0..8ed63ecdb4d7fb80ba5fea65cfcfd36804dc52fc 100644 (file)
@@ -46,7 +46,7 @@
 #include "vec.h"
 #include "futil.h"
 #include "xvgr.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "bondf.h"
 #include "copyrite.h"
 #include "disre.h"
index 3b1ed260ec2b65d0ad5014e427be59a7bfb73f5a..88103cf3e1707cf44ab4268f71fcbce86a2f45d0 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "futil.h"
 #include "string2.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "gmxfio.h"
 #include "enxio.h"
index f16e9628b8ddc79dd0b5160e44a25d496bd2788f..f7c63d73c7701a6e24265dda1dfa70538d57795a 100644 (file)
@@ -47,7 +47,6 @@
 #include "txtdump.h"
 #include "futil.h"
 #include "names.h"
-#include "fftgrid.h"
 #include "writeps.h"
 #include "macros.h"
 
index bb49638c53a05312bb6f07eabd6c6a2b74694b46..e1327e8d89442bacab39eccb2d912fc50766b059 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "string2.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "filenm.h"
 #include "futil.h"
 #include "wman.h"
index 6b0c7534a8c19be74a36aebce98f60b33f3ec01c..b969ebe2213d86a1df029da323a36db7e95271a4 100644 (file)
@@ -48,7 +48,7 @@
 #include "string2.h"
 #include "futil.h"
 #include "network.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "statutil.h"
 
index 808f547e4098b291778abe974633cd901069a963..3da20745766b0e3014f0e6869205bb2e6d0fd455 100644 (file)
@@ -41,7 +41,7 @@
 #include <math.h>
 #include "macros.h"
 #include "vec.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "gstat.h"
 #include "pbc.h"
 
index daa2caf53aa62ef0e4b6b13a5909c80019fc5e52..5a3c9101fbe1fbaf880a9571b60768293dd117e4 100644 (file)
@@ -40,7 +40,7 @@
 #include <ctype.h>
 #include <stdio.h>
 
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "smalloc.h"
 #include "futil.h"
index 47bd2179fd58648520e42153eb01ecdf7de44009..777f24d17a3df11385bde00a3796dcafa438449e 100644 (file)
@@ -740,7 +740,7 @@ void get_index(t_atoms *atoms, char *fnm, int ngrps,
               int isize[], atom_id *index[],char *grpnames[])
 {
   char    ***gnames;
-  t_block *grps;
+  t_block *grps = NULL; 
   int     *grpnr;
   
   snew(grpnr,ngrps);
index ba4e3e77c125ca32205ac99860e22ee0393437d4..ac4f648f54c131cf3fcf386ab52b7e88c5d53d14 100644 (file)
@@ -41,7 +41,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "invblock.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 atom_id *make_invblock(const t_block *block,int nr)
 {
index 30ac47670fc5d6db47860ea569ad7b1fd3589dc8..f41759ed9ee02aae36456c490f20cd3cd5db3e48 100644 (file)
@@ -139,14 +139,6 @@ F77_FUNC(xdrfint,XDRFINT)(int *xdrid, int *ip, int *ret)
        cnt += sizeof(int);
 }
 
-void
-F77_FUNC(xdrflong,XDRFLONG)(int *xdrid, long *lp, int *ret)
-{
-       *ret = xdr_long(xdridptr[*xdrid], lp);
-       cnt += sizeof(long);
-}
-
-void
 F77_FUNC(xdrfshort,XDRFSHORT)(int *xdrid, short *sp, int *ret)
 {
        *ret = xdr_short(xdridptr[*xdrid], sp);
@@ -160,12 +152,6 @@ F77_FUNC(xdrfuchar,XDRFUCHAR)(int *xdrid, unsigned char *ucp, int *ret)
        cnt += sizeof(char);
 }
 
-void
-F77_FUNC(xdrfulong,XDRFULONG)(int *xdrid, unsigned long *ulp, int *ret)
-{
-       *ret = xdr_u_long(xdridptr[*xdrid], (u_long *)ulp);
-       cnt += sizeof(unsigned long);
-}
 
 void
 F77_FUNC(xdrfushort,XDRFUSHORT)(int *xdrid, unsigned short *usp, int *ret)
index 0f459b755262ef6488f46c43219bba71a6a599f0..5af53f4a0f44b214e5d5429fcd1eddb3020d27d9 100644 (file)
@@ -43,7 +43,7 @@
 #include <limits.h>
 #include <time.h>
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "network.h"
 #include "main.h"
 #include "macros.h"
index b0e80aa2c79c8c6caeed8c8c74ee32e747f5fb81..611474e99ac22b25c8d3d676d7276ee2260ba89d 100644 (file)
@@ -43,7 +43,7 @@
 #include "string2.h"
 #include "macros.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "matio.h"
 #include "statutil.h"
 
index bfa83b135b7d0a52c1781de19b9fa78ede495481..ad9d536521d3cdede711c068bf0f040adb9d7aa9 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <string.h>
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "vec.h"
 #include "futil.h"
index 1e6f5e84224b34b7b7c6c63c2b24d80cfaa54b81..7cd7626740ff3adbc064405f239191e0b71f1190 100644 (file)
@@ -46,7 +46,7 @@
 #include "smalloc.h"
 #include "gmxfio.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "mtxio.h"
 
 
index e1b2c2b172a3f69e7e876d69002146cf1dfb968c..912190ca4cd8382adb5b2b5e3e37eb9b42f2ef09 100644 (file)
@@ -45,7 +45,7 @@
 #include "mvdata.h"
 #include "network.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "symtab.h"
 #include "vec.h"
 #include "tgroup.h"
@@ -175,6 +175,7 @@ static void ld_grpopts(const t_commrec *cr,int src,t_grpopts *g)
   snew(g->acc,g->ngacc);
   snew(g->nFreeze,g->ngfrz);
   snew(g->egp_flags,g->ngener*g->ngener);
+
   nblockrx(cr,src,g->ngtc,g->nrdf);
   nblockrx(cr,src,g->ngtc,g->tau_t);
   nblockrx(cr,src,g->ngtc,g->ref_t);
@@ -196,6 +197,7 @@ static void ld_grpopts(const t_commrec *cr,int src,t_grpopts *g)
       nblockrx(cr,src,n,g->anneal_temp[i]);
     }
   }
+
   /* QMMM stuff, see inputrec */
   blockrx(cr,src,g->ngQM);
   snew(g->QMmethod,g->ngQM);
index ebac88f11f60ce7ac23ea7fdbf60c3680be6888c..11ca9662cec5e7bd5715edbd99ca270a03769db6 100644 (file)
@@ -45,7 +45,7 @@
 #include "mvdata.h"
 #include "network.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "symtab.h"
 #include "main.h"
 #include "typedefs.h"
index 1baeb50cb88d5147428e28b0fe10f0bd80b15713..58e65991a791f19e6b8ed926eadbddaa3133e81e 100644 (file)
@@ -167,7 +167,7 @@ const char *eis_names[eisNR+1] = {
 
 const char *eQMmethod_names[eQMmethodNR+1] = {
   "AM1", "PM3", "RHF",
-  "UHF", "DFT", "B3LYP", "MP2", "CASSCF",
+  "UHF", "DFT", "B3LYP", "MP2", "CASSCF","B3LYPLAN",
   "DIRECT", NULL
 };
 
index ac709dee17d05b52d7b13e86e258539f5c84c3a7..d48c7a394d8ab6c0d71e1a7e7114a8f79423ec18 100644 (file)
@@ -38,7 +38,7 @@
 #endif
 
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "main.h"
 #include "smalloc.h"
 #include "network.h"
@@ -347,7 +347,7 @@ int gmx_idle_rec(void)
 
 void gmx_left_right(int nnodes,int nodeid,int *left,int *right)
 {
-  *left  = (nodeid - 1 + nnodes) % nnodes;
+  *left  = (nnodes+nodeid-1) % nnodes;
   *right = (nodeid + 1) % nnodes;
 }
 
index 88f6229185b48ae8fb9748a08833d458ca959975..5a047f6be10e35100d660274cd60a0f352cef706 100644 (file)
@@ -18,7 +18,6 @@
 
 
 
-
 .globl nb_kernel010_ia32_3dnow
 .globl _nb_kernel010_ia32_3dnow
 nb_kernel010_ia32_3dnow:        
index 3810b24d669b67254178eaad59564e743a4b45db..a50c2c2c1f1ce8a0ad144983c2a424229651343a 100644 (file)
@@ -18,7 +18,6 @@
 
 
 
-
 .globl nb_kernel030_ia32_3dnow
 .globl _nb_kernel030_ia32_3dnow
 nb_kernel030_ia32_3dnow:        
index be398544b72cefb5af35110774d4270145436748..1f5babc4ed0188aecb43976f7a9d6e212f3f805c 100644 (file)
@@ -17,8 +17,6 @@
 ##
 
 
-
-
 .globl nb_kernel101_ia32_3dnow
 .globl _nb_kernel101_ia32_3dnow
 nb_kernel101_ia32_3dnow:        
index 68ac635e070661f67dc5cbb415fe150f5c86ced5..d787c46fdbb25d830427f87f7800160085413dce 100644 (file)
@@ -17,7 +17,6 @@
 ##
 
 
-
 .globl nb_kernel112_ia32_3dnow
 .globl _nb_kernel112_ia32_3dnow
 nb_kernel112_ia32_3dnow:        
index 971844a9b002e61e49b04c60e9c170c3bb6e2bdb..29d08dacc2636437560fc5ea26bbced89f5ae7cc 100644 (file)
 #ifndef _NB_KERNEL_IA64_SINGLE_H_
 #define _NB_KERNEL_IA64_SINGLE_H_
 
-/*! \file  nb_kernel_ia64_double.h
- *  \brief ia64 double precision assembly nonbonded kernels.
+/*! \file  nb_kernel_ia64_single.h
+ *  \brief ia64 single precision assembly nonbonded kernels.
  *
  *  \internal
  */
 
 #include <stdio.h>
 
-#include <gmx_types.h>
-#include <gmx_neighborlist.h>
-#include <gmx_nonbonded.h>
-
-/* Include kernel headers in local directory.
- * We can only have one routine in each file due to a bug
- * in the intel assembler program...
- */
-#include "nb_kernel010_ia64_double.h"
-#include "nb_kernel010nf_ia64_double.h"
-#include "nb_kernel030_ia64_double.h"
-#include "nb_kernel030nf_ia64_double.h"
-#include "nb_kernel100_ia64_double.h"
-#include "nb_kernel100nf_ia64_double.h"
-#include "nb_kernel110_ia64_double.h"
-#include "nb_kernel110nf_ia64_double.h"
-#include "nb_kernel200_ia64_double.h"
-#include "nb_kernel200nf_ia64_double.h"
-#include "nb_kernel210_ia64_double.h"
-#include "nb_kernel210nf_ia64_double.h"
-#include "nb_kernel300_ia64_double.h"
-#include "nb_kernel300nf_ia64_double.h"
-#include "nb_kernel310_ia64_double.h"
-#include "nb_kernel310nf_ia64_double.h"
-#include "nb_kernel330_ia64_double.h"
-#include "nb_kernel330nf_ia64_double.h"
-#include "nb_kernel400_ia64_double.h"
-#include "nb_kernel400nf_ia64_double.h"
-#include "nb_kernel410_ia64_double.h"
-#include "nb_kernel410nf_ia64_double.h"
-#include "nb_kernel430_ia64_double.h"
-#include "nb_kernel430nf_ia64_double.h"
-
+#include "../nb_kerneltype.h"
 
+void
+nb_kernel_setup_ia64_single(FILE *log,nb_kernel_t **list);
 
 
 #endif
index 07763e9cb186f8e6a2aca92e4e8b3abbcb93cb17..33034bfb13c13ec8a3635b94ba506e205490279a 100644 (file)
@@ -54,7 +54,7 @@
 #include "names.h"
 #include "main.h"
 #include "xvgr.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "physics.h"
 #include "force.h"
 #include "bondf.h"
@@ -553,6 +553,7 @@ do_nonbonded14(int ftype,int nbonds,
     tab = fr->tab14.tab;
     rtab2 = sqr(fr->tab14.r);
     tabscale = fr->tab14.scale;
+
     krf = fr->k_rf;
     crf = fr->c_rf;
     
@@ -599,7 +600,7 @@ do_nonbonded14(int ftype,int nbonds,
         itype = iatoms[i++];
         ai    = iatoms[i++];
         aj    = iatoms[i++];
-        gid   = GID(md->cENER[ai],md->cENER[aj],ngrp);
+               gid   = GID(md->cENER[ai],md->cENER[aj],ngrp);
        
        switch (ftype) {
        case F_LJ14:
index 9b54ce84fbab1c013fca9258be06a8594b18257a..1cd08b561bbee28baecea4c28270f6a5fa4c0dcb 100644 (file)
@@ -45,7 +45,7 @@
 #include "random.h"
 #include "bondf.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "nrama.h"
 #include "rmpbc.h"
 
index 1907a9c3e6896f0cf76c4204b18b7e14cb08bd81..84922e9e071ffde97f5d90756fe1402c0ff67e28 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <string.h>
 #include "sysstuff.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "names.h"
 #include "macros.h"
 #include "nrnb.h"
index d8bdf70d708a70435932989fd12daff7b22516cf..200a9be22fd1341778e3984c04df2f0b0993cb94 100644 (file)
@@ -42,7 +42,7 @@
 #include <string.h>
 #include <ctype.h>
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "statutil.h"
 #include "readinp.h"
 #include "smalloc.h"
index 94f4ac5906e2b19008493be8ca5317a3b8d71764..041ee74db4d02dc60b87935fd6cba14343ac7098 100644 (file)
@@ -46,7 +46,7 @@
 #include "pbc.h"
 #include "smalloc.h"
 #include "txtdump.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 /*****************************************
  *     PERIODIC BOUNDARY CONDITIONS
index 1a4e4bd3d3b5d0fac8bfdfaf4236ee3fed83e45f..96938f4e186fe33875a06b5062bc24221918c2d2 100644 (file)
@@ -47,7 +47,6 @@
 #include "txtdump.h"
 #include "futil.h"
 #include "names.h"
-#include "fftgrid.h"
 #include "writeps.h"
 #include "macros.h"
 #include "xvgr.h"
index d8c2c638548bf8ea572f054487da5cb0ed8e674b..9450b84ba39189c17c8018b5ddf9b2c263e7067c 100644 (file)
@@ -44,7 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "main.h"
 
@@ -68,8 +68,8 @@ static void log_action(int bMal,char *what,char *file,int line,
   btot+=bytes;
     
   bytes/=1024;
-  if ((stdlog != NULL) && (bytes != 0))
-    fprintf(stdlog,"%30s:%6d kb (%7d kb) [%s, line %d, nelem %d, size %d]\n",
+  if (debug && (bytes != 0))
+    fprintf(debug,"%s:%d kb (%7d kb) [%s, line %d, nelem %d, size %d]\n",
            what ? what : NN,bytes,btot/1024,
            file ? file : NN,line,nelem,size);
 #ifdef GMX_THREAD_PTHREAD
index 9d2fb7b976d3d8ed07caddf78fe313487ed031b5..f1543852fc67943d570bd3eb984f98fcb07432ba 100644 (file)
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include "typedefs.h"
 #include "sysstuff.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "network.h"
 #include "txtdump.h"
 #include "names.h"
index fe2218a6e7e5d64be1b0a4bfdca4963838683789..067917ee0a2f6a22a22d073166bd89a53ff2cc34 100644 (file)
@@ -50,7 +50,7 @@
 #include "futil.h"
 #include "wman.h"
 #include "tpxio.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "network.h"
 #include "vec.h"
 
index 14bed18d6e8bb92cc9ab8596658a58832637cb84..5dff4b184e361834e72fbf9f9f5f2242781d6f09 100644 (file)
@@ -42,7 +42,7 @@
 #include "string2.h"
 #include "futil.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "strdb.h"
 
 bool get_a_line(FILE *fp,char line[],int n)
index 462254c7cd5cc23fe951ee4854cc7e51ff734761..fba0feeb1fbab5b37564216895be9806d336e347 100644 (file)
@@ -54,7 +54,7 @@
 
 #include "typedefs.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "string2.h"
 
index c0ea86f6725339416d36c2dad23d0f7200373cb4..3c83f85ecc64be6fec1bbc50ad43ed80ae21d852 100644 (file)
@@ -42,7 +42,7 @@
 #include "sysstuff.h"
 #include "string2.h"
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "txtdump.h"
 #include "symtab.h"
index e5658e939f8592f6878068bf0da5ff780e3c6aa6..e6d26c7d5c3b310eb050c3a52dca9c3bef97038d 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "typedefs.h"
 #include "statutil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 /* Globals for trajectory input */
 typedef struct {
index 0faec58af427ada64318320a7407c66e6df298fa..8896955ba4d83fc8aa6358223b281c5690e8267d 100644 (file)
@@ -1,4 +1,4 @@
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 void my_func(char *msg)
 {
index de657baa905eafd187bf9a648c60f7a457c742d5..2518bff2ef1fe1a3c19e7c85b0f963b9089e0c1c 100644 (file)
@@ -45,7 +45,7 @@
 #include "sysstuff.h"
 #include "smalloc.h"
 #include "string2.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "names.h"
 #include "symtab.h"
@@ -637,6 +637,11 @@ void do_iparams(t_functype ftype,t_iparams *iparams,bool bRead, int file_version
   case F_HARMONIC:
   case F_IDIHS:
     do_harm(iparams,bRead);
+    if ((ftype == F_ANGRES || ftype == F_ANGRESZ) && bRead) {
+      /* Correct incorrect storage of parameters */
+      iparams->pdihs.phiB = iparams->pdihs.phiA;
+      iparams->pdihs.cpB  = iparams->pdihs.cpA;
+    }
     break;
   case F_FENEBONDS:
     do_real(iparams->fene.bm);
index e2bb7fe3887ee6e9517bcec39d9b3280d86fd350..af2802124267f2df960ff82a92c037fa7d7d1502 100644 (file)
@@ -40,7 +40,7 @@
 #include <string.h>
 #include "sysstuff.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "txtdump.h"
 #include "names.h"
 #include "futil.h"
index 39d21419e0b08e31d9fb4055a2a52570fcbc2fc6..329465429b9fe6127abcfbdc830edc46c3aedf4a 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "widget.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 typedef struct {
   Widget   w,other,parent;
index f7f540b727746ffca527ee1b768be584722b7a66..154b5f31d70220e58a9d58e1765082c33bf0ce02 100644 (file)
@@ -472,11 +472,12 @@ static void write_ttyman(FILE *out,
     fprintf(out,"%s\n%s\n",GromacsVersion(),mydate(buf,255));
   }
   if (nldesc > 0) {
-    fprintf(out,"DESCRIPTION:\n\n");
+    fprintf(out,"DESCRIPTION\n-----------\n");
     print_tty_formatted(out,nldesc,desc,0);
   }
   if (nbug > 0) {
     fprintf(out,"\n");
+    fprintf(out,"KNOWN BUGS\n----------\n");
     for(i=0; i<nbug; i++) {
       snew(tmp,strlen(bugs[i])+3);
       strcpy(tmp,"* ");
index aa73e29bff5a3968b66f16ad071ccc86c34baa45..e6f6a7bf2458fbbbb094ff0e8199f06bbd787a46 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <stdio.h>
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "copyrite.h"
 #include "writeps.h"
 #include "smalloc.h"
index 0f9beac04408bea933223ab6ffb1538207ea796e..309489c6ac7c0ec46ad90b92abfcc11a73b05275 100644 (file)
@@ -42,7 +42,7 @@
 #ifdef HAVE_LIBXML2
 #include <libxml/parser.h>
 #include <libxml/tree.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string.h"
 #include "futil.h"
 #include "smalloc.h"
index e06815e8a3b1d0d6e74469c9d87371b87cd1b2f7..5e95e22f8da7d1e9908240b14596dc40070f148a 100644 (file)
@@ -45,7 +45,7 @@
 #include "smalloc.h"
 #include "vec.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #define XTC_MAGIC 1995
 
index fd134ae4eaf6090fdf959c9ebdd2fb7425fa9590..81467653403c5a83a9f77f894ff86dffd571f581 100644 (file)
@@ -44,7 +44,7 @@
 #include "vec.h"
 #include "smalloc.h"
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "topio.h"
 #include "toputil.h"
 #include "convparm.h"
index e53847a947d0def2ec43fd37d1716aff31f9a84a..7a5ba1bc0064fa4a4975d81b0d0eec0754f20cb2 100644 (file)
@@ -52,7 +52,7 @@
 #include "topexcl.h"
 #include "symtab.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pgutil.h"
 #include "resall.h"
 
index c77289fca34affddfb64bfce2d3896ad70fe32ea..d9f598e1f8d4d02d60b42c2def0be5e204405e98 100644 (file)
@@ -69,7 +69,7 @@
 #include "smalloc.h"
 #include "futil.h"
 #include "genalg.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "random.h"
 #include "txtdump.h"
 #include "vec.h"
index 1bfc19216d4b605ec0222fa13e89691a0ef91813..5d5fb29e7dbaba86d3b4aab0095378d864d0b886 100644 (file)
@@ -50,7 +50,7 @@
 #include "vec.h"
 #include "statutil.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "physics.h"
 #include "calch.h"
 #include "genhydro.h"
index 8c8c5e729f39911781f9d075c12aae8eed36ae1e..82df5515ca2dbd4cdb1e901a49cac6389eb6b114 100644 (file)
@@ -48,7 +48,7 @@
 #include "copyrite.h"
 #include "sysstuff.h"
 #include "txtdump.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "gmxfio.h"
 #include "trnio.h"
 #include "xtcio.h"
index 627ce423888cc6a0273ad1758b4d14689a01b55d..44c93da853250e01004c123c814813b1bc5b0b46 100644 (file)
@@ -47,7 +47,7 @@
 #include "copyrite.h"
 #include "sysstuff.h"
 #include "txtdump.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xtcio.h"
 #include "enxio.h"
 #include "smalloc.h"
index 8ffb36d93aa8f4076081cfd699e9ef1da28b2e8c..4b0e1d239b4b43caaa5fccc06c85994d347686fa 100644 (file)
@@ -64,7 +64,7 @@
 #include "splitter.h"
 #include "sortwater.h"
 #include "convparm.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "index.h"
 #include "gmxfio.h"
 #include "trnio.h"
@@ -138,28 +138,32 @@ static void check_eg_vs_cg(t_atoms *atoms,t_block *cgblock)
 
 static void check_pairs(int nrmols,t_molinfo mi[],int ntype,t_param *nb)
 {
-  int      i,j,jj,k,taiA,tajA,taiB,tajB,indA,indB,bLJ;
+  int      i,j,jj,k,ai,aj,taiA,tajA,taiB,tajB,bLJ;
   t_params *p;
   
   for(i=0; (i<nrmols); i++) {
     p = &(mi[i].plist[F_LJ14]);
     for(j=jj=0; (j<p->nr); j++) {
       /* Extract atom types and hence the index in the nbf matrix */
-      taiA = mi[i].atoms.atom[p->param[j].a[0]].type;
-      tajA = mi[i].atoms.atom[p->param[j].a[1]].type;
-      indA = ntype*taiA+tajA;
-      taiB = mi[i].atoms.atom[p->param[j].a[0]].typeB;
-      tajB = mi[i].atoms.atom[p->param[j].a[1]].typeB;
-      indB = ntype*taiB+tajB;
+      ai = p->param[j].a[0];
+      aj = p->param[j].a[1];
+      taiA = mi[i].atoms.atom[ai].type;
+      tajA = mi[i].atoms.atom[aj].type;
+      taiB = mi[i].atoms.atom[ai].typeB;
+      tajB = mi[i].atoms.atom[aj].typeB;
       
       bLJ  = FALSE;
       for(k=0; (k<MAXFORCEPARAM); k++)
-       bLJ = bLJ || ((nb[indA].c[k] != 0) || 
-                     (nb[indB].c[k] != 0));
+       bLJ = bLJ || (((nb[taiA].c[k]*nb[tajA].c[k]) != 0) || 
+                     ((nb[taiB].c[k]*nb[tajB].c[k]) != 0));
       if (bLJ) {
        cp_param(&(p->param[jj]),&(p->param[j]));
        jj++;
       }
+      else if (debug) {
+       fprintf(debug,"Removed 1-4 interaction between atoms %d and %d (within mol %s)\n",
+               ai+1,aj+1,*(mi[i].name));
+      }
     }
     fprintf(stderr,"Removed %d 1-4 interactions for molecule %s\n",
            p->nr-jj,*(mi[i].name));
index e5c525ed48d1c332584b3daf2dc3de94135bc0f1..8fea047fdcc34e14bed85eafe0fead2e0291380f 100644 (file)
@@ -67,6 +67,7 @@
 #include "pppm.h"
 #include "pme.h"
 #include "mdatoms.h"
+#include "rmpbc.h"
 #include "repl_ex.h"
 #include "qmmm.h"
 #include "mpelogging.h"
 #include <mpi.h>
 #endif
 
+#ifdef USE_MPE
+#include "mpe.h"
+#include "mpelogging.h"
+#endif
+
 /* The following two variables and the signal_handler function
  * is used from pme.c as well 
  */
@@ -335,6 +341,21 @@ void mdrunner(t_commrec *cr,int nfile,t_filenm fnm[],
    * energy message in do_pmeonly => receive_lrforces) */
   signal(SIGTERM,signal_handler);
   signal(SIGUSR1,signal_handler);
+   
+  /* Initiate PPPM if necessary */
+  if (fr->eeltype == eelPPPM)
+    init_pppm(stdlog,cr,nsb,FALSE,TRUE,state->box,getenv("GMXGHAT"),inputrec);
+  if ((fr->eeltype == eelPME) || (fr->eeltype == eelPMEUSER))
+    (void) init_pme(stdlog,cr,inputrec->nkx,inputrec->nky,inputrec->nkz,
+                   inputrec->pme_order,
+                   /*HOMENR(nsb),*/nsb->natoms,
+                   mdatoms->bChargePerturbed,
+                   inputrec->bOptFFT,inputrec->ewald_geometry);
+
+  /* Make molecules whole at start of run */
+  if (fr->ePBC != epbcNONE)  {
+    do_pbc_first(stdlog,state->box,fr,graph,state->x);
+  }
   
   /* Now do whatever the user wants us to do (how flexible...) */
   switch (inputrec->eI) {
@@ -492,6 +513,7 @@ time_t do_md(FILE *log,t_commrec *cr,int nfile,t_filenm fnm[],
   /* Initial values */
   init_md(cr,inputrec,&t,&t0,&state_global->lambda,&lam0,
          &mynrnb,top_global,
+
          nfile,fnm,&traj,&xtc_traj,&fp_ene,&fp_dgdl,&fp_field,&mdebin,grps,
          force_vir,shake_vir,mdatoms,mu_tot,&bNEMD,&bSimAnn,&vcm,nsb);
   debug_gmx();
@@ -621,7 +643,8 @@ time_t do_md(FILE *log,t_commrec *cr,int nfile,t_filenm fnm[],
       copy_rvec(state->v[ii],vcopy[ii]);
     }
     copy_mat(state->box,boxcopy);
-  } 
+  }  
+  
   /* Write start time and temperature */
   start_t=print_date_and_time(log,cr->nodeid,"Started mdrun");
   
@@ -757,7 +780,7 @@ time_t do_md(FILE *log,t_commrec *cr,int nfile,t_filenm fnm[],
       }
       copy_mat(boxcopy,state->box);
     }
-    
+
     if (bVsites) {
       if (graph) {
        /* Following is necessary because the graph may get out of sync
@@ -768,12 +791,10 @@ time_t do_md(FILE *log,t_commrec *cr,int nfile,t_filenm fnm[],
        shift_self(graph,state->box,state->x);
       }
       construct_vsites(log,state->x,&mynrnb,inputrec->delta_t,state->v,
-                       &top->idef,graph,cr,fr->ePBC,state->box,vsitecomm);
-      
+                      &top->idef,graph,cr,fr->ePBC,state->box,vsitecomm);
       if (graph)
        unshift_self(graph,state->box,state->x);
     }
-     
     debug_gmx();
     
     /* Set values for invmass etc. This routine not parallellized, but hardly
@@ -820,6 +841,7 @@ time_t do_md(FILE *log,t_commrec *cr,int nfile,t_filenm fnm[],
        * Check comments in sim_util.c
        */
       do_force(log,cr,inputrec,nsb,step,&mynrnb,top,grps,
+
               state->box,state->x,f,buf,mdatoms,ener,fcd,bVerbose && !PAR(cr),
               state->lambda,graph,
               TRUE,bNS,FALSE,TRUE,fr,mu_tot,FALSE,t,fp_field,edyn);
index 19ff37730f5ee1239e18334038a8580bdd5580f3..14254c79f07a4837f1c0dba89bd011d526b4a778 100644 (file)
@@ -42,6 +42,7 @@
 #include "copyrite.h"
 #include "main.h"
 #include "statutil.h"
+#include "smalloc.h"
 #include "futil.h"
 #include "smalloc.h"
 #include "edsam.h"
index 8130bd4807d912d399d9d70819fa07ab68c96c53..c87e4f6b8398da6a40a9825642637b370dd02c7d 100644 (file)
@@ -51,7 +51,6 @@
 #include "physics.h"
 #include "statutil.h"
 #include "tpxio.h"
-#include "fftgrid.h"
 #include "copyrite.h"
 
 const real tol = 1e-8;
index 848ee0235aa090f8a8592ef07f8c6c9e98609724..dfb4180a89bbca7d6112df63930d50500d997b83 100644 (file)
@@ -49,7 +49,7 @@
 #include "vec.h"
 #include "statutil.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pdbio.h"
 #include "toputil.h"
 #include "h_db.h"
index b0d0b6da791e3879e47b6794141dcef44ee5b2ff..d13041689359f8fc2b1bb0c531c34492f9348792 100644 (file)
@@ -46,7 +46,7 @@
 #include "macros.h"
 #include "symtab.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pdb2top.h"
 #include "topexcl.h"
 #include "topdirs.h"
index e25d3eade63202bd3a34059260eef24c87846c38..5e80566a2922528fb2eb0bc9afd700654d010b77 100644 (file)
@@ -45,7 +45,7 @@
 #include "typedefs.h"
 #include "physics.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "index.h"
 #include "symtab.h"
@@ -317,7 +317,7 @@ void check_ir(t_inputrec *ir, t_gromppopts *opts,int *nerror)
     sprintf(warn_buf,"Using L-BFGS with nbfgscorr<=0 just gets you steepest descent.");
     warning(NULL);
   }
-
+  
   /* FREE ENERGY */
   if (ir->efep != efepNO) {
     sprintf(err_buf,"The soft-core power is %d and can only be 1 or 2",
@@ -1298,7 +1298,7 @@ void do_index(char *ndx,
   ir->opts.ngener=atoms->grps[egcENER].nr;
   nuser=str_nelem(vcm,MAXPTR,ptr1);
   do_numbering(atoms,nuser,ptr1,grps,gnames,egcVCM,
-              restnm,FALSE,TRUE,bVerbose);
+              restnm,forward,FALSE,TRUE,bVerbose);
 
   /* Now we have filled the freeze struct, so we can calculate NRDF */ 
   calc_nrdf(atoms,idef,&(ir->opts),gnames,ir->nstcomm,ir->comm_mode);
index 36e5e5fe33c30a74866a834585ed8950b5ed01ef..65371f89ac86a6161f65ae36596e2f2ac26f7b41 100644 (file)
@@ -40,7 +40,7 @@
 #include <string.h>
 #include "typedefs.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "txtdump.h"
 #include "mdrun.h"
index baac0104a50ac7f4952e4e17bf6966b6324f19e1..de10939a306cf136cc6c5b0353dce34c06fa7d7d 100644 (file)
@@ -138,9 +138,17 @@ gmx_repl_ex_t *init_replica_exchange(FILE *fplog,
   if (re->bNPT) {
     fprintf(fplog,"\nRepl  p");
     for(i=0; i<re->nrepl; i++)
+    {
       fprintf(fplog," %5.2f",re->pres[re->ind[i]]);
-    if ((i > 0) && (re->pres[re->ind[i]] < re->pres[re->ind[i-1]]))
-      gmx_fatal(FARGS,"The reference pressure decreases with increasing temperature");
+    }
+
+    for(i=0; i<re->nrepl; i++)
+    {
+      if ((i > 0) && (re->pres[re->ind[i]] < re->pres[re->ind[i-1]]))
+      {
+        gmx_fatal(FARGS,"The reference pressure decreases with increasing temperature");
+      }
+    }
   }
   fprintf(fplog,"\nRepl  ");
   
index ebc41c6f1fbcff8f372adbfa03be2011bded7042..37f837c1eb60bf7675c8314c9e022e29b41e05a8 100644 (file)
@@ -43,7 +43,7 @@
 #include "strdb.h"
 #include "futil.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "symtab.h"
 #include "macros.h"
 #include "resall.h"
index 2a7748b0510f994a0605b9fa39c7540b63f69633..7ed1d8bd340b3ae10d9b78f41c58295898ba108e 100644 (file)
@@ -49,7 +49,7 @@
 #include "vec.h"
 #include "statutil.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pdbio.h"
 #include "toputil.h"
 #include "h_db.h"
index ff56debfbc60952648305ef6e80086b1188433e4..ff813c4ad800646505251bd56183434a9bb7acb0 100644 (file)
@@ -46,7 +46,7 @@
 #include "h_db.h"
 #include "string2.h"
 #include "strdb.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "ter_db.h"
 #include "toputil.h"
 
index 016f47fd3f4c02ef1b40e83eed44ecb49ba39b50..4e7299f400cfa2cc24ac9e1009667add70de7c64 100644 (file)
@@ -46,7 +46,7 @@
 #include "grompp.h"
 #include "futil.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 typedef struct {
   char *ai,*aj;
index 4e5ee46ffc47acfb76e6b96d241395415a27f227..0cce99e6c26cb1d90ff374018b069608059a8f7d 100644 (file)
@@ -54,7 +54,7 @@
 #include "names.h"
 #include "string2.h"
 #include "symtab.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vsite_parm.h"
 
 #include "toputil.h"
index b3505e8f6b987a07ab81bb1f761ec45db7894ed4..f43fe0870dd63f532e412bd81aacd0f01c970779 100644 (file)
@@ -70,6 +70,8 @@ extern char **do_top(bool         bVerbose,
                     int          *nsim,
                     t_simsystem  **sims);
 
-extern void generate_qmexcl(t_topology *sys,t_inputrec *ir);
+
+void 
+generate_qmexcl(t_topology *sys,t_inputrec *ir);
 
 #endif /* _topio_h */
index 597c4086f09a652d1b69a70207dfb636bc420eb7..741f743d77773d62ecfc4dba97629737ca57112f 100644 (file)
@@ -49,7 +49,7 @@
 #include "toppush.h"
 #include "topdirs.h"
 #include "symtab.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 
 void generate_nbparams(int comb,int ftype,t_params *plist,t_atomtype *atype)
index 60453ed8fab2eee443e3e4455e79c776bde92365..ead60b6fc17b24b267f15e7c161e28d44ed543b8 100644 (file)
@@ -46,7 +46,7 @@
 #include "topdirs.h"
 #include "toputil.h"
 #include "symtab.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include <math.h>
 
 /* UTILITIES */
@@ -127,15 +127,15 @@ void pr_alloc (int extra, t_params *pr)
 
 void init_atomtype (t_atomtype *at)
 {
-  at->nr   = 0;
-  at->atom     = NULL;
-  at->atomname = NULL;
-  at->nb       = NULL;
+  at->nr           = 0;
+  at->atom         = NULL;
+  at->atomname     = NULL;
+  at->nb           = NULL;
   at->bondatomtype = NULL;
-  at->radius   = NULL;
-  at->vol      = NULL;
-  at->surftens = NULL;
-  
+  at->radius       = NULL;
+  at->vol          = NULL;
+  at->surftens     = NULL;
+  at->atomnumber   = NULL;
 }
 
 void init_bond_atomtype (t_bond_atomtype *bat)
index 3b74dcc0c5b596109a01cc3e1d955e2d0be8cb5e..777f68700c2a0d6c89cd9f9456a01a04c984a79c 100644 (file)
@@ -48,7 +48,7 @@
 #include "statutil.h"
 #include "sysstuff.h"
 #include "txtdump.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "names.h"
 #include "tpxio.h"
 #include "enxio.h"
@@ -270,6 +270,7 @@ static void cmp_atoms(FILE *fp,t_atoms *a1,t_atoms *a2,real ftol)
   int i;
   
   fprintf(fp,"comparing atoms\n");
+
   if (a2) {
     cmp_int(fp,"atoms->nr",-1,a1->nr,a2->nr);
     for(i=0; (i<a1->nr); i++)
index a7a34b40c1af90945925507655e0755948b85104..1a3a39b02dffb511a6c8293bd69a726bb5189511 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <math.h>
 #include "index.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string2.h"
 #include "sysstuff.h"
 #include "smalloc.h"
index fb8d48688fd01b4242e3598b2b6736dcfc1d9117..9d211cd00ffe6fb48b4b9988c0dd8bb498a9e46c 100644 (file)
@@ -49,7 +49,7 @@
 #include "physics.h"
 #include "index.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string2.h"
 #include "physics.h"
 
index aceda107cbf8b00d53a42fa48ce33c1685d56829..fd6194f8e3e6c23632be4d99740accf3e3bd2493 100644 (file)
@@ -18,7 +18,7 @@ libmd@LIBSUFFIX@_la_SOURCES = \
        force.c         ghat.c          init.c          \
        mdatom.c        mdebin.c        minimize.c      \
        ns.c            nsb.c           nsgrid.c        \
-       pme.c           pppm.c          \
+       pme.c           pppm.c          fftgrid.c       \
        pull.c          pullinit.c      \
        pullio.c        pullutil.c      \
        rf_util.c       shakef.c        sim_util.c      \
index b057540f5d441bbecbe91919a80ab41d8f5c60e5..4890cb431489007aacf39c435242f0ff5983f3f4 100644 (file)
@@ -43,7 +43,7 @@
 #include "typedefs.h"
 #include "network.h"
 #include "vec.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "physics.h"
 #include "nsb.h"
 #include "main.h"
index e118547ce6ba81b46db34b932321b5bab1dbac77..4b397865792a6d3668f49d6db1d7c18d239a01e5 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "physics.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "txtdump.h"
 #include "nrnb.h"
 
index 5e57b6826e7de460163cc1431a2bfbc23cc5e504..d85c6c7341ce288b4650ac6b75d171c19acc7a96 100644 (file)
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include "vec.h"
 #include "constr.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #ifdef DEBUG
 static void check_cons(FILE *fp,char *title,real x[],int OW1,int HW2,int HW3)
index 3627d48cec0e11bf07c9e730359046160e37c813..5459f384efda3140af1ff9ba29150c0210670cda 100644 (file)
@@ -43,7 +43,7 @@
 #include "sysstuff.h"
 #include "smalloc.h"
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string2.h"
 #include "ebin.h"
 #include "main.h"
index fef307b4180b5ca36a3050b2292fc0a268ec08b0..cc9534c6c0e3177708f59b4bd395f97afe79c742 100644 (file)
@@ -45,7 +45,7 @@
 #include "smalloc.h"
 #include "futil.h"
 #include "fftgrid.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "physics.h"
 #include "coulomb.h"
 
index 6917e6386b44c432414e10f70a7789dd96ab19fa..2216d85661dfc07f8360af4e7c35dde97122518c 100644 (file)
@@ -125,6 +125,7 @@ t_fftgrid *mk_fftgrid(FILE *       fp,
   if (cr && PAR(cr)) 
   {
 #ifdef GMX_MPI
+<<<<<<< fftgrid.c
       gmx_parallel_3dfft_init(&grid->mpi_fft_setup,nx,ny,nz,
                              cr->mpi_comm_mysim);
           
@@ -133,6 +134,15 @@ t_fftgrid *mk_fftgrid(FILE *       fp,
                                 &(grid->pfft.local_nx),
                                 &(grid->pfft.local_y_start_after_transpose),
                                 &(grid->pfft.local_ny_after_transpose));
+=======
+      gmx_parallel_3dfft_init(&grid->mpi_fft_setup,nx,ny,nz,MPI_COMM_WORLD);
+          
+      gmx_parallel_3dfft_limits(grid->mpi_fft_setup,
+                                &(grid->pfft.local_x_start),                                
+                                &(grid->pfft.local_nx),
+                                &(grid->pfft.local_y_start_after_transpose),
+                                &(grid->pfft.local_ny_after_transpose));
+>>>>>>> 1.18.2.1
 #else
     gmx_fatal(FARGS,"Parallel FFT supported with MPI only!");
 #endif
index 37960ea9c4e3a7fd9bee6467efafeefcb44709b5..c53bf98a10d7dec886b90b3523d824b68c2a0fc6 100644 (file)
@@ -1109,8 +1109,7 @@ void init_forcerec(FILE *fp,
    * optimized solvent
    */
 
-  check_solvent(fp,top,fr,&top->atoms,nsb);
-
+  check_solvent(fp,top,fr,mdatoms,nsb);
   
   if (getenv("GMX_NO_SOLV_OPT")) {
     if (fp)
index 9f90e6c421c9b47201c79944c04fdc355ba86097..d674556ee460cecb81ddca186386f45db4d5cc18 100644 (file)
 #include "futil.h"
 #include "vec.h"
 #include "physics.h"
+<<<<<<< ghat.c
 #include "coulomb.h"
-#include "fftgrid.h"
+=======
+#include "shift_util.h"
 #include "xvgr.h"
+>>>>>>> 1.8.4.2
+#include "fftgrid.h"
 
 static void calc_k(rvec lll,int ix,int iy,int iz,int nx,int ny,int nz,rvec k)
 {
index 7f5e3f833499f416116b7e25449c5a4d0e961d06..f6518e36eee199e4431075672444dc22691cd9f9 100644 (file)
@@ -44,7 +44,7 @@
 #include "vec.h"
 #include "main.h"
 #include "mvdata.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "symtab.h"
 #include "txtdump.h"
 #include "splittop.h"
index ed34679feb4108607b385d2d3d78bb4ce10c17aa..dd9097d9c47f02842d7bbc01cb07808cd1253cad 100644 (file)
@@ -54,7 +54,7 @@
 #include "macros.h"
 #include "random.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "txtdump.h"
 #include "typedefs.h"
 #include "update.h"
index 6fb7a6861b14d0afd7d6f6164c9c9a503737456a..e3c2e53249daac9bb89b4f1bc4b5dafe756ff279 100644 (file)
@@ -55,7 +55,7 @@
 #include "ns.h"
 #include "pbc.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "nrnb.h"
 #include "txtdump.h"
 
index de062220b99c286d4210cd6a27955779cfc02f87..1dd7eaa4759ec9a322b249bf9802d5431ddd1b0d 100644 (file)
@@ -43,7 +43,7 @@
 #include "macros.h"
 #include "smalloc.h"
 #include "nsgrid.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "network.h"
 
index eea0ef1f90d0368adc37cb4dca572e597840ffd5..763245b3337b955696e37c02efcc279fa5125f38 100644 (file)
@@ -72,7 +72,7 @@
 #include "futil.h"
 #include "coulomb.h"
 #include "fftgrid.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "pme.h"
 #include "network.h"
 #include "physics.h"
index 481b9348919bb621192284983fee14f4c69e015a..406ed04a4d477f2d6540e5fd99d7bd7468563f55 100644 (file)
 #include "smalloc.h"
 #include "vec.h"
 #include "xvgr.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "txtdump.h"
 #include "network.h"
 #include "nrnb.h"
 #include "pppm.h"
 #include "coulomb.h"
 #include "mdrun.h"
-#include "fftgrid.h"
+#include "gmx_fft.h"
 #include "pme.h"
 
+#ifdef GMX_MPI
+#include "gmx_parallel_3dfft.h"
+#endif
+
 #define llim  (-1)
 #define ulim   (1)
 #define llim2 (-3)
index d56f5068caa6a46f3347d51f90475bd1baeeddc9..1b2b3cd4917251c105d7e3e7b0fa16522c8bf046 100644 (file)
@@ -49,7 +49,7 @@
 #include "smalloc.h"
 #include "typedefs.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "rdgroup.h"
 #include "symtab.h"
index 50c86e5ae944c343cc05d011932a176c94364edb..498bbd32cbb82d71fbfb38754bb11148afc22c4c 100644 (file)
@@ -47,7 +47,7 @@
 #include "smalloc.h"
 #include "typedefs.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "rdgroup.h"
 #include "symtab.h"
index 4998f0fea1554f3dfb609937c4ef4687e4c79141..bb17477f5d59d4f4a7b57bdd95677d37cefca437 100644 (file)
@@ -47,7 +47,7 @@
 #include "smalloc.h"
 #include "typedefs.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "rdgroup.h"
 #include "symtab.h"
index 5c502b7ead526c014aa243c3f8be41760918f348..98f6f38c3d564d9423e8a067c2e817d48b3b0ce1 100644 (file)
@@ -64,7 +64,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index 005f37d22f7a0739fbfc048d5d88bf1b92671ec3..4bc57c77ff12f40916f099a24b95daa1565a415b 100644 (file)
@@ -63,7 +63,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
@@ -452,25 +452,37 @@ void write_gaussian_input(int step ,t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
   }
   fprintf(out,"%s%s%s",
          "%subst l9999 ",qm->devel_dir,"/l9999\n");
-  fprintf(out,"%s",
-         "#P "); 
-  fprintf(out," %s", 
-         eQMmethod_names[qm->QMmethod]);
-  if(qm->QMmethod>=eQMmethodRHF){
-    fprintf(out,"/%s",
-           eQMbasis_names[qm->QMbasis]);
-    if(qm->QMmethod==eQMmethodCASSCF){
-      /* in case of cas, how many electrons and orbitals do we need?
-       */
-      fprintf(out,"(%d,%d)",
-             qm->CASelectrons,qm->CASorbitals);
+  if(step){
+    fprintf(out,"%s",
+           "#T ");
+  }else{
+    fprintf(out,"%s",
+           "#P ");
+  }
+  if(qm->QMmethod==eQMmethodB3LYPLAN){
+    fprintf(out," %s", 
+           "B3LYP/GEN Pseudo=Read");
+  }
+  else{
+    fprintf(out," %s", 
+           eQMmethod_names[qm->QMmethod]);
+    
+    if(qm->QMmethod>=eQMmethodRHF){
+      fprintf(out,"/%s",
+             eQMbasis_names[qm->QMbasis]);
+      if(qm->QMmethod==eQMmethodCASSCF){
+       /* in case of cas, how many electrons and orbitals do we need?
+        */
+       fprintf(out,"(%d,%d)",
+               qm->CASelectrons,qm->CASorbitals);
+      }
     }
   }
   if(QMMMrec->QMMMscheme==eQMMMschemenormal){
     fprintf(out," %s",
            "Charge ");
   }
-  if (step || qm->QMmethod>=eQMmethodCASSCF){
+  if (step || qm->QMmethod==eQMmethodCASSCF){
     /* fetch guess from checkpoint file, always for CASSCF */
     fprintf(out,"%s"," guess=read");
   }
@@ -503,6 +515,34 @@ void write_gaussian_input(int step ,t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
            qm->xQM[i][ZZ]/BORH2NM);
 #endif
   }
+
+  /* Pseudo Potential and ECP are included here if selected (MEthod suffix LAN) */
+  if(qm->QMmethod==eQMmethodB3LYPLAN){
+    fprintf(out,"\n");
+    for(i=0;i<qm->nrQMatoms;i++){
+      if(qm->atomicnumberQM[i]<21){
+       fprintf(out,"%d ",i+1);
+      }
+    }
+    fprintf(out,"\n%s\n****\n",eQMbasis_names[qm->QMbasis]);
+    
+    for(i=0;i<qm->nrQMatoms;i++){
+      if(qm->atomicnumberQM[i]>21){
+       fprintf(out,"%d ",i+1);
+      }
+    }
+    fprintf(out,"\n%s\n****\n\n","lanl2dz");    
+    
+    for(i=0;i<qm->nrQMatoms;i++){
+      if(qm->atomicnumberQM[i]>21){
+       fprintf(out,"%d ",i+1);
+      }
+    }
+    fprintf(out,"\n%s\n","lanl2dz");    
+  }    
+  
+    
+  
   /* MM point charge data */
   if(QMMMrec->QMMMscheme!=eQMMMschemeoniom && mm->nrMMatoms){
     fprintf(stderr,"nr mm atoms in gaussian.c = %d\n",mm->nrMMatoms);
@@ -518,7 +558,6 @@ void write_gaussian_input(int step ,t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
          fprintf(out,"%d F\n",i+1); /* counting from 1 */
        }
       }
-      fprintf(out,"\n");
       /* MM point charges include LJ parameters in case of QM optimization
        */
       for(i=0;i<mm->nrMMatoms;i++){
@@ -559,6 +598,8 @@ void write_gaussian_input(int step ,t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
     }
   }
   fprintf(out,"\n");
+  
+
   fclose(out);
 
 }  /* write_gaussian_input */
index 086cfff82962540461a08e0f73057a17c76603d2..5a2460a67660050814539de26e84c6fd26b9d979 100644 (file)
@@ -63,7 +63,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
index 26bb684fa7486d7cfe75bff5add6df2f0bd2cf5f..1809dd851e82a915d0166db2ea8881fe7c31a31d 100644 (file)
@@ -63,7 +63,7 @@
 #include "qmmm.h"
 #include <stdio.h>
 #include <string.h>
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "typedefs.h"
 #include <stdlib.h>
 
@@ -453,6 +453,11 @@ void init_QMMMrec(t_commrec *cr,
   c12au = (HARTREE2KJ*AVOGADRO*pow(BORH2NM,12)); 
   fprintf(stderr,"there we go!\n");
 
+  /* fill the nucnum array in the t_mdatoms struct: */
+  for(i=0;i<md->nr;i++){
+    md->atomnumber[i] = top->atomtypes.atomnumber[md->typeA[i]];
+  }
+
   /* Make a local copy of the QMMMrec */
   qr = fr->qr;
 
index dbb628426e149b5c411320ae8513d040eb4d29cb..d271bc2783da440bcfb3758b5a023aae818c8224 100644 (file)
@@ -65,6 +65,7 @@
 #include "calcmu.h"
 #include "constr.h"
 #include "xvgr.h"
+
 #include "mpelogging.h"
 #include "domdec.h"
 
@@ -73,6 +74,7 @@
 #endif
 #include "qmmm.h"
 
+
 #define difftime(end,start) ((double)(end)-(double)(start))
 
 void print_time(FILE *out,time_t start,int step,t_inputrec *ir)
index 1fb409167da6e9dbbe12f161f1a796133dc1a3e2..f95862f8b516f6e02e22c53eee10f672ffd8c030 100644 (file)
@@ -42,7 +42,7 @@
 #include "typedefs.h"
 #include "splittop.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "main.h"
 #include "vsite.h"
 
index 6ce8e2147bcaf2791e30cee0ad49673912b4e448..c4f1a30d945b1943c72a6cd97a8e7b4ec05301cd 100644 (file)
@@ -41,7 +41,7 @@
 #include "typedefs.h"
 #include "names.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "xvgr.h"
 #include "vec.h"
index 9a66961f710c0113bd4d3f573266bfeb2a501624..281640dfbf1680b67be3076e694e451bff2e3501 100644 (file)
 #include "xvgr.h"
 #include "complex.h"
 #include "copyrite.h"
-#include "fftgrid.h"
+#include "gmx_fft.h"
 #include "mdrun.h"
 #include "main.h"
 #include "statutil.h"
 
+#ifdef GMX_MPI
+#include "gmx_parallel_3dfft.h"
+#endif
+
+
 int main(int argc,char *argv[])
 {
   int       mmm[] = { 8, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, 40,
index 7d26563f0f47323338d4d312339dac7d8e43f75f..e915a289b5a63ea7e4df35a4cc6a76b33d873703 100644 (file)
@@ -857,6 +857,7 @@ void update(int          natoms,  /* number of atoms in simulation */
     
     /* We must always unshift here, also if we did not shake
      * x was shifted in do_force */
+
     if ((inputrec->ePBC == epbcXYZ) && (graph->nnodes > 0)) {
       unshift_x(graph,state->box,state->x,xprime);
       if (TRICLINIC(state->box))
index eaa6f7c03b037907b83dd808117341c68c1ee7cb..671a39062c607f6f58207bf6c8a4836c7392f385 100644 (file)
@@ -45,7 +45,7 @@
 #include "smalloc.h"
 #include "wnblist.h"
 #include "nrnb.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "macros.h"
 #include "futil.h"
 #include "names.h"
index 92a8a3ee3f452297c5b4232983dcc7eab2e4493a..84d95afce4d142b75600dc8c27ee9bc14ed8e6d5 100644 (file)
@@ -49,7 +49,7 @@
 #include "nmol.h"
 #include "manager.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #define MBFLAGS /* MB_APPLMODAL | */ MB_DONTSHOW
 
index 002febab080e5a61b6bd901a862dfc1386b12721..77aa052d768561b30dd6870e39a99b85a5b0e8c1 100644 (file)
@@ -45,7 +45,7 @@
 #include "xutil.h"
 #include "copyrite.h"
 #include "statutil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 /* Units are meter and second  */
 
index fdbe0f4794b15da55c9c42e7174b6a497f3c2414..30c63771e5d6d4410c2ed78937b1bbe9d6a2506a 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "xutil.h"
 #include "3dview.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "buttons.h"
 #include "manager.h"
 #include "nmol.h"
index 1a2ac105b68695d8d2f1cb0d5afe571c2bdf2841..540405999a81d2bc23f1064c6128c72a54fe3913 100644 (file)
@@ -43,7 +43,7 @@
 #include "sysstuff.h"
 #include "macros.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "typedefs.h"
 #include "string2.h"
 #include "statutil.h"
index 923b9bd827fa654f2202caa791fc0598e9346091..4dea6bbc6ac0f172c5fed38edc7f0f815af2a130 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "xutil.h"
 #include "3dview.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "buttons.h"
 #include "manager.h"
 #include "nmol.h"
index b496a12f064e1ce1548002a06d9ca07961daa763..439b4b1075f2a9c700036f76159bff457e5cb69b 100644 (file)
@@ -47,7 +47,7 @@
 #include "xutil.h"
 #include "xdlg.h"
 #include "xmb.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 /*****************************
  *
  * Helpful routines
index b0cfbd489e55a2f113269a48f5878ae156b7b48a..7b365bf308a533b3304f594acf18fe92d997e9a0 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <string.h>
 
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string2.h"
 #include "sysstuff.h"
 #include "smalloc.h"
index 4fc0b775f91647967006e49d9add4299608f9879..2266787b5c9286690a67214eb214102afb33ab74 100644 (file)
@@ -42,7 +42,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "string2.h"
 #include "smalloc.h"
 #include "macros.h"
index bc9c369bdc2a1a64172264c1588d47b6139b999f..b0b1bcec60452d682a9c4c9e2879d4e9b43c309b 100644 (file)
@@ -47,7 +47,7 @@
 #include "x11.h"
 #include "xdlg.h"
 #include "xmb.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "gromacs.bm"
 #include "stop.bm"
 #include "info.bm"
index e3548f34a03a8aad40fb3cb8ea2079576ce7b998..0cc29f83f84b03b54447df45b41088882c8cde11 100644 (file)
@@ -40,7 +40,7 @@
 #include "confio.h"
 #include "copyrite.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "string2.h"
 #include "vec.h"
index ac01cbb36943b41569002a1fd3a6ccd0b633953f..2f4904cd00fc49635a3aa38188716cd873eb6d9c 100644 (file)
@@ -47,7 +47,7 @@
 #include "futil.h"
 #include "gstat.h"
 #include "names.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "string2.h"
 #include "correl.h"
index 7dbdc034204d84ceab66e87e7af742ac58ee1cab..5265339b771dbbf379bb46b2ce5108ecf069108b 100644 (file)
@@ -46,7 +46,7 @@
 #include "force.h"
 #include "main.h"
 #include "filenm.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "mdrun.h"
 #include "ns.h"
 #include "txtdump.h"
index 882f769d936a4472b21f8f3c3668f0796ef85068..7f7938d690af62c99fc54ded3bca9197c2e3dd2f 100644 (file)
@@ -47,7 +47,7 @@
 #include "statutil.h"
 #include "copyrite.h"
 #include "pdbio.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "matio.h"
 #include "index.h"
index c0d9aa67d7a80df4335d0fd1672d939163716496..3eae597a56245750a1be8a3248fbe97fa2b74f45 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "smalloc.h"
 #include "string2.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "symtab.h"
 
 void replace_atom(t_topology *top,int inr,char *anm,char *resnm,
index b0e08e752377af75c4fbcdeda618614117b69b29..60313e04e661b6e60e475e951392e5a96b7503c4 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "types/simple.h"
 #include "smalloc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 #include "sparsematrix.h"
 #include "eigensolver.h"
similarity index 62%
rename from src/gmxlib/xdrd.c
rename to src/tools/g_kinetics.c
index ccffe615b53b1f55307f8a4ab31d87eebd87890b..891152ad55089f21247b5caead3c659ad0855a42 100644 (file)
  * For more info, check our website at http://www.gromacs.org
  * 
  * And Hey:
- * GROningen Mixture of Alchemy and Childrens' Stories
+ * Green Red Orange Magenta Azure Cyan Skyblue
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include "typedefs.h"
-#include "xdrf.h"
-#include "fatal.h"
-#include "smalloc.h"
+#include <gmx_ana.h>
 
-int xdr_real(XDR *xdrs,real *r)
-{
-#ifdef GMX_DOUBLE
-  float f;
-  int   ret;
-  
-  f=*r;
-  ret=xdr_float(xdrs,&f);
-  *r=f;
-
-  return ret;
-#else
-  return xdr_float(xdrs,(float *)r);
-#endif
-}
 
-int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision)
+/* This is just a wrapper binary.
+* The code that used to be in g_kinetics.c is now in gmx_kinetics.c,
+* where the old main function is called gmx_kinetics().
+*/
+int
+main(int argc, char *argv[])
 {
-#ifdef GMX_DOUBLE
-  float *ffp;
-  float  fprec;
-  int    i,ret,isize;
-  
-  isize=*size*DIM;
-  if (isize <= 0)
-    gmx_fatal(FARGS,"Don't know what to malloc for ffp, isize = %d",isize);
-
-  snew(ffp,isize);
-
-  for(i=0; (i<isize); i++)
-    ffp[i]=fp[i];
-  fprec=*precision;
-  ret=xdr3dfcoord(xdrs,ffp,size,&fprec);
-  
-  *precision=fprec;
-  for(i=0; (i<isize); i++)
-    fp[i]=ffp[i];
-
-  sfree(ffp);
-  return ret;
-#else
-  return xdr3dfcoord(xdrs,(float *)fp,size,(float *)precision);
-#endif
+  gmx_kinetics(argc,argv);
+  return 0;
 }
 
 
-
-
-
-
-
+  
index 3c001a212e9d051cb3fe8b526639b5b96da90b6c..2ab15f5af0bb356b2a6144a4a40b9a675691882d 100644 (file)
@@ -43,7 +43,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "pbc.h"
 #include "copyrite.h"
index c16d2d99708ca39f51153c4a1c1154f639d8ca88..5cc30149d0ba5782e212827643330d0b92891d19 100644 (file)
@@ -43,7 +43,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "copyrite.h"
 #include "futil.h"
index 4634ce3df6fc11e0e13d67c811876033a50ee794..eede302b8716305fff84224f23ac2f0667b7af5d 100644 (file)
@@ -49,7 +49,7 @@
 #include "vec.h"
 #include "index.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "gstat.h"
 #include "trnio.h"
index b31fc27a1ad754fae037c5501a5eaaf3092036c6..9444485124079c99b257e99260369b9a9c9fcfbc 100644 (file)
@@ -46,7 +46,7 @@
 #include "pbc.h"
 #include "xvgr.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "statutil.h"
 #include "index.h"
index 3efa5d2202587879163a4a950de0e1b5d6e8b69d..fd1551bc2ad30d08d1fa3731466ab6e8af235af9 100644 (file)
@@ -42,7 +42,7 @@
 #include "confio.h"
 #include "pdbio.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "gstat.h"
 #include "macros.h"
@@ -1082,7 +1082,7 @@ int gmx_chi(int argc,char *argv[])
   bool       bChi,bCorr,bSSHisto;
   bool       bDo_rt, bDo_oh, bDo_ot, bDo_jc ; 
   real       dt=0, traj_t_ns;
-
+  
   atom_id    isize,*index;
   int        ndih,nactdih,nf;
   real       **dih,*trans_frac,*aver_angle,*time;
index ea5fe242c615a961923fd99bd60af51b995796f7..65a294da288df8f2c253301d72173c2cd3f52c13 100644 (file)
@@ -50,7 +50,7 @@
 #include "vec.h"
 #include "index.h"
 #include "pbc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "confio.h"
 #include "pdbio.h"
index cc8a6f6c1c56da152fff05be852643901054e70f..f485f9ecddaf89745865334baebe2289fbead191 100644 (file)
@@ -400,8 +400,8 @@ int gmx_density(int argc,char *argv[])
   static bool bCount=FALSE;      /* just count                 */
   static int  axis = 2;          /* normal to memb. default z  */
   static char *axtitle="Z"; 
-  static int  nslices = 10;      /* nr of slices defined       */
-  static int  ngrps = 0;         /* nr. of groups              */
+  static int  nslices = 50;      /* nr of slices defined       */
+  static int  ngrps   = 1;       /* nr. of groups              */
   static bool bSymmetrize=FALSE;
   static bool bCenter=FALSE;
   t_pargs pa[] = {
index e6aa3f3b4e76d39bc4930960c0af71f91823f16f..634cde812a226d97a5d6221b4a2c56805f8826af 100644 (file)
@@ -48,7 +48,7 @@
 #include "vec.h"
 #include "index.h"
 #include "pbc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "gstat.h"
 #include "pbc.h"
@@ -168,10 +168,10 @@ int gmx_dist(int argc,char *argv[])
     
     if (!bCutoff) {
       /* write to output */
-      fprintf(fp,"%8.3f ",t);
+      fprintf(fp,"%12.7f ",t);
       for(g=0;(g<ngrps/2);g++) {
        pbc_dx(&pbc,com[2*g],com[2*g+1],dx);
-       fprintf(fp,"%10.5f %10.5f %10.5f %10.5f",
+       fprintf(fp,"%12.7f %12.7f %12.7f %12.7f",
                norm(dx),dx[XX],dx[YY],dx[ZZ]);
       }
       fprintf(fp,"\n");
index 167bc472c1b654dc1de5454051c3f2b478c93ccc..d60f082fac6d343707e703ce06631bc73e6c8432 100644 (file)
@@ -43,7 +43,7 @@
 #include "copyrite.h"
 #include "index.h"
 #include "confio.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "physics.h"
 #include "random.h"
index fa744dbab9b05825d529c3aa9dac3fdfcd9f0936..2b4d420f2a4f60dadd4326bf5cb6ba95b3afef1d 100644 (file)
@@ -376,9 +376,10 @@ int gmx_editconf(int argc, char *argv[])
     "[TT]-angles[tt]. Both [TT]-box[tt] and [TT]-d[tt]",
     "will center the system in the box.",
     "[PAR]",
-    "Option [TT]-bt[tt] determines the box type: [TT]tric[tt] is a",
-    "triclinic box, [TT]cubic[tt] is a cubic box, [TT]dodecahedron[tt] is",
-    "a rhombic dodecahedron and [TT]octahedron[tt] is a truncated octahedron.",
+    "Option [TT]-bt[tt] determines the box type: [TT]triclinic[tt] is a",
+    "triclinic box, [TT]cubic[tt] is a rectangular box with all sides equal", 
+    "[TT]dodecahedron[tt] represents a rhombic dodecahedron and "
+    "[TT]octahedron[tt] is a truncated octahedron.",
     "The last two are special cases of a triclinic box.",
     "The length of the three box vectors of the truncated octahedron is the",
     "shortest distance between two opposite hexagons.",
@@ -387,10 +388,12 @@ int gmx_editconf(int argc, char *argv[])
     "[PAR]",
     "Option [TT]-box[tt] requires only",
     "one value for a cubic box, dodecahedron and a truncated octahedron.",
-    "With [TT]-d[tt] and [TT]tric[tt] the size of the system in the x, y",
+    "[PAR]",
+    "With [TT]-d[tt] and a [TT]triclinic[tt] box the size of the system in the x, y",
     "and z directions is used. With [TT]-d[tt] and [TT]cubic[tt],",
-    "[TT]dodecahedron[tt] or [TT]octahedron[tt] the diameter of the system",
-    "is used, which is the largest distance between two atoms.",
+    "[TT]dodecahedron[tt] or [TT]octahedron[tt] boxes, the dimensions are set",
+    "to the diameter of the system (largest distance between atoms) plus twice",
+    "the specified distance.",
     "[PAR]",
     "Option [TT]-angles[tt] is only meaningful with option [TT]-box[tt] and",
     "a triclinic box and can not be used with option [TT]-d[tt].",
@@ -454,7 +457,7 @@ int gmx_editconf(int argc, char *argv[])
   static rvec scale={1,1,1},newbox={0,0,0},newang={90,90,90};
   static real rho=1000.0,rvdw=0.12;
   static rvec center={0,0,0},translation={0,0,0},rotangles={0,0,0};
-  static char *btype[]={ NULL, "tric", "cubic", "dodecahedron", "octahedron", NULL },*label="A";
+  static char *btype[]={ NULL, "triclinic", "cubic", "dodecahedron", "octahedron", NULL },*label="A";
   static rvec visbox={0,0,0};
   t_pargs pa[] = {
     { "-ndef",   FALSE, etBOOL, {&bNDEF}, 
@@ -765,8 +768,6 @@ int gmx_editconf(int argc, char *argv[])
        box[ZZ][ZZ] = sqrt(sqr(newbox[ZZ])
                           -box[ZZ][XX]*box[ZZ][XX]-box[ZZ][YY]*box[ZZ][YY]);
       }
-      if (bDist && TRICLINIC(box))
-       fprintf(stderr,"WARNING: the box is triclinic, the minimum distance between the solute and the box might be less than %f\nYou can check this with g_mindist -pi\n",dist);
       break;
     case 'c':
     case 'd':
@@ -825,6 +826,23 @@ int gmx_editconf(int argc, char *argv[])
   if (check_box(box))
     printf("\nWARNING: %s\n",check_box(box));
 
+  if (bDist && btype[0][0]=='t')
+  {
+      if(TRICLINIC(box))
+      {
+          printf("\nWARNING: Your box is triclinic with non-orthogonal axes. In this case, the\n"
+                 "distance from the solute to a box surface along the corresponding normal\n"
+                 "vector might be somewhat smaller than your specified value %f.\n"
+                 "You can check the actual value with g_mindist -pi\n",dist);
+      }
+      else
+      {
+          printf("\nWARNING: No boxtype specified - distance condition applied in each dimension.\n"
+                 "If the molecule rotates the actual distance will be smaller. You might want\n"
+                 "to use a cubic box instead, or why not try a dodecahedron today?\n");
+      }
+  }  
+  
   if (bIndex) {
     fprintf(stderr,"\nSelect a group for output:\n");
     get_index(&atoms,opt2fn_null("-n",NFILE,fnm),
index a991a7d1f817a183314290b19fdaffd1b7b08d35..6b7addb30a9f8a53e7bfdf8574464b89745bc6c5 100644 (file)
@@ -47,7 +47,7 @@
 #include "names.h"
 #include "copyrite.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "enxio.h"
 
 #define TIME_EXPLICIT 0
index ebf24f5326e503efbbcf149d8e7aecfdc2aa2263..4ddfa505febb341ad6e394cd42f723d14974c93c 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "string2.h"
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "smalloc.h"
 #include "enxio.h"
index 6821602ac819f6794ced9608d4bd7b9e65f6a009..9a8d33d5d881211b7d0e44a7596a597502fad7cb 100644 (file)
@@ -41,7 +41,7 @@
 #include <math.h>
 
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "string2.h"
 #include "smalloc.h"
@@ -872,6 +872,8 @@ int gmx_energy(int argc,char *argv[])
   bORIRE = bORA || bORT || bODA || bODR || bODT;
   bOTEN  = opt2bSet("-oten",NFILE,fnm);
 
+  nset = 0;
+
   snew(frame,2);
   fp = open_enx(ftp2fn(efENX,NFILE,fnm),"r");
   do_enxnms(fp,&nre,&enm);
index 3a8da95f9a84bf50063bc0d6308f91a9e9530d2c..03362b68f27d7f3741b24bf49b28b66299d92031 100644 (file)
@@ -53,7 +53,7 @@
 #include "atomprop.h"
 #include "names.h"
 #include "vec.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "statutil.h"
 #include "vec.h"
 #include "gbutil.h"
index b6a331e0e901b3107c7dcb3420b362ee5b56edeb..cc4a2fded2a567162e1872aaf7574f7d7bc794c9 100644 (file)
@@ -46,7 +46,7 @@
 #include "statutil.h"
 #include "pbc.h"
 #include "force.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "maths.h"
 #include "macros.h"
index cc7ecd6132467e208d3a9d09cfdb50fab52ed42f..c031987f6d5c140a264d2234e0eeeef51422d2b6 100644 (file)
@@ -48,7 +48,7 @@
 #include "futil.h"
 #include "macros.h"
 #include "index.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 int gmx_genpr(int argc,char *argv[])
 {
index a71f08bfc70da513b6714d76b77d4e23fcade0fd..00eed9b5379e8eb9479e66ae696bbb997f435e39 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * $Id$
  * 
+ * 
  *                This source code is part of
  * 
  *                 G   R   O   M   A   C   S
@@ -46,7 +47,7 @@
 #include "tpxio.h"
 #include "physics.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "index.h"
 #include "smalloc.h"
 #include "vec.h"
@@ -212,7 +213,7 @@ static bool is_hb(unsigned int hbexist[],int frame)
 
 static void set_hb(t_hbdata *hb,int id,int ih, int ia,int frame,int ihb)
 {
-  unsigned int *ghptr;
+  unsigned int *ghptr=NULL;
   
   if (ihb == hbHB)
     ghptr = hb->hbmap[id][ia]->h[ih];
@@ -580,8 +581,9 @@ static t_gridcell ***init_grid(bool bBox,rvec box[],real rcut,ivec ngrid)
   if ( !bBox || (ngrid[XX]<3) || (ngrid[YY]<3) || (ngrid[ZZ]<3) )
     for(i=0; i<DIM; i++)
       ngrid[i]=1;
-  printf("\nWill do grid-seach on %dx%dx%d grid, rcut=%g\n",
-        ngrid[XX],ngrid[YY],ngrid[ZZ],rcut);
+  else 
+    printf("\nWill do grid-seach on %dx%dx%d grid, rcut=%g\n",
+          ngrid[XX],ngrid[YY],ngrid[ZZ],rcut);
   snew(grid,ngrid[ZZ]);
   for (z=0; z<ngrid[ZZ]; z++) {
     snew((grid)[z],ngrid[YY]);
@@ -1453,7 +1455,7 @@ static void dump_hbmap(t_hbdata *hb,
     fprintf(fp,"[ %s ]",grpnames[grp]);
     for (i=0; i<isize[grp]; i++) {
       fprintf(fp,(i%15)?" ":"\n");
-      fprintf(fp,"%4u",index[grp][i]+1);
+      fprintf(fp," %4u",index[grp][i]+1);
     }
     fprintf(fp,"\n");
     fprintf(fp,"[ donors_hydrogens_%s ]",grpnames[grp]);
@@ -1535,10 +1537,10 @@ int gmx_hbond(int argc,char *argv[])
     "bonds between atoms within the shell distance from the one atom are",
     "considered.[PAR]"
     
-    "It is also possible to analyse specific hydrogen bonds with",
+    /*    "It is also possible to analyse specific hydrogen bonds with",
     "[TT]-sel[tt]. This index file must contain a group of atom triplets",
     "Donor Hydrogen Acceptor, in the following way:[PAR]",
-    
+    */
     "[TT]",
     "[ selected ][BR]",
     "     20    21    24[BR]",
@@ -1617,12 +1619,14 @@ int gmx_hbond(int argc,char *argv[])
     { "-merge", FALSE, etBOOL, {&bMerge},
       "H-bonds between the same donor and acceptor, but with different hydrogen are treated as a single H-bond. Mainly important for the ACF." }
   };
-
+  static char *bugs[] = {
+    "The option [TT]-sel[tt] that used to work on selected hbonds is out of order, and therefore not available for the time being."
+  };
   t_filenm fnm[] = {
     { efTRX, "-f",   NULL,     ffREAD  },
     { efTPX, NULL,   NULL,     ffREAD  },
     { efNDX, NULL,   NULL,     ffOPTRD },
-    { efNDX, "-sel", "select", ffOPTRD },
+    /*    { efNDX, "-sel", "select", ffOPTRD },*/
     { efXVG, "-num", "hbnum",  ffWRITE },
     { efXVG, "-ac",  "hbac",   ffOPTWR },
     { efXVG, "-dist","hbdist", ffOPTWR },
@@ -1654,7 +1658,7 @@ int gmx_hbond(int argc,char *argv[])
   matrix  box;
   real    t,ccut,dist,ang;
   double  max_nhb,aver_nhb,aver_dist;
-  int     h,i,j,k,l,start,end,id,ja,ogrp;
+  int     h,i,j,k,l,start,end,id,ja,ogrp,nsel;
   int     xi,yi,zi,ai;
   int     xj,yj,zj,aj,xjj,yjj,zjj;
   int     xk,yk,zk,ak,xkk,ykk,zkk;
@@ -1674,7 +1678,7 @@ int gmx_hbond(int argc,char *argv[])
   ppa    = add_acf_pargs(&npargs,pa);
   
   parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE,NFILE,fnm,npargs,
-                   ppa,asize(desc),desc,0,NULL);
+                   ppa,asize(desc),desc,asize(bugs),bugs);
 
   /* process input */
   bSelected = opt2bSet("-sel",NFILE,fnm);
@@ -1713,24 +1717,26 @@ int gmx_hbond(int argc,char *argv[])
     /* analyze selected hydrogen bonds */
     printf("Select group with selected atoms:\n");
     get_index(&(top.atoms),opt2fn("-sel",NFILE,fnm),
-             1,isize,index,grpnames);
-    if (isize[0] % 3)
+             1,&nsel,index,grpnames);
+    if (nsel % 3)
       gmx_fatal(FARGS,"Number of atoms in group '%s' not a multiple of 3\n"
                  "and therefore cannot contain triplets of "
                  "Donor-Hydrogen-Acceptor",grpnames[0]);
     bTwo=FALSE;
     
-    for(i=0; (i<isize[0]); i+=3) {
+    for(i=0; (i<nsel); i+=3) {
       int dd = index[0][i];
       int hh = index[0][i+1];
       int aa = index[0][i+2];
       add_dh (&hb->d,dd,hh,i);
       add_acc(&hb->a,aa,i);
       /* Should this be here ? */
-      /* add_hbond(hb,dd,aa,hh,gr0,gr0,-1,FALSE,bMerge);*/
+      snew(hb->d.dptr,top.atoms.nr);
+      snew(hb->a.aptr,top.atoms.nr);
+      add_hbond(hb,dd,aa,hh,gr0,gr0,0,FALSE,bMerge,0);
     }
     printf("Analyzing %d selected hydrogen bonds from '%s'\n",
-          hb->nrhb,grpnames[0]);
+          isize[0],grpnames[0]);
   } 
   else {
     /* analyze all hydrogen bonds: get group(s) */
@@ -1865,42 +1871,60 @@ int gmx_hbond(int argc,char *argv[])
 
     if (hb->bDAnr)
       count_da_grid(ngrid, grid, hb->danr[nframes]);
-    /* loop over all gridcells (xi,yi,zi)      */
-    /* Removed confusing macro, DvdS 27/12/98  */
-    for(xi=0; (xi<ngrid[XX]); xi++)
-      for(yi=0; (yi<ngrid[YY]); yi++)
-       for(zi=0; (zi<ngrid[ZZ]); zi++) {
+      
+    if (bSelected) {
+      int ii;
+      
+      for(ii=0; (ii<nsel); ii++) {
+       int dd = index[0][i];
+       int hh = index[0][i+1];
+       int aa = index[0][i+2];
+       ihb = is_hbond(hb,ii,ii,dd,aa,rcut,ccut,x,bBox,box,
+                      hbox,&dist,&ang,bDA,&h,bContact);
        
-         /* loop over donor groups gr0 (always) and gr1 (if necessary) */
-         for (grp=gr0; (grp <= (bTwo?gr1:gr0)); grp++) {
-           icell=&(grid[zi][yi][xi].d[grp]);
-           
-           if (bTwo)
-             ogrp = 1-grp;
-           else
-             ogrp = grp;
+       if (ihb) {
+         /* add to index if not already there */
+         /* Add a hbond */
+         add_hbond(hb,dd,aa,hh,ii,ii,nframes,FALSE,bMerge,ihb);
+       }
+      }
+    }
+    else {
+      /* loop over all gridcells (xi,yi,zi)      */
+      /* Removed confusing macro, DvdS 27/12/98  */
+      for(xi=0; (xi<ngrid[XX]); xi++)
+       for(yi=0; (yi<ngrid[YY]); yi++)
+         for(zi=0; (zi<ngrid[ZZ]); zi++) {
            
-           /* loop over all hydrogen atoms from group (grp) 
-            * in this gridcell (icell) 
-            */
-           for (ai=0; (ai<icell->nr); ai++) {
-             i  = icell->atoms[ai];
+           /* loop over donor groups gr0 (always) and gr1 (if necessary) */
+           for (grp=gr0; (grp <= (bTwo?gr1:gr0)); grp++) {
+             icell=&(grid[zi][yi][xi].d[grp]);
+             
+             if (bTwo)
+               ogrp = 1-grp;
+             else
+               ogrp = grp;
              
-             /* loop over all adjacent gridcells (xj,yj,zj) */
-             /* This is a macro!!! */
-             LOOPGRIDINNER(xj,yj,zj,xjj,yjj,zjj,xi,yi,zi,ngrid,bTric) {
-               jcell=&(grid[zj][yj][xj].a[ogrp]);
-               /* loop over acceptor atoms from other group (ogrp) 
-                * in this adjacent gridcell (jcell) 
-                */
-               for (aj=0; (aj<jcell->nr); aj++) {
-                 j = jcell->atoms[aj];
+             /* loop over all hydrogen atoms from group (grp) 
+              * in this gridcell (icell) 
+              */
+             for (ai=0; (ai<icell->nr); ai++) {
+               i  = icell->atoms[ai];
+               
+               /* loop over all adjacent gridcells (xj,yj,zj) */
+               /* This is a macro!!! */
+               LOOPGRIDINNER(xj,yj,zj,xjj,yjj,zjj,xi,yi,zi,ngrid,bTric) {
+                 jcell=&(grid[zj][yj][xj].a[ogrp]);
+                 /* loop over acceptor atoms from other group (ogrp) 
+                  * in this adjacent gridcell (jcell) 
+                  */
+                 for (aj=0; (aj<jcell->nr); aj++) {
+                   j = jcell->atoms[aj];
                  
-                 if ((bSelected && (j == i)) || (!bSelected)) {
                    /* check if this once was a h-bond */
                    ihb = is_hbond(hb,grp,ogrp,i,j,rcut,ccut,x,bBox,box,
                                   hbox,&dist,&ang,bDA,&h,bContact);
-                                  
+                   
                    if (ihb) {
                      /* add to index if not already there */
                      /* Add a hbond */
@@ -1911,13 +1935,13 @@ int gmx_hbond(int argc,char *argv[])
                        ang*=RAD2DEG;
                        adist[(int)( ang/abin)]++;
                        rdist[(int)(dist/rbin)]++;
-                     
+                       
                        if (!bTwo) {
                          int id,ia;
                          if ((id = donor_index(&hb->d,grp,i)) == NOTSET)
                            gmx_fatal(FARGS,"Invalid donor %d",i);
                          if ((ia = acceptor_index(&hb->a,ogrp,j)) == NOTSET)
-                         gmx_fatal(FARGS,"Invalid acceptor %d",j);
+                           gmx_fatal(FARGS,"Invalid acceptor %d",j);
                          resdist=abs(top.atoms.atom[id].resnr-
                                      top.atoms.atom[ia].resnr);
                          if (resdist >= max_hx) 
@@ -1925,98 +1949,98 @@ int gmx_hbond(int argc,char *argv[])
                          hb->nhx[nframes][resdist]++;
                        }
                      }
-                   }
-                   if (bInsert && bSelected) {
-                     /* this has been a h-bond, or we are analyzing 
-                        selected bonds: check for inserted */
-                     bool ins_d, ins_a;
-                     real ins_d_dist, ins_d_ang, ins_a_dist, ins_a_ang;
-                     int  ins_d_k=0,ins_a_k=0;
-                     
-                     ins_d=ins_a=FALSE;
-                     ins_d_dist=ins_d_ang=ins_a_dist=ins_a_ang=1e6;
-                     
-                     /* loop over gridcells adjacent to i (xk,yk,zk) */
-                     LOOPGRIDINNER(xk,yk,zk,xkk,ykk,zkk,xi,yi,zi,ngrid,bTric){
-                       kcell=&(grid[zk][yk][xk].a[grI]);
-                       /* loop over acceptor atoms from ins group 
-                          in this adjacent gridcell (kcell) */
-                       for (ak=0; (ak<kcell->nr); ak++) {
-                         k=kcell->atoms[ak];
-                         ihb = is_hbond(hb,grp,grI,i,k,rcut,ccut,x,
-                                        bBox,box,hbox,&dist,&ang,bDA,&h,
-                                        bContact);
-                         if (ihb == hbHB) {
-                           if (dist < ins_d_dist) {
-                             ins_d=TRUE;
-                             ins_d_dist=dist;
-                             ins_d_ang =ang ;
-                             ins_d_k   =k   ;
+                     if (bInsert && bSelected) {
+                       /* this has been a h-bond, or we are analyzing 
+                          selected bonds: check for inserted */
+                       bool ins_d, ins_a;
+                       real ins_d_dist, ins_d_ang, ins_a_dist, ins_a_ang;
+                       int  ins_d_k=0,ins_a_k=0;
+                       
+                       ins_d=ins_a=FALSE;
+                       ins_d_dist=ins_d_ang=ins_a_dist=ins_a_ang=1e6;
+                       
+                       /* loop over gridcells adjacent to i (xk,yk,zk) */
+                       LOOPGRIDINNER(xk,yk,zk,xkk,ykk,zkk,xi,yi,zi,ngrid,bTric){
+                         kcell=&(grid[zk][yk][xk].a[grI]);
+                         /* loop over acceptor atoms from ins group 
+                            in this adjacent gridcell (kcell) */
+                         for (ak=0; (ak<kcell->nr); ak++) {
+                           k=kcell->atoms[ak];
+                           ihb = is_hbond(hb,grp,grI,i,k,rcut,ccut,x,
+                                          bBox,box,hbox,&dist,&ang,bDA,&h,
+                                          bContact);
+                           if (ihb == hbHB) {
+                             if (dist < ins_d_dist) {
+                               ins_d=TRUE;
+                               ins_d_dist=dist;
+                               ins_d_ang =ang ;
+                               ins_d_k   =k   ;
+                             }
                            }
                          }
                        }
-                     }
-                     ENDLOOPGRIDINNER;
+                       ENDLOOPGRIDINNER;
                        /* loop over gridcells adjacent to j (xk,yk,zk) */
-                     LOOPGRIDINNER(xk,yk,zk,xkk,ykk,zkk,xj,yj,zj,ngrid,bTric){
-                       kcell=&grid[zk][yk][xk].d[grI];
-                       /* loop over hydrogen atoms from ins group 
-                          in this adjacent gridcell (kcell) */
-                       for (ak=0; ak<kcell->nr; ak++) {
-                         k   = kcell->atoms[ak];
-                         ihb = is_hbond(hb,grI,ogrp,k,j,rcut,ccut,x,
-                                        bBox,box,hbox,&dist,&ang,bDA,&h,
-                                        bContact);
-                         if (ihb == hbHB) {
-                           if (dist<ins_a_dist) {
-                             ins_a=TRUE;
-                             ins_a_dist=dist;
-                             ins_a_ang =ang ;
-                             ins_a_k   =k   ;
+                       LOOPGRIDINNER(xk,yk,zk,xkk,ykk,zkk,xj,yj,zj,ngrid,bTric){
+                         kcell=&grid[zk][yk][xk].d[grI];
+                         /* loop over hydrogen atoms from ins group 
+                            in this adjacent gridcell (kcell) */
+                         for (ak=0; ak<kcell->nr; ak++) {
+                           k   = kcell->atoms[ak];
+                           ihb = is_hbond(hb,grI,ogrp,k,j,rcut,ccut,x,
+                                          bBox,box,hbox,&dist,&ang,bDA,&h,
+                                          bContact);
+                           if (ihb == hbHB) {
+                             if (dist<ins_a_dist) {
+                               ins_a=TRUE;
+                               ins_a_dist=dist;
+                               ins_a_ang =ang ;
+                               ins_a_k   =k   ;
+                             }
                            }
                          }
                        }
-                     }
-                     ENDLOOPGRIDINNER;
+                       ENDLOOPGRIDINNER;
                        
-                     {
-                       ihb = is_hbond(hb,grI,grI,ins_d_k,ins_a_k,rcut,ccut,x,
-                                      bBox,box,hbox,&dist,&ang,bDA,&h,
-                                      bContact);
-                       if (ins_d && ins_a && ihb) {
-                         /* add to hbond index if not already there */
-                         add_hbond(hb,ins_d_k,ins_a_k,h,grI,ogrp,
-                                   nframes,TRUE,bMerge,ihb);
-                         
-                         /* print insertion info to file */
-                         /*fprintf(fpins,
-                           "%4g: %4u:%3.3s%4d%3.3s -> "
-                           "%4u:%3.3s%4d%3.3s (%4.2f,%2.0f) - "
-                           "%4u:%3.3s%4d%3.3s (%4.2f,%2.0f)\n",t,
-                           a[grIA][ins_d_k]+1,
-                           *top.atoms.resname[top.atoms.atom[a[grIA][ins_d_k]].resnr],
-                           top.atoms.atom[a[grIA][ins_d_k]].resnr+1,
-                           *top.atoms.atomname[a[grIA][ins_d_k]],
-                           a[grp+grD][i]+1,
-                           *top.atoms.resname[top.atoms.atom[a[grp+grD][i]].resnr],
-                           top.atoms.atom[a[grp+grD][i]].resnr+1,
-                           *top.atoms.atomname[a[grp+grD][i]],
-                           ins_d_dist,ins_d_ang*RAD2DEG,
-                           a[ogrp+grA][j]+1,
-                           *top.atoms.resname[top.atoms.atom[a[ogrp+grA][j]].resnr],
-                           top.atoms.atom[a[ogrp+grA][j]].resnr+1,
-                           *top.atoms.atomname[a[ogrp+grA][j]],
-                           ins_a_dist,ins_a_ang*RAD2DEG);*/
+                       {
+                         ihb = is_hbond(hb,grI,grI,ins_d_k,ins_a_k,rcut,ccut,x,
+                                        bBox,box,hbox,&dist,&ang,bDA,&h,
+                                        bContact);
+                         if (ins_d && ins_a && ihb) {
+                           /* add to hbond index if not already there */
+                           add_hbond(hb,ins_d_k,ins_a_k,h,grI,ogrp,
+                                     nframes,TRUE,bMerge,ihb);
+                           
+                           /* print insertion info to file */
+                           /*fprintf(fpins,
+                             "%4g: %4u:%3.3s%4d%3.3s -> "
+                             "%4u:%3.3s%4d%3.3s (%4.2f,%2.0f) - "
+                             "%4u:%3.3s%4d%3.3s (%4.2f,%2.0f)\n",t,
+                             a[grIA][ins_d_k]+1,
+                             *top.atoms.resname[top.atoms.atom[a[grIA][ins_d_k]].resnr],
+                             top.atoms.atom[a[grIA][ins_d_k]].resnr+1,
+                             *top.atoms.atomname[a[grIA][ins_d_k]],
+                             a[grp+grD][i]+1,
+                             *top.atoms.resname[top.atoms.atom[a[grp+grD][i]].resnr],
+                             top.atoms.atom[a[grp+grD][i]].resnr+1,
+                             *top.atoms.atomname[a[grp+grD][i]],
+                             ins_d_dist,ins_d_ang*RAD2DEG,
+                             a[ogrp+grA][j]+1,
+                             *top.atoms.resname[top.atoms.atom[a[ogrp+grA][j]].resnr],
+                             top.atoms.atom[a[ogrp+grA][j]].resnr+1,
+                             *top.atoms.atomname[a[ogrp+grA][j]],
+                             ins_a_dist,ins_a_ang*RAD2DEG);*/
+                         }
                        }
                      }
                    }
-                 }
-               } /* for aj  */
-             }
-             ENDLOOPGRIDINNER;
-           } /* for ai  */
-         } /* for grp */
-       } /* for xi,yi,zi */
+                 } /* for aj  */
+               }
+               ENDLOOPGRIDINNER;
+             } /* for ai  */
+           } /* for grp */
+         } /* for xi,yi,zi */
+    }
     analyse_donor_props(opt2fn_null("-don",NFILE,fnm),hb,nframes,t);
     if (fpnhb)
       do_nhb_dist(fpnhb,hb,t);
index ace23267ba04a2db73739a0a34479da3ff5929bf..916a332d9ebab17a814438cc63a6dd1e22a0aab2 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "confio.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "fitahx.h"
 #include "futil.h"
 #include "gstat.h"
diff --git a/src/tools/gmx_kinetics.c b/src/tools/gmx_kinetics.c
new file mode 100644 (file)
index 0000000..c95f54f
--- /dev/null
@@ -0,0 +1,804 @@
+/*
+ * $Id$
+ * 
+ *                This source code is part of
+ * 
+ *                 G   R   O   M   A   C   S
+ * 
+ *          GROningen MAchine for Chemical Simulations
+ * 
+ *                        VERSION 3.2.0
+ * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team,
+ * check out http://www.gromacs.org for more information.
+
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * If you want to redistribute modifications, please consider that
+ * scientific software is very special. Version control is crucial -
+ * bugs must be traceable. We will be happy to consider code for
+ * inclusion in the official distribution, but derived work must not
+ * be called official GROMACS. Details are found in the README & COPYING
+ * files - if they are missing, get the official version at www.gromacs.org.
+ * 
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the papers on the package - you can find them in the top README file.
+ * 
+ * For more info, check our website at http://www.gromacs.org
+ * 
+ * And Hey:
+ * Green Red Orange Magenta Azure Cyan Skyblue
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include "statutil.h"
+#include "sysstuff.h"
+#include "typedefs.h"
+#include "smalloc.h"
+#include "macros.h"
+#include "gmx_fatal.h"
+#include "vec.h"
+#include "copyrite.h"
+#include "futil.h"
+#include "readinp.h"
+#include "statutil.h"
+#include "txtdump.h"
+#include "gstat.h"
+#include "xvgr.h"
+#include "physics.h"
+#include <gsl/gsl_multimin.h>
+
+enum { epAuf, epEuf, epAfu, epEfu, epNR };
+enum { eqAif, eqEif, eqAfi, eqEfi, eqAui, eqEui, eqAiu, eqEiu, eqNR };
+static char *eep[epNR] = { "Af", "Ef", "Au", "Eu" };
+static char *eeq[eqNR] = { "Aif","Eif","Afi","Efi","Aui","Eui","Aiu","Eiu" };
+
+typedef struct {
+  int nreplica;   /* Number of replicas in the calculation                   */
+  int nframe;     /* Number of time frames                                   */
+  int nstate;     /* Number of states the system can be in, e.g. F,I,U       */
+  int nparams;    /* Is 2, 4 or 8                                            */
+  bool *bMask;    /* Determine whether this replica is part of the d2 comp.  */
+  bool bSum;
+  int nmask;      /* Number of replicas taken into account                   */
+  real dt;        /* Timestep between frames                                 */
+  int  j0,j1;     /* Range of frames used in calculating delta               */
+  real **temp,**data;
+  int  **state;   /* State index running from 0 (F) to nstate-1 (U)          */
+  real **beta,**fcalt,**icalt;
+  real *time,*sumft,*sumit,*sumfct,*sumict;
+  real *params;
+  real *d2_replica;
+} t_remd_data;
+
+char *itoa(int i)
+{
+  static char ptr[12];
+  
+  sprintf(ptr,"%d",i);
+  return ptr;
+}
+
+char *epnm(int nparams,int index)
+{
+  static char buf[32],from[8],to[8];
+  int    nn,ni,ii;
+  
+  range_check(index,0,nparams);
+  if ((nparams == 2) || (nparams == 4))
+    return eep[index];
+  else if ((nparams > 4) && (nparams % 4 == 0))
+    return eeq[index];
+  else 
+    gmx_fatal(FARGS,"Don't know how to handle %d parameters",nparams);
+    
+  return NULL;
+}
+
+bool bBack(t_remd_data *d) 
+{
+  return (d->nparams > 2);
+}
+
+real is_folded(t_remd_data *d,int irep,int jframe)
+{
+  if (d->state[irep][jframe] == 0)
+    return 1.0;
+  else
+    return 0.0;
+}
+
+real is_unfolded(t_remd_data *d,int irep,int jframe)
+{
+  if (d->state[irep][jframe] == d->nstate-1)
+    return 1.0;
+  else
+    return 0.0;
+}
+
+real is_intermediate(t_remd_data *d,int irep,int jframe)
+{
+  if ((d->state[irep][jframe] == 1) && (d->nstate > 2))
+    return 1.0;
+  else
+    return 0.0;
+}
+
+void integrate_dfdt(t_remd_data *d)
+{
+  int    i,j;
+  double beta,ddf,ddi,df,db,fac,sumf,sumi;
+  
+  d->sumfct[0] = 0;
+  d->sumict[0] = 0;
+  for(i=0; (i<d->nreplica); i++) {
+    if (d->bMask[i]) {
+      ddf = 0.5*d->dt*is_folded(d,i,0);
+      ddi = 0.5*d->dt*is_intermediate(d,i,0);
+      d->fcalt[i][0] = ddf;
+      d->icalt[i][0] = ddi;
+      d->sumfct[0]  += ddf;
+      d->sumict[0]  += ddi;
+    }
+  }
+  for(j=1; (j<d->nframe); j++) {
+    if (j==d->nframe-1)
+      fac = 0.5*d->dt;
+    else
+      fac = d->dt;
+    sumf = sumi = 0;
+    for(i=0; (i<d->nreplica); i++) {
+      if (d->bMask[i]) {
+       beta = d->beta[i][j];
+       if (d->nstate <= 2) {
+         df = (d->params[epAuf]*exp(-beta*d->params[epEuf])*
+               is_unfolded(d,i,j));
+         if (bBack(d)) {
+           db = (d->params[epAfu]*exp(-beta*d->params[epEfu])*
+                 is_folded(d,i,j));
+           ddf = fac*(df-db);
+         }
+         else
+           ddf = fac*df;
+         d->fcalt[i][j] = d->fcalt[i][j-1] + ddf;
+         sumf += ddf;
+       }
+       else {
+         ddf = fac*((d->params[eqAif]*exp(-beta*d->params[eqEif])*
+                     is_intermediate(d,i,j)) -
+                    (d->params[eqAfi]*exp(-beta*d->params[eqEfi])*
+                     is_folded(d,i,j)));
+         ddi = fac*((d->params[eqAui]*exp(-beta*d->params[eqEui])*
+                     is_unfolded(d,i,j)) -
+                    (d->params[eqAiu]*exp(-beta*d->params[eqEiu])*
+                     is_intermediate(d,i,j)));
+         d->fcalt[i][j] = d->fcalt[i][j-1] + ddf;
+         d->icalt[i][j] = d->icalt[i][j-1] + ddi;
+         sumf += ddf;
+         sumi += ddi;
+       }
+      }
+    }
+    d->sumfct[j] = d->sumfct[j-1] + sumf;
+    d->sumict[j] = d->sumict[j-1] + sumi;
+  }
+}
+
+void sum_ft(t_remd_data *d)
+{
+  int i,j;
+  double fac;
+    
+  for(j=0; (j<d->nframe); j++) {
+    d->sumft[j] = 0;
+    d->sumit[j] = 0;
+    if ((j == 0) || (j==d->nframe-1))
+      fac = d->dt*0.5;
+    else
+      fac = d->dt;
+    for(i=0; (i<d->nreplica); i++) {
+      if (d->bMask[i]) {
+       d->sumft[j] += fac*is_folded(d,i,j);
+       d->sumit[j] += fac*is_intermediate(d,i,j);
+      }
+    }
+  }
+}
+
+double calc_d2(t_remd_data *d)
+{
+  int    i,j;
+  double dd2,d2=0,dr2,tmp;
+  
+  integrate_dfdt(d);
+  
+  if (d->bSum) {
+    for(j=d->j0; (j<d->j1); j++) {
+      d2  += sqr(d->sumft[j]-d->sumfct[j]);
+      if (d->nstate > 2)
+       d2 += sqr(d->sumit[j]-d->sumict[j]);
+    }
+  }
+  else {
+    for(i=0; (i<d->nreplica); i++) {
+      dr2 = 0;
+      if (d->bMask[i]) {
+       for(j=d->j0; (j<d->j1); j++) {
+         tmp  = sqr(is_folded(d,i,j)-d->fcalt[i][j]);
+         d2  += tmp;
+         dr2 += tmp; 
+         if (d->nstate > 2) {
+           tmp = sqr(is_intermediate(d,i,j)-d->icalt[i][j]);
+           d2  += tmp;
+           dr2 += tmp;
+         }
+       }
+       d->d2_replica[i] = dr2/(d->j1-d->j0);
+      }
+    }
+  }
+  dd2 = (d2/(d->j1-d->j0))/d->nmask;
+   
+  return dd2;
+}
+
+double my_f(const gsl_vector *v,void *params)
+{
+  t_remd_data *d = (t_remd_data *) params;
+  double penalty=0;
+  int i;
+  
+  for(i=0; (i<d->nparams); i++) {
+    d->params[i] = gsl_vector_get(v, i);
+    if (d->params[i] < 0)
+      penalty += 10;
+  }
+  if (penalty > 0)
+    return penalty;
+  else
+    return calc_d2(d);
+}
+
+static void optimize_remd_parameters(FILE *fp,t_remd_data *d,int maxiter,
+                                    real tol)
+{
+  real   size,d2;
+  size_t iter = 0;
+  int    status = 0;
+  int    i;
+
+  const gsl_multimin_fminimizer_type *T;
+  gsl_multimin_fminimizer *s;
+
+  gsl_vector *x,*dx;
+  gsl_multimin_function my_func;
+
+  my_func.f      = &my_f;
+  my_func.n      = d->nparams;
+  my_func.params = (void *) d;
+
+  /* Starting point */
+  x = gsl_vector_alloc (my_func.n);
+  for(i=0; (i<my_func.n); i++)
+    gsl_vector_set (x, i, d->params[i]);
+  
+  /* Step size, different for each of the parameters */
+  dx = gsl_vector_alloc (my_func.n);
+  for(i=0; (i<my_func.n); i++)
+    gsl_vector_set (dx, i, 0.1*d->params[i]);
+
+  T = gsl_multimin_fminimizer_nmsimplex;
+  s = gsl_multimin_fminimizer_alloc (T, my_func.n);
+
+  gsl_multimin_fminimizer_set (s, &my_func, x, dx);
+  gsl_vector_free (x);
+  gsl_vector_free (dx);
+
+  printf ("%5s","Iter");
+  for(i=0; (i<my_func.n); i++) 
+    printf(" %8s",epnm(my_func.n,i));
+  printf (" %8s %8s\n","NM Size","Chi2");
+  
+  do  {
+    iter++;
+    status = gsl_multimin_fminimizer_iterate (s);
+    
+    if (status != 0)
+      gmx_fatal(FARGS,"Something went wrong in the iteration in minimizer %s",
+               gsl_multimin_fminimizer_name(s));
+               
+    d2     = gsl_multimin_fminimizer_minimum(s);
+    size   = gsl_multimin_fminimizer_size(s);
+    status = gsl_multimin_test_size(size,tol);
+    
+    if (status == GSL_SUCCESS)
+      printf ("Minimum found using %s at:\n",
+             gsl_multimin_fminimizer_name(s));
+  
+    printf ("%5d", iter);
+    for(i=0; (i<my_func.n); i++) 
+      printf(" %8.2e",gsl_vector_get (s->x,i));
+    printf (" %8.2e %8.2e\n",size,d2);
+  }
+  while ((status == GSL_CONTINUE) && (iter < maxiter));
+  
+  gsl_multimin_fminimizer_free (s);
+}
+
+
+static void preprocess_remd(FILE *fp,t_remd_data *d,real cutoff,real tref,
+                           real ucut,bool bBack,real Euf,real Efu,
+                           real Ei,real t0,real t1,bool bSum)
+{
+  int i,j,ninter;
+  real dd,tau_f,tau_u;
+
+  ninter = (ucut > cutoff) ? 1 : 0;
+  if (ninter && (ucut <= cutoff))
+    gmx_fatal(FARGS,"You have requested an intermediate but the cutoff for intermediates %f is smaller than the normal cutoff(%f)",ucut,cutoff);
+    
+  if (!bBack) {
+    d->nparams = 2;
+    d->nstate  = 2;
+  }
+  else {
+    d->nparams = 4*(1+ninter);
+    d->nstate  = 2+ninter;
+  }
+  d->bSum = bSum;
+  snew(d->beta, d->nreplica);
+  snew(d->state,d->nreplica);
+  snew(d->bMask,d->nreplica);
+  snew(d->d2_replica,d->nreplica);
+  snew(d->sumft,d->nframe);
+  snew(d->sumit,d->nframe);
+  snew(d->sumfct,d->nframe);
+  snew(d->sumict,d->nframe);
+  snew(d->params,d->nparams);
+  snew(d->fcalt,d->nreplica);
+  snew(d->icalt,d->nreplica);
+
+  if (t0 < 0)
+    d->j0 = 0;
+  else
+    for(d->j0=0; (d->j0<d->nframe) && (d->time[d->j0] < t0); d->j0++)
+      ;
+  if (t1 < 0)
+    d->j1=d->nframe;
+  else
+    for(d->j1=0; (d->j1<d->nframe) && (d->time[d->j1] < t1); d->j1++)
+      ;
+  if ((d->j1-d->j0) < d->nparams+2)
+    gmx_fatal(FARGS,"Start (%f) or end time (%f) for fitting inconsistent. Reduce t0, increase t1 or supply more data",t0,t1);
+  fprintf(fp,"Will optimize from %g to %g\n",
+         d->time[d->j0],d->time[d->j1-1]);  
+  d->nmask = d->nreplica;
+  for(i=0; (i<d->nreplica); i++) {
+    snew(d->beta[i],d->nframe);
+    snew(d->state[i],d->nframe);
+    snew(d->fcalt[i],d->nframe);
+    snew(d->icalt[i],d->nframe);
+    d->bMask[i] = TRUE;
+    for(j=0; (j<d->nframe); j++) {
+      d->beta[i][j] = 1.0/(BOLTZ*d->temp[i][j]);
+      dd = d->data[i][j];
+      if (dd <= cutoff)
+       d->state[i][j] = 0;
+      else if ((ucut > cutoff) && (dd <= ucut))
+       d->state[i][j] = 1;
+      else
+       d->state[i][j] = d->nstate-1;
+    }
+  }
+  sum_ft(d);
+  
+  /* Assume forward rate constant is half the total time in this
+   * simulation and backward is ten times as long */
+  tau_f = d->time[d->nframe-1];
+  tau_u = 4*tau_f;
+  d->params[epEuf] = Euf;
+  d->params[epAuf] = exp(d->params[epEuf]/(BOLTZ*tref))/tau_f;
+  if (bBack) {
+    d->params[epEfu] = Efu;
+    d->params[epAfu] = exp(d->params[epEfu]/(BOLTZ*tref))/tau_u;
+    if (ninter >0) {
+      d->params[eqEui] = Ei;
+      d->params[eqAui] = exp(d->params[eqEui]/(BOLTZ*tref))/tau_u;
+      d->params[eqEiu] = Ei;
+      d->params[eqAiu] = exp(d->params[eqEiu]/(BOLTZ*tref))/tau_u;
+    }
+  }
+  else {
+    d->params[epAfu]  = 0;
+    d->params[epEfu]  = 0;
+  }
+}
+
+real tau(real A,real E,real T)
+{
+  return exp(E/(BOLTZ*T))/A;
+}
+
+real folded_fraction(t_remd_data *d,real tref)
+{
+  real tauf,taub;
+  
+  tauf = tau(d->params[epAuf],d->params[epEuf],tref);
+  taub = tau(d->params[epAfu],d->params[epEfu],tref);
+  
+  return (taub/(tauf+taub));
+}
+
+void print_tau(FILE *gp,t_remd_data *d,real tref)
+{
+  real tauf,taub,ddd,fff,DG,DH,TDS,Tm,Tb,Te,Fb,Fe,Fm;
+  int  i,np=d->nparams;
+  
+  ddd = calc_d2(d);
+  fprintf(gp,"Final value for Chi2 = %12.5e (%d replicas)\n",ddd,d->nmask);
+  tauf = tau(d->params[epAuf],d->params[epEuf],tref);
+  fprintf(gp,"%s = %12.5e %s = %12.5e (kJ/mole)\n",
+         epnm(np,epAuf),d->params[epAuf],
+         epnm(np,epEuf),d->params[epEuf]);
+  if (bBack(d)) {
+    taub = tau(d->params[epAfu],d->params[epEfu],tref);
+    fprintf(gp,"%s = %12.5e %s = %12.5e (kJ/mole)\n",
+           epnm(np,epAfu),d->params[epAfu],
+           epnm(np,epEfu),d->params[epEfu]);
+    fprintf(gp,"Equilibrium properties at T = %g\n",tref);
+    fprintf(gp,"tau_f = %8.3f ns, tau_b = %8.3f ns\n",tauf/1000,taub/1000);
+    fff = taub/(tauf+taub);
+    DG  = BOLTZ*tref*log(fff/(1-fff));
+    DH  = d->params[epEfu]-d->params[epEuf];
+    TDS = DH-DG;
+    fprintf(gp,"Folded fraction     F = %8.3f\n",fff);
+    fprintf(gp,"Unfolding energies: DG = %8.3f  DH = %8.3f TDS = %8.3f\n",
+           DG,DH,TDS);
+    Tb = 260;
+    Te = 420;
+    Fb = folded_fraction(d,Tb);
+    Fe = folded_fraction(d,Te);
+    while((Te-Tb > 0.001) && (Fm != 0.5)) {
+      Tm = 0.5*(Tb+Te);
+      Fm = folded_fraction(d,Tm);
+      if (Fm > 0.5) {
+       Fb = Fm;
+       Tb = Tm;
+      }
+      else if (Fm < 0.5) {
+       Te = Tm;
+       Fe = Fm;
+      }
+    }
+    if ((Fb-0.5)*(Fe-0.5) <= 0)
+      fprintf(gp,"Melting temperature Tm = %8.3f K\n",Tm);
+    else 
+      fprintf(gp,"No melting temperature detected between 260 and 420K\n");
+    if (np > 4) {
+      char *ptr;
+      fprintf(gp,"Data for intermediates at T = %g\n",tref);
+      fprintf(gp,"%8s  %10s  %10s  %10s\n","Name","A","E","tau");
+      for(i=0; (i<np/2); i++) {
+       tauf = tau(d->params[2*i],d->params[2*i+1],tref);
+       ptr = epnm(d->nparams,2*i);
+       fprintf(gp,"%8s  %10.3e  %10.3e  %10.3e\n",ptr+1,
+               d->params[2*i],d->params[2*i+1],tauf/1000);
+      }
+    }
+  }
+  else {
+    fprintf(gp,"Equilibrium properties at T = %g\n",tref);
+    fprintf(gp,"tau_f = %8.3f\n",tauf);
+  }
+}
+
+void dump_remd_parameters(FILE *gp,t_remd_data *d,char *fn,char *fn2,char *rfn,
+                         char *efn,char *mfn,int skip,real tref)
+{
+  FILE *fp,*hp;
+  int  i,j,np=d->nparams;
+  real rhs,tauf,taub,fff,DG;
+  real *params;
+  char *leg[] = { "Measured", "Fit", "Difference" };
+  char *mleg[] = { "Folded fraction","DG (kJ/mole)"};
+  char **rleg;
+  real fac[] = { 0.97, 0.98, 0.99, 1.0, 1.01, 1.02, 1.03 };
+#define NFAC asize(fac)
+  real d2[NFAC];
+  
+  integrate_dfdt(d);
+  print_tau(gp,d,tref);
+  
+  if (fn) {
+    fp = xvgropen(fn,"Optimized fit to data","Time (ps)","Fraction Folded");
+    xvgr_legend(fp,asize(leg),leg);
+    for(i=0; (i<d->nframe); i++) {
+      if ((skip <= 0) || ((i % skip) == 0))
+       fprintf(fp,"%12.5e  %12.5e  %12.5e\n",d->time[i],
+               d->sumft[i]/d->nmask,d->sumfct[i]/d->nmask,
+               (d->sumft[i]-d->sumfct[i])/d->nmask);
+    }
+    fclose(fp);
+  }
+  if (!d->bSum && rfn) {
+    snew(rleg,d->nreplica*2);
+    for(i=0; (i<d->nreplica); i++) {
+      snew(rleg[2*i],32);
+      snew(rleg[2*i+1],32);
+      sprintf(rleg[2*i],"\\f{4}F(t) %d",i);
+      sprintf(rleg[2*i+1],"\\f{12}F \\f{4}(t) %d",i);
+    }
+    fp = xvgropen(rfn,"Optimized fit to data","Time (ps)","Fraction Folded");
+    xvgr_legend(fp,d->nreplica*2,rleg);
+    for(j=0; (j<d->nframe); j++) {
+      if ((skip <= 0) || ((j % skip) == 0)) {
+       fprintf(fp,"%12.5e",d->time[j]);
+       for(i=0; (i<d->nreplica); i++) 
+         fprintf(fp,"  %5f  %9.2e",is_folded(d,i,j),d->fcalt[i][j]);
+       fprintf(fp,"\n");
+      }
+    }
+    fclose(fp);
+  }
+
+  if (fn2 && (d->nstate > 2)) {
+    fp = xvgropen(fn2,"Optimized fit to data","Time (ps)",
+                 "Fraction Intermediate");
+    xvgr_legend(fp,asize(leg),leg);
+    for(i=0; (i<d->nframe); i++) {
+      if ((skip <= 0) || ((i % skip) == 0))
+       fprintf(fp,"%12.5e  %12.5e  %12.5e  %12.5e\n",d->time[i],
+               d->sumit[i]/d->nmask,d->sumict[i]/d->nmask,
+               (d->sumit[i]-d->sumict[i])/d->nmask);
+    }
+    fclose(fp);
+  }
+  if (mfn) {
+    if (bBack(d)) {
+      fp = xvgropen(mfn,"Melting curve","T (K)","");
+      xvgr_legend(fp,asize(mleg),mleg);
+      for(i=260; (i<=420); i++) {
+       tauf = tau(d->params[epAuf],d->params[epEuf],1.0*i);
+       taub = tau(d->params[epAfu],d->params[epEfu],1.0*i);
+       fff  = taub/(tauf+taub);
+       DG   = BOLTZ*i*log(fff/(1-fff));
+       fprintf(fp,"%5d  %8.3f  %8.3f\n",i,fff,DG);
+      }
+      fclose(fp);
+    }
+  }
+  
+  if (efn) {
+    snew(params,d->nparams);
+    for(i=0; (i<d->nparams); i++)
+      params[i] = d->params[i];
+    
+    hp = xvgropen(efn,"Chi2 as a function of relative parameter",
+                 "Fraction","Chi2");
+    for(j=0; (j<d->nparams); j++) {
+      /* Reset all parameters to optimized values */
+      fprintf(hp,"@type xy\n");
+      for(i=0; (i<d->nparams); i++) 
+       d->params[i] = params[i];
+      /* Now modify one of them */
+      for(i=0; (i<NFAC); i++) {
+       d->params[j] = fac[i]*params[j];
+       d2[i] = calc_d2(d);
+       fprintf(gp,"%s = %12g  d2 = %12g\n",epnm(np,j),d->params[j],d2[i]);
+       fprintf(hp,"%12g  %12g\n",fac[i],d2[i]);
+      }
+      fprintf(hp,"&\n");
+    }
+    fclose(hp);
+    for(i=0; (i<d->nparams); i++) 
+      d->params[i] = params[i];
+    sfree(params);
+  }
+  if (!d->bSum) {
+    for(i=0; (i<d->nreplica); i++)
+      fprintf(gp,"Chi2[%3d] = %8.2e\n",i,d->d2_replica[i]);
+  }
+}
+
+int gmx_kinetics(int argc,char *argv[])
+{
+  static char *desc[] = {
+    "g_kinetics reads two xvg files, each one containing data for N replicas.",
+    "The first file contains the temperature of each replica at each timestep,"
+    "and the second contains real values that can be interpreted as",
+    "an indicator for folding. If the value in the file is larger than",
+    "the cutoff it is taken to be unfolded and the other way around.[PAR]",
+    "From these data an estimate of the forward and backward rate constants",
+    "for folding is made at a reference temperature. In addition,"
+    "a theoretical melting curve and free energy as a function of temperature"
+    "are printed in an xvg file.[PAR]",
+    "The user can give a max value to be regarded as intermediate",
+    "([TT]-ucut[tt]), which, when given will trigger the use of an intermediate state",
+    "in the algorithm to be defined as those structures that have",
+    "cutoff < DATA < ucut. Structures with DATA values larger than ucut will",
+    "not be regarded as potential folders. In this case 8 parameters are optimized.[PAR]",
+    "The average fraction foled is printed in an xvg file together with the fit to it.", 
+    "If an intermediate is used a further file will show the build of the intermediate and the fit to that process."
+  };
+  static int  nreplica = 1;
+  static real tref     = 298.15;
+  static real cutoff   = 0.2;
+  static real ucut     = 0.0;
+  static real Euf      = 10;
+  static real Efu      = 30;
+  static real Ei       = 10;
+  static bool bHaveT   = TRUE;
+  static real t0       = -1;
+  static real t1       = -1;
+  static real tb       = 0;
+  static real te       = 0;
+  static real tol      = 1e-3;
+  static int  maxiter  = 100;
+  static int  skip     = 0;
+  static bool bBack    = TRUE;
+  static bool bSplit   = TRUE;
+  static bool bSum     = TRUE;
+  t_pargs pa[] = {
+    { "-time",    FALSE, etBOOL, {&bHaveT},
+      "Expect a time in the input" },
+    { "-b",       FALSE, etREAL, {&tb},
+      "First time to read from set" },
+    { "-e",       FALSE, etREAL, {&te},
+      "Last time to read from set" },
+    { "-bfit",    FALSE, etREAL, {&t0},
+      "Time to start the fit from" },
+    { "-efit",    FALSE, etREAL, {&t1},
+      "Time to end the fit" },
+    { "-T",       FALSE, etREAL, {&tref},
+      "Reference temperature for computing rate constants" },
+    { "-n",       FALSE, etINT, {&nreplica},
+      "Read data for # replicas" },
+    { "-cut",     FALSE, etREAL, {&cutoff},
+      "Cut-off (max) value for regarding a structure as folded" },
+    { "-ucut",    FALSE, etREAL, {&ucut},
+      "Cut-off (max) value for regarding a structure as intermediate (if not folded)" },
+    { "-euf",     FALSE, etREAL, {&Euf},
+      "Initial guess for energy of activation for folding (kJ/mole)" },
+    { "-efu",     FALSE, etREAL, {&Efu},
+      "Initial guess for energy of activation for unfolding (kJ/mole)" },
+    { "-ei",      FALSE, etREAL, {&Ei},
+      "Initial guess for energy of activation for intermediates (kJ/mole)" },
+    { "-maxiter", FALSE, etINT, {&maxiter},
+      "Max number of iterations" },
+    { "-back",    FALSE, etBOOL, {&bBack},
+      "Take the back reaction into account" },
+    { "-tol",     FALSE, etREAL,{&tol},
+      "Absolute tolerance for convergence of the Nelder and Mead simplex algorithm" },
+    { "-skip",    FALSE, etINT, {&skip},
+      "Skip points in the output xvg file" },
+    { "-split",   FALSE, etBOOL,{&bSplit},
+      "Estimate error by splitting the number of replicas in two and refitting" },
+    { "-sum",     FALSE, etBOOL,{&bSum},
+      "Average folding before computing chi^2" }
+  };
+#define NPA asize(pa)
+
+  FILE        *fp;
+  real        dt_t,dt_d;
+  int         nset_t,nset_d,n_t,n_d,i;
+  char        *tfile,*dfile;
+  t_remd_data remd;  
+  
+  t_filenm fnm[] = { 
+    { efXVG, "-f",    "temp",    ffREAD   },
+    { efXVG, "-d",    "data",    ffREAD   },
+    { efXVG, "-o",    "ft_all",  ffWRITE  },
+    { efXVG, "-o2",   "it_all",  ffOPTWR  },
+    { efXVG, "-o3",   "ft_repl", ffOPTWR  },
+    { efXVG, "-ee",   "err_est", ffOPTWR  },
+    { efLOG, "-g",    "remd",    ffWRITE  },
+    { efXVG, "-m",    "melt",    ffWRITE  }
+  }; 
+#define NFILE asize(fnm) 
+
+  CopyRight(stderr,argv[0]); 
+  parse_common_args(&argc,argv,PCA_CAN_VIEW | PCA_BE_NICE,
+                   NFILE,fnm,NPA,pa,asize(desc),desc,0,NULL); 
+
+  if (cutoff < 0)
+    gmx_fatal(FARGS,"cutoff should be >= 0 (rather than %f)",cutoff);
+                   
+  tfile  = opt2fn("-f",NFILE,fnm);
+  dfile  = opt2fn("-d",NFILE,fnm);
+  
+  fp = ffopen(opt2fn("-g",NFILE,fnm),"w");
+  
+  remd.temp = read_xvg_time(tfile,bHaveT,
+                           opt2parg_bSet("-b",NPA,pa),tb,
+                           opt2parg_bSet("-e",NPA,pa),te,
+                           nreplica,&nset_t,&n_t,&dt_t,&remd.time);
+  printf("Read %d sets of %d points in %s, dt = %g\n\n",nset_t,n_t,tfile,dt_t);
+  sfree(remd.time);
+  
+  remd.data = read_xvg_time(dfile,bHaveT,
+                           opt2parg_bSet("-b",NPA,pa),tb,
+                           opt2parg_bSet("-e",NPA,pa),te,
+                           nreplica,&nset_d,&n_d,&dt_d,&remd.time);
+  printf("Read %d sets of %d points in %s, dt = %g\n\n",nset_d,n_d,dfile,dt_d);
+  
+  if ((nset_t != nset_d) || (n_t != n_d) || (dt_t != dt_d))
+    gmx_fatal(FARGS,"Files %s and %s are inconsistent. Check log file",
+             tfile,dfile);
+  remd.nreplica = nset_d;
+  remd.nframe   = n_d;
+  remd.dt       = dt_d;
+  preprocess_remd(fp,&remd,cutoff,tref,ucut,bBack,Euf,Efu,Ei,t0,t1,bSum);
+  
+  optimize_remd_parameters(fp,&remd,maxiter,tol);
+  
+  dump_remd_parameters(fp,&remd,opt2fn("-o",NFILE,fnm),
+                      opt2fn_null("-o2",NFILE,fnm),
+                      opt2fn_null("-o3",NFILE,fnm),
+                      opt2fn_null("-ee",NFILE,fnm),
+                      opt2fn("-m",NFILE,fnm),skip,tref);
+
+  if (bSplit) {
+    printf("Splitting set of replicas in two halves\n");
+    for(i=0; (i<remd.nreplica); i++) 
+      remd.bMask[i] = FALSE;
+    remd.nmask = 0;
+    for(i=0; (i<remd.nreplica); i+=2) {
+      remd.bMask[i] = TRUE;
+      remd.nmask++;
+    }
+    sum_ft(&remd);
+    optimize_remd_parameters(fp,&remd,maxiter,tol);
+    dump_remd_parameters(fp,&remd,"test1.xvg",NULL,NULL,NULL,NULL,skip,tref);
+    
+    for(i=0; (i<remd.nreplica); i++) 
+      remd.bMask[i] = !remd.bMask[i];
+    remd.nmask = remd.nreplica - remd.nmask;
+    
+    sum_ft(&remd);
+    optimize_remd_parameters(fp,&remd,maxiter,tol);
+    dump_remd_parameters(fp,&remd,"test2.xvg",NULL,NULL,NULL,NULL,skip,tref);
+    
+    for(i=0; (i<remd.nreplica); i++) 
+      remd.bMask[i] = FALSE;
+    remd.nmask = 0;
+    for(i=0; (i<remd.nreplica/2); i++) {
+      remd.bMask[i] = TRUE;
+      remd.nmask++;
+    }
+    sum_ft(&remd);
+    optimize_remd_parameters(fp,&remd,maxiter,tol);
+    dump_remd_parameters(fp,&remd,"test1.xvg",NULL,NULL,NULL,NULL,skip,tref);
+    
+    for(i=0; (i<remd.nreplica); i++) 
+      remd.bMask[i] = FALSE;
+    remd.nmask = 0;
+    for(i=remd.nreplica/2; (i<remd.nreplica); i++) {
+      remd.bMask[i] = TRUE;
+      remd.nmask++;
+    }
+    sum_ft(&remd);
+    optimize_remd_parameters(fp,&remd,maxiter,tol);
+    dump_remd_parameters(fp,&remd,"test1.xvg",NULL,NULL,NULL,NULL,skip,tref);
+  }
+  fclose(fp);
+  
+  view_all(NFILE, fnm);
+  
+  thanx(stderr);
+  
+  return 0;
+}
+  
+int main(int argc, char *argv[])
+{
+  gmx_kinetics(argc,argv);
+  return 0;
+}
index bdcab7a215cc07637c62f9ea0ee8548dbcaa2bd2..03e43214e0495d3e17d91bff7d1cffa26709dbd4 100644 (file)
@@ -47,7 +47,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "copyrite.h"
 #include "futil.h"
index 0dfd54de8070c5c9496d8808dcadc962ff97beee..44e8151c314d62f6450eb8732e8566464aeae385 100644 (file)
@@ -48,7 +48,7 @@
 #include "statutil.h"
 #include "copyrite.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "matio.h"
 #include "xvgr.h"
index 30cd582c508723f6626de55ed0770d9595b13524..6a8b17996bbed46a5fe4c2fb2d5dc5ee439539aa 100644 (file)
@@ -45,7 +45,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "copyrite.h"
 #include "futil.h"
index 5e89bdc94c0b5280a355ce2569b028f078d96e17..3ef2416b58b3e20444bd1a7121887394667debdb 100644 (file)
@@ -45,7 +45,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "copyrite.h"
 #include "futil.h"
index 07aed784b6f4c2f9d2693f8ae9e78ff8911257b1..f1034c4e499dc203765b1504430613ec03e64aa3 100644 (file)
@@ -594,6 +594,7 @@ static void extract_sq(t_fftgrid *fftgrid,int nbin,real k_max,real lambda,
   }
 }
 
+
 t_complex *** rc_tensor_allocation(int x, int y, int z)
 {
   t_complex ***t;
index 4538520d7fe26e0634a4a8b091210c10a26c950d..7bc8627bbe1522f953dd987b74d13bc686f704be 100644 (file)
@@ -48,7 +48,7 @@
 #include "string2.h"
 #include "vec.h"
 #include "index.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "princ.h"
 #include "rmpbc.h"
@@ -810,9 +810,9 @@ int gmx_rms (int argc,char *argv[])
   for(i=0; (i<teller); i++) {
     if ( bSplit && i>0 && abs(time[bPrev ? freq*i : i]/time_factor())<1e-5 ) 
       fprintf(fp,"&\n");
-    fprintf(fp,"%8.4f",time[bPrev ? freq*i : i]);
+    fprintf(fp,"%12.7f",time[bPrev ? freq*i : i]);
     for(j=0; (j<nrms); j++) {
-      fprintf(fp," %8.4f",rls[j][i]);
+      fprintf(fp," %12.7f",rls[j][i]);
       if (bAv)
        rlstot+=rls[j][i];
     }
@@ -834,9 +834,9 @@ int gmx_rms (int argc,char *argv[])
     for(i=0; (i<teller); i++) {
       if ( bSplit && i>0 && abs(time[i])<1e-5 ) 
        fprintf(fp,"&\n");
-      fprintf(fp,"%8.4f",time[i]);
+      fprintf(fp,"%12.7f",time[i]);
       for(j=0; (j<nrms); j++)
-       fprintf(fp," %8.4f",rlsm[j][i]);
+       fprintf(fp," %12.7f",rlsm[j][i]);
       fprintf(fp,"\n");
     }
   }
index 3c56499d143b2caa38c5a3e8bc8306e8f738e57c..52df89373242e61d22131cbbcc90bed7b7108212 100644 (file)
@@ -50,7 +50,7 @@
 #include "pdbio.h"
 #include "tpxio.h"
 #include "pbc.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "do_fit.h"
 #include "princ.h"
index 4ed89450c4d18aadfbbdd2fcd764dc9945f14e25..e987fb5dde1be0a4586512711369e25436ded462 100644 (file)
@@ -48,7 +48,7 @@
 #include "copyrite.h"
 #include "index.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "xvgr.h"
 #include "gstat.h"
 #include "vec.h"
index 8ae07f9acf79836ac689bcc16d76e4af52a5f8db..947368de06e57d8ec549e6f0988fd3bcd7660cbd 100644 (file)
@@ -47,7 +47,7 @@
 #include "statutil.h"
 #include "copyrite.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "pbc.h"
 #include "xvgr.h"
index dbac43b917783c6fb7fc4deb4c9812b028483c8f..446f1119ba44ffaeb9987c540d19fca4580fda19 100644 (file)
@@ -43,7 +43,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "copyrite.h"
 #include "futil.h"
index afa656a0f4eb4d334a8b8255f40a2a7b98f154a2..ed690aa2e7bb86ae9c82eb0d68b5664ef8a9f12c 100644 (file)
@@ -41,7 +41,7 @@
 #include <math.h>
 #include "confio.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "gstat.h"
 #include "macros.h"
index a61723ce31b5735ddf6ef65b41b9856bb9f69ef7..f31c790edd923d9878b8098f8446f657dbcf0ad8 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "confio.h"
 #include "copyrite.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "gstat.h"
 #include "macros.h"
index 55d797d78f25d49f3bb62c03bf06d72b570db3df..a7c554dcb2300f76528abd42e8d79a7e91dd92f6 100644 (file)
@@ -56,7 +56,7 @@
 #include "pbc.h"
 #include "index.h"
 #include "gstat.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "writeps.h"
 #include "strdb.h"
 
index 826585c13400776c062d8b8c65c007eb1e60257f..13975aec50bf962593ba01b95c7c98099b35f83e 100644 (file)
@@ -45,7 +45,7 @@
 #include "statutil.h"
 #include "writeps.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "smalloc.h"
 #include "string2.h"
 #include "matio.h"
index a613dcb5a87194d5fbc451c89b23df4036e47fd1..c1a6fafdce9fb7e1e8dc6151dd5bbcd02dd7c349 100644 (file)
@@ -46,7 +46,7 @@
 #include "typedefs.h"
 #include "smalloc.h"
 #include "macros.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "vec.h"
 #include "pbc.h"
 #include "copyrite.h"
index 2717c163c7853cca0102097d3ce588e65f599437..227fb1158b993f3521b65a7d88800d6fcb9c3d5d 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "string2.h"
 #include "futil.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 
 static int calc_nftype(int FTYPE,t_idef *idef)
 {
index eda1e99163dae1c618c09cd505676e70d92f031c..03c622091cb6ed60b0698c6dbb4d6446e8ac05e6 100644 (file)
@@ -42,7 +42,7 @@
 #include "maths.h"
 #include "string2.h"
 #include "hxprops.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "smalloc.h"
 #include "readev.h"
index 7c5acd7d89f37ee6358da47476f13b40369bde32..2bc89edf502a5a3ec7cb7b3915ef03f8b053c508 100644 (file)
@@ -40,7 +40,7 @@
 #include <stdio.h>
 #include <math.h>
 #include "typedefs.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "gstat.h"
 
 real LegendreP(real x,unsigned long m)
index 2ce46d0a739df09867f6df0661db7ec87da8b0c2..5e1ad0f4e75cbd859d7ad9a4d6e63a9cabe24c74 100644 (file)
@@ -41,7 +41,7 @@
 #include "maths.h"
 #include "string2.h"
 #include "hxprops.h"
-#include "fatal.h"
+#include "gmx_fatal.h"
 #include "futil.h"
 #include "smalloc.h"
 #include "readev.h"