Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NOAA-GFDL/FMS into generic_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 committed Jul 23, 2024
2 parents dd5a0d5 + 77382e3 commit 3381556
Show file tree
Hide file tree
Showing 42 changed files with 788 additions and 310 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/github_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
libyaml-flag: [ "", -DWITH_YAML=on ]
io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
build-type: [ "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_BUILD_TYPE=Debug" ]
container:
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
env:
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
CMAKE_FLAGS: "${{ matrix.build-type }} ${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ 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`).

## [2024.02] - 2024-07-11

### Known Issues
- 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`.
- 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.
- 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.

### Added
- TIME_INTERP: Enables use of `verbose` option in `time_interp_external2` calls from `data_override`. The option is enabled in `data_override_nml` by setting `debug_data_override` to true. (#1516)
- COUPLER: Adds optional argument to `coupler_types_send_data` routine that contains the return statuses for any calls made to the diag_manager's `send_data` routine. (#1530)
- MPP: Adds a separate error log file `warnfile.<root pe num>.out` that only holds output from any `mpp_error` calls made during a run (#1544)
### Changed
- DIAG_MANAGER: The `diag_field_log.out` output file of all registered fields will now include the PE number of the root PE at the time of writing (ie. diag_field_log.out.0). This is to prevent overwritting the file in cases where the root PE may change. (#1497)

### Fixed
- CMAKE: Fixes real kind flags being overwritten when using the Debug release type (#1532)
- HORIZ_INTERP: Fixes allocation issues when using method-specific horiz_interp_new routines (such as `horiz_interp_bilinear_new`) by setting `is_allocated` and the `method_type` during initialization for each method. (#1538)


### Tag Commit Hashes
- 2024.02-alpha1 5757c7813f1170efd28f5a4206395534894095b4
- 2024.02-alpha2 5757c7813f1170efd28f5a4206395534894095b4
- 2024.02-beta1 ca592ef8f47c246f4dc56d348d62235bd0ceaa9d
- 2024.02-beta2 ca592ef8f47c246f4dc56d348d62235bd0ceaa9d

## [2024.01.02] - 2024-06-14

### Known Issues
- Diag Manager Rewrite:
- Expected output file changes:
- If the model run time is less than the output frequency, old diag_manager would write a specific value (9.96921e+36). The new diag_manager will not, so only fill values will be present.
- A `scalar_axis` dimension will not be added to scalar variables
- The `average_*` variables will no longer be added as they are non-standard conventions
- Attributes added via `diag_field_add_attributes` in the old code were saved as `NF90_FLOAT` regardless of precision, but will now be written as the precision that is passed in
- Subregional output will have a global attribute `is_subregional = True` set for non-global history files.
- The `grid_type` and `grid_tile` global attributes will no longer be added for all files, and some differences may be seen in the exact order of the `associated_files` attribute

- DIAG_MANAGER: When using the `do_diag_field_log` nml option, the output log file may be ovewritten if using a multiple root pe's
- BUILD(HDF5): HDF5 version 1.14.3 generates floating point exceptions, and will cause errors if FMS is built with FPE traps enabled.
- 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.

### Fixed
- DIAG_MANAGER: Fixes incorrect dates being appended to static file names

## [2024.01.01] - 2024-05-30

### Known Issues
Expand Down
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@

cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

# add build type for debug, overrides default flags (set with $FCFLAGS, $CFLAGS)
set(CMAKE_Fortran_FLAGS_DEBUG)

# Define the CMake project
project(FMS
VERSION 2024.01.01
VERSION 2024.02.0
DESCRIPTION "GFDL FMS Library"
HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms"
LANGUAGES C Fortran)
Expand Down Expand Up @@ -339,11 +336,8 @@ foreach(kind ${kinds})
target_compile_definitions(${libTgt}_f PRIVATE "${fms_defs}")
target_compile_definitions(${libTgt}_f PRIVATE "${${kind}_defs}")

string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
if (NOT build_type STREQUAL debug)
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS
"${${kind}_flags}")
endif()
set_target_properties(${libTgt}_f PROPERTIES COMPILE_FLAGS "${${kind}_flags}")

set_target_properties(${libTgt}_f PROPERTIES Fortran_MODULE_DIRECTORY
${moduleDir})

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AC_PREREQ([2.69])

# Initialize with name, version, and support email address.
AC_INIT([GFDL FMS Library],
[2024.01.01-dev],
[2024.02-dev],
[[email protected]],
[FMS],
[https://www.github.com/NOAA-GFDL/FMS])
Expand Down
41 changes: 37 additions & 4 deletions coupler/coupler_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2944,10 +2944,12 @@ end subroutine CT_set_diags_3d


!> @brief Write out all diagnostics of elements of a coupler_2d_bc_type
!! TODO this should really be a function in order to return the status of send_data call
subroutine CT_send_data_2d(var, Time)
subroutine CT_send_data_2d(var, Time, return_statuses)
type(coupler_2d_bc_type), intent(in) :: var !< BC_type structure with the diagnostics to write
type(time_type), intent(in) :: time !< The current model time
logical, allocatable, optional, intent(out) :: return_statuses(:,:) !< Return status of send data calls
!! first index is index of boundary condition
!! second index is field/value within that boundary condition

integer :: m, n
logical :: used
Expand All @@ -2966,18 +2968,33 @@ subroutine CT_send_data_2d(var, Time)

! num_bcs .lt. 1 -> loop doesn't run but shouldn't error out
if(associated(var%bc) .or. var%num_bcs .lt. 1) then

! allocate array for returned send data statuses
if( present(return_statuses) .and. var%num_bcs .gt. 0) then
allocate(return_statuses(var%num_bcs, var%bc(1)%num_fields))
endif

do n = 1, var%num_bcs
do m = 1, var%bc(n)%num_fields
if (var%bc(n)%field(m)%id_diag > 0) then
used = send_data(var%bc(n)%field(m)%id_diag, var%bc(n)%field(m)%values, Time)
if(allocated(return_statuses)) return_statuses(n,m) = used
endif
enddo
enddo

else if(associated(var%bc_r4)) then

! allocate array for returned send data statuses
if( present(return_statuses) .and. var%num_bcs .gt. 0) then
allocate(return_statuses(var%num_bcs, var%bc_r4(1)%num_fields))
endif

do n = 1, var%num_bcs
do m = 1, var%bc_r4(n)%num_fields
if (var%bc_r4(n)%field(m)%id_diag > 0) then
used = send_data(var%bc_r4(n)%field(m)%id_diag, var%bc_r4(n)%field(m)%values, Time)
if(allocated(return_statuses)) return_statuses(n,m) = used
endif
enddo
enddo
Expand All @@ -2988,10 +3005,12 @@ subroutine CT_send_data_2d(var, Time)
end subroutine CT_send_data_2d

!> @brief Write out all diagnostics of elements of a coupler_3d_bc_type
!! TODO this should really be a function in order to return the status of send_data call
subroutine CT_send_data_3d(var, Time)
subroutine CT_send_data_3d(var, Time, return_statuses)
type(coupler_3d_bc_type), intent(in) :: var !< BC_type structure with the diagnostics to write
type(time_type), intent(in) :: time !< The current model time
logical, allocatable, optional, intent(out) :: return_statuses(:,:) !< Return status of send data calls
!! first index is index of boundary condition
!! second index is field/value within that boundary condition

integer :: m, n
logical :: used
Expand All @@ -3010,18 +3029,32 @@ subroutine CT_send_data_3d(var, Time)

! num_bcs .lt. 1 -> loop doesn't run but shouldn't error out
if(associated(var%bc) .or. var%num_bcs .lt. 1) then

! allocate array for returned send data statuses
if( present(return_statuses) .and. var%num_bcs .gt. 0) then
allocate(return_statuses(var%num_bcs, var%bc(1)%num_fields))
endif

do n = 1, var%num_bcs
do m = 1, var%bc(n)%num_fields
if (var%bc(n)%field(m)%id_diag > 0) then
used = send_data(var%bc(n)%field(m)%id_diag, var%bc(n)%field(m)%values, Time)
if(allocated(return_statuses)) return_statuses(n,m) = used
endif
enddo
enddo
else if(associated(var%bc_r4)) then

! allocate array for returned send data statuses
if( present(return_statuses) .and. var%num_bcs .gt. 0) then
allocate(return_statuses(var%num_bcs, var%bc_r4(1)%num_fields))
endif

do n = 1, var%num_bcs
do m = 1, var%bc_r4(n)%num_fields
if (var%bc_r4(n)%field(m)%id_diag > 0) then
used = send_data(var%bc_r4(n)%field(m)%id_diag, var%bc_r4(n)%field(m)%values, Time)
if(allocated(return_statuses)) return_statuses(n,m) = used
endif
enddo
enddo
Expand Down
Loading

0 comments on commit 3381556

Please sign in to comment.