Skip to content

Commit

Permalink
Bug fix: Make sure planeflight writes out on last timestep of day
Browse files Browse the repository at this point in the history
Luke Schiferl wrote:

   The planeflight diagnostic in v12.2.0 fails to read out points in
   the final dynamic timestep of the day. It seems that this is due to
   a remnant from before the transition from minutes to seconds used
   to describe timesteps.

This has now been corrected.

Also -- changed the GC version number to 12.3.1 in the file
GeosCore/gc_classic_version.H.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
  • Loading branch information
yantosca committed Mar 28, 2019
1 parent 07c1031 commit 04da94c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GeosCore/gc_classic_version.H
Expand Up @@ -13,4 +13,4 @@
! Z = updated for patches that do not break backwards compatibility
! with run directories from the last benchmarked version X.Y.0.
!-----------------------------------------------------------------------
GC_CLASSIC_VERSION = '12.3.0'
GC_CLASSIC_VERSION = '12.3.1'
10 changes: 7 additions & 3 deletions GeosCore/planeflight_mod.F
Expand Up @@ -1711,9 +1711,13 @@ SUBROUTINE PLANEFLIGHT( am_I_Root, Input_Opt, State_Met,
PTAUS = PTAUE - ( GET_TS_DIAG() / 3600d0 )
! Otherwise write out only half a timestep's worth of data
ELSE
! Write half hour only if we are on last time step, otherwise
! exit the subroutine
IF (MOD(GET_ELAPSED_SEC(), (GET_TS_DIAG()*1440)) == 0) THEN
! Flush the last timestep to the output file (bmy, 3/28/19)
! NOTE: Luke Schiferl pointed out we should test against
! 86400 seconds instead of GET_TS_DIAG*1440. GET_TS_DIAG
! by now is already in seconds and 1440 is minutes/day,
! so there's a mismatch. This caused planeflight data
! for the last timestep of a day not to be written out.
IF (MOD(GET_ELAPSED_SEC(), 86400) == 0) THEN
PTAUS = PTAUE - ( GET_TS_DIAG() / (2.0 * 3600d0) )
ELSE
EXIT
Expand Down

0 comments on commit 04da94c

Please sign in to comment.