-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improper section 1 offset in getgb2rp2 ('7777' issue) #666
Comments
Do you have a test for this? |
OK, this test now passes, and I modified it a bit to make it more sensitive. One thing did surprise me. The namelist file contains one parameter which is not found in the data file. This is in the test as a special if-statement. Was this intended? Thanks Alex for this excellent test. |
Which parameter was that? |
Record 314.
The output for that record:
|
That's funny, I thought I'd removed that entry. Anyway, yes, that was a mismatch in the files we got from the developers, where that field didn't make it into the grib2 file. |
OK, great, let's leave it there as a test of what happens when a parameter is not found. Thanks for the excellent test, it really helped! |
So that explains the missing parameter. I kept the file with the missing parameter and use it to test failure, and I have another version of the namelist without the missing parameter, which tests success. |
In the course of attempting to modify tocgrib2 to support >2GB files, it appears that the
getgb2rp2()
subroutine inserts extra spacing at the end of Section 1, which then pushes back the rest of the file by 4 elements.lencur
then reachesleng
before the whole message has been read. This manifested itself as wgrib2 complaining about missing 7777 the first time it encounters a message where it's missing.The text was updated successfully, but these errors were encountered: