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

Variable 'jcap' uninitialized in utils/nemsio_read #42

Open
GeorgeGayno-NOAA opened this issue Dec 8, 2020 · 9 comments
Open

Variable 'jcap' uninitialized in utils/nemsio_read #42

GeorgeGayno-NOAA opened this issue Dec 8, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@GeorgeGayno-NOAA
Copy link

NCO opened a BugZilla report about the nemsio_read utility. Variable jcap is declared but never defined. Then it is printed to standard output at line 76. I suspect the utility author meant to return jcap from the call to nemsio_getfilehead at line 74.

http://www2.spa.ncep.noaa.gov/bugzilla/show_bug.cgi?id=1002

@GeorgeGayno-NOAA GeorgeGayno-NOAA added the bug Something isn't working label Dec 8, 2020
@edwardhartnett
Copy link
Contributor

Can we get a test to demonstrate this?

@kgerheiser
Copy link
Contributor

A quick cmd+f of nemsio_read doesn't show any variable named jcap? Is this in a different version of the library?

@GeorgeGayno-NOAA
Copy link
Author

Running a test is very straightforward. All you need is a nemsio file. On Hera, I use nemsio files in the chgres_cube regression tests:

  • /scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/input_data/gfs.nemsio

To run the utility, do nemsio_read $nemsio_file and pipe to a log file. My tests show 'jcap' is '0'.

@GeorgeGayno-NOAA
Copy link
Author

A quick cmd+f of nemsio_read doesn't show any variable named jcap? Is this in a different version of the library?

Check the nemsio_read.f90 in the ./utils directory.

@edwardhartnett
Copy link
Contributor

When I say "test" I always mean automated test. Please automate a test for this bug before submitting a fix.

Put the nemsio file on the ftp site and fetch it for the test. Write a shell script to run the test and have it launch with make test.

Ask for help for any part you need help with...

@GeorgeGayno-NOAA
Copy link
Author

Running a test is very straightforward. All you need is a nemsio file. On Hera, I use nemsio files in the chgres_cube regression tests:

  • /scratch1/NCEPDEV/da/George.Gayno/noscrub/reg_tests/chgres_cube/input_data/gfs.nemsio

To run the utility, do nemsio_read $nemsio_file and pipe to a log file. My tests show 'jcap' is '0'.

Intel must set uninitialized variables to '0' by default.

@kgerheiser
Copy link
Contributor

Yep, that's an uninitialized variable.

Compiling the libraries -check all once in a while could catch things like this.

@kgerheiser kgerheiser changed the title Bug in nemsio_read utility Variable 'jcap' uninitialized in utils/nemsio_read Dec 8, 2020
@GeorgeGayno-NOAA
Copy link
Author

A better test file is: /scratch1/NCEPDEV/da/George.Gayno/noscrub/chgres_tutorial/nemsio/gfnanl.gdas.2017071700

It is from an older version of the spectral GFS and has a more complete header.

@edwardhartnett
Copy link
Contributor

Bumping this to the next release...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants