ClimateMachine.jl icon indicating copy to clipboard operation
ClimateMachine.jl copied to clipboard

calculation of soil properties

Open kmdeck opened this issue 3 years ago • 0 comments

Description

The soil has different parameters (~10) at different points in space, but these parameters are constant in time. These parameters are needed by multiple balance law functions. Currently, we pass in functions (of aux) for these parameters as part of the SoilModel structure. Each balance law method has access to these functions, so that they can be evaluated at that nodal point's position (aux.x, aux.y, aux.z). However, that means that each timestep, at each point, we evaluate a function O(10)x# of balance law methods that need them. If these functions are not written carefully, it can slow things down a lot (20 min to ~2-5 hrs in one example). This is inefficient - we don't need to compute them every timestep, they are constant, and shouldnt need to calculate them anew in different balance law functions for the same point in the same timestep.

I think the alternative is storing a look up table (not huge, O(10) params xO(100) points per column) in the SoilModel, and then the "function" we eval at each timestep at each point is just the look up, which is fast. Or maybe we store the values of these parameters at the points as part of aux, and we never update them, so they are only initialized once and dont add any unnecessary computation at each time step.

This should wait until after the software redesign since aux will change, the balance law may change, etc.

@jakebolewski just as a heads up that I'll ask your opinion on this when we get there!

kmdeck avatar May 27 '21 16:05 kmdeck