Skip to content

Commit

Permalink
Fix for static files (for real this time)
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 committed Feb 15, 2024
1 parent 571990f commit f02d88f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions diag_manager/fms_diag_file_object.F90
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ logical function fms_diag_files_object_init (files_array)
obj%next_close = diag_time_inc(obj%start_time, obj%get_file_new_file_freq(), &
obj%get_file_new_file_freq_units())
else
! The file is static, so set the close time to be equal to the start time so that
! the file can be closed at the first diag send complete call
obj%next_close = obj%start_time
obj%next_close = diag_time_inc(obj%start_time, VERY_LARGE_FILE_FREQ, DIAG_DAYS)
endif
obj%is_file_open = .false.

Expand Down Expand Up @@ -990,7 +988,13 @@ subroutine add_start_time(this, start_time, model_time)
this%next_close = diag_time_inc(this%start_time, this%get_file_new_file_freq(), &
this%get_file_new_file_freq_units())
else
this%next_close = diag_time_inc(this%start_time, VERY_LARGE_FILE_FREQ, DIAG_DAYS)
if (this%is_static) then
! If the file is static, set the close time to be equal to the start_time, so that it can be closed
! after the first write!
this%next_close = this%start_time
else
this%next_close = diag_time_inc(this%start_time, VERY_LARGE_FILE_FREQ, DIAG_DAYS)
endif
endif

if(this%has_file_duration()) then
Expand Down

0 comments on commit f02d88f

Please sign in to comment.