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/ISSUE] HISTORY diagnostics only saves 23 hours of data to diagnostic files (except for Budget) #269
Comments
Hi Katie, could you provide your HISTORY.rc file? You can drag and drop it into a comment box if you add extension .txt. Thanks! |
Hi Katie, thanks for bringing this to our attention. @msulprizio and I just looked at some timeseries output that she had handy for another project. Long story short: What happens is that at 0Z on the last day of your run, a file is created with one timestamp (e.g. 2018-07-01, 00Z). But then when you start the next run stage in your, the existing file gets overwritten with data from e.g. 2018-07-01 00 to 2018-07-01 23z. We think the solution may be simple. In 12.8.1, we can add a test to see if the file that is trying to be created already exists, and if it does, to use netCDF append mode instead of netCDF write mode. In the meantime, there are a couple of things you can do as a workaround.
then you can combine those files with the new files that are created at the end of the month.
Anyway, thanks again and stay tuned for the fix! |
Also -- to answer your question about why the budget diagnostics were not affected, that is probably because you archived the budget diagnostics as time-averaged. The bug above only affects instantaneous collections. |
This commit fixes an issue raised by Katie Travis on Github: #269 The fix is: (1) For instantaneous collections (except Restart), test if a file already exists. This often happens at the start of a new day. (2) If the file exists, then open it for appending, and get the number of timestamps already in the file. (3) Then increment the timestamp counter to account for the number of existing timestamps. (For example, if there was one time point in the file, then write the next time slice with time index=2 instead of time index=1. NOTE: This fix also required the addition of a new subroutine (NC_APPEND) to NcdfUtil/ncdf_mod.F90. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
I have pushed commit 28109a7, which is now currently on the bugfix/NcWrite branch. This will go into 12.8.1 once that version is ready (but you can check out this update if you need it). I did a couple of test runs where I ran the transport tracer simulation for 1 day at a time and then saved out instantaneous 3-hourly output. I then checked to see if the file for the 2nd day had the first timestep (which was written out at the end of the previous day's run) preserved. Indeed it is!
Without the fix, the list of timestamps would have started with 2016-01-02 03 (for 3-hourly output) instead of 2016-01-02 00, and there would have been 7 timesteps instead of the correct value of 8. |
Commit 28109a7 has now been merged up to version 12.8.1 |
The commit 28109a7, as described in this Github issue: #269 originally fixed an error where instantaneous files having data at 00 UTC were being overwritten by the next day's output. However, in commit 28109a7, we moved the statement Container%FirstInt=.FALSE lower in the subroutine so that it could be used again. However, we forgot to add this line in the IF block that returns out of the subroutine. Therefore, due to this bug, any existing instantaneous file would get overwritten inadvertently. This new bug fix now prevents this, as well as setting the netCDF reference time properly. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
It was discovered that the prior commit 28109a7 had a bug that was caused by a missing This behavior is now corrected in commit 8003e32. NOTE: We may add a further update to decide which instantaneous files should be appended to and which should not. |
Also note, a further commit 1a160e1 was made in order to make sure that instantaneous collections where frequency=duration are written to disk with the proper reference time. Also, we removed "UTC" from the time:units" string, as this sometimes causes ncdump -t not to display the proper time values. |
Also added further commit 81c7126, which adds extra updates so that instantaneous collections with multiple time points are now archived properly. Also, we now throw an error if we try to append to an instantaneous netCDF file with more than one time point. This is now in 12.8.1. |
After further consideration, we have decided to remove the need for appending to instantaneous file collection files due to the danger of clobbering data. This was updated in commit 94d78a7. Instantaneous collection with more than one time point per file
For example, a 2-day run with hourly archiving saved to daily files creates this output:
Instantaneous collection with only one time point per file
For example, a multi-day run with hourly archiving saved to hourly files now creates this output:
|
Hi support team,
I am running version 12.6.3 at 0.25x0.3125 resolution for the China grid. I need hourly time series, which I output with the HISTORY.rc diagnostic. I can only run two days at a time at this resolution on my computing system. For some reason, the budget diagnostic outputs all 24 hours in a day to the same file, but the other diagnostics (species concentration, prod/loss) output 23 hours and put the 24th hour in a new file. I am not sure which is correct and how to fix this.
Thank you!
The text was updated successfully, but these errors were encountered: