16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
+
+
+
|
# Copyright (c) P.J.Gawthrop 1997.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
# Revision 1.12 1997/05/15 08:39:56 peterg
# Don't initialise states - now done in numpar file.
#
# Revision 1.11 1997/05/12 16:00:54 peterg
# Removed itime again.,
#
# Revision 1.10 1997/05/10 10:05:15 peterg
# Put _input in inner loop in front of call to _ode
#
## Revision 1.9 1997/05/10 09:54:34 peterg
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
|
-
+
-
+
-
+
-
+
|
write "/* Main (Euler) integration loop */"$
write " while (time<LAST)"$
write " {"$
%Write to output to file
write "/* Write to output file */"$
write " fprintf(fpso, ""%5.4f "",time);"$
write " fprintf(fpso, ""%5.4g "",time);"$
write " for (i=1; i<=MTTNY; i++)"$
write " fprintf(fpso, ""%5.4f "", y[i]);"$
write " fprintf(fpso, ""%5.4g "", y[i]);"$
write " fprintf(fpso, ""\n"");"$
%Write to state to file
write "/* Write to state file */"$
write " fprintf(fps, ""%5.4f "",time);"$
write " fprintf(fps, ""%5.4g "",time);"$
write " for (i=1; i<=MTTNX; i++)"$
write " fprintf(fps, ""%5.4f "", x[i]);"$
write " fprintf(fps, ""%5.4g "", x[i]);"$
write " fprintf(fps, ""\n"");"$
write "/* Inner integration loop */"$
write " for (k=1; k<=STEPFACTOR; k++)"$
write " {"$
write " for (i=1; i<=MTTNX; i++)"$
|
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
-
+
-
+
-
+
-
+
|
write " time = time + DT;"$
write " }"$
%Write to files
%Write to output to file
write "/* Write to output file */"$
write " fprintf(fpso, ""%5.4f "",time);"$
write " fprintf(fpso, ""%5.4g "",time);"$
write " for (i=1; i<=MTTNY; i++)"$
write " fprintf(fpso, ""%5.4f "", y[i]);"$
write " fprintf(fpso, ""%5.4g "", y[i]);"$
write " fprintf(fpso, ""\n"");"$
%Write to state to file
write "/* Write to state file */"$
write " fprintf(fps, ""%5.4f "",time);"$
write " fprintf(fps, ""%5.4g "",time);"$
write " for (i=1; i<=MTTNX; i++)"$
write " fprintf(fps, ""%5.4f "", x[i]);"$
write " fprintf(fps, ""%5.4g "", x[i]);"$
write " fprintf(fps, ""\n"");"$
write " fprintf(fps, ""];\n"");"$
write " fprintf(fpso, ""];\n"");"$
write " return 0;"$
|