From 7371c877c63b0a12aca150da7dad2f99ff1b53b8 Mon Sep 17 00:00:00 2001 From: uramirez8707 <49168881+uramirez8707@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:57:35 -0400 Subject: [PATCH 1/2] fix: start_time functionality in diag manager (#1390) --- diag_manager/diag_manager.F90 | 14 +++++++++++--- diag_manager/diag_util.F90 | 12 +++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/diag_manager/diag_manager.F90 b/diag_manager/diag_manager.F90 index 92fdf0e122..ef3623b57b 100644 --- a/diag_manager/diag_manager.F90 +++ b/diag_manager/diag_manager.F90 @@ -218,7 +218,8 @@ MODULE diag_manager_mod & check_out_of_bounds, check_bounds_are_exact_dynamic, check_bounds_are_exact_static,& & diag_time_inc, find_input_field, init_input_field, init_output_field,& & diag_data_out, write_static, get_date_dif, get_subfield_vert_size, sync_file_times,& - & prepend_attribute, attribute_init, diag_util_init, field_log_separator + & prepend_attribute, attribute_init, diag_util_init, field_log_separator, & + & get_file_start_time USE diag_data_mod, ONLY: max_files, CMOR_MISSING_VALUE, DIAG_OTHER, DIAG_OCEAN, DIAG_ALL, EVERY_TIME,& & END_OF_RUN, DIAG_SECONDS, DIAG_MINUTES, DIAG_HOURS, DIAG_DAYS, DIAG_MONTHS, DIAG_YEARS, num_files,& & max_input_fields, max_output_fields, num_output_fields, EMPTY, FILL_VALUE, null_axis_id,& @@ -444,6 +445,7 @@ INTEGER FUNCTION register_diag_field_array(module_name, field_name, axes, init_t INTEGER :: stdout_unit LOGICAL :: mask_variant1, verbose1 CHARACTER(len=128) :: msg + TYPE(time_type) :: diag_file_init_time !< The intial time of the diag_file ! get stdout unit number stdout_unit = stdout() @@ -559,7 +561,6 @@ INTEGER FUNCTION register_diag_field_array(module_name, field_name, axes, init_t ind = input_fields(field)%output_fields(j) output_fields(ind)%static = .FALSE. ! Set up times in output_fields - output_fields(ind)%last_output = init_time ! Get output frequency from for the appropriate output file file_num = output_fields(ind)%output_file IF ( file_num == max_files ) CYCLE @@ -578,8 +579,10 @@ INTEGER FUNCTION register_diag_field_array(module_name, field_name, axes, init_t END IF freq = files(file_num)%output_freq + diag_file_init_time = get_file_start_time(file_num) output_units = files(file_num)%output_units - output_fields(ind)%next_output = diag_time_inc(init_time, freq, output_units, err_msg=msg) + output_fields(ind)%last_output = diag_file_init_time + output_fields(ind)%next_output = diag_time_inc(diag_file_init_time, freq, output_units, err_msg=msg) IF ( msg /= '' ) THEN IF ( fms_error_handler('diag_manager_mod::register_diag_field',& & ' file='//TRIM(files(file_num)%name)//': '//TRIM(msg),err_msg)) RETURN @@ -1911,6 +1914,11 @@ LOGICAL FUNCTION diag_send_data(diag_field_id, field, time, is_in, js_in, ks_in, ! Finished output of previously buffered data, now deal with buffering new data END IF + if (present(time)) then + !! If the last_output is greater than the time passed in, it is not time to start averaging the data + if (output_fields(out_num)%last_output > time) CYCLE + endif + IF ( .NOT.output_fields(out_num)%static .AND. .NOT.need_compute .AND. debug_diag_manager ) THEN CALL check_bounds_are_exact_dynamic(out_num, diag_field_id, Time, err_msg=err_msg_local) IF ( err_msg_local /= '' ) THEN diff --git a/diag_manager/diag_util.F90 b/diag_manager/diag_util.F90 index 9956c2d9c4..60f5fff786 100644 --- a/diag_manager/diag_util.F90 +++ b/diag_manager/diag_util.F90 @@ -84,7 +84,7 @@ MODULE diag_util_mod & prepend_attribute, attribute_init, diag_util_init,& & update_bounds, check_out_of_bounds, check_bounds_are_exact_dynamic, check_bounds_are_exact_static,& & fms_diag_check_out_of_bounds, & - & fms_diag_check_bounds_are_exact_dynamic, fms_diag_check_bounds_are_exact_static + & fms_diag_check_bounds_are_exact_dynamic, fms_diag_check_bounds_are_exact_static, get_file_start_time !> @brief Prepend a value to a string attribute in the output field or output file. @@ -2753,6 +2753,16 @@ SUBROUTINE prepend_attribute_file(out_file, att_name, prepend_value, err_msg) END IF END SUBROUTINE prepend_attribute_file + !> @brief Get the a diag_file's start_time as it is defined in the diag_table + !! @return the start_time for the file + function get_file_start_time(file_num) & + result (start_time) + integer, intent(in) :: file_num !< File number of the file to get the start_time from + + TYPE(time_type) :: start_time !< The start_time to return + + start_time = files(file_num)%start_time + end function get_file_start_time END MODULE diag_util_mod !> @} ! close documentation grouping From a01e24e53036a76f518425c3622cf64ba4acfeb2 Mon Sep 17 00:00:00 2001 From: Ryan Mulhall <35538242+rem1776@users.noreply.github.com> Date: Fri, 13 Oct 2023 12:03:35 -0400 Subject: [PATCH 2/2] chore: build/log changes for release (#1391) --- CHANGELOG.md | 5 +++++ CMakeLists.txt | 2 +- configure.ac | 2 +- libFMS/Makefile.am | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32cc50cd27..da19293b10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project uses `yyyy.rr[.pp]`, where `yyyy` is the year a patch is releas `rr` is a sequential release number (starting from `01`), and an optional two-digit sequential patch number (starting from `01`). +## [2023.02.01] - 2023-10-13 +### Fixed +- DIAG_MANAGER: Fixes issue with incorrect start_time functionality + + ## [2023.02] - 2023-07-27 ### Known Issues - GCC 11.1.0 is unsupported due to compilation issues with select type. The issue is resolved in later GCC releases. diff --git a/CMakeLists.txt b/CMakeLists.txt index ff75d3cf90..5f6046fc01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(CMAKE_Fortran_FLAGS_DEBUG) # Define the CMake project project(FMS - VERSION 2023.02.0 + VERSION 2023.02.01 DESCRIPTION "GFDL FMS Library" HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms" LANGUAGES C Fortran) diff --git a/configure.ac b/configure.ac index f7f0fea4aa..1d5803a2e5 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ AC_PREREQ([2.69]) # Initialize with name, version, and support email address. AC_INIT([GFDL FMS Library], - [2023.02.00], + [2023.02.01], [gfdl.climate.model.info@noaa.gov], [FMS], [https://www.github.com/NOAA-GFDL/FMS]) diff --git a/libFMS/Makefile.am b/libFMS/Makefile.am index db57f86562..b75f6817b6 100644 --- a/libFMS/Makefile.am +++ b/libFMS/Makefile.am @@ -28,7 +28,7 @@ lib_LTLIBRARIES = libFMS.la # These linker flags specify libtool version info. # See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning # for information regarding incrementing `-version-info`. -libFMS_la_LDFLAGS = -version-info 16:0:0 +libFMS_la_LDFLAGS = -version-info 16:1:0 # Add the convenience libraries to the FMS library. libFMS_la_LIBADD = $(top_builddir)/platform/libplatform.la