E3SM-Project / polaris

Testing and analysis for OMEGA, MPAS-Ocean, MALI and MPAS-Seaice
BSD 3-Clause "New" or "Revised" License
6 stars 13 forks source link

Fix visualization of edge quantities with periodic boundaries #150

Closed cbegeman closed 5 months ago

cbegeman commented 11 months ago

Fixes https://github.com/E3SM-Project/polaris/issues/149

Checklist

cbegeman commented 11 months ago

@xylar I might replace this later with something more robust and elegant. This is a quick fix.

cbegeman commented 11 months ago

@xylar That's a good idea! I'll put that on the to-do list for after AGU.

cbegeman commented 6 months ago

@xylar Let me know what you think. I decided to go with just moving polygon coordinates so that they don't cross boundaries rather than removing or adding additional polygons (corresponding to cells or edge kites). The side that the polygons end up on depends on the value of xCell or xEdge (yCell or yEdge) so it can result in jagged boundaries for the kites. I'm personally ok with that because I prefer to see the fields as they actually are when testing. With duplicated polygons plotted, it may be hard to see just how many bad values emerge at the boundary, for example. If you have a strong feeling otherwise, let me know. I don't envision we would use edge quantities for publication-ready images anyhow given how difficult normalVelocity is to interpret by eye.

image

xylar commented 5 months ago

Sure, I'm fine with this approach.

cbegeman commented 5 months ago

Testing

I tested this approach on perlmutter with the in-development drying_slope test case. I will test it with any other tasks that produce edge-quantity viz before merging.

xylar commented 5 months ago

Merge when you're ready.

cbegeman commented 5 months ago

The only other task that currently plots a horizontal edge field with periodicity is baroclinic_channel. Its figure also looks good: image