You are here

Opening large models in Simile 5.5 different problem (finding correct submodel properties and out of bounds array error)

I have a model that had 150 layers in 5.0.  It still has the appropriate number of layers but when you bring up propertires for the submodel it only indicates 1 layer.  If you change the 1 to 150 you end up with a 150,150 xy grid.  Alos I have another problem that may not be related to 5.5.  In this model I calculate the diffusion of several compounds into a sediment profile.  After you compile the initial data should show numbers up to 09 layers and zeros after.  This happens in all cases but for O2 which has a negative number in thwe last layer (150).  I cannot determine why it is there.  The functions for all chemicals use essentially the same format. Can you fix?

AttachmentSize
Binary Data diadenesistestb.sml1.61 MB
Reporter: 
John E. Rogers04
Created: 
Wed, 23/09/2009 - 21:04
Updated: 
Tue, 29/09/2009 - 07:53

Comments

Model looks OK to me -- are you sure you were editing the submodel properties rather than the desktop properties? You can have multiple instances of the desktop too, though it is not recommended

I am looking at the model.The submodel has the appropriate structure for a submodel having 150 layers (see attached file). However, when I open properties it only indicates one layer.  If I change the 1 to 150 I get a x,y array.  Also if you compile the model and set it to zero steps you will see for the O2flux and erronous number at level 150 that should not be there.  If the you do the same with NO3fux the number is not there.  If you don't see what I see is there something funny going on with my computer? 

Hi,

The properties dialogue is for "diadenesistestb" that is the top level model - or "desktop". If you double click in open space inside the "diagenesis" submodel you'll see the dimensions are 150.

Changing the dimensions of the top level model (desktop) to say, 150, would mean that there would be 150 diagenesis submodels (and other contents of the desktop), with there being 150 instances set by the diagenesis submodel properties as well, you'd get 150x150 elements of variables inside the diagenesis submodel.

Looking at the equation for O2flux

if depth_number==1 then  ((Db0X+O2diffusion/element([tortuosity],depth_number)))*O2initial)-(sediment_advection_rates*O2initial*10/surface_porosity)
else
(Db0X+((O2diffusion/element([tortuosity],depth_number))*(sum_O2-element([O2_out],depth_number+1)))-(sediment_advection_rates*sum_O2*10*element([porosity],depth_number)/element([porosity],depth_number+1)))

there is depth_number+1 being used as an index to an element that will cause an out of bounds error at level 150 (=depth_number) as it tries to find element 151 in an array with 150 elelments.

If you try building in debug mode (use the Debug comand in the Model menu instead of Run) you get bounds checking.

-- Jonathan

 

 

Thanks I'm learning all of this stuff out here in a void.

No problem. Please don't hesitate to ask about any other problems.