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

Fix time_average for instantaneous output #310

Merged
merged 13 commits into from
Sep 20, 2024

Conversation

uramirez8707
Copy link
Contributor

Fixes #307
Adds a test to test the time_average program, without the code updates the instantaneous test will fail

@uramirez8707
Copy link
Contributor Author

@ceblanton @rem1776

@ceblanton
Copy link
Contributor

It looks like the new test is activated in the configure output and the test passes, but when i run the test interactively on ppan, or on the original test case file in the issue, it fails. Did it work interactively for you?

an010:~/git/FRE-NCtools/build10%>python3 ../t/test_time_avg.py  

 Will use input file settings for NetCDF4 deflation level
 Will use input file settings for NetCDF4 shuffle
 NETCDF ERROR in program time_average
 error getting varid for time bounds
 NetCDF: Variable not found

Program aborted. Backtrace:
#0  0x402c39 in ???
#1  0x403a63 in ???
#2  0x40a55d in ???
#3  0x40240c in ???
#4  0x2af8b7c16554 in ???
#5  0x40243c in ???
#6  0xffffffffffffffff in ???
sh: line 1: 21793 Aborted                 TAVG.exe < instantaneous.nml

@uramirez8707
Copy link
Contributor Author

@ceblanton The test works me, are you sure there isn't an old version of frenctools in your path?

…stent with what it is done in the 2023 version
@uramirez8707
Copy link
Contributor Author

@ceblanton I reproduced your crash when i compiled with -O3 flags. I think the problem is that the tbnds_present variable was never initialized and it ended up in this block:

istat = NF90_INQ_VARID ( ncid, trim(tbnds_name), varid(1) )
if (istat /= NF90_NOERR) call error_handler ('error getting varid for time bounds', ncode=istat)
istat = NF90_GET_VAR ( ncid, varid(1), tbnds )
if (istat /= NF90_NOERR) call error_handler ('error getting data for time bounds', ncode=istat)

and complained when it couldn't find the time_bnds.

Copy link
Contributor

@ceblanton ceblanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ceblanton ceblanton merged commit f0637c1 into NOAA-GFDL:main Sep 20, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

The time_average program is broken for instantaneous output
2 participants