DSL with macros?
Maybe worth reworking the interface to be simpler and yielding more efficient code. I was thinking of something along the lines of
-
Define tracers, e.g.,
DIP,DOP,POP,DFe,DO₂, maybe with a macro like@define_tracers DIP DOP POP DFe DO₂ -
Then define functions and who they apply to, maybe something like
@add_BGC_sink DIP → uptake : 1 / τ * DIP^2 / (DIP + k) * (z ≤ zₑ) @add_BGC_source POP : σ * uptake @add_BGC_source DOP : (1-σ) * uptake @add_BGC_transfer DOP → DIP : kDOP * DOP @add_BGC_transfer POP → DOP : kPOP * POP @add_restoring DIP : DIPgeo τgeo @add_external_source DFe : aeolian_DFe_source etc. -
Then be able to pack/unpack the tracers and also create efficient inplace
F(as suggested in #10)
Somehow it might be nice to have a struct detailing the model generated as well, i.e., containing metadata about the model. See DSL branch for trials.
Also might be good to replace the current parameter API into something like
@parameters "MyParams" begin
a | 1.0u"m/s"
b | 2.0u"m^2"
end
Hopefully this issue in FieldMetadata.jl will help!