CliMA / ClimateMachine.jl

Climate Machine: an Earth System Model that automatically learns from data
https://clima.github.io/ClimateMachine.jl/latest/
Other
449 stars 77 forks source link

Standardized Interface for Handling Multiple Boundaries #1252

Open blallen opened 4 years ago

blallen commented 4 years ago

Description

We should move the unrolling the BC tuple behavior used in AtmosModel [1] and HydrostaticBoussinesqModel [2] upstream into DGMethods so that all models have a unified way of dealing with multiple boundaries. Thus the default behavior of boundary_state! will be to unroll a tuple of boundary condition types for dispatch and the user will just define the boundary condition per type instead of having to hard code numeric bctypes in the boundary_state! functions. Also, we can move the AtmosModel to only using boundary_state! instead of needing normal_boundary_flux!. This implementation is working for the ocean and land models so far, so it should also work for the AtmosModel.

[1] https://github.com/CliMA/ClimateMachine.jl/blob/master/src/Atmos/Model/boundaryconditions.jl#L45-L80 [2] https://github.com/CliMA/ClimateMachine.jl/blob/master/src/Ocean/HydrostaticBoussinesq/BoundaryConditions.jl#L49-L127

Additional context

In addition to making the boundary condition interface simpler for model developers, this will also make it easier for me to write a tutorial on how to implement boundary conditions for a new model.

For CLIMA Developers

blallen commented 3 years ago

The core ideas are in the sb/bc-tuple branch. The new interface works for HBModel and SWModel and for the main AtmosModel (but not sub-components).

@simonbyrne when do you want to work on this again?