The diag_file%unlim_dimension_level check is no longer needed because at the end of run, this is called which sets data_has_been_written and unlim_dimension_level to 1 (if data has never received for the file), which prevents issues with the combiner.
Describe the bug The time and time_bnds data of the
ocean_annual.nc
file for my 1 year SPEAR run are not correct. They are off by one year.To Reproduce The issue can actually be reproduce by running the
test_var_masks
test because you are writing daily data but only running for 1 day.If you look at the time and time_bnds variable you would see
which is not correct.
Expected behavior The time and time_bnds variables should be correct. The test should have checked the actual time data :/
This is the line that is causing the issue: https://github.com/NOAA-GFDL/FMS/blob/42f8506512e1b5b43982320f5b9d4ca1ca9cbebd/diag_manager/fms_diag_file_object.F90#L1476-L1479 At the end of the run, for these files
data_has_been_written
will be .False. but theunlim_dimension_level
is equal to 1, so it won't leave that subroutine and basically rewrite the time and time_bnds with the next timeThe
diag_file%unlim_dimension_level
check is no longer needed because at the end of run, this is called which setsdata_has_been_written
andunlim_dimension_level
to 1 (if data has never received for the file), which prevents issues with the combiner.https://github.com/NOAA-GFDL/FMS/blob/42f8506512e1b5b43982320f5b9d4ca1ca9cbebd/diag_manager/fms_diag_file_object.F90#L1558-L1565
System Environment N/A
Additional context N/A