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

[Bug]: Figure out why TREFHT regridded reference variable is not regridding on main with ESMF bilinear #817

Open
tomvothecoder opened this issue Jun 3, 2024 · 0 comments
Labels
bug Bug fix (will increment patch version)

Comments

@tomvothecoder
Copy link
Collaborator

What happened?

In PR #815:

This PR validates the replication of the slice flag feature added in PR #750 to fix #759.

I re-ran ex1.py and found that all .nc files produced are now within the relative tolerance.

For metrics, all but one is within the relative tolerance. This single metric is related to the regridded reference data for "TREFHT" with the land region. In trefht.py, I compare the .nc file for the regridded reference data between xCDAT/xESMF and CDAT/ESMF. I found that CDAT/ESMF doesn't seem to actually regrid the data since the original and regridded reference variables are the same, as noted in this PR review comment. I think this is leading to the large diffs along the coast lines, as shown below.

xCDAT CDAT Diff
debug_TREFHT_actual debug_TREFHT_expected debug_TREFHT_diff

In PR #794, I noticed how bilinear regridding with xCDAT/xESMF produces nan location mismatches when comparing land sea masks to CDAT/ESMF. I think we should move forward for now and debug this more later on in a separate PR.

What did you expect to happen? Are there are possible answers you came across?

The reference TREFHT variable should be regridded since the mv2.regrid is called below:

# use nlat to decide data resolution, higher number means higher data
# resolution. For the difference plot, regrid toward lower resolution
if len(axes1[1]) <= len(axes2[1]):
mv_grid = mv1.getGrid()
mv1_reg = mv1
mv2_reg = mv2.regrid(
mv_grid, regridTool=regrid_tool, regridMethod=regrid_method
)
mv2_reg.units = mv2.units

Minimal Complete Verifiable Example (MVCE)

No response

Relevant log output

No response

Anything else we need to know?

No response

Environment

main branch

@tomvothecoder tomvothecoder added the bug Bug fix (will increment patch version) label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix (will increment patch version)
Projects
None yet
Development

No branches or pull requests

1 participant