From 04da94cdbe01c9032904a9f7d14ec3a5aded5aee Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 28 Mar 2019 16:01:52 -0400 Subject: [PATCH] Bug fix: Make sure planeflight writes out on last timestep of day 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 --- GeosCore/gc_classic_version.H | 2 +- GeosCore/planeflight_mod.F | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/GeosCore/gc_classic_version.H b/GeosCore/gc_classic_version.H index 8a4b127cc..c280755c9 100644 --- a/GeosCore/gc_classic_version.H +++ b/GeosCore/gc_classic_version.H @@ -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' diff --git a/GeosCore/planeflight_mod.F b/GeosCore/planeflight_mod.F index 5a788c60c..706640d87 100644 --- a/GeosCore/planeflight_mod.F +++ b/GeosCore/planeflight_mod.F @@ -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