-
Notifications
You must be signed in to change notification settings - Fork 0
Apply stream reference_time to individual output records #1418
Apply stream reference_time to individual output records #1418
Conversation
Previously, a stream's reference_time only applied to determining the filename breaks. Right now, output is always relative to the time of the start of the current simulation (even it it is a restart). There is no way to force, say, monthly output (i.e. on the 1st of every month) if your restart does not start on the first of a month. This commit extends reference_time to also apply to determing when individual records should be written. Thus, output stream behavior will not change after a restart. This is done by adding a new routine to mpas_timekeeping that adjusts the prevRingTime of an alarm to be an integer multiple of the stream's output_interval away from the stream's reference_time. This routine is called for each output stream created by the stream manager.
To test, I set up a restart test that does a cold start followed by a restart.
The restart is identical except for:
With this configuration the output file contains:
This is incorrect because we asked for output to occur every 5 days, so we should have gotten it on day 11 and 16 instead of day 13 and 18 - the restart on day 8 threw it off. Rerunning the test with this branch, the output is correct:
I tried a second test where the stream reference_time is in the future, but I get an unrelated error that exists prior to this branch:
We could try to fix this in this branch if anyone is willing to figure it out. I took a quick look but was unable to get a usable backtrace. Note that I included code for reverse-running clocks but I did not test it. |
! Local variables | ||
type (MPAS_Alarm_type), pointer :: alarmPtr | ||
type (MPAS_TimeInterval_type) :: searchInterval, searchRemainder | ||
integer (kind=I8KIND) :: nDivs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewhoffman I added this I8 kind in an extra commit to get it to compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I was able to mimic your exact test, with success, when I merged this into ocean/develop
. Thank you @matthewhoffman, that is one more annoying item off our list. This is a bit like swatting flies.
An important note for ACME is that the restart and all output streams should have |
@matthewhoffman I'm ready to take off |
@mgduda do you have time to look at this today? We are making a big push to merge these framework PRs and update framework in all the ACME cores. |
I ran a test on the original issue, which is monthly output and sub-monthly restarts. I ran the ocean core for 70 days with 10 day restarts, then continue for another 70 days with ten day restarts. Output file is monthly. It worked perfectly. head of
This PR merged into ocean/develop
Note you still need For my reference, runs at:
|
@mgduda I know you are busy. Any chance I can merge this in today? This is the last framework PR we need, then we can update all our cores and test. |
@mgduda Sorry to jump ahead on this, but we have a big ACME code update with framework updates today. This PR worked perfectly in my testing, and solves a problem that has been a long-standing annoyance in ACME. I merged locally and test compiled the atmosphere core with gnu and intel. |
…' into develop Previously, a stream's reference_time only applied to determining the filename breaks. Right now, output is always relative to the time of the start of the current simulation (even if it is a restart). There is no way to force, say, monthly output (i.e. on the 1st of every month) if your restart does not start on the first of a month. This commit extends reference_time to also apply to determining when individual records should be written. Thus, output stream behavior will not change after a restart. This is done by adding a new routine to mpas_timekeeping that adjusts the prevRingTime of an alarm to be an integer multiple of the stream's output_interval away from the stream's reference_time. This routine is called for each output stream created by the stream manager. Fixes Issue #1307.
@mark-petersen , thanks for sponsoring this PR. BTW, regarding the comment you made about still needing |
Update needed for ACME Framework features brought in: * f444d0f Merge PR #1418 'matthewhoffman/framework/output_record_reference_time' into develop * 263e14f Merge PR #1428 'mark-petersen/framework/couple_fixes' into develop * bcce31d Merge PR #1424 'amametjanov:az/tools/cp-prebuilt-tools' into develop * 98cfeea Merge PR# 1349 'akturner/framework/forcing_cleanup' into develop * 9359319 Merge PR #1347 'akturner/framework/forcing_restart_timestamp' into develop * e9ce203 Merge PR #1348 'akturner/framework/forcing_at_init' into develop * 4974284 Merge PR #1368 'akturner/framework/improved_messages_in_driver' into develop * 86d50c5 Merge PR #1417 'akturner/framework/forcing_multiple_blocks' into develop * 9116da3 Merge branch 'framework/validation-of-streams-using-interval_in-interval_out' into develop * e466b46 Merge branch 'framework/interval_in-interval_out-support-for-streams' into develop * 30dc955 Merge branch 'az/framework/mpas_dmpar-race-fix' into develop * b632938 Merge branch 'framework/i8_interval_division' into develop * 6dac06c Merge branch 'framework/log_write_IBM_error' into develop * 960a648 Merge branch 'framework/cleanup-logging-stream-manager' into develop * 504c282 Merge branch 'framework/make-streams-with-direction-none-inactive' into develop * 5903748 Merge branch 'framework/correctly_remove_blk_fields' into develop * 3565965 Merge branch 'framework/iostreams-real4dfield-bug' into develop * 8b60591 Merge branch 'framework/missing-deallocate-nEdgesOnCellField-bootstrapping' into develop * 70b953b Merge branch 'master' into develop
Previously, a stream's reference_time only applied to determining the
filename breaks. Right now, output is always relative to the time of
the start of the current simulation (even if it is a restart). There is
no way to force, say, monthly output (i.e. on the 1st of every month) if
your restart does not start on the first of a month.
This commit extends reference_time to also apply to
determining when individual records should be written. Thus, output
stream behavior will not change after a restart.
This is done by adding a new routine to mpas_timekeeping that adjusts
the prevRingTime of an alarm to be an integer multiple of the stream's
output_interval away from the stream's reference_time. This routine is
called for each output stream created by the stream manager.
Fixes Issue #1307.