Skip to content

Commit

Permalink
fix: allow > 2 dimensions when generating Vensim array names (#155)
Browse files Browse the repository at this point in the history
Fixes #154
  • Loading branch information
ToddFincannon authored Oct 28, 2021
1 parent 3de7bd8 commit 6575ea9
Show file tree
Hide file tree
Showing 7 changed files with 551 additions and 8 deletions.
216 changes: 216 additions & 0 deletions models/arrays_cname/arrays_cname.dat
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,222 @@ inputAB[A3,B2]
0 18
inputAB[A3,B3]
0 19
ndim4[A1,B1,C1,D1]
0 4
ndim4[A1,B1,C1,D2]
0 4
ndim4[A1,B1,C1,D3]
0 4
ndim4[A1,B1,C1,D4]
0 4
ndim4[A1,B1,C2,D1]
0 4
ndim4[A1,B1,C2,D2]
0 4
ndim4[A1,B1,C2,D3]
0 4
ndim4[A1,B1,C2,D4]
0 4
ndim4[A1,B1,C3,D1]
0 4
ndim4[A1,B1,C3,D2]
0 4
ndim4[A1,B1,C3,D3]
0 4
ndim4[A1,B1,C3,D4]
0 4
ndim4[A1,B2,C1,D1]
0 4
ndim4[A1,B2,C1,D2]
0 4
ndim4[A1,B2,C1,D3]
0 4
ndim4[A1,B2,C1,D4]
0 4
ndim4[A1,B2,C2,D1]
0 4
ndim4[A1,B2,C2,D2]
0 4
ndim4[A1,B2,C2,D3]
0 4
ndim4[A1,B2,C2,D4]
0 4
ndim4[A1,B2,C3,D1]
0 4
ndim4[A1,B2,C3,D2]
0 4
ndim4[A1,B2,C3,D3]
0 4
ndim4[A1,B2,C3,D4]
0 4
ndim4[A1,B3,C1,D1]
0 4
ndim4[A1,B3,C1,D2]
0 4
ndim4[A1,B3,C1,D3]
0 4
ndim4[A1,B3,C1,D4]
0 4
ndim4[A1,B3,C2,D1]
0 4
ndim4[A1,B3,C2,D2]
0 4
ndim4[A1,B3,C2,D3]
0 4
ndim4[A1,B3,C2,D4]
0 4
ndim4[A1,B3,C3,D1]
0 4
ndim4[A1,B3,C3,D2]
0 4
ndim4[A1,B3,C3,D3]
0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1,C3,D2]
0 4
ndim4[A3,B1,C3,D3]
0 4
ndim4[A3,B1,C3,D4]
0 4
ndim4[A3,B2,C1,D1]
0 4
ndim4[A3,B2,C1,D2]
0 4
ndim4[A3,B2,C1,D3]
0 4
ndim4[A3,B2,C1,D4]
0 4
ndim4[A3,B2,C2,D1]
0 4
ndim4[A3,B2,C2,D2]
0 4
ndim4[A3,B2,C2,D3]
0 4
ndim4[A3,B2,C2,D4]
0 4
ndim4[A3,B2,C3,D1]
0 4
ndim4[A3,B2,C3,D2]
0 4
ndim4[A3,B2,C3,D3]
0 4
ndim4[A3,B2,C3,D4]
0 4
ndim4[A3,B3,C1,D1]
0 4
ndim4[A3,B3,C1,D2]
0 4
ndim4[A3,B3,C1,D3]
0 4
ndim4[A3,B3,C1,D4]
0 4
ndim4[A3,B3,C2,D1]
0 4
ndim4[A3,B3,C2,D2]
0 4
ndim4[A3,B3,C2,D3]
0 4
ndim4[A3,B3,C2,D4]
0 4
ndim4[A3,B3,C3,D1]
0 4
ndim4[A3,B3,C3,D2]
0 4
ndim4[A3,B3,C3,D3]
0 4
ndim4[A3,B3,C3,D4]
0 4
o[B1]
0 42
1 42
Expand Down
5 changes: 5 additions & 0 deletions models/arrays_cname/arrays_cname.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ z[C2, DimA, DimB]=
~ 2D constant array with additional index subscript (2/2)
|

ndim4[DimA, DimB, DimC, DimD] = 4
~
~ 4D constant array
|

INITIAL TIME = 0 ~~|
FINAL TIME = 1 ~~|
TIME STEP = 1 ~~|
Expand Down
3 changes: 2 additions & 1 deletion models/arrays_cname/arrays_cname_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"_sc[1][2]",
"_sc[2][0]",
"_sc[2][1]",
"_sc[2][2]"
"_sc[2][2]",
"_ndim4[2][2][2][3]"
]
}
Loading

0 comments on commit 6575ea9

Please sign in to comment.