changed reading hint
[gromacs/adressmacs.git] / src / tools / protonate.c
blob6b9471f12d8bc8e54d7d1876313df667fff05ce0
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Great Red Oystrich Makes All Chemists Sane
29 static char *SRCID_protonate_c = "$Id$";
31 #include <math.h>
32 #include "typedefs.h"
33 #include "macros.h"
34 #include "copyrite.h"
35 #include "smalloc.h"
36 #include "statutil.h"
37 #include "confio.h"
38 #include "genhydro.h"
40 int main (int argc,char *argv[])
42 static char *desc[] = {
43 "protonate protonates a protein molecule."
46 char title[256];
47 t_atoms *atoms;
48 rvec *x,*v;
49 matrix box;
50 int natoms;
52 t_filenm fnm[] = {
53 { efSTX, "-f", NULL, ffREAD },
54 { efSTO, "-o", "confout", ffWRITE }
56 #define NFILE asize(fnm)
58 CopyRight(stderr,argv[0]);
59 parse_common_args(&argc,argv,0,FALSE,NFILE,fnm,0,NULL,
60 asize(desc),desc,0,NULL);
62 snew(atoms,1);
63 atoms->nr=0;
64 atoms->nres=0;
65 get_stx_coordnum(opt2fn("-f",NFILE,fnm),&natoms);
66 init_t_atoms(atoms,natoms,FALSE);
67 snew(x,natoms);
68 snew(v,natoms);
69 read_stx_conf(opt2fn("-f",NFILE,fnm),title,atoms,x,v,box);
70 sfree(v);
72 fprintf(stderr,"Read title: %s\n",title);
74 protonate(&atoms,&x);
75 snew(v,atoms->nr);
77 write_sto_conf(opt2fn("-o",NFILE,fnm),title,atoms,x,v,box);
79 thanx(stdout);
81 return 0;