Skip to content

Commit

Permalink
Merge branch 'master' into f/bmi_multi_past_ts_inputs/main
Browse files Browse the repository at this point in the history
  • Loading branch information
mattw-nws authored Mar 9, 2022
2 parents 0499ebf + 59d1f6d commit 4af16b2
Show file tree
Hide file tree
Showing 38 changed files with 3,119 additions and 78 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/module_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
- name: Build surfacebmi module
run: |
cmake -B extern/noah-mp-modular/cmake_build cmake_build -S extern/noah-mp-modular
cmake --build extern/noah-mp-modular/cmake_build --target surfacebmi -- -j ${{ env.LINUX_NUM_PROC_CORES }}
cmake -B extern/noah-owp-modular/cmake_build cmake_build -S extern/noah-owp-modular
cmake --build extern/noah-owp-modular/cmake_build --target surfacebmi -- -j ${{ env.LINUX_NUM_PROC_CORES }}
- name: Build cfebmi module
run: |
Expand All @@ -67,4 +67,4 @@ jobs:
timeout-minutes: 15

- name: Run surfacebmi plus cfebmi
run: ./cmake_build/ngen data/catchment_data.geojson "cat-27" data/nexus_data.geojson "nex-26" data/example_bmi_multi_realization_config.json
run: ./cmake_build/ngen data/catchment_data.geojson "cat-27" data/nexus_data.geojson "nex-26" data/example_bmi_multi_realization_config.json
125 changes: 124 additions & 1 deletion .github/workflows/test_and_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,68 @@ jobs:
- name: cleanup_dir
run: rm -rf cmake_build


# Run BMI C++ tests in linux environment
test_bmi_cpp_ubuntu_latest:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Init Submodules
run: git submodule update --init --recursive

- name: cmake_init_shared_lib_build
run: cmake -B extern/test_bmi_cpp/cmake_build -S extern/test_bmi_cpp

- name: build_test_bmi_cpp_shared_lib
run: cmake --build extern/test_bmi_cpp/cmake_build --target testbmicppmodel

- name: Cache Boost Dependency
id: cache-boost-dep
uses: actions/cache@v1
with:
path: boost_1_72_0
key: unix-boost-dep

- name: Get Boost Dependency
if: steps.cache-boost-dep.outputs.cache-hit != 'true'
run: |
curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2
tar xjf boost_1_72_0.tar.bz2
- name: cmake_init_build
run: |
export BOOST_ROOT="$(pwd)/boost_1_72_0"
[ ! -d "$BOOST_ROOT" ] && echo "Error: no Boost root found at $BOOST_ROOT" && exit 1
cmake -B cmake_build -DNGEN_ACTIVATE_PYTHON:BOOL=OFF -S .
- name: build_bmi_c++_tests
run: cmake --build cmake_build --target test_bmi_cpp -- -j ${{ env.LINUX_NUM_PROC_CORES }}
timeout-minutes: 15

- name: run_bmi_c++_tests
run: |
cd ./cmake_build/test/
./test_bmi_cpp
cd ../../
timeout-minutes: 15

- name: clean_build
run: cmake --build cmake_build --target clean

- name: clean_shared_lib_build
run: cmake --build extern/test_bmi_cpp/cmake_build --target clean

- name: cleanup_dir
run: rm -rf cmake_build

- name: cleanup_dir
run: rm -rf extern/test_bmi_cpp/cmake_build

# Run BMI C tests in linux environment, and separating to isolate
test_bmi_c_ubuntu_latest:
# The type of runner that the job will run on
Expand Down Expand Up @@ -453,6 +515,67 @@ jobs:
- name: cleanup_dir
run: rm -rf cmake_build

# Run BMI C++ tests in macOS environment
test_bmi_cpp_macos_latest:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Init Submodules
run: git submodule update --init --recursive

- name: cmake_init_shared_lib_build
run: cmake -B extern/test_bmi_cpp/cmake_build -S extern/test_bmi_cpp

- name: build_test_bmi_cpp_shared_lib
run: cmake --build extern/test_bmi_cpp/cmake_build --target testbmicppmodel

- name: Cache Boost Dependency
id: cache-boost-dep
uses: actions/cache@v1
with:
path: boost_1_72_0
key: unix-boost-dep

- name: Get Boost Dependency
if: steps.cache-boost-dep.outputs.cache-hit != 'true'
run: |
curl -L -O https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2
tar xjf boost_1_72_0.tar.bz2
- name: cmake_init_build
run: |
export BOOST_ROOT="$(pwd)/boost_1_72_0"
[ ! -d "$BOOST_ROOT" ] && echo "Error: no Boost root found at $BOOST_ROOT" && exit 1
cmake -B cmake_build -DNGEN_ACTIVATE_PYTHON:BOOL=OFF -S .
- name: build_bmi_c++_tests
run: cmake --build cmake_build --target test_bmi_cpp -- -j ${{ env.MACOS_NUM_PROC_CORES }}
timeout-minutes: 15

- name: run_bmi_c++_tests
run: |
cd ./cmake_build/test/
./test_bmi_cpp
cd ../../
timeout-minutes: 15

- name: clean_build
run: cmake --build cmake_build --target clean

- name: clean_shared_lib_build
run: cmake --build extern/test_bmi_cpp/cmake_build --target clean

- name: cleanup_dir
run: rm -rf cmake_build

- name: cleanup_shared_lib_dir
run: rm -rf extern/test_bmi_cpp/cmake_build

