From 2e768484be7025cc2c309d07e28613715b161bf2 Mon Sep 17 00:00:00 2001 From: Uriel Ramirez Date: Mon, 21 Sep 2020 10:41:16 -0400 Subject: [PATCH] Add fix to the time_bnds issue in history files --- diag_manager/diag_util.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index f2bc3e7ff2..554224fdd4 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -2556,7 +2556,9 @@ SUBROUTINE diag_data_out(file, field, dat, time, final_call_in, static_write_in) num = files(file)%fields(i) IF ( output_fields(num)%time_ops .AND. & input_fields(output_fields(num)%input_field)%register) THEN + ! time needs to be between start_dif and end_dif to prevent duplicate writes on time_bnds IF ( num == field ) THEN + IF ( files(file)%rtime_current >= start_dif .AND. files(file)%rtime_current <= end_dif) THEN ! Output the axes if this is first time-averaged field time_data(1, 1, 1, 1) = start_dif call diag_field_write (files(file)%f_avg_start, time_data(1:1,:,:,:), file_num=file, & @@ -2576,6 +2578,7 @@ SUBROUTINE diag_data_out(file, field, dat, time, final_call_in, static_write_in) fileobjU=fileobjU, fileobj=fileobj, fileobjND=fileobjND, & fnum_for_domain=fnum_for_domain(file), time_in=files(file)%time_index) EXIT + END IF END IF END IF END DO