NEURON
version.cpp
Go to the documentation of this file.
1 #include <../../nmodlconf.h>
2 /* $Header$ */
3 /*
4 $Log$
5 Revision 1.2 2005/10/04 20:55:32 hines
6 The bg1 branch is merged into the Main trunk. That branch contains all
7 the BlueGene specific enhancements and many general Parallel Network simulation
8 enhancements that were useful for efficient simulation on the BlueGene.
9 The bottom line is that a 25000 cell Cortical network eleptogenesis model
10 by Paul Bush, re-written for parallel simulation by Bill Lytton shows linear
11 speedup on up to 2500 cpus on the BlueGene. This model generated approximately
12 200000 spikes and managed over 100,000,000 NetCons.
13 
14 Revision 1.1.1.1.72.1 2005/09/25 16:59:51 hines
15 A first pass at configure support for cross compiling. Not perfect but
16 much superior to what existed prior to this commit. The problem is that
17 although most of the binaries constructed are executed on the host
18 machine, there are three, hoc_e, modlunit, and nocmodl, that are
19 executed on the build machine. This means potentially different
20 configuration, compilers, and makefile dependency mechanisms. The
21 current solution requires two passes. The first pass is to configure
22 with the --with-nmodl-only option and then make and make install. That
23 pass constructs a nmodlconf.h file which is the dual to nrnconf.h. The
24 second pass should configure with the --without-nmodl option and then
25 make and make install. Note that it is important to properly set
26 CC, CXX, CFLAGS, CXXFLAGS, LIBS and any other thing that is distinct between
27 the configurations. Also note that the BlueGene is special since those
28 variables are set to proper default values for both passes. In this
29 case the nmodl pass should have the configuration options
30 --enable-bluegene --with-nmodl-only
31 and the second pass does NOT need the --without-nmodl option and the single
32 option --enable-bluegene suffices.
33 One can switch to the build configuration without affecting the host and
34 vice versa since .h.in files are not shared. That is helpful as there are
35 no files that have to be recompiled due to the switch.
36 
37 Revision 1.1.1.1 2003/02/11 18:36:08 hines
38 NEURON Simulation environment. Unreleased 5.4 development version.
39 
40 Revision 1.1.1.1 2003/01/01 17:46:33 hines
41 NEURON -- Version 5.4 2002/12/23 from prospero as of 1-1-2003
42 
43 Revision 1.1.1.1 2002/06/26 16:23:07 hines
44 NEURON 5.3 2002/06/04
45 
46  * Revision 1.1.1.1 2001/01/01 20:30:34 hines
47  * preparation for general sparse matrix
48  *
49  * Revision 1.2 2000/03/27 14:17:44 hines
50  * All sources now include nrnconf.h instead of config.h so that minor
51  * option changes (eg in src/parallel/bbsconf.h) do not require recompilation
52  * of everything.
53  *
54  * Revision 1.1.1.1 2000/03/09 13:55:34 hines
55  * almost working
56  *
57  * Revision 4.3 1997/11/13 19:53:08 hines
58  * LONGITUDINAL_DIFFUSION area {state} allowed in KINETIC block
59  * same syntax as COMPARTMENT statement.
60  * Units checking not established yet but area should be in um2 and
61  * the COMPARTMENT volume units should be um3/um.
62  * If the longitudinal area is affected by diam then diam should
63  * appear explicitly in the area expression (generally as diam*diam/4
64  * but perhaps some coordinate systems may have area that scales
65  * linearly with diam).
66  * Longitudinal diffusion works correctly with changing diameter and
67  * rallbranch. It works with cvode but the linear solver for it
68  * is currently equivalent to modified euler. With CVODE and
69  * cvode.jacobian(1) to use a full matrix the approach to steady state
70  * is fast if there are not too many states. It would be nice to
71  * do some approimate tridiagonal system approaches for the built-in
72  * linear solver.
73  *
74  * Revision 4.2 1997/10/20 14:59:33 hines
75  * nocmodl file.mod allowed (ie suffix is allowed)
76  *
77  * Revision 4.1 1997/08/30 20:45:38 hines
78  * cvs problem with branches. Latest nmodl stuff should now be a top level
79  *
80  * Revision 4.0.1.1 1997/08/08 17:24:06 hines
81  * nocmodl version 4.0.1
82  *
83  * Revision 4.0 1997/08/08 17:22:24 hines
84  * version 4.0 of nocmodl
85  *
86  * Revision 1.4 1997/08/08 17:21:52 hines
87  * version 4.0 of nocmodl
88  *
89  * Revision 1.3 1997/08/08 17:06:34 hines
90  * proper nocmodl version number
91  *
92  * Revision 1.2 1997/08/08 17:03:28 hines
93  * correct nocmodl language version
94  *
95  * Revision 1.1.1.1 1994/10/12 17:21:37 hines
96  * NEURON 3.0 distribution
97  *
98  * Revision 9.194 1994/10/03 17:49:49 hines
99  * more flexibility as to relation of erev and concentrations and their types
100  *
101  * Revision 9.193 1994/09/26 18:37:06 hines
102  * forgot to checkin last time
103  *
104  * Revision 9.192 1994/09/26 18:20:19 hines
105  * USEION ... VALENCE real
106  * required when a model uses an ion other than na, k, ca
107  * USEION ... WRITE cai, cao
108  * promotes cai, cao to STATE
109  * USEION ... READ cai, cao
110  * promotes cai, cao to CONST
111  *
112  * Revision 9.191 1994/09/20 14:45:44 hines
113  * port to dec alpha
114  *
115  * Revision 9.190 1994/09/20 14:44:11 hines
116  * port to dec alpha
117  *
118  * Revision 9.189 1994/08/23 15:45:09 hines
119  * In SOLVE procedure the VERBATIM return 0; is no longer
120  * requires since all procedures have this by default.
121  * In nocmodl, INDEPENDENT no longer required since if doesn't exist then
122  * t (ms) automatically declared.
123  *
124  * Revision 9.188 1994/08/18 12:12:43 hines
125  * properly put pragmas in with if... else stmts.
126  * Dont use pragmas in nonvectorized part of kinetic block
127  *
128  * Revision 9.187 1994/08/05 14:11:14 hines
129  * NullParameter replaces null args in Imakefile
130  *
131  * Revision 9.186 1994/08/04 20:03:55 hines
132  * forgot to remove 1 && from kinetic vectorize testbed
133  *
134  * Revision 9.185 1994/07/30 17:14:21 hines
135  * standard check for bison and changes to kinetic vectorization surrounded
136  * by proper conditional preprocessor directives
137  *
138  * Revision 9.184 1994/07/26 14:04:22 hines
139  * avoid objectcenter warning about retrieving int from pointer when
140  * procedure is solved. The pointer in question is null and the int
141  * is never used.
142  *
143  * Revision 9.183 1994/07/25 20:59:38 hines
144  * wrong number of args in an emission of MATELM in new style.
145  *
146  * Revision 9.182 1994/07/21 13:11:16 hines
147  * allow vectorization of kinetic blocks on cray when using sparse method.
148  * not tested yet
149  *
150  * Revision 9.181 1994/05/23 17:56:52 hines
151  * error in handling MODL_INCLUDE when no file exists
152  *
153  * Revision 9.180 1994/05/18 18:11:56 hines
154  * INCLUDE "file"
155  * tries originalpath/file ./file MODL_INCLUDEpaths/file
156  *
157  * Revision 9.179 1994/05/09 19:10:30 hines
158  * pointprocess.has_loc() returns true if point process located in section
159  *
160  * Revision 9.178 1994/05/02 12:48:35 hines
161  * on abort with NOCMODL call nrn_complain(_p) to tell location where
162  * failure occurred (only SOLVE statement) and print line and .mod file
163  *
164  * Revision 9.177 1994/03/16 20:51:30 hines
165  * use getcwd instead of getwd. More portable
166  *
167  * Revision 9.176 1994/03/08 17:51:05 hines
168  * allow help syntax, ? treated same as :
169  * send the filename and mechname to hoc during registration
170  *
171  * Revision 9.175 1994/02/24 19:25:58 hines
172  * better error message if no declaration and gets caught in decode_ustr
173  *
174  * Revision 9.174 1993/11/04 15:53:20 hines
175  * port to solaris2 (no more warnings)
176  *
177  * Revision 9.173 1993/07/09 17:21:34 hines
178  * fix error in vectorization of solve from last change
179  *
180  * Revision 9.172 93/07/09 16:28:36 hines
181  * point processes now work correctly when they are electrodes and an
182  * extracellular mechananism is present.
183  * vclmp.mod and stim.mod are electrodes
184  * positive electrode current causes depolarization (normal mechanism
185  * current is positive outward)
186  * When ELECTRODE_CURRENT keyword is present then v refers to
187  * vmembrane+vext
188  * Note : no warning is given if there are membrane currents within
189  * the same model. they are also silently treated the same way as
190  * an electrode
191  *
192  * Revision 9.171 93/07/08 14:46:09 hines
193  * Alternative to NONSPECIFIC_CURRENT is ELECTRODE_CURRENT
194  * at this time is identical to old way. Introduced because membrane
195  * mechanisms for electrode currents don't work right because the
196  * current is assumed to pass from the extracellular space to the inside
197  * and thus current injection does not change vext (and it is opposite in
198  * sign to what one would expect). This change is not complete here. Only
199  * the scaffolding is now in place and it has been verified to be identical
200  * to the old way. The change is mostly to non-vectorized models and
201  * now
202  * void nrn_cur(Node*, double*, Datum*) so that the model gets v directly
203  * from the node and changes d and rhs from the node.
204  *
205  * Revision 9.170 93/05/17 11:06:54 hines
206  * PI defined by some <math.h> so undefing it
207  *
208  * Revision 9.169 93/04/28 10:01:12 hines
209  * local right hand side for sparse. used to be extern modl_rhs now it is
210  * coef... This allows multiple models to use sparse.
211  *
212  * Revision 9.168 93/04/23 11:13:45 hines
213  * model keeps sparse method state in its own static area so sparse
214  * can solve different sets of equations
215  *
216  * Revision 9.167 93/04/21 11:06:10 hines
217  * lineq blocks do not return error number
218  * nocpout point processes dparam element 2 reserved for a pointer to
219  * Point_process
220  *
221  * Revision 9.166 93/03/21 17:47:57 hines
222  * for some reason vectorized models with functions with no args
223  * were begin translated at f(ix_,)
224  *
225  * Revision 9.165 93/02/25 13:25:51 hines
226  * need_memb called with symbol instead of name
227  *
228  * Revision 9.164 93/02/23 14:51:59 hines
229  * compiles with dos
230  *
231  * Revision 9.163 93/02/23 14:48:15 hines
232  * compiles with DOS
233  *
234  * Revision 9.162 93/02/23 14:43:33 hines
235  * works under DOS
236  *
237  * Revision 9.161 93/02/15 08:57:33 hines
238  * linux
239  *
240  * Revision 9.159 93/02/11 16:55:48 hines
241  * minor mods for NeXT
242  *
243  * Revision 9.158 93/02/02 10:32:50 hines
244  * create static func before usage
245  *
246  * Revision 9.157 93/02/01 15:18:19 hines
247  * static functions should be declared before use.
248  * inline is keyword for some compilers.
249  *
250  * Revision 9.156 93/01/23 13:13:57 hines
251  * The NeXT does not like to include files twice so nmodl_redef.h
252  * has been separated into nmodl1_redef.h and nmodl2_redef.h
253  *
254  * Revision 9.155 93/01/05 11:05:46 hines
255  * functions with no suffix still need to be declared
256  *
257  * Revision 9.154 92/11/10 11:56:22 hines
258  * when compiling a translated model on the CRAY (with _CRAY defined as 1)
259  * the check table functions are taken out of the loops. This is
260  * not entirely safe if tables are used (and dependencies have changed)
261  * in direct calls to functions that call functions with tables. It is
262  * reasonably safe for finitialize(), fadvance(), fcurrent(), and
263  * calling the hoc_function itself.
264  *
265  * Revision 9.153 92/10/30 16:06:36 hines
266  * echo proper number of shift/reduce conflicts
267  *
268  * Revision 9.152 92/10/27 09:28:20 hines
269  * all point processes use same steer_point_process in nrnoc/point.c
270  * so there is no need to register a special one.
271  *
272  * Revision 9.151 92/10/24 16:31:43 hines
273  * sets prop->param_size for use in notifying interviews when arrays are freed
274  *
275  * Revision 9.150 92/10/11 15:40:49 hines
276  * forgot to declare _n_func for tables
277  *
278  * Revision 9.149 92/10/09 08:15:13 hines
279  * for nrnoc, change in point process output style. now creates a built
280  * in object for point processes. lives in SUN4nocmod
281  *
282  * Revision 9.148 92/10/05 13:05:03 hines
283  * table functions separated into name(), _check_name(), _f_name(),
284  * and _n_name().
285  * name() is robust in that it will steer to analytic or table and will
286  * check that the table is uptodate. note _n_name is a table that does
287  * no checking.
288  *
289  * Revision 9.147 92/09/27 17:46:21 hines
290  * vectorized channel densities with _method3 fill thisnode.GC,EC instead
291  * of rhs,d
292  *
293  * Revision 9.146 92/09/25 13:55:18 hines
294  * the includes at beginning of lines must be hidden from the preprocessor
295  * or else some machines will try to include them.
296  *
297  * Revision 9.145 92/08/06 10:13:37 hines
298  * the check table function did not have _ix defined
299  *
300  * Revision 9.144 92/08/06 09:59:17 hines
301  * put cray pragmas at appropriate places
302  * get rid of initmodel references to saveing t and incrementing ninit
303  *
304  * Revision 9.143 92/08/06 09:04:22 hines
305  * table checking and creation moved into separate procedure. still called
306  * everytime function is called.
307  *
308  * Revision 9.142 92/08/05 16:23:18 hines
309  * can vectorize hh. need work on tables though.
310  *
311  * Revision 9.140 92/07/27 11:34:15 hines
312  * some bugs fixed. no vectorizing except for SOLVE procedure (and that not done yet)
313  *
314  * Revision 9.139 92/07/27 10:11:25 hines
315  * Can do some limited vectorization. Much remains. Often fails
316  *
317  * Revision 9.138 92/06/01 12:04:16 hines
318  * NEURON { EXTERNAL name, name, ...}
319  * translates to extern double name;
320  * GLOBAL changed to translate to
321  * #define name name_suffix
322  * extern double name
323  *
324  * Revision 9.137 92/05/05 08:39:51 hines
325  * last addition botched because line put in wrong place
326  *
327  * Revision 9.136 92/05/05 08:33:27 hines
328  * need to link with math library (at least on RS6000)
329  *
330  * Revision 9.135 92/04/15 16:21:35 hines
331  * recursive define problem with GLOBFUNCT when suffix was nothing, fixed
332  *
333  * Revision 9.134 92/03/31 06:51:21 hines
334  * CONSTANT could not be a negative number. Fixed
335  *
336  * Revision 9.133 92/03/19 15:15:18 hines
337  * creates a nrn_initialize function that will be called from finitialize().
338  *
339  * Revision 9.132 92/02/18 13:25:51 hines
340  * modl_rhs must be extern or else turboc won't connect it with sparse.c
341  *
342  * Revision 9.131 92/02/17 12:53:55 hines
343  * GLOBFUNCT for parsact so table functions declare external instead of
344  * static.
345  *
346  * Revision 9.130 92/02/17 10:25:13 hines
347  * global modl functions declared with suffixes using #define
348  *
349  * Revision 9.129 92/02/15 21:13:08 hines
350  * if bison used compile with -DBISON=1
351  *
352  * Revision 9.128 92/02/05 14:47:56 hines
353  * saber warning free
354  * FUNCTION made global for use by other models. #define GLOBFUNC 1
355  *
356  * Revision 9.127 92/02/05 12:32:05 hines
357  * creates setdata_suffix(x) to allow use of data when functions called
358  * from hoc.
359  *
360  * Revision 9.126 92/02/05 08:34:09 hines
361  * NEURON {POINTER ...} allows a model to connect to external variables
362  * #includes in nparout moved to beginning of defslist so crucial fields in
363  * section structures not defined into nonsense.
364  *
365  * Revision 9.125 92/01/28 14:08:00 hines
366  * fix Imakefile
367  *
368  * Revision 9.123 91/12/27 12:29:44 hines
369  * no message when COMPARTMENT does not specify STATE since
370  * it may specify an assigned or parameter. Note that
371  * this statement is irrelevant but it is necessary for modlunit
372  *
373  * Revision 9.122 91/10/28 09:10:19 hines
374  * wathey's improvements. different binary architectures in different
375  * directories.
376  *
377  * Revision 9.121 91/10/01 11:30:13 hines
378  * SUFFIX nothing now really adds nothing (usd to add _)
379  *
380  * Revision 9.120 91/09/16 15:46:15 hines
381  * reorganization of how NEURON variables are declared.
382  * RANGE: definitely range variables, can be param, assigned, or state
383  * GLOBAL: definitely global variables, can be param or assigned
384  * SECTION: not implemented
385  * By default params are global variables.
386  * By default states are range
387  * By default assigned are in p array but not accessible from NEURON
388  * NON-SPECIFIC current not accessible unless specified in RANGE.
389  *
390  * Revision 9.119 91/09/11 11:51:38 hines
391  * extraneous rule in conststmt: removed
392  *
393  * Revision 9.118 91/09/11 11:14:53 hines
394  * bad function number used in multiple kinetic models.
395  *
396  * Revision 9.116 91/08/23 08:30:01 hines
397  * MACHDEP was changed to MACHDEF
398  *
399  * Revision 9.115 91/08/22 17:07:43 hines
400  * for distribution to work on RS6000
401  *
402  * Revision 9.114 91/08/15 11:18:31 hines
403  * point process calls to point.c in neuron don't use getarg, etc. This
404  * means a change to the calling sequence doesn't necessarily mean a change
405  * to nparout.c
406  *
407  * Revision 9.113 91/08/13 09:17:41 hines
408  * Comments inside strings do not need to be escaped. And they cause warnings
409  * on some machines.
410  *
411  * Revision 9.112 91/08/12 11:35:41 hines
412  * creates a get_loc_suffix(i) function to tell what location and
413  * section of ith index is.
414  *
415  * Revision 9.111 91/08/12 11:34:33 hines
416  * more generic makefile. Change MACHDEF for machine dependent definitions.
417  *
418  * Revision 9.110 91/08/12 09:57:56 hines
419  * set_seed missing in extdef.h
420  *
421  * Revision 9.109 91/07/30 10:22:30 hines
422  * eion, ioni, iono are constants, iion is assigned
423  *
424  * Revision 9.107 91/06/29 08:51:45 hines
425  * left out hparout.o in nmodl.mk
426  *
427  * Revision 9.106 91/06/29 08:45:32 hines
428  * more general units factor and slightly different syntax for conversion
429  *
430  * Revision 9.105 91/06/25 09:02:47 hines
431  * last change broke saber...
432  *
433  * Revision 9.104 91/06/25 08:40:30 hines
434  * makefile fairly generic, no sun4 isms
435  *
436  * Revision 9.103 91/06/25 08:18:48 hines
437  * first attempt at generic makefile, no sun4 isms
438  *
439  * Revision 9.102 91/05/22 13:42:51 hines
440  * last change botched
441  *
442  * Revision 9.101 91/05/22 13:39:24 hines
443  * get modlunit stuff from SRC directory instead of RCS directory.
444  *
445  * Revision 9.100 91/05/06 13:28:01 hines
446  * malloc not properly declared when compiling with turboc
447  *
448  * Revision 9.99 91/04/17 16:15:35 hines
449  * DISCRETE block integrates by delta_indepvar instead of 1.0.
450  * Also delta_indepvar not changed automatically and model() may return
451  * at indepvar at value different from request if break not an integral
452  * value of delta_indepvar.
453  *
454  * Revision 9.98 91/03/18 09:11:45 hines
455  * FORALL i {} loops over all elements of vectors in statements. vector
456  * length must be the same.
457  *
458  * Revision 9.97 91/02/15 13:35:23 hines
459  * allow READ and WRITE of same ionic variable
460  *
461  * Revision 9.96 91/02/08 09:49:26 hines
462  * "nothing" allowed as suffix (auto functions get base filename)
463  * trivial model works since v, t, dt, etc auto created if not declared.
464  *
465  * Revision 9.95 91/01/29 09:16:04 hines
466  * nmodl doesn't create modl_set_dt because multiple mechanisms would make
467  * multiple declarations.
468  *
469  * Revision 9.94 91/01/24 14:00:45 hines
470  * translation error when last token of LOCAL statement was the first token
471  * after the LOCAL statement. Fixed by changing symbols at the parser instead
472  * of the lexical analyser.
473  *
474  * Revision 9.93 91/01/03 08:00:15 hines
475  * some static neuron variables were not declared under some circumstances.
476  *
477  * Revision 9.92 91/01/03 07:55:10 hines
478  * nparout.c version comment moved to beginning of file
479  *
480  * Revision 9.91 91/01/03 07:18:40 hines
481  * stepforce and schedule added to extdef.h
482  *
483  * Revision 9.90 91/01/02 08:00:53 hines
484  * stepforce and schedule added to list of functions which handle
485  * discontinuities.
486  *
487  * Revision 9.89 90/12/14 15:44:24 hines
488  * nmodl: point process working with proper current dimensions. tested with
489  * stim.mod and pascab1.hoc
490  *
491  * Revision 9.88 90/12/14 12:52:35 hines
492  * nmodl: point processes allowed via POINT_PROCESS
493  *
494  * Revision 9.87 90/12/13 11:25:11 hines
495  * calculation of _nstep cast to (int)
496  *
497  * Revision 9.86 90/12/12 18:18:14 hines
498  * FROM index : index is an integer and cast to double wherever it
499  * appears in expressons. It is not cast to int whenever it appears
500  * in intexpr
501  *
502  * Revision 9.85 90/12/12 17:24:04 hines
503  * nmodl: FROM i translates i as double fh.mod works properly
504  *
505  * Revision 9.84 90/12/12 10:06:59 hines
506  * nmodl: GLOBAL allowed in NEURON block
507  *
508  * Revision 9.83 90/12/12 09:02:14 hines
509  * nmodl: nparout allocates the p-array
510  *
511  * Revision 9.82 90/12/12 09:01:29 hines
512  * LOCAL arrays allowed
513  *
514  * Revision 9.81 90/12/12 08:05:47 hines
515  * NMODL: better partition of global and p-array. parameters that are
516  * not explicitly defined become static.
517  *
518  * Revision 9.80 90/12/11 11:23:46 hines
519  * forgot to take care of case where there is no TABLE statement
520  *
521  * Revision 9.79 90/12/11 10:55:29 hines
522  * TABLE works with hocmodl
523  *
524  * Revision 9.78 90/12/10 16:56:48 hines
525  * TABLE allowed in FUNCTION and PROCEDURE
526  *
527  * Revision 9.76 90/12/07 09:27:32 hines
528  * new list structure that uses unions instead of void *element
529  *
530  * Revision 9.75 90/12/05 11:03:38 hines
531  * forgot to add pindex to s->varnum to get index into parray for specific index.
532  *
533  * Revision 9.74 90/12/04 13:08:30 hines
534  * kept calling initmodel from model. Now use hoc_pindepindex
535  *
536  * Revision 9.73 90/12/04 12:00:24 hines
537  * model version displayed only as comment in generated c file
538  * format of plot lines for scalar in .var file is
539  * name nl vindex pindex 1 nl
540  * for vector with specific index:
541  * name[index] vindex pindex 1
542  * for vector without index
543  * name[size] vindex pindex size
544  *
545  * Revision 9.72 90/11/30 13:10:07 hines
546  * dcurdv calculated for ionic currents.
547  *
548  * Revision 9.71 90/11/30 08:22:24 hines
549  * modl_set_dt should only be created for time dependent models
550  *
551  * Revision 9.70 90/11/28 15:35:18 hines
552  * much work on case when ion is a state
553  *
554  * Revision 9.69 90/11/28 12:54:22 hines
555  * ion variables do not all appear in the hoc name list.
556  * diam understood
557  *
558  * Revision 9.68 90/11/28 09:12:07 hines
559  * location where we are checking for STADYSTATE may not be a SYMBOL
560  *
561  * Revision 9.67 90/11/27 12:10:46 hines
562  * bug in bnd introduced by change to partial
563  *
564  * Revision 9.66 90/11/27 10:47:49 hines
565  * allow multiple partial equations within a partial block
566  *
567  * Revision 9.65 90/11/26 09:14:06 hines
568  * merge didn't recognize units
569  *
570  * Revision 9.64 90/11/26 08:16:14 hines
571  * external functions of type EXTDEF3 get two extra arguments.
572  * The first arg is a pointer to _reset which should be set by the
573  * function upon the occurence of a discontinuity.
574  * The second arg is a pointer to a double which may be used by the
575  * function to store information to help determine if a discontinuity
576  * has occurred. init.c gives a list of these functions.
577  *
578  * Revision 9.63 90/11/23 15:07:22 hines
579  * factor calculation using units.c of model
580  *
581  * Revision 9.62 90/11/23 10:33:18 hines
582  * steadystate in BREAKPOINT block had failed to allocate delta_t
583  *
584  * Revision 9.61 90/11/23 10:01:50 hines
585  * STEADYSTATE of kinetic and derivative blocks
586  *
587  * Revision 9.60 90/11/21 10:47:17 hines
588  * _ninits is first argument in call to integrators
589  *
590  * Revision 9.59 90/11/21 08:41:10 hines
591  * merge allows BREAKPOINT and PARAMETER. makefile merge works
592  *
593  * Revision 9.58 90/11/20 17:24:22 hines
594  * CONSTANT changed to PARAMETER
595  * CONSTANT now refers to variables that don't get put in .var file
596  *
597  * Revision 9.57 90/11/20 16:04:27 hines
598  * EQUATION changed to BREAKPOINT
599  * STEADYSTATE keyword added, EQUATION keyword still exists
600  *
601  * Revision 9.56 90/11/15 16:16:02 hines
602  * unit parentheses for numbers and functions were not being removed.
603  *
604  * Revision 9.55 90/11/15 16:05:23 hines
605  * units definition syntax is (unit) (unit)
606  *
607  * Revision 9.54 90/11/13 15:49:45 hines
608  * allow function definitions and function definition arguments to
609  * have units specifications. Also numbers can have units specifications.
610  *
611  * Revision 9.53 90/11/13 13:10:21 hines
612  * nmodl: cachan works pretty well. ions generating current works.
613  *
614  * Revision 9.52 90/11/10 15:45:00 hines
615  * nmodl: uses new NEURON { USEION ... format
616  * passive.c works
617  *
618  * Revision 9.51 90/11/02 09:12:02 hines
619  * TABLE keyword added. For now it is translated just as FUNCTION
620  *
621  * Revision 9.50 90/11/02 08:31:52 hines
622  * Allow UNITS block and make a units defintion scale factor a static
623  * variable so that it doesn't have to appear in the var file. eg.
624  * UNITS { FARADAY = 96520 (coul) }
625  *
626  * Revision 9.49 90/11/02 07:01:15 hines
627  * works better. Problem is that conditional macros cannot be used
628  * in explicit target.
629  *
630  * Revision 9.48 90/11/02 06:59:36 hines
631  * new way of specifying NEURON info. Keywords are
632  * NEURON SUFFIX CURRENT NEED GET SET
633  *
634  * Revision 9.47 90/11/01 15:21:19 hines
635  * SOLVE procedure allowed. The procedure needs to return an error code
636  * with a VERBATIM statement
637  *
638  * Revision 9.46 90/10/30 14:29:23 hines
639  * calc_dt is gone. Not needed because due to scopfit, dt needs to be
640  * calculated at every break point.
641  * _reset no longer used to say that dt has changed. The integrator will
642  * have to check that itself.
643  *
644  * Revision 9.45 90/10/30 13:56:57 hines
645  * derivative blocks (this impacts kinetic and sens as well) now return
646  * _reset which can be set with RESET statement. _reset is static in the
647  * file and set to 0 on entry to a derivative or kinetic block.
648  *
649  * Revision 9.44 90/10/30 10:25:16 hines
650  * modl: saber warning free except for ytab.c and lex.cpp
651  *
652  * Revision 9.43 90/10/30 10:21:30 hines
653  * ytab.o was not placed in proper directory
654  *
655  * Revision 9.42 90/10/30 10:01:06 hines
656  * hmodl saber warning free and test.mod works
657  *
658  * Revision 9.41 90/10/30 08:37:13 hines
659  * saber warning free except for ytab.c and lex.cpp
660  *
661  * Revision 9.40 90/10/30 08:07:07 hines
662  * nmodl: Passive.mod working with index vectors. No longer copying
663  * doubles. Just copying two pointers.
664  *
665  * Revision 9.39 90/10/30 07:32:47 hines
666  * modl, nmodl, hmodl, smodl objects appear in different directories
667  * but sources and archive files come from SRC and RCS respectively
668  *
669  * Revision 9.38 90/10/29 18:30:47 hines
670  * restore after accidental erasure
671  *
672  * Revision 9.37 90/10/15 13:08:40 hines
673  * parout separated into parout for modl, hparout for hmodl nparout for nmodl
674  *
675  * Revision 9.35 90/10/15 12:13:05 hines
676  * mistake with checkin
677  *
678  * Revision 9.34 90/10/15 11:47:09 hines
679  * hmodl: use _p[]
680  *
681  * Revision 9.33 90/10/11 15:45:06 hines
682  * bugs fixed with respect to conversion from pointer vector to index vector.
683  *
684  * Revision 9.32 90/10/08 14:12:58 hines
685  * index vector instead of pointer vector for slist and dlist
686  *
687  * Revision 9.31 90/10/08 11:34:06 hines
688  * simsys prototype
689  *
690  * Revision 9.30 90/09/10 14:12:00 hines
691  * extdef2.h added to makefile and checked in
692  *
693  * Revision 9.29 90/09/10 14:09:18 hines
694  * certain functions specified in extdef2.h can have arguments which are
695  * pointers to functions and pointers to vectors.
696  *
697  * Revision 9.28 90/09/09 17:28:29 hines
698  * merge the summer's work at nbsr into modl
699  *
700  * Revision 9.27 90/09/05 07:08:26 hines
701  * changed spar_rhs to modl_rhs in kinetic.c so that it would not
702  * conflict with hoc sparse matrix. The only externs is sparse.c
703  * are now _getelm sparse modl_rhs
704  *
705  * Revision 9.26 90/08/30 11:29:07 hines
706  * units computations removed and can link with saber-c
707  *
708  * Revision 9.25 90/08/30 11:28:24 hines
709  * units computations removed
710  *
711  * Revision 9.24 90/08/17 08:45:00 hines
712  * mistake on last checkin
713  *
714  * Revision 9.23 90/08/17 08:39:30 hines
715  * no more modltype for double scalars
716  *
717  * Revision 9.22 90/08/17 08:15:02 hines
718  * HMODL change define from HOC to HMODL, ensure all .c files compiled
719  *
720  * Revision 9.21 90/08/17 08:13:46 hines
721  * flux input to array state missing a )
722  *
723  * Revision 9.20 90/08/15 15:17:03 hines
724  * need to pass error value from crank back through the
725  * block called by SOLVE.
726  *
727  * Revision 9.19 90/08/07 15:36:45 hines
728  * forgot name of mechanism. Also append suffix to all range names
729  *
730  * Revision 9.18 90/08/07 15:36:03 hines
731  * computation of rhs was bad
732  *
733  * Revision 9.17 90/08/07 08:43:58 hines
734  * functions and procedures interfaced to NMODL and HMODL
735  *
736  * Revision 9.16 90/08/02 08:58:49 hines
737  * NMODL can use more than one mechanism. Integrators that use ninits and
738  * reset will not work, though.
739  *
740  * Revision 9.15 90/08/01 07:48:49 hines
741  * repair HOC portion after all the errors introduced by NMODL
742  *
743  * Revision 9.14 90/07/31 17:03:54 hines
744  * NMODL getting close. Compiles but multiple .mod files cause
745  * multiple definitions.
746  *
747  * Revision 9.13 90/07/30 14:37:20 hines
748  * NMODL looks pretty good. Ready to start testing. Have not yet tried
749  * to compile the .c file.
750  *
751  * Revision 9.12 90/07/30 12:38:04 hines
752  * wrong name for ASSIGNED
753  *
754  * Revision 9.11 90/07/30 11:51:18 hines
755  * NMODL getting better, almost done
756  *
757  * Revision 9.10 90/07/27 13:58:11 hines
758  * nmodl handles declarations about right for first pass at this.
759  *
760  * Revision 9.9 90/07/26 09:25:10 hines
761  * beginning interface to NEURON
762  * new keywords are PARAMETER and CURRENT
763  *
764  * Revision 9.8 90/07/26 07:58:45 hines
765  * interface modl to hoc and call the translator hmodl
766  *
767  * Revision 9.7 90/07/21 11:36:18 hines
768  * allow more than one reactant on -> reaction
769  * fix bug where wrong reactant index used in constructing term.
770  *
771  * Revision 9.6 90/07/18 08:15:44 hines
772  * PARAMETER is synonym for CONSTANT
773  * Distinguishing them is necessary for NEURON since PARAMETER's can
774  * vary with position on the neuron.
775  *
776  * Revision 9.5 90/07/18 08:00:21 hines
777  * turn off units.
778  * define for arrays now (p + n) instead of &p[n]. This allows the c file
779  * to have arrays that look like a[i] instead of *(a + i).
780  *
781  * Revision 9.4 90/06/04 08:23:27 mlh
782  * extend exponents from both expressions dimensionless to
783  * allowing exponent to be positive integer.
784  *
785  * Revision 9.3 90/06/01 11:02:07 mlh
786  * checks for conformability of units but does not check for
787  * correct conversion factors.
788  * in x^y, both x and y must be dimensionless
789  *
790  * Revision 9.2 90/05/30 17:01:16 mlh
791  * not working yet, just adding files administratively
792  *
793  * Revision 8.30 90/04/09 08:41:42 mlh
794  * implicit method for derivative blocks (allows mixed equations also).
795  * The solve statement must precede the derivative block
796  *
797  * Revision 8.29 90/04/04 14:15:00 mlh
798  * when multiple sparse models were called, MATELM was defined only
799  * once and getelm was multiply declared. Now fixed.
800  *
801  * Revision 8.28 90/04/03 07:49:12 mlh
802  * typo in previous change. Due to nature of RCS on nbsr, it is unfortunately
803  * necessary to check things back in before testing.
804  *
805  * Revision 8.27 90/04/03 07:47:02 mlh
806  * for turbo-c defs.h stuff must appear after inclusion of scoplib.h
807  * This is done by now saving defs.h stuff in defs_list and printing
808  * it in cout.c. Note that each item is type VERBATIM so that there
809  * is no prepended space.
810  *
811  * Revision 8.26 90/02/15 10:11:54 mlh
812  * defs.h no longer included. #defines come from parraycount during
813  * handling of .var file. Thsi handling must be before putting info
814  * in .c file
815  *
816  * Revision 8.25 90/02/15 08:57:59 mlh
817  * first check for .mrg file and translate if it exists
818  * if not the check for .mor file and translate that.
819  * This is done if there is only one argument.
820  * If two arguments then use first as basename and
821  * second as input file
822  * print message about what it is doing
823  *
824  * Revision 8.24 90/02/07 10:23:27 mlh
825  * It is important that blocks for derivative and sensitivity also
826  * be declared static before their possible use as arguments to other
827  * functions and that their body also be static to avoid multiple
828  * declaration errors.
829  *
830  * Revision 8.23 90/01/29 14:07:37 mlh
831  * simplex is a nonlinear method
832  *
833  * Revision 8.22 90/01/23 16:11:09 mlh
834  * delta_t is calculated for the first two calls after
835  * a call to initmodel(). This is because the breakpoint
836  * interval can change aftera the first call to model().
837  * The implementation is accomplished by _calc_dt=2
838  * in initmodel() and _calc_dt-- when _calc_dt is nonzero
839  * in model()
840  *
841  * Revision 8.21 90/01/19 07:38:07 mlh
842  * _modl_cleanup() called by abort_run()
843  *
844  * Revision 8.20 90/01/18 11:46:34 mlh
845  * SOLVEFOR statement added
846  * syntax is
847  * blocktype blockname [SOLVEFOR name, name, ...] {statment}
848  * where blocktype is KINETIC, NONLINEAR, or LINEAR
849  * Only the states in the SOLVEFOR statement are solved
850  * in that block. If the statement is not present then
851  * all states are solved that appear in that block.
852  *
853  * Revision 8.19 90/01/18 08:14:22 mlh
854  * serious error in calculating p-array index for
855  * plot variables in .var file.
856  * Fixed by using symbol->varnum to hold the p-index.
857  *
858  * Revision 8.18 90/01/16 11:06:28 mlh
859  * error checking and cleanup after error and call to abort_run()
860  *
861  * Revision 8.17 90/01/03 16:13:44 mlh
862  * discrete array variables had their for loops switched.
863  *
864  * Revision 8.16 89/12/18 07:58:23 mlh
865  * Fixed problem in .var file in which x-axis array variable's dimension
866  * was 1 too large.
867  *
868  * Revision 8.15 89/12/15 10:11:02 mlh
869  * newton's last arg changed to vector of double pointers.
870  * For nonlinear equations dlist holds the doubles and
871  * pdlist points to them individually.
872  *
873  * Revision 8.14 89/11/21 08:18:46 mlh
874  * More reliable method for ensuring that solve for loop ends up exactly
875  * at the final time value.
876  *
877  * Revision 8.13 89/11/21 07:37:11 mlh
878  * _calc_dt used in scopcore and therefore must be declared even for
879  * time independent models.
880  *
881  * Revision 8.12 89/11/17 16:08:28 mlh
882  * _ninits tells how many times initmodel() is called. Used by
883  * scopmath routines that need to know when to self_initialize.
884  *
885  * Revision 8.11 89/11/17 15:12:43 nfh
886  * Changed modl_version string printed by SCoP to read: "Language version..."
887  *
888  * Revision 8.10 89/11/14 16:38:00 mlh
889  * _reset set to true whenever initmodel is called and whenever _calc_dt
890  * is true
891  *
892  * Revision 8.9 89/11/13 15:17:48 mlh
893  * _called_init changed to _calc_dt and made global so
894  * that scop can cause dt to be recomputed on an
895  * extend run command
896  *
897  * Revision 8.8 89/11/01 10:21:17 mlh
898  * Three changes
899  * consist moved after solvehandler to avoid warning that delta_indep is
900  * >> undeclared.
901  * Warning given if state is assigned a value in a DERIVATIVE block
902  * identical names in nested LOCAL statements declared incorrectly.
903  * >> The problem was fixed by not allowing extra _l prepended to
904  * >> an already local variable.
905  *
906  * Revision 8.7 89/10/30 15:04:34 mlh
907  * error message when no derivative equations in DERIVATIVE block
908  *
909  * Revision 8.6 89/10/27 15:44:25 mlh
910  * initqueue() called in initmodel() when PUTQ or GETQ used.
911  *
912  * Revision 8.5 89/10/25 13:48:15 mlh
913  * PUTQ and GETQ implemented
914  *
915  * Revision 8.4 89/10/25 13:43:47 mlh
916  * Bug with discrete models in that delta_indep is used
917  * Fixed by generating the proper line only when type is DERF
918  *
919  * Revision 8.3 89/10/11 08:43:27 mlh
920  * _reset apparently bein declared elsewhere
921  *
922  * Revision 8.2 89/10/11 08:35:29 mlh
923  * generate modl_version string in .c file
924  * declare _reset=1
925  *
926  * Revision 8.1 89/09/29 16:26:09 mlh
927  * ifdef for VMS and SYSV and some fixing of assert
928  *
929  * Revision 8.0 89/09/22 17:27:06 nfh
930  * Freezing
931  *
932  * Revision 7.2 89/09/07 07:45:48 mlh
933  * 1) a scop independent variable may be a constant and an independent
934  * 2)was failing to prevent multiple declarations involveing the SWEEP variable
935  * 3) was not initializing time after match
936  * 4) many bugs in handling exact for loop of t to the break point
937  * >>
938  *
939  *
940  * Revision 7.1 89/09/05 08:10:09 mlh
941  * ensure an integer number of steps/break
942  * allow us to deal easily with lists of pointers to item pointers
943  * COMPARTMENT keyword for KINETIC block
944  *
945  * Revision 7.0 89/08/30 13:32:43 nfh
946  * Rev 7 is now Experimental; Rev 6 is Testing
947  *
948  * Revision 6.3 89/08/24 12:08:11 mlh
949  * failed to declare reprime(), make lint free
950  *
951  * Revision 6.2 89/08/23 12:03:22 mlh
952  * kinetic reaction may involve stepped and independent (sweeped) variable
953  *
954  * Revision 6.1 89/08/23 10:32:18 mlh
955  * derivative variables in .var file have names like var' instead of Dvar
956  *
957  * Revision 6.0 89/08/14 16:27:22 nfh
958  * Rev 6.0 is latest of 4.x; now the Experimental version
959  *
960  * Revision 4.8 89/08/12 11:04:13 mlh
961  * In hierarchical models, CONSTANT and ASSIGNED can be promoted to STATE
962  *
963  * Revision 4.7 89/08/11 09:57:29 mlh
964  * simultaneous nonlinear equations allowed in DERIVATIVE block
965  * CONSTANT and ASSIGNED variables can appear as terms in reactions
966  * in a KINETIC block
967  *
968  * Revision 4.6 89/08/07 15:35:37 mlh
969  * freelist now takes pointer to list pointer and 0's the list pointer.
970  * Not doing this is a bug for multiple sens blocks, etc.
971  *
972  * Revision 4.5 89/08/05 11:38:45 mlh
973  * axis units info now in .var file
974  * units for higher order derivatives auto generated
975  * .var syntax for higher order derivative states now a:b
976  *
977  * Revision 4.4 89/08/01 07:35:47 mlh
978  * DEPENDENT keyword changed to ASSIGNED
979  *
980  * Revision 4.3 89/07/31 07:56:26 mlh
981  * Slight problem with error messages. Now missing partial equation in PARTIAL
982  * block says DEL2 instead of DEL
983  *
984  * Revision 4.2 89/07/27 13:28:18 mlh
985  * crank calling sequence sends indepsym as a sentinal value
986  * ugh!
987  *
988  * Revision 4.1 89/07/25 19:22:22 mlh
989  * fixed error in copying string into too small a space in
990  * section handling higher order derivatives.
991  *
992  * Revision 4.0 89/07/24 17:03:53 nfh
993  * Freezing rev 3. Rev 4 is now Experimental
994  *
995  * Revision 3.10 89/07/21 09:28:21 mlh
996  * Discrete equitions evaluated at time given by independent variable
997  * in the sense that the state on the left hand side refers to state(t)
998  * and explicit dependence on t works naturally.
999  *
1000  * Revision 3.9 89/07/19 15:05:44 mlh
1001  * pass t by value introduces bug, return to version before that.
1002  *
1003  * Revision 3.8 89/07/18 15:29:14 mlh
1004  * integrators now are passed value of time instead of pointer to time
1005  *
1006  * Revision 3.7 89/07/18 11:55:29 mlh
1007  * first_time removed and MODEL_LEVEL used for declaration precedence
1008  *
1009  * Revision 3.6 89/07/12 16:34:06 mlh
1010  * 2nd optional argument gives input file. First arg is prefix to .var
1011  * and .c files (and .mod input file if 2nd arg not present).
1012  *
1013  * Revision 3.5 89/07/12 12:24:03 mlh
1014  * state@1 now refers to state value at end of previous step
1015  * state@0 is a syntax error
1016  *
1017  * Revision 3.4 89/07/11 19:32:26 mlh
1018  * missing ) from previous checkin
1019  *
1020  * Revision 3.3 89/07/11 19:30:00 mlh
1021  * Bug in which initial condition could not be a STEPPED variable is fixed
1022  *
1023  * Revision 3.2 89/07/11 16:56:58 mlh
1024  * remove p array from calling sequence of crank
1025  *
1026  * Revision 3.1 89/07/07 16:55:24 mlh
1027  * FIRST LAST START in independent SWEEP higher order derivatives
1028  *
1029  * Revision 1.1 89/07/07 16:25:06 mlh
1030  * Initial revision
1031  *
1032  * Revision 3.1 89/07/07 08:57:37 mlh
1033  * major revision
1034  *
1035  * Revision 1.2 89/07/06 15:35:04 mlh
1036  * inteface with version.c
1037  *
1038  * Revision 1.1 89/07/06 15:27:11 mlh
1039  * Initial revision
1040  *
1041 */
1042 char *RCS_version = "$Revision: 1098 $";
1043 char *RCS_date = "$Date: 2005-10-04 22:55:37 +0200 (Tue, 04 Oct 2005) $";
1044 
1045 
char * RCS_version
Definition: version.cpp:4
char * RCS_date
Definition: version.cpp:5