Skip to content

Commit e2e9189

Browse files
authored
fix: add 2025.01.02 patch commits to main (#1659)
2 parents b4de40d + ef677e1 commit e2e9189

File tree

10 files changed

+97
-10
lines changed

10 files changed

+97
-10
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@ and this project uses `yyyy.rr[.pp]`, where `yyyy` is the year a patch is releas
66
`rr` is a sequential release number (starting from `01`), and an optional two-digit
77
sequential patch number (starting from `01`).
88

9+
## [2025.01.02] - 2025-03-06
10+
11+
### Known Issues
12+
- Diag Manager Rewrite: See [below](#20240102---2024-06-14) for known output file differences regarding the new diag manager. The new diag_manager is disabled by default, so this differences will only be present if `use_modern_diag` is set to true in the `diag_manager_nml`.
13+
- BUILD(HDF5): HDF5 version 1.14.3 generates floating point exceptions, and will cause errors if FMS is built with FPE traps enabled. FPE traps are turned on when using the debug target in mkmf.
14+
- GCC: version 14.1.0 is unsupported due to a bug with strings that has come up previously in earlier versions. This will be caught by the configure script, but will cause compilation errors if using other build systems.
15+
- INTEL: The `-check uninit` flag for the Intel Oneapi Fortran compiler (ifx) is unsupported due to a bug causing false positives when using external libraries. If using the `-check all` flag, `-check all,nouninit` should be used instead.
16+
17+
### Changed
18+
- DIAG_MANAGER: Change name of yaml output file to include the root PE number at the end in order to prevent overwrites (#1654)
19+
20+
## [2025.01.01] - 2025-02-26
21+
22+
### Known Issues
23+
- Diag Manager Rewrite: See [below](#20240102---2024-06-14) for known output file differences regarding the new diag manager. The new diag_manager is disabled by default, so this differences will only be present if `use_modern_diag` is set to true in the `diag_manager_nml`.
24+
- BUILD(HDF5): HDF5 version 1.14.3 generates floating point exceptions, and will cause errors if FMS is built with FPE traps enabled. FPE traps are turned on when using the debug target in mkmf.
25+
- GCC: version 14.1.0 is unsupported due to a bug with strings that has come up previously in earlier versions. This will be caught by the configure script, but will cause compilation errors if using other build systems.
26+
- INTEL: The `-check uninit` flag for the Intel Oneapi Fortran compiler (ifx) is unsupported due to a bug causing false positives when using external libraries. If using the `-check all` flag, `-check all,nouninit` should be used instead.
27+
28+
### Changed
29+
- DIAG_MANAGER: Change name of yaml output file from "diag_out.yaml" to "diag_manifest.yaml" (#1646)
30+
31+
### Added
32+
- DIAG_MANAGER: Added field to the yaml output file to specify the number of time levels written to a given file (#1648)
33+
34+
935
## [2025.01] - 2025-01-30
1036

1137
### Known Issues

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
2323

2424
# Define the CMake project
2525
project(FMS
26-
VERSION 2025.01.0
26+
VERSION 2025.01.02
2727
DESCRIPTION "GFDL FMS Library"
2828
HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms"
2929
LANGUAGES C Fortran)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AC_PREREQ([2.69])
2525

2626
# Initialize with name, version, and support email address.
2727
AC_INIT([GFDL FMS Library],
28-
[2025.01-dev],
28+
[2025.01.02-dev],
2929
3030
[FMS],
3131
[https://www.github.com/NOAA-GFDL/FMS])

diag_manager/diag_manager.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,6 +3518,7 @@ LOGICAL FUNCTION send_data_4d(diag_field_id, field, time, is_in, js_in, ks_in, &
35183518
call fms_diag_object%fms_diag_accept_data(diag_field_id, field, mask_local, rmask_local, &
35193519
time, is_in, js_in, ks_in, ie_in, je_in, ke_in, weight, &
35203520
err_msg)
3521+
send_data_4d = .true.
35213522

35223523
if (present(err_msg)) then
35233524
if (err_msg .ne. "") then

diag_manager/fms_diag_file_object.F90

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ module fms_diag_file_object_mod
9999
logical, allocatable :: time_ops !< .True. if file contains variables that are time_min, time_max, time_average,
100100
!! or time_sum
101101
integer :: unlim_dimension_level !< The unlimited dimension level currently being written
102+
integer :: num_time_levels !< The number of time levels that were actually written to the file
102103
logical :: data_has_been_written !< .True. if data has been written for the current unlimited dimension level
103104
logical :: is_static !< .True. if the frequency is -1
104105
integer :: nz_subaxis !< The number of Z axis currently added to the file
@@ -194,6 +195,7 @@ module fms_diag_file_object_mod
194195
procedure :: init_unlim_dim
195196
procedure :: update_current_new_file_freq_index
196197
procedure :: get_unlim_dimension_level
198+
procedure :: get_num_time_levels
197199
procedure :: flush_diag_file
198200
procedure :: get_next_output
199201
procedure :: get_next_next_output
@@ -296,6 +298,7 @@ logical function fms_diag_files_object_init (files_array)
296298
endif
297299

298300
obj%unlim_dimension_level = 0
301+
obj%num_time_levels = 0
299302
obj%is_static = obj%get_file_freq() .eq. -1
300303
obj%nz_subaxis = 0
301304

@@ -1607,6 +1610,16 @@ subroutine init_unlim_dim(this, output_buffers)
16071610
enddo
16081611
end subroutine init_unlim_dim
16091612

1613+
!> \brief Get the number of time levels that were actually written to the file
1614+
!! \return Number of time levels that were actually written to the file
1615+
pure function get_num_time_levels(this) &
1616+
result(res)
1617+
class(fmsDiagFileContainer_type), intent(in), target :: this !< The file object
1618+
integer :: res
1619+
1620+
res = this%FMS_diag_file%num_time_levels
1621+
end function
1622+
16101623
!> \brief Get the unlimited dimension level that is in the file
16111624
!! \return The unlimited dimension
16121625
pure function get_unlim_dimension_level(this) &
@@ -1816,6 +1829,13 @@ subroutine close_diag_file(this, output_buffers, model_end_time, diag_fields)
18161829
call close_file(fms2io_fileobj)
18171830
end select
18181831

1832+
!< Keep track of the number of time levels that were written to the file
1833+
!! If the file is using the new_file_freq key, it will be closing the file multiple
1834+
!! time, so this ensures that we keep a running count
1835+
!! This is going be written to the output yaml, after all the files are closed
1836+
this%FMS_diag_file%num_time_levels = this%FMS_diag_file%num_time_levels + &
1837+
this%FMS_diag_file%unlim_dimension_level
1838+
18191839
!< Reset the unlimited dimension level back to 0, in case the fms2io_fileobj is re-used
18201840
this%FMS_diag_file%unlim_dimension_level = 0
18211841
this%FMS_diag_file%is_file_open = .false.

diag_manager/fms_diag_object.F90

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ module fms_diag_object_mod
9999
procedure :: allocate_diag_field_output_buffers
100100
procedure :: fms_diag_compare_window
101101
procedure :: set_time_end
102+
procedure :: get_ntimes_per_file
102103
#ifdef use_yaml
103104
procedure :: get_diag_buffer
104105
#endif
@@ -154,24 +155,49 @@ subroutine fms_diag_object_init (this,diag_subset_output, time_init)
154155
#endif
155156
end subroutine fms_diag_object_init
156157

158+
!> @brief Determines the number of time levels that were written each file
159+
!! @return The number of time levels that were written each file
160+
function get_ntimes_per_file(this) &
161+
result(ntimes)
162+
class(fmsDiagObject_type) :: this !< Diag object
163+
integer, allocatable :: ntimes(:)
164+
165+
integer :: i !< For looping through the files
166+
167+
#ifdef use_yaml
168+
allocate(ntimes(size(this%FMS_diag_files)))
169+
do i = 1, size(this%FMS_diag_files)
170+
ntimes(i) = this%FMS_diag_files(i)%get_num_time_levels()
171+
enddo
172+
#else
173+
allocate(ntimes(1))
174+
ntimes = diag_null
175+
call mpp_error(FATAL, "You must compile with -Duse_yaml to call fms_diag_object%get_ntimes_per_file!")
176+
#endif
177+
178+
end function get_ntimes_per_file
179+
157180
!> \description Loops through all files and does one final write.
158181
!! Closes all files
159182
!! Deallocates all buffers, fields, and files
160183
!! Uninitializes the fms_diag_object
161184
subroutine fms_diag_object_end (this, time)
162185
class(fmsDiagObject_type) :: this
163186
TYPE(time_type), INTENT(in) :: time
187+
integer, allocatable :: ntimes(:) !< Number of time steps per file
164188

165189
integer :: i
166190
#ifdef use_yaml
167191
!TODO: loop through files and force write
168192
if (.not. this%initialized) return
169193

170-
! write output yaml
171-
call fms_diag_yaml_out()
172-
173194
call this%do_buffer_math()
174195
call this%fms_diag_do_io(end_time=time)
196+
197+
! write output yaml
198+
ntimes = this%get_ntimes_per_file()
199+
call fms_diag_yaml_out(ntimes)
200+
175201
!TODO: Deallocate diag object arrays and clean up all memory
176202
do i=1, size(this%FMS_diag_output_buffers)
177203
call this%FMS_diag_output_buffers(i)%flush_buffer()

diag_manager/fms_diag_yaml.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,8 @@ subroutine dump_diag_yaml_obj( filename )
16451645
!> Writes an output yaml with all available information on the written files.
16461646
!! Will only write with root pe.
16471647
!! Global attributes are limited to 16 per file.
1648-
subroutine fms_diag_yaml_out()
1648+
subroutine fms_diag_yaml_out(ntimes)
1649+
integer, intent(in) :: ntimes(:) !< The number of time levels that were written for each file
16491650
type(diagYamlFiles_type), pointer :: fileptr !< pointer for individual variables
16501651
type(diagYamlFilesVar_type), pointer :: varptr !< pointer for individual variables
16511652
type (fmsyamloutkeys_type), allocatable :: keys(:), keys2(:), keys3(:)
@@ -1714,6 +1715,7 @@ subroutine fms_diag_yaml_out()
17141715
call fms_f2c_string(keys2(i)%key8, 'start_time')
17151716
call fms_f2c_string(keys2(i)%key9, 'file_duration')
17161717
call fms_f2c_string(keys2(i)%key10, 'file_duration_units')
1718+
call fms_f2c_string(keys2(i)%key11, 'number_of_timelevels')
17171719

17181720
call fms_f2c_string(vals2(i)%val1, fileptr%file_fname)
17191721
call fms_f2c_string(vals2(i)%val5, fileptr%file_unlimdim)
@@ -1750,6 +1752,7 @@ subroutine fms_diag_yaml_out()
17501752
enddo
17511753
call fms_f2c_string(vals2(i)%val9, adjustl(tmpstr1))
17521754
call fms_f2c_string(vals2(i)%val10, get_diag_unit_string(fileptr%file_duration_units))
1755+
call fms_f2c_string(vals2(i)%val11, string(ntimes(i)))
17531756

17541757
!! tier 3 - varlists, subregion, global metadata
17551758
call yaml_out_add_level2key('varlist', keys2(i))
@@ -1976,7 +1979,7 @@ subroutine fms_diag_yaml_out()
19761979
enddo
19771980
tier2size = i
19781981

1979-
call write_yaml_from_struct_3( 'diag_out.yaml'//c_null_char, 1, keys, vals, &
1982+
call write_yaml_from_struct_3( 'diag_manifest.yaml.'//string(mpp_pe())//c_null_char, 1, keys, vals, &
19801983
SIZE(diag_yaml%diag_files), keys2, vals2, &
19811984
tier3size, tier3each, keys3, vals3, &
19821985
(/size(diag_yaml%diag_files), 0, 0, 0, 0, 0, 0, 0/))

libFMS/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ lib_LTLIBRARIES = libFMS.la
2828
# These linker flags specify libtool version info.
2929
# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
3030
# for information regarding incrementing `-version-info`.
31-
libFMS_la_LDFLAGS = -version-info 22:0:0
31+
libFMS_la_LDFLAGS = -version-info 22:2:0
3232

3333
# Add the convenience libraries to the FMS library.
3434
libFMS_la_LIBADD = $(top_builddir)/platform/libplatform.la

test_fms/diag_manager/test_diag_manager2.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ diag_files:
898898
start_time:
899899
file_duration:
900900
file_duration_units:
901+
number_of_timelevels: 1
901902
varlist:
902903
- module: atm_mod
903904
var_name: var7
@@ -930,6 +931,7 @@ diag_files:
930931
start_time:
931932
file_duration:
932933
file_duration_units:
934+
number_of_timelevels: 3
933935
varlist:
934936
- module: ocn_mod
935937
var_name: var1
@@ -972,6 +974,7 @@ diag_files:
972974
start_time:
973975
file_duration:
974976
file_duration_units:
977+
number_of_timelevels: 3
975978
varlist:
976979
- module: atm_mod
977980
var_name: var3
@@ -1036,6 +1039,7 @@ diag_files:
10361039
start_time:
10371040
file_duration:
10381041
file_duration_units:
1042+
number_of_timelevels: 3
10391043
varlist:
10401044
- module: lnd_mod
10411045
var_name: var5
@@ -1078,6 +1082,7 @@ diag_files:
10781082
start_time:
10791083
file_duration:
10801084
file_duration_units:
1085+
number_of_timelevels: 3
10811086
varlist:
10821087
- module: lnd_mod
10831088
var_name: var1
@@ -1109,6 +1114,7 @@ diag_files:
11091114
start_time:
11101115
file_duration:
11111116
file_duration_units:
1117+
number_of_timelevels: 3
11121118
varlist:
11131119
- module: atm_mod
11141120
var_name: var4
@@ -1140,6 +1146,7 @@ diag_files:
11401146
start_time: 00020101.000000
11411147
file_duration: 12
11421148
file_duration_units: hours
1149+
number_of_timelevels: 2
11431150
varlist:
11441151
- module: ocn_mod
11451152
var_name: var1
@@ -1171,6 +1178,7 @@ diag_files:
11711178
start_time:
11721179
file_duration:
11731180
file_duration_units:
1181+
number_of_timelevels: 3
11741182
varlist:
11751183
- module: ocn_mod
11761184
var_name: var1
@@ -1202,6 +1210,7 @@ diag_files:
12021210
start_time: 00020101.000000
12031211
file_duration: 12 3 9
12041212
file_duration_units: hours hours hours
1213+
number_of_timelevels: 24
12051214
varlist:
12061215
- module: ocn_mod
12071216
var_name: var1
@@ -1233,6 +1242,7 @@ diag_files:
12331242
start_time: 00020101.000000
12341243
file_duration: 12 3 9
12351244
file_duration_units: hours hours hours
1245+
number_of_timelevels: 24
12361246
varlist:
12371247
- module: ocn_mod
12381248
var_name: var1
@@ -1264,6 +1274,7 @@ diag_files:
12641274
start_time:
12651275
file_duration:
12661276
file_duration_units:
1277+
number_of_timelevels: 1
12671278
varlist:
12681279
- module: ocn_mod
12691280
var_name: var1

test_fms/diag_manager/test_diag_out_yaml.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ subroutine check_output_yaml
4141
integer, parameter :: yaml_len = 402
4242
character(len=128) :: out_yaml_line, ref_yaml_line
4343
character(len=17), parameter :: ref_fname = 'diag_out_ref.yaml'
44-
character(len=13), parameter :: out_fname = 'diag_out.yaml'
44+
character(len=20), parameter :: out_fname = 'diag_manifest.yaml.0'
4545
if( mpp_root_pe() .ne. mpp_pe()) return
4646
open(newunit=un_out, file=out_fname, status="old", action="read")
4747
open(newunit=un_ref, file=ref_fname, status="old", action="read")
@@ -58,4 +58,4 @@ subroutine check_output_yaml
5858
end subroutine
5959

6060

61-
end program
61+
end program

0 commit comments

Comments
 (0)