You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In the netcdf output, when using a restart file, then time:units attribute is set in a way that is inconsistent with the time variable.
For an initial run of one day long, in the netcdf output:
time:units = "seconds since 1900-01-01 00:00:00" ;
time = 86400 ;
Which is correct
If another day is run, the time variable in netcdf output is:
time:units = "seconds since 1900-01-02 00:00:00" ;
time = 172800 ;
This is inconsistent, as both the time and the time origin have stepped forward one day.
Interestingly the file name has the correct date (i.e. the end of the time period): GMOM_JRA_WD.ww3.hi.1900-01-03-00000.nc
To Reproduce
Start the model from a restart file, with netcdf output turned on.
Expected behavior
Time:units should be set from the model start time, not the restart time.
Additional context
The time_origin is set based on the 'Current Time' before the model is time stepped:
@anton-seaice I have made this fix in some work I'm doing in WW3 for the Coastal application in UFS. I'll be making a PR which will include this fix in the coming weeks.
index c7bb14ef..f2d4a4f8 100644
--- a/model/src/wav_comp_nuopc.F90
+++ b/model/src/wav_comp_nuopc.F90
@@ -623,7 +623,7 @@ contains
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif
! Determine time attributes for history output
- call ESMF_TimeGet( esmfTime, timeString=time_origin, calendar=calendar, rc=rc )
+ call ESMF_TimeGet( startTime, timeString=time_origin, calendar=calendar, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
time_origin = 'seconds since '//time_origin(1:10)//' '//time_origin(12:19)
!call ESMF_ClockGet(clock, calendar=calendar)
Describe the bug
In the netcdf output, when using a restart file, then time:units attribute is set in a way that is inconsistent with the time variable.
For an initial run of one day long, in the netcdf output:
Which is correct
If another day is run, the time variable in netcdf output is:
This is inconsistent, as both the time and the time origin have stepped forward one day.
Interestingly the file name has the correct date (i.e. the end of the time period):
GMOM_JRA_WD.ww3.hi.1900-01-03-00000.nc
To Reproduce
Start the model from a restart file, with netcdf output turned on.
Expected behavior
Time:units should be set from the model start time, not the restart time.
Additional context
The
time_origin
is set based on the 'Current Time' before the model is time stepped:WW3/model/src/wav_comp_nuopc.F90
Line 613 in 97740a1
But then the 'elapsed_secs' is set from the 'Start Time'
WW3/model/src/wav_comp_nuopc.F90
Line 1062 in 97740a1
I think setting time_origin based on Start Time would make sense.
The text was updated successfully, but these errors were encountered: