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

Add periodic boundary condition when lat is 360° #164

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Nov 14, 2024

closes #163 - When the difference between the longitude dimension is exactly 360.0 degrees, then a periodic boundary condition is added.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.34%. Comparing base (dd54614) to head (8bd71ed).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #164   +/-   ##
=======================================
  Coverage   98.34%   98.34%           
=======================================
  Files          11       11           
  Lines        1206     1207    +1     
=======================================
+ Hits         1186     1187    +1     
  Misses         20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ph-kev ph-kev requested a review from Sbozzolo November 14, 2024 23:49
src/Var.jl Outdated
@@ -166,6 +166,10 @@ function _find_extp_bound_cond(dim_name, dim_array)
_isequispaced(dim_array) &&
isapprox(dim_size + dsize, 360.0)
) && return Intp.Periodic()
(
conventional_dim_name(dim_name) == "longitude" &&
(dim_array[end] - dim_array[begin]) == 360.0
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
(dim_array[end] - dim_array[begin]) == 360.0
(dim_array[end] - dim_array[begin]) 360.0

Better account for floating point errors

When the difference between the longitude dimension is exactly 360.0
degrees, then a periodic boundary condition is added.
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.

Peridoic boundary condition when the longitude dimension is exactly 360 degrees
2 participants