4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Copyright (c) 1991-2001, University of Groningen, The Netherlands
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * If you want to redistribute modifications, please consider that
18 * scientific software is very special. Version control is crucial -
19 * bugs must be traceable. We will be happy to consider code for
20 * inclusion in the official distribution, but derived work must not
21 * be called official GROMACS. Details are found in the README & COPYING
22 * files - if they are missing, get the official version at www.gromacs.org.
24 * To help us fund GROMACS development, we humbly ask that you cite
25 * the papers on the package - you can find them in the top README file.
27 * For more info, check our website at http://www.gromacs.org
30 * Getting the Right Output Means no Artefacts in Calculating Stuff
43 #include <types/simple.h>
52 #define FCON " &" /* continuation line in f77 */
53 #define max(a,b) (((a) > (b)) ? (a) : (b))
56 /* Array referencing shortcut */
57 #define ARRAY(a,idx) _array(#a,#idx)
66 } decl_t
; /* Argument and variable buffer element */
68 extern int prec
; /* precision (4=single, 8=double) */
69 extern int IND
; /* current indentation */
70 extern char *codebuffer
; /* buffer to which code is written */
71 extern char header
[10000]; /* buffer for info and loop name */
72 extern FILE *output
; /* output file */
73 extern decl_t
*decl_list
; /* list with args and vars */
74 extern int ndecl
; /* length of above list */
75 extern int nargs
; /* first nargs are arguments, rest is vars */
79 /* Concatenate a string to a buffer with plus sign between terms. */
80 void add_to_buffer(char *buffer
,char *term
);
82 /* initiate output buffers */
83 void init_metacode(void);
85 /* write a function to file and empty buffers */
86 void flush_buffers(void);
88 /* Return the correct indentation as a string */
91 /* Print a line of code to the output file */
92 void code(char *fmt
, ...);
97 void comment(char *s
);
99 /* Define a new floating-point variable */
100 void declare_real(char *name
);
101 void declare_real_vector(char *name
);
103 void declare_const_real(char *name
,double val
);
104 void declare_const_int(char *name
,int val
);
106 void declare_int(char *name
);
107 void declare_int_vector(char *name
);
108 void declare_real4(char *name
);
109 void declare_int4(char *name
);
110 void declare_int8(char *name
);
111 void declare_intreal(char *name
);
112 void declare_other(char *typename
,char *name
);
114 /* Cray vector pragma */
115 void vector_pragma(void);
118 char *_array(char *a
,char *idx
, ...);
120 void _p_state(char *left
,char *right
,char *symb
);
122 void file_error(char *fn
);
124 void assign(char *left
, char *right
, ...);
126 void increment(char *left
,char *right
, ...);
128 void decrement(char *left
,char *right
, ...);
130 void add(char *left
,char *r1
,char *r2
, ...);
132 void subtract(char *left
,char *r1
,char *r2
, ...);
134 void multiply(char *left
,char *r1
,char *r2
, ...);
138 void usage(int argc
,char *argv
[]);
140 int count_lines(char *fn
);
142 void edit_warning(char *fn
);
144 void start_loop(char *lvar
,char *from
,char *to
);
146 void start_stride_loop(char *lvar
,char *from
,char *to
, char *stride
);
150 void start_if(char *cond
);
154 void close_func(void);