Skip to content

Commit

Permalink
Only use hist_time_axis when hist_avg is true
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 committed Jun 21, 2023
1 parent 2efc26c commit befc255
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,12 @@ subroutine ice_write_hist (ns)
!-----------------------------------------------------------------
! write time variable
!-----------------------------------------------------------------

ltime2 = timesecs/secday ! hist_time_axis = 'end' (default)

if (trim(hist_time_axis) == 'begin') then
ltime2 = time_beg(ns)
elseif (trim(hist_time_axis) == 'middle') then
ltime2 = p5*(time_beg(ns)+time_end(ns))
else ! hist_time_axis == 'end' (default)
ltime2 = timesecs/secday
if (hist_avg(ns)) then
if (trim(hist_time_axis) == "begin" ) ltime2 = time_beg(ns)
if (trim(hist_time_axis) == "middle") ltime2 = p5*(time_beg(ns)+time_end(ns))
endif

status = nf90_inq_varid(ncid,'time',varid)
Expand Down
11 changes: 5 additions & 6 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,11 @@ subroutine ice_write_hist (ns)
! write time variable
!-----------------------------------------------------------------

if (trim(hist_time_axis) == 'begin') then
ltime2 = time_beg(ns)
elseif (trim(hist_time_axis) == 'middle') then
ltime2 = p5*(time_beg(ns)+time_end(ns))
else ! hist_time_axis == 'end' (default)
ltime2 = timesecs/secday
ltime2 = timesecs/secday ! hist_time_axis = 'end' (default)

if (hist_avg(ns)) then
if (trim(hist_time_axis) == "begin" ) ltime2 = time_beg(ns)
if (trim(hist_time_axis) == "middle") ltime2 = p5*(time_beg(ns)+time_end(ns))
endif

status = pio_inq_varid(File,'time',varid)
Expand Down

0 comments on commit befc255

Please sign in to comment.