4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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
27 * Green Red Orange Magenta Azure Cyan Skyblue
29 static char *SRCID_copyrite_c
= "$Id$";
43 static void pr_two(FILE *out
,int c
,int i
)
46 fprintf(out
,"%c0%1d",c
,i
);
48 fprintf(out
,"%c%2d",c
,i
);
51 void pr_difftime(FILE *out
,double dt
)
53 int ndays
,nhours
,nmins
,nsecs
;
57 dt
= dt
-24*3600*ndays
;
66 fprintf(out
,"%d",ndays
);
67 bPrint
=bPrint
|| (nhours
> 0);
70 pr_two(out
,'d',nhours
);
72 fprintf(out
,"%d",nhours
);
74 bPrinted
=bPrinted
|| bPrint
;
75 bPrint
=bPrint
|| (nmins
> 0);
78 pr_two(out
,'h',nmins
);
80 fprintf(out
,"%d",nmins
);
82 bPrinted
=bPrinted
|| bPrint
;
84 pr_two(out
,':',nsecs
);
86 fprintf(out
,"%ds",nsecs
);
95 if ((getenv("IAMCOOL")) == NULL
)
103 void space(FILE *out
, int n
)
105 fprintf(out
,"%*s",n
,"");
108 void f(char *a
){int i
;for(i
=0;i
<(int)strlen(a
);i
++)a
[i
]=~a
[i
]; }
110 static void sp_print(FILE *out
,char *s
)
115 space(out
,(80-slen
)/2);
116 fprintf(out
,"%s\n",s
);
119 static void ster_print(FILE *out
,char *s
)
124 sprintf(buf
,":-) %s (-:",s
);
126 space(out
,(80-slen
)/2);
127 fprintf(out
,"%s\n",buf
);
130 /* char *GromacsVersion() */
137 static char *pukeit(char *db
,char *defstring
)
139 static char hulp
[STRLEN
];
147 else if ((fp
= low_libopen(db
,FALSE
)) != NULL
) {
148 nhlp
=fget_lines(fp
,&help
);
151 nran
=nhlp
*rando(&seed
);
152 if (strlen(help
[nran
]) >= STRLEN
)
153 help
[nran
][STRLEN
-1] = '\0';
154 strcpy(hulp
,help
[nran
]);
156 for(i
=0; (i
<nhlp
); i
++)
168 return pukeit("bromacs.dat",
169 "Groningen Machine for Chemical Simulation");
172 char *cool_quote(void)
174 static char buf
[1024];
177 /* protect audience from explicit lyrics */
178 s
= pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day");
180 if (be_cool() && ((ptr
=strchr(s
,'_')) != NULL
)) {
183 sprintf(buf
,"\"%s\" %s",s
,ptr
);
192 void CopyRight(FILE *out
,char *szProgram
)
194 #define NCR asize(CopyrightText)
200 ster_print(out
,"G R O M A C S");
207 ster_print(out
,GromacsVersion());
210 for(i
=0; (i
<NCR
); i
++)
211 sp_print(out
,CopyrightText
[i
]);
213 sprintf(buf
,"%s",szProgram
);
215 strcat(buf
," (double precision)");
225 /* protect the audience from suggestive discussions */
229 snew(c
,strlen(cq
)+20);
230 sprintf(c
,"gcq#%d: %s\n",nran
,cq
);
231 fprintf(fp
,"\n%s\n",c
);
235 fprintf(fp
,"\n%s\n",cq
);
238 void please_cite(FILE *fp
,char *key
)
240 static char *citedb
[] = {
242 "H. J. C. Berendsen, D. van der Spoel and R. van Drunen",
243 "GROMACS: A message-passing parallel molecular dynamics implementation",
248 "H. J. C. Berendsen, J. P. M. Postma, A. DiNola and J. R. Haak",
249 "Molecular dynamics with coupling to an external bath",
254 "J. P. Ryckaert and G. Ciccotti and H. J. C. Berendsen",
255 "Numerical Integration of the Cartesian Equations of Motion of a "
256 "System with Constraints; Molecular Dynamics of n-Alkanes",
261 "S. Miyamoto and P. A. Kollman",
262 "SETTLE: An Analytical Version of the SHAKE and RATTLE Algorithms "
263 "for Rigid Water Models",
268 "E. Barth and K. Kuczera and B. Leimkuhler and R. D. Skeel",
269 "Algorithms for Constrained Molecular Dynamics",
274 "A. E. Torda and R. M. Scheek and W. F. van Gunsteren",
275 "Time-dependent distance restraints in molecular dynamics simulations",
280 "I. G. Tironi and R. Sperb and P. E. Smith and W. F. van Gunsteren",
281 "Generalized reaction field method for molecular dynamics simulations",
283 "102 1995 5451 5459",
286 "B. Hess and H. Bekker and H. J. C. Berendsen and J. G. E. M. Fraaije",
287 "LINCS: A Linear Constraint Solver for molecular simulations",
292 "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",
293 "Prediction of Protein Conformational Freedom From Distance Constrains",
297 #define NSTR asize(citedb)
299 int j
,index
,year
,vol
,p1
,p2
;
301 #define LINE_WIDTH 79
303 index
= search_str(NSTR
,citedb
,key
);
305 fprintf(fp
,"\n++++++++ PLEASE CITE THE FOLLOWING REFERENCE ++++++++\n");
306 if ((index
!= -1) && (index
+4 < NSTR
)) {
307 if (sscanf(citedb
[index
+4],"%d%d%d%d",&vol
,&year
,&p1
,&p2
) != 4) {
310 /* Insert newlines */
311 for(j
=1; (j
<=3); j
++)
312 ptr
[j
-1] = wrap_lines(citedb
[index
+j
],LINE_WIDTH
,0);
313 fprintf(fp
,"%s\n%s\n%s %d (%d) pp. %d-%d\n",
314 ptr
[0],ptr
[1],ptr
[2],
320 fprintf(fp
,"Entry %s not found in citation database\n",key
);
322 fprintf(fp
,"-------- -------- --- Thank You --- -------- --------\n\n");