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

Assumes SCRIP format grid files are in degrees #27

Closed
jonbob opened this issue Dec 22, 2016 · 3 comments
Closed

Assumes SCRIP format grid files are in degrees #27

jonbob opened this issue Dec 22, 2016 · 3 comments

Comments

@jonbob
Copy link

jonbob commented Dec 22, 2016

We have had failures using tempest when our input grids are in SCRIP format but have coordinate units in radians instead of degrees. It looks like degrees are assumed in GridElements.cpp:

line 824: double dLon = dCornerLon[i][j] / 180.0 * M_PI;
line 825: double dLat = dCornerLat[i][j] / 180.0 * M_PI;

For our grids, tempest fails later during the grid validation step, with the following error:

Validate mesh A Error detected (orientation): Face 354, Edge 0, Orientation 5.27839e-06 (x,y,z): n0: 9.93977e-01 1.09429e-01 -5.87795e-03 n1: 9.99983e-01 6.21380e-05 -5.89998e-03 n2: 9.99983e-01 1.10999e-04 -5.85172e-03 (lambda, phi): n0: 1.09650e-01 -5.87798e-03 n1: 6.21391e-05 -5.90001e-03 n2: 1.11001e-04 -5.85176e-03 X-Product: 5.27655e-06 2.89801e-07 -3.23976e-07

If I remove the hard-wired conversion, tempest successfully creates our regrid files.

If possible, could you add a check of the netcdf attributes for units, and convert only when in degrees? Thanks

@paullric
Copy link
Contributor

paullric commented Dec 23, 2016 via email

@jonbob
Copy link
Author

jonbob commented Dec 23, 2016

Hey Paul -- thanks so much, and I'll happily test it. It may be first thing in January -- we're shut down next week. But a very much appreciate the fast turnaround. Jon

@jonbob
Copy link
Author

jonbob commented Jan 4, 2017

Thanks Paul -

I tested your new code this morning and it worked just great. The map it created was within round-off (e-17) of the map I had made with my hard-wired version before the break -- so I think we can close this. Thanks for the quick response!

@jonbob jonbob closed this as completed Jan 4, 2017
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

No branches or pull requests

2 participants