You are here

Taking 2-d array out of submodel

I am having an issue when I try to work with a 2-d array outside of a submodel. It is created within a nested submodel, but I need to take it out of this into another submodel as I need to have it in another timestep. When I try to do this I gt the error message:

 

This equation evaluates to a data structure which includes an array of size records.

records is not a valid dimension for a model component -- they must be integers greater than 1.

 

Do you know what this error is referring to?

Thanks

 

Forums: 

Hi Wookie,

It appears from that message that you have set up the dimensions of the submodel to be defined by the number of data records in a file. This means that it may have different sizes in different runs of the model, or since it is 2-D, that the size of the inner dimension may be different for each value of the outer dimension.

Simile is unable to manage the dimensions of an individual variable to behave like that. You can only take values out of the submodel by using list-processing functions such as sum() and with_greatest(). If you are using Simile v5.6 or later you can use element() to refer to individual values from a submodel like this, so you may be able to take a link directly from the submodel into another with the same dimensions and use something like element(x, index(1)) to get the appropriate value into each instance of the second submodel.

Alternatively you could put a simple submodel with a different time step inside the first submodel.

Hope this helps

--Jasper