Skip to content

Commit

Permalink
Merge branch 'main' into commit-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored May 9, 2024
2 parents 4892961 + d42f8ac commit 32b5114
Show file tree
Hide file tree
Showing 97 changed files with 20,882 additions and 710 deletions.
22 changes: 9 additions & 13 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ Makefile.am @uramirez8707 @rem1776
*.m4 @uramirez8707 @rem1776

# cmake files
CM* @mlee03 @ngs333
cmake @mlee03 @ngs333
CM* @mlee03
cmake @mlee03

# Files specific to GitHub or GitLab
/.github/ @GFDL-Eric @rem1776
/.gitlab/ @GFDL-Eric @rem1776
/.github/ @rem1776

# Testing files
/.gitlab-ci.yml @uramirez8707 @mlee03 @bensonr @thomas-robinson @rem1776
/test_fms/ @uramirez8707 @mlee03 @bensonr @thomas-robinson @rem1776

# Specific component directories
Expand All @@ -52,18 +50,16 @@ cmake @mlee03 @ngs333
/block_control/ @bensonr
/test_fms/block_control/ @bensonr @rem1776

/data_override/ @GFDL-Eric
/test_fms/data_override/ @GFDL-Eric @rem1776
#/data_override/ Currently no code owner
/test_fms/data_override/ @rem1776

/diag_manager @thomas-robinson @ngs333
/test_fms/diag_manager/ @thomas-robinson @ngs333

/fv3gfs/ @bensonr
/diag_manager @thomas-robinson
/test_fms/diag_manager/ @thomas-robinson

/fms/ @thomas-robinson @rem1776
/test_fms/fms/ @thomas-robinson @rem1776
/fms2/ @uramirez8707 @GFDL-Eric
/test_fms/fms2/ @uramirez8707 @GFDL-Eric
/fms2/ @uramirez8707
/test_fms/fms2/ @uramirez8707

/libFMS/ @thomas-robinson @rem1776

Expand Down
68 changes: 0 additions & 68 deletions .github/workflows/Dockerfile.gnu

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/github_autotools_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
conf-flag: [ --disable-openmp, --disable-setting-flags, --with-mpi=no, --disable-r8-defaults]
conf-flag: [ --disable-openmp, --disable-setting-flags, --with-mpi=no, --disable-r8-default]
input-flag: [--with-yaml, --enable-test-input=/home/unit_tests_input]
exclude:
- conf-flag: --with-mpi=no
input-flag: --enable-test-input=/home/unit_tests_input
container:
image: noaagfdl/fms-ci-rocky-gnu:12.3.0
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
env:
TEST_VERBOSE: 1
DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flag }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}"
SKIP_TESTS: "test_yaml_parser.5" # temporary till fixes are in
SKIP_TESTS: "test_horiz_interp2.[23-24]" # TODO (couldn't reproduce outside CI)
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/github_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,24 @@ jobs:
libyaml-flag: [ "", -DWITH_YAML=on ]
io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
container:
image: noaagfdl/hpc-me.ubuntu-minimal:cmake
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"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate makefiles with CMake
run: cmake $CMAKE_FLAGS .
run: cmake $CMAKE_FLAGS -DNetCDF_ROOT=/opt/view -DLIBYAML_ROOT=/opt/view
- name: Build the library
run: make
- name: Link with basic executable
run: |
echo "program test" > test.F90
echo " use fms_mod" >> test.F90
echo " call fms_init" >> test.F90
echo " call fms_end" >> test.F90
echo "end program" >> test.F90
mpifort -L/opt/view/lib -fopenmp `nf-config --flibs` -Iinclude_r4 -Iinclude_r8 test.F90 libfms_r4.a libfms_r8.a -o test.x
touch input.nml
- name: Run executable
run: ./test.x
2 changes: 1 addition & 1 deletion .github/workflows/github_coupler_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
coupler-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:12.3.0
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/github_mom_gnu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run MOM6 test suite

# runs on PR's or when manually triggered
on: [workflow_dispatch, pull_request]

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/fms/fms-ci-rocky-gnu:13.2.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Checkout MOM6 repository
uses: actions/checkout@v4
with:
repository: 'NOAA-GFDL/MOM6'
submodules: recursive
- name: Checkout FMS into MOM build
uses: actions/checkout@v4
with:
path: .testing/deps/fms/src
- name: Build FMS and MOM test suite
run: make -C .testing -j
- name: Run MOM tests
run: make -C .testing -j test
17 changes: 0 additions & 17 deletions .github/workflows/spack.env

This file was deleted.

55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,61 @@ 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.01] - 2024-05-03

