-
Notifications
You must be signed in to change notification settings - Fork 132
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 grid averaging for tmass, aice, uvelT, vvelT #762
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The change here for tmass is right: to get the correct mass at the U point, we need to compute
sum(rhoi*vice*aice*T cell area)/sum(aice*T cell area)
over the T cells [ignoring snow for now], since vice has units of volume per unit area.
But I do not think this is correct for aice_init. Since ice concentration is assumed to be uniformly distributed over each grid cell, the concentration at U should be
sum(aice_init*T cell area)/sum(T cell area)
but I think the calculation here is
sum(aice_init*aice*T cell area)/sum(aice*T cell area)
.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.
Just to clarify, The "S" mapping is masked area weighted while the "A" mapping is just area weighted. When you use "aice" above, is that the ice fraction? There are no ice fraction weighted averages built into CICE. If we want to do that, we can use user defined averaging weights. Again,
Where Tarea and Tmask are the static grid cell areas and masks computed at initialization. If we do want to have fraction weighted mapping, we can do that, but it's not the standard "S", "A", or "F". To do that we'd do
and that would do
umass = sum(tmass*Tarea*aice)/sum(Tarea*aice)
At this point, we NEVER weigh the grid averaging by the ice fraction anywhere. Is that something we should be doing?
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.
Sorry, I misunderstood "area weighted" in the doc to mean ice-area-weighted, but it clearly says grid cell area. My mistake. Let me think about this some more - what I wrote above is not quite correct.
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.
Correction to my comment above:
To get the correct mass at the U point, we need to compute
sum(rhoi*vice*Tarea)/sum(Tarea)
over the T cells [ignoring snow for now], since vice has units of volume per unit area and already incorporates aice (i.e. vice = hi * aice). So the tmass line is correct.
Since ice concentration is assumed to be uniformly distributed over each grid cell, the initial concentration at U should be
sum(aice_init*Tarea)/sum(Tarea)
and that is what's being done in the S mapping.
So I agree with both of these modifications. Sorry for the confusion!
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.
The "S" mapping includes the mask, the "A" mapping does not. I think we need to change "S" to "A" for umass and aiU if we want an unmasked weighted average as written above. This only matters for gridcells near land. So should the average be an average of only ocean cells ("S" mapping) or an average of all ocean/land cells ("A" mapping)?
One other thing that I just want reiterate. Maybe there is a place for fraction weighted mapping in CICE. We do that in the coupler when we map ice coupling fields to other grids. We fraction area weight the mapping so a gridcell with fraction=0.9 has much greater weight than a gridcell with fraction=0.2 when interpolating from ice to atmosphere for example. You can also think of it as a fraction weighted merge. How we do that depends whether it's a flux (which has to be strictly conserved and has a particular mapping requirement) or a state (which could be done many ways). Maybe we need to do the same in CICE in some places for some fields?? I guess it partly depends whether we can define an ice fraction on the grid we're mapping from. We'd have to think about it a bit.
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 think S is correct in this case, with the mask included, although it would be good for @JFLemieux73 @dabail10 to confirm that it's consistent with other assumptions in the C-grid approach. On a B-grid, the velocity being computed would be zero if any of the T cells is land (i.e. the point is moot).
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.
Great, thanks for the clarification.
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 also wondered whether ice area weighting could/should be included as part of the averaging infrastructure. For coupling, the actual averaging happens in the coupler with other components' data, so we can't control the entire average anyhow. Once the model starts being coupled with different grids, we should check whether we are calculating the coupling fields appropriately, but I think you've already thought through all of that. In the ice model, we "aggregate" across ice thickness categories, but that's only within a particular cell, not for shifting things around horizontally (there are vertical grid remappings). The tracer loading/unloading also involves a lot of multiplying/dividing by "weights" (including ice area and other tracers). Neither of these cases involve grid shifts. So: I don't think we should worry about it unless we come across a particular case in which we need it.