From d85c442ceedecebb0d08d944cbd7e1bc74766eee Mon Sep 17 00:00:00 2001 From: Jesse Lentz <42011922+J-Lentz@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:18:18 -0400 Subject: [PATCH 1/4] fix: correct error code type for `yaml_parser_mod` c binding (#1580) --- parser/yaml_parser.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/yaml_parser.F90 b/parser/yaml_parser.F90 index 3a3c7f005..a34c5d4e2 100644 --- a/parser/yaml_parser.F90 +++ b/parser/yaml_parser.F90 @@ -76,7 +76,7 @@ function open_and_parse_file_wrap(filename, file_id) bind(c) & use iso_c_binding, only: c_char, c_int, c_bool character(kind=c_char), intent(in) :: filename(*) !< Filename of the yaml file integer(kind=c_int), intent(out) :: file_id !< File id corresponding to the yaml file that was opened - logical(kind=c_int) :: error_code !< Flag indicating the error message (1 if sucessful) + integer(kind=c_int) :: error_code !< Flag indicating the error message (1 if sucessful) end function open_and_parse_file_wrap !> @brief Private c function that checks if a file_id is valid (see yaml_parser_binding.c) From 44a211a7540576db0237a9e7d2edcedfbb2eb155 Mon Sep 17 00:00:00 2001 From: Harshula Jayasuriya Date: Wed, 11 Sep 2024 05:24:34 +1000 Subject: [PATCH 2/4] build: use $CMAKE_INSTALL_LIBDIR instead of hardcoding "lib" (#1589) --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5082a98e0..9bca8c46c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -429,13 +429,13 @@ endforeach() install( TARGETS ${LIB_TARGETS} EXPORT FMSExports - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ### Package config include(CMakePackageConfigHelpers) -set(CONFIG_INSTALL_DESTINATION lib/cmake/fms) +set(CONFIG_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fms) export(EXPORT FMSExports NAMESPACE FMS:: From 85475e58d94f6667c2e106acbb2b61fdb8db2a66 Mon Sep 17 00:00:00 2001 From: uramirez8707 <49168881+uramirez8707@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:33:24 -0400 Subject: [PATCH 3/4] fix: data_override test failures from input (#1595) --- .../data_override/test_data_override2_mono.sh | 18 ++++- .../test_data_override2_ongrid.sh | 10 ++- .../test_data_override2_scalar.sh | 12 +++- .../test_data_override_ongrid.F90 | 68 ++++++++++--------- .../test_data_override_weights.sh | 10 ++- 5 files changed, 79 insertions(+), 39 deletions(-) diff --git a/test_fms/data_override/test_data_override2_mono.sh b/test_fms/data_override/test_data_override2_mono.sh index be1cce410..05c833389 100755 --- a/test_fms/data_override/test_data_override2_mono.sh +++ b/test_fms/data_override/test_data_override2_mono.sh @@ -27,9 +27,10 @@ output_dir [ ! -d "INPUT" ] && mkdir -p "INPUT" -cat <<_EOF > input.nml +cat <<_EOF > input_base.nml &test_data_override_ongrid_nml test_case = 2 + write_only = .False. / _EOF @@ -41,6 +42,12 @@ _EOF for KIND in r4 r8 do rm -rf INPUT/* + sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml + test_expect_success "Creating input files (${KIND})" ' + mpirun -n 6 ../test_data_override_ongrid_${KIND} + ' + + cp input_base.nml input.nml test_expect_success "test_data_override with monotonically increasing and decreasing data sets (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} ' @@ -48,9 +55,10 @@ done rm -rf data_table -cat <<_EOF > input.nml +cat <<_EOF > input_base.nml &test_data_override_ongrid_nml test_case = 2 + write_only = .False. / &data_override_nml use_data_table_yaml = .True. @@ -80,6 +88,12 @@ if [ -z $parser_skip ]; then for KIND in r4 r8 do rm -rf INPUT/* + sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml + test_expect_success "Creating input files (${KIND})" ' + mpirun -n 6 ../test_data_override_ongrid_${KIND} + ' + + cp input_base.nml input.nml test_expect_success "test_data_override with monotonically increasing and decreasing data sets -yaml (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} ' diff --git a/test_fms/data_override/test_data_override2_ongrid.sh b/test_fms/data_override/test_data_override2_ongrid.sh index e9f36712c..4d4616734 100755 --- a/test_fms/data_override/test_data_override2_ongrid.sh +++ b/test_fms/data_override/test_data_override2_ongrid.sh @@ -36,6 +36,7 @@ use_data_table_yaml=.False. &test_data_override_ongrid_nml nhalox=halo_size nhaloy=halo_size + write_only = .False. / _EOF printf '"OCN", "runoff", "runoff", "./INPUT/runoff.daitren.clim.1440x1080.v20180328.nc", "none" , 1.0' | cat > data_table @@ -48,6 +49,7 @@ use_data_table_yaml=.True. &test_data_override_ongrid_nml nhalox=halo_size nhaloy=halo_size + write_only = .False. / _EOF cat <<_EOF > data_table.yaml @@ -65,13 +67,17 @@ fi [ ! -d "INPUT" ] && mkdir -p "INPUT" for KIND in r4 r8 do -rm -rf INPUT/* +sed -e 's/halo_size/2/g ; s/write_only = .False./write_only = .True./g' input_base.nml > input.nml + +test_expect_success "Creating input files (${KIND})" ' + mpirun -n 6 ../test_data_override_ongrid_${KIND} +' + sed 's/halo_size/2/g' input_base.nml > input.nml test_expect_success "data_override on grid with 2 halos in x and y (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} ' -rm -rf INPUT/* sed 's/halo_size/0/g' input_base.nml > input.nml test_expect_success "data_override on grid with 0 halos in x and y (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} diff --git a/test_fms/data_override/test_data_override2_scalar.sh b/test_fms/data_override/test_data_override2_scalar.sh index ac19b2b0a..6b6c096b7 100755 --- a/test_fms/data_override/test_data_override2_scalar.sh +++ b/test_fms/data_override/test_data_override2_scalar.sh @@ -28,22 +28,24 @@ output_dir rm -rf data_table data_table.yaml input.nml input_base.nml if [ ! -z $parser_skip ]; then - cat <<_EOF > input.nml + cat <<_EOF > input_base.nml &data_override_nml use_data_table_yaml=.False. / &test_data_override_ongrid_nml test_case = 3 + write_only = .False. / _EOF printf '"OCN", "co2", "co2", "./INPUT/scalar.nc", "none" , 1.0' | cat > data_table else -cat <<_EOF > input.nml +cat <<_EOF > input_base.nml &data_override_nml use_data_table_yaml=.True. / &test_data_override_ongrid_nml test_case = 3 + write_only = .False. / _EOF cat <<_EOF > data_table.yaml @@ -62,6 +64,12 @@ fi for KIND in r4 r8 do rm -rf INPUT/* +sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml +test_expect_success "Creating input files (${KIND})" ' + mpirun -n 6 ../test_data_override_ongrid_${KIND} +' + +cp input_base.nml input.nml test_expect_success "data_override scalar field (${KIND})" ' mpirun -n 6 ../test_data_override_ongrid_${KIND} ' diff --git a/test_fms/data_override/test_data_override_ongrid.F90 b/test_fms/data_override/test_data_override_ongrid.F90 index a05eb9d6c..8f1fe43f7 100644 --- a/test_fms/data_override/test_data_override_ongrid.F90 +++ b/test_fms/data_override/test_data_override_ongrid.F90 @@ -33,7 +33,7 @@ program test_data_override_ongrid use netcdf, only: nf90_create, nf90_def_dim, nf90_def_var, nf90_enddef, nf90_put_var, & nf90_close, nf90_put_att, nf90_clobber, nf90_64bit_offset, nf90_char, & nf90_double, nf90_unlimited -use fms_mod, only: string +use fms_mod, only: string, fms_init, fms_end implicit none @@ -53,10 +53,11 @@ program test_data_override_ongrid integer, parameter :: scalar = 3 integer, parameter :: weight_file = 4 integer :: test_case = ongrid +logical :: write_only=.false. !< True if creating the input files only -namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout +namelist / test_data_override_ongrid_nml / nhalox, nhaloy, test_case, nlon, nlat, layout, write_only -call mpp_init +call fms_init call fms2_io_init read (input_nml_file, test_data_override_ongrid_nml, iostat=io_status) @@ -75,35 +76,38 @@ program test_data_override_ongrid call mpp_define_io_domain(Domain, (/1,1/)) call mpp_get_data_domain(Domain, is, ie, js, je) -select case (test_case) -case (ongrid) - call generate_ongrid_input_file () -case (bilinear) - call generate_bilinear_input_file () -case (scalar) - call generate_scalar_input_file () -case (weight_file) - call generate_weight_input_file () -end select - -call mpp_sync() -call mpp_error(NOTE, "Finished creating INPUT Files") - -!< Initiliaze data_override -call data_override_init(Ocean_domain_in=Domain, mode=lkind) - -select case (test_case) -case (ongrid) - call ongrid_test() -case (bilinear) - call bilinear_test() -case (scalar) - call scalar_test() -case (weight_file) - call weight_file_test() -end select - -call mpp_exit +if (write_only) then + select case (test_case) + case (ongrid) + call generate_ongrid_input_file () + case (bilinear) + call generate_bilinear_input_file () + case (scalar) + call generate_scalar_input_file () + case (weight_file) + call generate_weight_input_file () + end select + + call mpp_sync() + call mpp_error(NOTE, "Finished creating INPUT Files") + +else + !< Initiliaze data_override + call data_override_init(Ocean_domain_in=Domain, mode=lkind) + + select case (test_case) + case (ongrid) + call ongrid_test() + case (bilinear) + call bilinear_test() + case (scalar) + call scalar_test() + case (weight_file) + call weight_file_test() + end select +endif + +call fms_end contains diff --git a/test_fms/data_override/test_data_override_weights.sh b/test_fms/data_override/test_data_override_weights.sh index a3bc8902e..2bb1e2c3f 100755 --- a/test_fms/data_override/test_data_override_weights.sh +++ b/test_fms/data_override/test_data_override_weights.sh @@ -48,7 +48,7 @@ data_table: factor: 1.0 _EOF -cat <<_EOF > input.nml +cat <<_EOF > input_base.nml &data_override_nml use_data_table_yaml = .True. / @@ -58,6 +58,7 @@ cat <<_EOF > input.nml nlon = 5 nlat = 6 layout = 1, 2 + write_only = .False. / _EOF @@ -66,6 +67,13 @@ if [ -z $parser_skip ]; then for KIND in r4 r8 do rm -rf INPUT/. + + sed 's/write_only = .False./write_only = .True./g' input_base.nml > input.nml + test_expect_success "Creating input files (${KIND})" ' + mpirun -n 2 ../test_data_override_ongrid_${KIND} + ' + + cp input_base.nml input.nml test_expect_success "test_data_override with and without weight files -yaml (${KIND})" ' mpirun -n 2 ../test_data_override_ongrid_${KIND} ' From 2b05550d8a21995f95983381899bd895f5afee72 Mon Sep 17 00:00:00 2001 From: Tom Robinson <33458882+thomas-robinson@users.noreply.github.com> Date: Tue, 8 Oct 2024 12:59:07 -0400 Subject: [PATCH 4/4] chore: replace @thomas-robinson with @uramirez8707 as code owner (#1592) --- .github/CODEOWNERS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4421b7285..b9d65285a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,7 +25,7 @@ # These owners will be the default owners for all the files in the # repository. Unless a later match is found, these owners # will be requested for a review when a PR is opened. -* @thomas-robinson @bensonr @rem1776 +* @uramirez8707 @bensonr @rem1776 # GNU autotools files Makefile.am @uramirez8707 @rem1776 @@ -41,7 +41,7 @@ cmake @mlee03 /.github/ @rem1776 # Testing files -/test_fms/ @uramirez8707 @mlee03 @bensonr @thomas-robinson @rem1776 +/test_fms/ @uramirez8707 @mlee03 @bensonr @rem1776 # Specific component directories /affinity/ @bensonr @@ -53,15 +53,15 @@ cmake @mlee03 #/data_override/ Currently no code owner /test_fms/data_override/ @rem1776 -/diag_manager @thomas-robinson -/test_fms/diag_manager/ @thomas-robinson +/diag_manager @uramirez8707 +/test_fms/diag_manager/ @uramirez8707 -/fms/ @thomas-robinson @rem1776 -/test_fms/fms/ @thomas-robinson @rem1776 +/fms/ @uramirez8707 @rem1776 +/test_fms/fms/ @uramirez8707 @rem1776 /fms2/ @uramirez8707 /test_fms/fms2/ @uramirez8707 -/libFMS/ @thomas-robinson @rem1776 +/libFMS/ @uramirez8707 @rem1776 -/mpp/ @thomas-robinson @bensonr -/test_fms/mpp/ @thomas-robinson @bensonr @rem1776 +/mpp/ @uramirez8707 @bensonr +/test_fms/mpp/ @uramirez8707 @bensonr @rem1776