add new task       

Task ID:  1872  Need to allow [output]s with nested arrays    
Created by rcichota on 2014-04-23 1:10 PM, 1492 days ago
Project:  Module Code
Category:  Minor
Priority:  [no priority]
Assigned to:  [not assigned]  
Status:  Submitted
Apsim Version:
Your Name:Rogerio
Contact Details:

show inline images      show change history

 comment 42737 posted by her123 on 2018-03-26 9:30 AM, 59 days ago 
It is possible to use .GetObject() from the component in question and pass a ref to an instance of the type required. Would this solve the issue?
For example this can be done:

AvailableToAnimalType available = new AvailableToAnimalType();
Component somforstock = (Component) MySimulation.LinkByName("wheatpaddock.somforstock");
if (somforstock != null)
   somforstock.GetObject(somforstock.FullName + ".AvailableToAnimal", ref available);
 comment 35298 posted by rcichota on 2014-04-23 1:10 PM, 1492 days ago 

It would be of great help if one could get nested array variables tagged with [output].  This would allow to access such variables using a manager script for example. An example of such variables (from SoilNitrogen) is: double[][] PatchNH4, which represents the amounts of NH4 in each layer for various (internal) patches.  I guess doubles would be the most common numeric type, but other types or even complex types may be required. As a hypothetical example: FOM[pool].C[layer], or even: Patch[k].FOM[pool].C[layer] - which is the carbon content for each layer. for each FOM pool, for each patch... Not sure how flexible the infrastructure can be, but enabling double[][] would be great.