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

Update combine_surfaces! #316

Merged
merged 1 commit into from
Jun 8, 2023
Merged

Update combine_surfaces! #316

merged 1 commit into from
Jun 8, 2023

Conversation

LenkaNovak
Copy link
Collaborator

@LenkaNovak LenkaNovak commented Jun 3, 2023

Purpose

We need to generalize combine_surfaces! and update_area_fractions before introducing the new surface fluxes outlined in #296 .

Closes #317 (also see for more details)


  • I have read and checked the items on the review checklist.

@LenkaNovak LenkaNovak marked this pull request as ready for review June 6, 2023 15:49
update_field!(sim::SurfaceModelSimulation, ::Val{:area_fraction}, field::Fields.Field) = ...
update_field!(sim::SurfaceModelSimulation, ::Val{:air_temperature}, field::Fields.Field) = ...
```
- these adapter function, to be defined in the component models' init files (preferably in their own repositories), allow the coupler to operate without having to assume particular data structures of the underlying component models. This allows easy swapping of model components, as well as a stable source code with coupler-specific unit tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- these adapter function, to be defined in the component models' init files (preferably in their own repositories), allow the coupler to operate without having to assume particular data structures of the underlying component models. This allows easy swapping of model components, as well as a stable source code with coupler-specific unit tests.
- these adapter functions, to be defined in the component models' init files (preferably in their own repositories), allow the coupler to operate without having to assume particular data structures of the underlying component models. This allows easy swapping of model components, as well as a stable source code with coupler-specific unit tests.

@@ -162,6 +163,7 @@ function bucket_init(
space,
dt::FT,
saveat::FT,
land_fraction,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The named field in the struct was generic area_fraction (as for the other SurfaceModelSimulation types). Is this discrepancy here desired/intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, this was left from an old version. Well spotted!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - I think it would be nice to consistently use area_fraction :)

Comment on lines 1 to 5
"""
Interfacer

...
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some missing docstring warnings in the docs
image

src/Regridder.jl Outdated

Sums Field objects in `fields` weighted by the respective area fractions, and updates
these values in `combined_field`.
NamedTuples `fields` and `fractions` must have matching field names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we give an example here of the call with matching field names?

Copy link
Member

@juliasloan25 juliasloan25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments, mostly suggestions for how to reduce code duplication, and clarifying questions regarding the docs. Overall I like the interface design, I think this is a good step!

docs/src/interfacer.md Outdated Show resolved Hide resolved
docs/src/interfacer.md Outdated Show resolved Hide resolved
docs/src/interfacer.md Outdated Show resolved Hide resolved
docs/src/interfacer.md Show resolved Hide resolved
@@ -162,6 +163,7 @@ function bucket_init(
space,
dt::FT,
saveat::FT,
land_fraction,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - I think it would be nice to consistently use area_fraction :)

docs/src/interfacer.md Outdated Show resolved Hide resolved
update amip experiment

slabplanet runs

amip runs

component model test passes

fix combine_surfaces_from_sol! import

viz fix

add more unit tests

docs and interface bug fixes

conservation fix

`combine_surfaces!` docstring fix

revs

rev2

doc

comment
@LenkaNovak
Copy link
Collaborator Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 8, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit aaa842d into main Jun 8, 2023
10 checks passed
@bors bors bot deleted the ln/combine-surfaces-update branch June 8, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update combine_surfaces!
3 participants