3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * GROningen Mixture of Alchemy and Childrens' Stories
40 #include <thread_mpi.h>
43 /* This file is completely threadsafe - keep it that way! */
58 static void pr_two(FILE *out
,int c
,int i
)
61 fprintf(out
,"%c0%1d",c
,i
);
63 fprintf(out
,"%c%2d",c
,i
);
66 void pr_difftime(FILE *out
,double dt
)
68 int ndays
,nhours
,nmins
,nsecs
;
72 dt
= dt
-24*3600*ndays
;
81 fprintf(out
,"%d",ndays
);
82 bPrint
=bPrint
|| (nhours
> 0);
85 pr_two(out
,'d',nhours
);
87 fprintf(out
,"%d",nhours
);
89 bPrinted
=bPrinted
|| bPrint
;
90 bPrint
=bPrint
|| (nmins
> 0);
93 pr_two(out
,'h',nmins
);
95 fprintf(out
,"%d",nmins
);
97 bPrinted
=bPrinted
|| bPrint
;
99 pr_two(out
,':',nsecs
);
101 fprintf(out
,"%ds",nsecs
);
108 /* Yes, it is bad to check the environment variable every call,
109 * but we dont call this routine often, and it avoids using
110 * a mutex for locking the variable...
112 return (getenv("GMX_NO_QUOTES") == NULL
);
115 void space(FILE *out
, int n
)
117 fprintf(out
,"%*s",n
,"");
129 static void sp_print(FILE *out
,const char *s
)
134 space(out
,(80-slen
)/2);
135 fprintf(out
,"%s\n",s
);
138 static void ster_print(FILE *out
,const char *s
)
143 sprintf(buf
,":-) %s (-:",s
);
145 space(out
,(80-slen
)/2);
146 fprintf(out
,"%s\n",buf
);
150 static void pukeit(const char *db
,const char *defstring
, char *retstring
,
151 int retsize
, int *cqnum
)
158 if (be_cool() && ((fp
= low_libopen(db
,FALSE
)) != NULL
)) {
159 nhlp
=fget_lines(fp
,&help
);
160 /* for libraries we can use the low-level close routines */
163 *cqnum
=nhlp
*rando(&seed
);
164 if (strlen(help
[*cqnum
]) >= STRLEN
)
165 help
[*cqnum
][STRLEN
-1] = '\0';
166 strncpy(retstring
,help
[*cqnum
],retsize
);
168 for(i
=0; (i
<nhlp
); i
++)
173 strncpy(retstring
,defstring
,retsize
);
176 void bromacs(char *retstring
, int retsize
)
180 pukeit("bromacs.dat",
181 "Groningen Machine for Chemical Simulation",
182 retstring
,retsize
,&dum
);
185 void cool_quote(char *retstring
, int retsize
, int *cqnum
)
196 /* protect audience from explicit lyrics */
197 snew(tmpstr
,retsize
+1);
198 pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day",
201 if ((ptr
= strchr(tmpstr
,'_')) != NULL
) {
204 sprintf(retstring
,"\"%s\" %s",tmpstr
,ptr
);
207 strcpy(retstring
,tmpstr
);
212 void CopyRight(FILE *out
,const char *szProgram
)
214 /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
215 * name of a file. Otherwise, we won't be able to find the library dir.
217 #define NCR (int)asize(CopyrightText)
219 #define NGPL 0 /*FAH has an exception permission from GPL to allow digital signatures in Gromacs*/
221 #define NGPL (int)asize(GPLText)
224 char buf
[256],tmpstr
[1024];
227 set_program_name(szProgram
);
229 ster_print(out
,"G R O M A C S");
232 bromacs(tmpstr
,1023);
233 sp_print(out
,tmpstr
);
236 ster_print(out
,GromacsVersion());
239 /* fprintf(out,"\n");*/
241 /* sp_print(out,"PLEASE NOTE: THIS IS A BETA VERSION\n");
243 fprintf(out,"\n"); */
245 for(i
=0; (i
<NCR
); i
++)
246 sp_print(out
,CopyrightText
[i
]);
247 for(i
=0; (i
<NGPL
); i
++)
248 sp_print(out
,GPLText
[i
]);
252 sprintf(buf
,"%s",Program());
254 strcat(buf
," (double precision)");
266 /* protect the audience from suggestive discussions */
267 cool_quote(cq
,1023,&cqnum
);
270 fprintf(fp
,"\ngcq#%d: %s\n\n",cqnum
,cq
);
272 fprintf(fp
,"\n%s\n\n",cq
);
284 void please_cite(FILE *fp
,const char *key
)
286 static const t_citerec citedb
[] = {
288 "M. P. Allen and D. J. Tildesley",
289 "Computer simulation of liquids",
290 "Oxford Science Publications",
293 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
294 "GROMACS: A message-passing parallel molecular dynamics implementation",
298 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
299 "Molecular dynamics with coupling to an external bath",
301 81, 1984, "3684-3690" },
303 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
304 "Numerical Integration of the Cartesian Equations of Motion of a System with Constraints; Molecular Dynamics of n-Alkanes",
306 23, 1977, "327-341" },
308 "S. Miyamoto and P. A. Kollman",
309 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms for Rigid Water Models",
311 13, 1992, "952-962" },
313 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
314 "Algorithms for Constrained Molecular Dynamics",
316 16, 1995, "1192-1209" },
318 "U. Essman, L. Perela, M. L. Berkowitz, T. Darden, H. Lee and L. G. Pedersen ",
319 "A smooth particle mesh Ewald method",
321 103, 1995, "8577-8592" },
323 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
324 "Time-dependent distance restraints in molecular dynamics simulations",
326 157, 1989, "289-294" },
328 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
329 "Generalized reaction field method for molecular dynamics simulations",
331 102, 1995, "5451-5459" },
333 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
334 "LINCS: A Linear Constraint Solver for molecular simulations",
336 18, 1997, "1463-1472" },
339 "P-LINCS: A Parallel Linear Constraint Solver for molecular simulation",
340 "J. Chem. Theory Comput.",
341 4, 2008, "116-122" },
343 "B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl",
344 "GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable molecular simulation",
345 "J. Chem. Theory Comput.",
346 4, 2008, "435-447" },
348 "Y. In-Chul and M. L. Berkowitz",
349 "Ewald summation for systems with slab geometry",
351 111, 1999, "3155-3162" },
353 "B. L. de Groot and D. M. F. van Aalten and R. M. Scheek and A. Amadei and G. Vriend and H. J. C. Berendsen",
354 "Prediction of Protein Conformational Freedom From Distance Constrains",
356 29, 1997, "240-251" },
358 "D. van der Spoel and P. J. van Maaren and H. J. C. Berendsen",
359 "A systematic study of water models for molecular simulation. Derivation of models optimized for use with a reaction-field.",
361 108, 1998, "10220-10230" },
363 "D. S. Wishart and A. M. Nip",
364 "Protein Chemical Shift Analysis: A Practical Guide",
365 "Biochem. Cell Biol.",
366 76, 1998, "153-163" },
368 "V. N. Maiorov and G. M. Crippen",
369 "Size-Independent Comparison of Protein Three-Dimensional Structures",
370 "PROTEINS: Struct. Funct. Gen.",
371 22, 1995, "273-283" },
373 "K. A. Feenstra and B. Hess and H. J. C. Berendsen",
374 "Improving Efficiency of Large Time-scale Molecular Dynamics Simulations of Hydrogen-rich Systems",
376 20, 1999, "786-798" },
378 "N. Timneanu and C. Caleman and J. Hajdu and D. van der Spoel",
379 "Auger Electron Cascades in Water and Ice",
381 299, 2004, "277-283" },
383 "E. Lindahl and B. Hess and D. van der Spoel",
384 "GROMACS 3.0: A package for molecular simulation and trajectory analysis",
386 7, 2001, "306-317" },
388 "J. Wang and W. Wang and S. Huo and M. Lee and P. A. Kollman",
389 "Solvation model based on weighted solvent accessible surface area",
391 105, 2001, "5055-5067" },
393 "D. Eisenberg and A. D. McLachlan",
394 "Solvation energy in protein folding and binding",
396 319, 1986, "199-203" },
398 "Frank Eisenhaber and Philip Lijnzaad and Patrick Argos and Chris Sander and Michael Scharf",
399 "The Double Cube Lattice Method: Efficient Approaches to Numerical Integration of Surface Area and Volume and to Dot Surface Contouring of Molecular Assemblies",
401 16, 1995, "273-284" },
403 "B. Hess, H. Saint-Martin and H.J.C. Berendsen",
404 "Flexible constraints: an adiabatic treatment of quantum degrees of freedom, with application to the flexible and polarizable MCDHO model for water",
406 116, 2002, "9602-9610" },
408 "Csaba Hetenyi and David van der Spoel",
409 "Efficient docking of peptides to proteins without prior knowledge of the binding site.",
411 11, 2002, "1729-1737" },
413 "B. Hess and R.M. Scheek",
414 "Orientation restraints in molecular dynamics simulations using time and ensemble averaging",
416 164, 2003, "19-27" },
418 "A. K. Rappe and W. A. Goddard III",
419 "Charge Equillibration for Molecular Dynamics Simulations",
421 95, 1991, "3358-3363" },
423 "Y. Mu, P. H. Nguyen and G. Stock",
424 "Energy landscape of a small peptide revelaed by dihedral angle principal component analysis",
425 "Prot. Struct. Funct. Bioinf.",
428 "T. Okabe and M. Kawata and Y. Okamoto and M. Mikami",
429 "Replica-exchange {M}onte {C}arlo method for the isobaric-isothermal ensemble",
431 335, 2001, "435-439" },
433 "K. Hukushima and K. Nemoto",
434 "Exchange Monte Carlo Method and Application to Spin Glass Simulations",
435 "J. Phys. Soc. Jpn.",
436 65, 1996, "1604-1608" },
439 "Dipolar Relaxation and Nuclear Overhauser effects in nonrigid molecules: The effect of fluctuating internuclear distances",
441 72, 1980, "6035-6043" },
443 "P. Bultinck and W. Langenaeker and P. Lahorte and F. De Proft and P. Geerlings and M. Waroquier and J. P. Tollenaere",
444 "The electronegativity equalization method I: Parametrization and validation for atomic charge calculations",
446 106, 2002, "7887-7894" },
448 "Q. Y. Yang and K. A. Sharp",
449 "Atomic charge parameters for the finite difference Poisson-Boltzmann method using electronegativity neutralization",
450 "J. Chem. Theory Comput.",
451 2, 2006, "1152-1167" },
453 "D. van der Spoel, E. Lindahl, B. Hess, G. Groenhof, A. E. Mark and H. J. C. Berendsen",
454 "GROMACS: Fast, Flexible and Free",
456 26, 2005, "1701-1719" },
458 "D. van der Spoel, P. J. van Maaren, P. Larsson and N. Timneanu",
459 "Thermodynamics of hydrogen bonding in hydrophilic and hydrophobic media",
461 110, 2006, "4393-4398" },
463 "D. van der Spoel and M. M. Seibert",
464 "Protein folding kinetics and thermodynamics from atomistic simulations",
465 "Phys. Rev. Letters",
466 96, 2006, "238102" },
469 "Transverse-current autocorrelation-function calculations of the shear viscosity for molecular liquids",
471 49, 1994, "359-366" },
473 "G. Bussi, D. Donadio and M. Parrinello",
474 "Canonical sampling through velocity rescaling",
476 126, 2007, "014101" },
478 "J. S. Hub and B. L. de Groot",
479 "Does CO2 permeate through Aquaporin-1?",
481 91, 2006, "842-848" },
483 "J. S. Hub and B. L. de Groot",
484 "Mechanism of selectivity in aquaporins and aquaglyceroporins",
486 105, 2008, "1198-1203" }
488 #define NSTR (int)asize(citedb)
493 #define LINE_WIDTH 79
498 for(index
=0; (index
<NSTR
) && (strcmp(citedb
[index
].key
,key
) != 0); index
++)
501 fprintf(fp
,"\n++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++\n");
503 /* Insert newlines */
504 author
= wrap_lines(citedb
[index
].author
,LINE_WIDTH
,0,FALSE
);
505 title
= wrap_lines(citedb
[index
].title
,LINE_WIDTH
,0,FALSE
);
506 fprintf(fp
,"%s\n%s\n%s %d (%d) pp. %s\n",
507 author
,title
,citedb
[index
].journal
,
508 citedb
[index
].volume
,citedb
[index
].year
,
509 citedb
[index
].pages
);
514 fprintf(fp
,"Entry %s not found in citation database\n",key
);
516 fprintf(fp
,"-------- -------- --- Thank You --- -------- --------\n\n");
520 /* This routine only returns a static (constant) string, so we use a
521 * mutex to initialize it. Since the string is only written to the
522 * first time, there is no risk with multiple calls overwriting the
523 * output for each other.
525 const char *GromacsVersion()
528 /* Version generated at compile time. */
531 /* Fall back to statically defined version. */
532 static const char ver_string
[]="VERSION " VERSION
;