AIBECS.jl
AIBECS.jl copied to clipboard
AIBECS `F` is quite slower (5x) than handmade `F`
Note to self: Actually it would be nice to be able to create a performant inplace F from the user input of sources and sinks. This might require some code transformation though, so I'm not sure how I would do this.
For example, the user could provide an expression for each term, like
- uptake:
-1 / τ * DIP^2 / (DIP + k) * (z ≤ zₑ) - remin:
κ * POP - geores:
(DIPgeo - DIP) / τgeo
and then AIBECS could build an inplace and fused-loop function
function G_DIP!(dDIP, DIP, POP, p)
@unpack τ, k, zₑ, κ, DIPgeo, τgeo = p # unpack parameters
dDIP .= @. -1 / τ * DIP^2 / (DIP + k) * (z ≤ zₑ) + κ * POP + (DIPgeo - DIP) / τgeo
end