4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
34 * Gromacs Runs On Most of All Computer Systems
47 #include <types/simple.h>
56 #define FCON " &" /* continuation line in f77 */
57 #define max(a,b) (((a) > (b)) ? (a) : (b))
60 /* Array referencing shortcut */
61 #define ARRAY(a,idx) _array(#a,#idx)
70 } decl_t
; /* Argument and variable buffer element */
72 extern int prec
; /* precision (4=single, 8=double) */
73 extern int IND
; /* current indentation */
74 extern char *codebuffer
; /* buffer to which code is written */
75 extern char header
[10000]; /* buffer for info and loop name */
76 extern FILE *output
; /* output file */
77 extern decl_t
*decl_list
; /* list with args and vars */
78 extern int ndecl
; /* length of above list */
79 extern int nargs
; /* first nargs are arguments, rest is vars */
83 /* Concatenate a string to a buffer with plus sign between terms. */
84 void add_to_buffer(char *buffer
,char *term
);
86 /* initiate output buffers */
87 void init_metacode(void);
89 /* write a function to file and empty buffers */
90 void flush_buffers(void);
92 /* Return the correct indentation as a string */
95 /* Print a line of code to the output file */
96 void code(char *fmt
, ...);
101 void comment(char *s
);
103 /* Define a new floating-point variable */
104 void declare_real(char *name
);
105 void declare_real_vector(char *name
);
107 void declare_const_real(char *name
,double val
);
108 void declare_const_int(char *name
,int val
);
110 void declare_int(char *name
);
111 void declare_int_vector(char *name
);
112 void declare_real4(char *name
);
113 void declare_int4(char *name
);
114 void declare_int8(char *name
);
115 void declare_intreal(char *name
);
116 void declare_other(char *typename
,char *name
);
118 /* Cray vector pragma */
119 void vector_pragma(void);
122 char *_array(char *a
,char *idx
, ...);
124 void _p_state(char *left
,char *right
,char *symb
);
126 void file_error(char *fn
);
128 void assign(char *left
, char *right
, ...);
130 void increment(char *left
,char *right
, ...);
132 void decrement(char *left
,char *right
, ...);
134 void add(char *left
,char *r1
,char *r2
, ...);
136 void subtract(char *left
,char *r1
,char *r2
, ...);
138 void multiply(char *left
,char *r1
,char *r2
, ...);
142 void usage(int argc
,char *argv
[]);
144 int count_lines(char *fn
);
146 void edit_warning(char *fn
);
148 void start_loop(char *lvar
,char *from
,char *to
);
150 void start_stride_loop(char *lvar
,char *from
,char *to
, char *stride
);
154 void start_if(char *cond
);
158 void close_func(void);