-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add remapping to coupler puts & gets #58
Conversation
Currently it is not possible to map to an exchange or intermediary grid -- any field |
This is because of the current way the mapping is set up which uses a tag ( Perhaps the right solution is to remove the double usage of |
This PR sets up several follow up PRs:
|
ocn_to_atm = Operators.LinearRemap(atm_boundary, ocn_domain) | ||
lnd_to_atm = Operators.LinearRemap(atm_boundary, lnd_domain) | ||
maps = ( | ||
atmos_to_ocean = Operators.LinearRemap(ocn_domain, atm_boundary), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, but we should be consistent between using "atm" and "atmos", "land" and "lnd, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very neat, thanks @jb-mackay ! I added a couple of comments, both of which we can discuss when we do the interface revamp. I think this can be merged.
|
||
# init coupler fields and maps | ||
coupler = CouplerState() | ||
coupler_add_field!(coupler, :T_sfc_ocean, ocean.integrator.u.T_sfc; write_sim = ocean) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way of asserting that the correct models write into the right vars could be via multiple dispatch, which would allow specifying the same name to one variable in different domains (e.g. T_sfc(::atm_sim)
, T_sfc(::ocn_sim)
etc). We can discuss this during the interface 🍐 next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that that would lead to a large number of methods for these shared variables. I think it would be better to have fewer methods that can give us flexibility. Let's discuss further.
struct SimulationA{T} <: ClimaCoupler.AbstractSimulation | ||
data::T | ||
end | ||
ClimaCoupler.name(::SimulationA) = :simA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could get away with avoiding the (simA, simB, ...) assignment, e.g. using Symbol
? Again, something we can address during the next iteration. Noted down to discuss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be good for this to work for an arbitrary number of sims, each of which has it's own user-defined tag. Maybe the solution will become clearer next week, when we focus on the interface! :)
bors r+ |
Purpose and Content
Adds remapping to the coupler
put!
andget
calls. Implements these calls in the sea breeze simulationBenefits and Risks
Hides explicitly calling remapping operations from the user.
Next steps
The initialization phase needs reworking and reordering in order to facilitate the auto-construction of the remap operators.
Linked Issues
#44
PR Checklist