ClimaCoupler.jl
ClimaCoupler.jl copied to clipboard
clean up component model initialization
There are a couple of problems with how we currently initialize component models:
- We initialize a land model even if it isn't used (masked out later) in the slabplanet_aqua case, and initialize ocean even if it isn't used in the slabplanet_terra case
- There is a lot of redundancy in setting up component models for each of the different mode types we use our driver for (amip, slabplanet, etc)
Possible solutions to this are:
- Smaller if/else chunks where we check the mode names and come up with flags to pass to generic component model constructors that dispatch off of them. E.g. we could have land_init(:bucket), land_init(nothing) that return different land model types
- Separate the driver into one for AMIP and one for slabplanet
- would still need to handle the aqua/terra cases specially
- would cause some code duplication between drivers