Overview
Comment:Upgraded for new simulation approach - uses data files to input
parameters -- no more argv stuff
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 8690e225945617ce9883da236b2afb626bec84124574019f1f38557b8e8a048e
User & Date: gawthrop@users.sourceforge.net on 2000-05-16 18:56:03
Other Links: branch diff | manifest | tags
Context
2000-05-16
18:56:14
*** empty log message *** check-in: acfbf3a2c8 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:56:03
Upgraded for new simulation approach - uses data files to input
parameters -- no more argv stuff
check-in: 8690e22594 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:55:10
Initial revision check-in: 38505163b2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_m2p from [cc6de330d2] to [e652f8d2b9].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.45  2000/05/13 13:16:52  peterg
## Matrix initialisation for smxa
##
## Revision 1.44  2000/05/13 11:52:16  peterg
## A now matrix in smxa rep
##
## Revision 1.43  2000/05/11 19:35:16  peterg







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.46  2000/05/16 11:59:01  peterg
## Updated for new data file parameter/state update
##
## Revision 1.45  2000/05/13 13:16:52  peterg
## Matrix initialisation for smxa
##
## Revision 1.44  2000/05/13 11:52:16  peterg
## A now matrix in smxa rep
##
## Revision 1.43  2000/05/11 19:35:16  peterg
342
343
344
345
346
347
348

349
350
351
352
353
354
355
sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\
awk -F# '{printf("%s",$1) 
          if (NF>1) printf("{* %s *}", $2)
          printf("\n") 
         }' |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)(\($args\))/\2(\1,\3)/" |\

sed "s/$space\[\($non_space\)\]$spaces=$spaces\(zeros\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)/\2(\1)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)/\2(\1)/"  |\
awk '
function printvar(Name,N) {
  if (N<1) return;







>







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
sed "s/^$space%/#/" | sed "s/\([;)]$space\)%/\1#/" |\
awk -F# '{printf("%s",$1) 
          if (NF>1) printf("{* %s *}", $2)
          printf("\n") 
         }' |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($mttfun_name\)/\2(\1)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\(zeros\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\[\($non_space\)\]$spaces=$spaces\($fun_name\)/\2(\1)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)(\($args\))/\2(\1,\3)/" |\
sed "s/$space\($non_space\)$spaces=$spaces\($fun_name\)/\2(\1)/"  |\
awk '
function printvar(Name,N) {
  if (N<1) return;
415
416
417
418
419
420
421

422
423
424
425
426
427
428
          }
          printf("{%s %s_switchopen.p}\n\n",inc,Sys)

          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("\nBEGIN{%s}\n", Sys_rep)
          printf("  open(statefile,\"%s_state.dat\");\n", Sys)

          printf("  open(numparfile,\"%s_numpar.dat\");\n", Sys)
        }
        else{
          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("VAR \n");
          for (k=1;k<i;k++) printf("  %s,\n",global[k])







>







419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
          }
          printf("{%s %s_switchopen.p}\n\n",inc,Sys)

          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("\nBEGIN{%s}\n", Sys_rep)
          printf("  open(statefile,\"%s_state.dat\");\n", Sys)
          printf("  open(simparfile,\"%s_simpar.dat\");\n", Sys)
          printf("  open(numparfile,\"%s_numpar.dat\");\n", Sys)
        }
        else{
          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("VAR \n");
          for (k=1;k<i;k++) printf("  %s,\n",global[k])
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
          printf("%s THEN BEGIN\n", $0)
        }
        else { 
          if ((match($1,"mtt_write")>0)&&(length(Stdin)>0)) {
           sub(/mtt_write/, "if NOT eof THEN mtt_write");
          }
          if ($1=="for"){
            if (($2=="MTTit")&&(length(Stdin)>0)){
	      printf("WHILE NOT eof DO BEGIN {Integration loop}")
            }
            else {
              sub(/:/," TO ",$0)
              sub(/=/,":=",$0)
              printf("%s DO BEGIN\n", $0)
            } 
          }







|
|







465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
          printf("%s THEN BEGIN\n", $0)
        }
        else { 
          if ((match($1,"mtt_write")>0)&&(length(Stdin)>0)) {
           sub(/mtt_write/, "if NOT eof THEN mtt_write");
          }
          if ($1=="for"){
            if (($2=="it")&&(length(Stdin)>0)){
	      printf("WHILE NOT eof DO BEGIN {Integration loop}\n")
            }
            else {
              sub(/:/," TO ",$0)
              sub(/=/,":=",$0)
              printf("%s DO BEGIN\n", $0)
            } 
          }


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]