Skip to content

Commit

Permalink
Add fix to the time_bnds issue in history files
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriel Ramirez committed Sep 21, 2020
1 parent d34bb9f commit 2e76848
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions diag_manager/diag_util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand All @@ -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
Expand Down

0 comments on commit 2e76848

Please sign in to comment.