Closed chaukap closed 5 years ago
@chaukap I am fine with this as long as code readability remains. For instance I find this rather clear (in terms of understanding how _roots_active_sum gets calculated):
/* Calculate the active roots in each month and soil layer for each STEPPE
* functional group based on the functional group biomass this year */
ForEachGroup(g)
{
t = RGroup[g]->veg_prod_type-1;
nLyrs = getNTranspLayers(RGroup[g]->veg_prod_type);
for (l = 0; l < nLyrs; l++) {
ForEachTrPeriod(p)
{
x = _rootsXphen[Iglp(g, l, p)] * sizes[g];
_roots_active[Iglp(g, l, p)] = x;
_roots_active_sum[Itlp(t, l, p)] += x;
}
}
}
@kpalmqui absolutely. I'll explain on our call, but this change shouldn't affect any of the functions, where the structs are defined.
The struct has been created, but right now it is called TempType. I will update the name as soon as we come up with a more descriptive one.
@chaukap how about SXW_resource?
@kpalmqui sounds good!
@kpalmqui since we have a file called sxw_resource.c I'll call the type SXW_resourceType
so there is no confusion does that sound alright?
@chaukap not sure what Type is referring to, but I guess it is OK.
sxw.c has a lot of local variables of primitive types. Here's a snippet:
To make the gridded overhaul easier it would be nice to create a struct that holds all of these variables. The code would not only look less cluttered, but also make adding these variables to CellType much easier.