Created
June 3, 2017 01:33
-
-
Save spencerkclark/bae91200c3d2c1b59adcd831b1594a2e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kuchaale,
Sorry I just saw this now (for some reason I wasn't notified by your tagging of me in your post). Many thanks for trying things out!
For right now I would say the boundary behavior of
xdiff
you experienced is expected, because I've only allowed for themode='wrap'
option, which is enabled by default, and the interior values look good.But it's clear you've uncovered a bug in
xgradient
. I think I've fixed things in the updated gist:Note that my result using
xgradient
is different than NCL's on the boundaries, because I'm doing second-order accurate differencing everywhere. NCL uses second-order centered differencing on the interior and first-order forward or backward differencing on the boundaries.In the updated gist I also added some logic in
xgradient
that checks to see if the underlying data is stored in a dask array; only then will it chunk the left and right components. (This way you don't need to call.compute()
at the end anymore).