# Run BMI C tests in MacOS environment, and separating to isolate
test_bmi_c_macos_latest:
# The type of runner that the job will run on
Expand Down Expand Up @@ -678,7 +801,7 @@ jobs:
- name: Init Python Dependencies
if: steps.cache-unix-py3-dependencies.outputs.cache-hit != 'true'
run: |
python -m venv .venv
python3 -m venv .venv
. .venv/bin/activate
pip install pip
pip install numpy
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ CMakeCache.txt
*.cmake
# Specifically adding this to cover a symlink pointing to an alternate dir
/cmake-build-debug
/cmake_build
/build

# Static Headers
include/bmi.hpp
Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
path = extern/topmodel/topmodel
url = https://github.com/NOAA-OWP/topmodel.git
branch = master
[submodule "extern/noah-mp-modular/noah-mp-modular"]
path = extern/noah-mp-modular/noah-mp-modular
url = https://github.com/noaa-owp/noah-mp-modular
[submodule "extern/noah-owp-modular/noah-owp-modular"]
path = extern/noah-owp-modular/noah-owp-modular
url = https://github.com/NOAA-OWP/noah-owp-modular
branch = main
[submodule "extern/UDUNITS-2"]
path = extern/UDUNITS-2
url = https://github.com/Unidata/UDUNITS-2.git
ignore = dirty

[submodule "extern/bmi-cxx"]
path = extern/bmi-cxx
url = https://github.com/csdms/bmi-cxx.git
28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,24 @@ target_include_directories(ngen PUBLIC
#add_subdirectory("extern/cfe")
#add_subdirectory("extern/test_bmi_c")

if(QUIET)
set(UDUNITS_QUIET true)
set(ET_QUIET true)
set(NGEN_QUIET true)
endif()

if(UDUNITS_QUIET)
add_compile_definitions(UDUNITS_QUIET)
endif()

if(ET_QUIET)
add_compile_definitions(ET_QUIET)
endif()

if(NGEN_QUIET)
add_compile_definitions(NGEN_QUIET)
endif()

add_subdirectory("src/core")
add_dependencies(core libudunits2)
add_subdirectory("src/geojson")
Expand Down Expand Up @@ -335,16 +353,6 @@ if(PACKAGE_TESTS)
add_subdirectory(test)
endif()

if(QUIET)
set(UDUNITS_QUIET true)
set(ET_QUIET true)
set(NGEN_QUIET true)
endif()

if(UDUNITS_QUIET)
add_compile_definitions(UDUNITS_QUIET)
endif()

#add_library(Hymod ${HYMOD_INCLUDE_DIR}/Hymod.h)
#set_target_properties(Hymod PROPERTIES LINKER_LANGUAGE CXX)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
/

&parameters
parameter_dir = "extern/noah-mp-modular/noah-mp-modular/parameters/"
parameter_dir = "extern/noah-owp-modular/noah-owp-modular/parameters/"
general_table = "GENPARM.TBL" ! general param tables and misc params
soil_table = "SOILPARM.TBL" ! soil param table
noahmp_table = "MPTABLE.TBL" ! noah-mp related param tables
noahowp_table = "MPTABLE.TBL" ! noah-mp related param tables
soil_class_name = "STAS" ! soil class data source - "STAS" or "STAS-RUC"
veg_class_name = "MODIFIED_IGBP_MODIS_NOAH" ! vegetation class data source - "MODIFIED_IGBP_MODIS_NOAH" or "USGS"
/
Expand Down
8 changes: 4 additions & 4 deletions data/example_bmi_multi_realization_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "bmi_multi",
"params": {
"model_type_name": "bmi_multi_noahmp_cfe",
"model_type_name": "bmi_multi_noahowp_cfe",
"forcing_file": "",
"init_config": "",
"allow_exceed_end_time": true,
Expand All @@ -13,10 +13,10 @@
{
"name": "bmi_fortran",
"params": {
"model_type_name": "bmi_fortran_noahmp",
"library_file": "./extern/noah-mp-modular/cmake_build/libsurfacebmi.so",
"model_type_name": "bmi_fortran_noahowp",
"library_file": "./extern/noah-owp-modular/cmake_build/libsurfacebmi.so",
"forcing_file": "",
"init_config": "./data/bmi/fortran/noah-mp-modular-init-{{id}}.namelist.input",
"init_config": "./data/bmi/fortran/noah-owp-modular-init-{{id}}.namelist.input",
"allow_exceed_end_time": true,
"main_output_variable": "QINSUR",
"variables_names_map": {
Expand Down
8 changes: 4 additions & 4 deletions data/example_bmi_multi_realization_config_w_routing.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "bmi_multi",
"params": {
"model_type_name": "bmi_multi_noahmp_cfe",
"model_type_name": "bmi_multi_noahowp_cfe",
"forcing_file": "",
"init_config": "",
"allow_exceed_end_time": true,
Expand All @@ -13,10 +13,10 @@
{
"name": "bmi_fortran",
"params": {
"model_type_name": "bmi_fortran_noahmp",
"library_file": "./extern/noah-mp-modular/cmake_build/libsurfacebmi.so",
"model_type_name": "bmi_fortran_noahowp",
"library_file": "./extern/noah-owp-modular/cmake_build/libsurfacebmi.so",
"forcing_file": "",
"init_config": "./data/bmi/fortran/noah-mp-modular-init-{{id}}.namelist.input",
"init_config": "./data/bmi/fortran/noah-owp-modular-init-{{id}}.namelist.input",
"allow_exceed_end_time": true,
"main_output_variable": "QINSUR",
"variables_names_map": {
Expand Down
Loading

0 comments on commit 4af16b2

Please sign in to comment.