Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL with macros? #18

Open
briochemc opened this issue Aug 2, 2019 · 2 comments
Open

DSL with macros? #18

briochemc opened this issue Aug 2, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@briochemc
Copy link
Member

Maybe worth reworking the interface to be simpler and yielding more efficient code.
I was thinking of something along the lines of

  1. Define tracers, e.g., DIP, DOP, POP, DFe, DO₂, maybe with a macro like

    @define_tracers DIP DOP POP DFe DO₂
  2. 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.
  3. Then be able to pack/unpack the tracers and also create efficient inplace F (as suggested in AIBECS F is quite slower (5x) than handmade F #10)

@briochemc
Copy link
Member Author

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.

@briochemc briochemc added the enhancement New feature or request label Nov 19, 2019
@briochemc
Copy link
Member Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant