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