### Known Issues
- Diag Manager Rewrite:
- If two empty files are present in the diag_table.yaml file the code will crash with a allocation error (#1506)
- Setting an output frequency of '0 days' does not work as expected and may cause an error stating a time_step has been skipped (#1502)
- The `flush_nc_files` and `mix_snapshot_average_fields` nml options are not yet functional. The `mix_snapshot_average_fields` option is planned to be deprecated (for the rewritten diag_manager only).
- 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
- TESTS: `test_mpp_gatscat.F90` fails to compile with the Intel Oneapi 2024.01's version of ifort
- BUILD(HDF5): HDF5 version 1.14.3 generates floating point exceptions, and will cause errors if FMS is built with FPE traps enabled.

### Added
- DIAG_MANAGER: The diag manager has been rewritten with a object oriented design. The old diag_manager code has been kept intact and will be used by default. The rewritten diag manager can be enabled via `use_modern_diag = .true.` to your `diag_manager_nml`. New features include:
- Self-describing YAML formatting for diag_table's
- Allows 4d variables
- Support defining subregions with indices
- More flexibility when adding metadata and defining output frequency
- FMS2_IO: Adds support for collective parallel reads to improve model startup time. The collective reads are disabled by default and enabled via the `use_collective` flag in `netcdf_io_mod`.
- DATA_OVERRIDE: Adds multifile support for using 3 input netcdf files instead of one. Three keys have been added to the data_table: `is_multi_file` to be set to true to enable the feature, as well as `prev_file_name` and `next_file_name` to set to the names of the additional files.
- INTERPOLATOR: Adds support for yearly/annual data
- DATA_OVERRIDE: Adds support for monotonically increasing/decreasing arrays
- DOCS: Add documentation for the exchange grid (xgrid_mod) and update the contribution guide to add a section on code reviews
- MPP: MPI sub-communicators for domains are now accessible via `mpp_get_domain_tile_commid` and `mpp_get_domain_commid` in `mpp_domains_mod`

### Changed
- DATA_OVERRIDE: Changes behavior to crash if both data_table and data_table.yaml are present and adds error checking when reading in yaml files
- FIELD_MANAGER: Changes behavior to crash if both field_table and field_table.yaml are present as well as adds a namelist flag (`use_field_table_yaml`) to enable support for the yaml input.

### Fixed
- DATA_OVERRIDE: Fixes allocation error with scalar routine and replaces pointers with allocatables
- INTERPOLATOR: Increase max string size for file paths
- AXIS_UTILS: Improves performance of `nearest_index` routine
- CMAKE: Fixes macOS linking issues with OpenMP

### Tag Commit Hashes
- 2024.01-beta5 d3bab5a84b6a51eddd46ab6fb65eaa532830c6c7
- 2024.01-beta4 ac363ddfd3075637cecae30ddfbae7a78751197b
- 2024.01-alpha6 2ace94564a08aec4d7ab7eca0e57c0289e52d5b1
- 2024.01-alpha5 5ed0bd373cc59a9681052fa837cb83a67169d102
- 2024.01-alpha4 8dd90d72b58f0de3632dc62920f8adfb996b2265
- 2024.01-beta3 f71405a075102aef42f5811dc09e239ddd002637
- 2024.01-beta2 bb6de937f70a08a440f5e63b8553b047c1921509
- 2024.01-beta1 913f8aaecca374d5e10280056de862d5e4a7a668
- 2024.01-alpha3 085c6bfc945a6f1c586b842ca6268fca442884d8
- 2024.01-alpha2 38bfde30e1cb8bf5222410a9c37e71529567bf69
- 2024.01-alpha1 ac0d086296ea8b9196552463655cb9a848db39fe

## [2023.04] - 2023-12-04
### Known Issues
- GCC 9 and below as well as GCC 11.1.0 are unsupported due to compilation issues. See prior releases for more details.
Expand Down
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(CMAKE_Fortran_FLAGS_DEBUG)

# Define the CMake project
project(FMS
VERSION 2023.04.0
VERSION 2024.01.0
DESCRIPTION "GFDL FMS Library"
HOMEPAGE_URL "https://www.gfdl.noaa.gov/fms"
LANGUAGES C Fortran)
Expand Down Expand Up @@ -125,11 +125,20 @@ list(APPEND fms_fortran_src_files
diag_manager/diag_output.F90
diag_manager/diag_table.F90
diag_manager/diag_util.F90
diag_manager/fms_diag_time_utils.F90
diag_manager/fms_diag_object.F90
diag_manager/fms_diag_yaml.F90
diag_manager/fms_diag_file_object.F90
diag_manager/fms_diag_field_object.F90
diag_manager/fms_diag_axis_object.F90
diag_manager/fms_diag_output_buffer.F90
diag_manager/fms_diag_input_buffer.F90
diag_manager/fms_diag_time_reduction.F90
diag_manager/fms_diag_outfield.F90
diag_manager/fms_diag_elem_weight_procs.F90
diag_manager/fms_diag_fieldbuff_update.F90
diag_manager/fms_diag_bbox.F90
diag_manager/fms_diag_reduction_methods.F90
drifters/cloud_interpolator.F90
drifters/drifters.F90
drifters/drifters_comm.F90
Expand Down Expand Up @@ -345,9 +354,12 @@ foreach(kind ${kinds})
target_link_libraries(${libTgt}_f PRIVATE OpenMP::OpenMP_Fortran)
endif()

# Check if gnu 10 or higher with mpich
# Check if gnu 10 or higher
# this should only be needed with mpich, but wasn't able to find a good way to find the MPI flavor consistently
if ( CMAKE_Fortran_COMPILER_VERSION MATCHES "1[0-9]\.[0-9]*\.[0-9]*" AND CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
if(MPI_C_COMPILER MATCHES ".*mpich.*" )
include(CheckFortranCompilerFlag)
check_fortran_compiler_flag("-fallow-argument-mismatch" _arg_mismatch_flag)
if(_arg_mismatch_flag)
message(STATUS "Adding -fallow-argument-mismatch flag to compile with GCC >=10 and MPICH")
target_compile_options(${libTgt}_f PRIVATE "-fallow-argument-mismatch;-w")
endif()
Expand Down
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,33 @@ Descriptive commit messages within PR’s should still be used, and some project
The commit message on the main branch must follow the guidelines of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), meaning it includes a ‘type’ prefix (ie. usually fix or feat(ure)) and a footer for any API-breaking changes.
Additionally, commits should include the number of the pull request in parentheses (this is automatically added on github) to allow easier tracking of each commit.

## Reviewing Pull Requests

When reviewing a pull request, members of MSD should look for the following:

- Design
- Does the code change belong in the FMS library or does it better belong elsewhere such as a component repository or the FMScoupler?
- Could existing routines/modules be utilized to reduce redundancy?
- Temporary changes/fixes meant to be removed should be avoided whenever possible
- Functionality
- Does this PR do what is intended (and stated)
- Are the changes good for both end-users and developers?
- Will the code change impact existing end-users needlessly?
- Complexity
- Are the changes easily understood by the reader / reviewer?
- Testing
- Code changes should include a test program or a modification to a test program to ensure the code is covered by the test suite
- Comments
- Inline comments for complex code segments or intricacies to make the purpose of the code reasonably clear
- Style and Consistency
- Code should follow the syle guide in general, but should also be consistent to the file the change is made in
- Documentation
- If a PR changes the behaviour or instructions, accompanying documentation should also change
- Thoroughness
- Reviews should be done line by line, and the surrounding context/file should be taken into account

Comments on pull requests should be courteous and constructive, giving useful feedback and explanations for why changes should be made. See the [code of conduct](CODE_OF_CONDUCT.md) for more information.

## Tests

FMS uses github actions workflows to run build, runtime, and code linting tests for libFMS. Users may be required to create
Expand Down
5 changes: 3 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SUBDIRS = \
mosaic2 \
fms \
parser \
string_utils \
affinity \
mosaic \
time_manager \
Expand Down Expand Up @@ -125,10 +126,10 @@ check-code-coverage: check
.PHONY: check-code-coverage

clean-local:
-rm -rf .mods coverage-data coverage-report
-rm -rf .mods coverage-data coverage-report test.nc
else
clean-local:
-rm -rf .mods
-rm -rf .mods test.nc
endif

install-data-hook:
Expand Down
4 changes: 2 additions & 2 deletions cmake/Findlibyaml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# LIBYAML_INCLUDE_DIR
# LIBYAML_LIBRARIES

FIND_PATH(LIBYAML_INCLUDE_DIR NAMES yaml.h PATHS $ENV{LIBYAML_ROOT}/include )
FIND_LIBRARY(LIBYAML_LIBRARIES NAMES yaml PATHS $ENV{LIBYAML_ROOT}/lib )
FIND_PATH(LIBYAML_INCLUDE_DIR NAMES yaml.h PATHS ${LIBYAML_ROOT}/include $ENV{LIBYAML_ROOT}/include )
FIND_LIBRARY(LIBYAML_LIBRARIES NAMES yaml PATHS ${LIBYAML_ROOT}/lib $ENV{LIBYAML_ROOT}/lib )
if(NOT LIBYAML_INCLUDE_DIR OR NOT LIBYAML_LIBRARIES)
message(SEND_ERROR "libyaml library/include file not found, set LIBYAML_ROOT")
endif()
Expand Down
Loading

0 comments on commit 32b5114

Please sign in to comment.