Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Hymod and Simple_Lumped #595

Merged
merged 7 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ endfunction()
set(PROJ_ROOT_INCLUDE_DIR ./include)
set(PROJ_ROOT_MODELS_DIR ./models)

set(HYMOD_DIR ${PROJ_ROOT_MODELS_DIR}/hymod)
set(HYMOD_INCLUDE_DIR ${HYMOD_DIR}/include)

# Find the Boost library and configure usage
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
Expand Down Expand Up @@ -143,6 +140,12 @@ add_executable(ngen
src/NGen.cpp
)

# Natively support BMI C++ modules and pre-compile in the test_bmi_cpp mock/example.
set(TEST_BMI_CPP_DIR ${PROJECT_SOURCE_DIR}/extern/test_bmi_cpp)
git_update_submodule(${PROJECT_SOURCE_DIR}/extern/bmi-cxx)
add_subdirectory(${TEST_BMI_CPP_DIR} ${TEST_BMI_CPP_DIR}/cmake_build)
add_dependencies(ngen testbmicppmodel) # because our demo realizations will use it

# Handle several steps for BMI C library logic and dependencies, at top level, if functionality is turned on
if(BMI_C_LIB_ACTIVE)
# Define associated preprocessor directive
Expand Down Expand Up @@ -281,11 +284,6 @@ if(PACKAGE_TESTS)
add_subdirectory(test)
endif()

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

#target_compile_features(Hymod PUBLIC cxx_std_14)

#set_target_properties(ngen PROPERTIES LINKER_LANGUAGE CXX)
#
#target_compile_options(ngen PUBLIC -std=c++14 -Wall)
Expand Down
177 changes: 56 additions & 121 deletions data/example_realization_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,20 @@
"global": {
"formulations": [
{
"name": "tshirt_c",
"params": {
"maxsmc": 0.439,
"wltsmc": 0.066,
"satdk": 0.00000338,
"satpsi": 0.355,
"slope": 1.0,
"scaled_distribution_fn_shape_parameter": 4.05,
"multiplier": 0.0,
"alpha_fc": 0.33,
"Klf": 0.01,
"Kn": 0.03,
"nash_n": 2,
"Cgw": 0.01,
"expon": 6.0,
"max_groundwater_storage_meters": 1.0,
"nash_storage": [
0.0,
0.0
],
"soil_storage_percentage": 0.667,
"groundwater_storage_percentage": 0.5,
"timestep": 3600,
"giuh": {
"giuh_path": "./test/data/giuh/GIUH.json",
"crosswalk_path": "./data/crosswalk.json"
}
}
"name": "bmi_c++",
"params": {
"model_type_name": "test_bmi_cpp",
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so",
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini",
"main_output_variable": "OUTPUT_VAR_2",
"variables_names_map" : {
"INPUT_VAR_2": "TMP_2maboveground",
"INPUT_VAR_1": "precip_rate"
},
"create_function": "bmi_model_create",
"destroy_function": "bmi_model_destroy",
"uses_forcing_file": false
}
}
],
"forcing": {
Expand All @@ -46,70 +32,42 @@
"cat-27": {
"formulations": [
{
"name":"tshirt_c",
"params": {
"maxsmc": 0.439,
"wltsmc": 0.066,
"satdk": 0.00000338,
"satpsi": 0.355,
"slope": 1.0,
"scaled_distribution_fn_shape_parameter": 4.05,
"multiplier": 0.0,
"alpha_fc": 0.33,
"Klf": 0.01,
"Kn": 0.03,
"nash_n": 2,
"Cgw": 0.01,
"expon": 6.0,
"max_groundwater_storage_meters": 1.0,
"nash_storage": [
0.0,
0.0
],
"soil_storage_percentage": 0.667,
"groundwater_storage_percentage": 0.5,
"timestep": 3600,
"giuh": {
"giuh_path": "./test/data/giuh/GIUH.json",
"crosswalk_path": "./data/crosswalk.json",
"cdf_ordinates": [
0.1,
0.35,
0.2,
0.14,
0.1,
0.06,
0.05
]
}
}
"name": "bmi_c++",
"params": {
"model_type_name": "test_bmi_cpp",
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so",
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini",
"main_output_variable": "OUTPUT_VAR_2",
"variables_names_map" : {
"INPUT_VAR_2": "TMP_2maboveground",
"INPUT_VAR_1": "precip_rate"
},
"create_function": "bmi_model_create",
"destroy_function": "bmi_model_destroy",
"uses_forcing_file": false
}
],
"forcing": {
"path": "./data/forcing/cat-27_2015-12-01 00_00_00_2015-12-30 23_00_00.csv"
}
],
"forcing": {
"path": "./data/forcing/cat-27_2015-12-01 00_00_00_2015-12-30 23_00_00.csv"
}
},
"cat-52": {
"formulations": [
{
"name": "simple_lumped",
"params": {
"sr": [
1.0,
1.0,
1.0
],
"storage": 1.0,
"gw_storage": 1.0,
"gw_max_storage": 10.0,
"nash_max_storage": 2.0,
"smax": 5,
"a": 1.0,
"b": 10.0,
"Ks": 0.1,
"Kq": 0.01,
"n": 3,
"t": 0
"name": "bmi_c++",
"params": {
"model_type_name": "test_bmi_cpp",
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so",
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini",
"main_output_variable": "OUTPUT_VAR_2",
"variables_names_map" : {
"INPUT_VAR_2": "TMP_2maboveground",
"INPUT_VAR_1": "precip_rate"
},
"create_function": "bmi_model_create",
"destroy_function": "bmi_model_destroy",
"uses_forcing_file": false
}
}
],
Expand All @@ -120,42 +78,19 @@
"cat-67": {
"formulations": [
{
"name":"tshirt_c",
"name": "bmi_c++",
"params": {
"maxsmc": 0.439,
"wltsmc": 0.066,
"satdk": 0.00000338,
"satpsi": 0.355,
"slope": 1.0,
"scaled_distribution_fn_shape_parameter": 4.05,
"multiplier": 0.0,
"alpha_fc": 0.33,
"Klf": 0.01,
"Kn": 0.03,
"nash_n": 2,
"Cgw": 0.01,
"expon": 6.0,
"max_groundwater_storage_meters": 1.0,
"nash_storage": [
0.0,
0.0
],
"soil_storage_percentage": 0.667,
"groundwater_storage_percentage": 0.5,
"timestep": 3600,
"giuh": {
"giuh_path": "./test/data/giuh/GIUH.json",
"crosswalk_path": "./data/crosswalk.json",
"cdf_ordinates": [
0.1,
0.35,
0.2,
0.14,
0.1,
0.06,
0.05
]
}
"model_type_name": "test_bmi_cpp",
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so",
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini",
"main_output_variable": "OUTPUT_VAR_2",
"variables_names_map" : {
"INPUT_VAR_2": "TMP_2maboveground",
"INPUT_VAR_1": "precip_rate"
},
"create_function": "bmi_model_create",
"destroy_function": "bmi_model_destroy",
"uses_forcing_file": false
}
}
],
Expand Down
1 change: 1 addition & 0 deletions extern/test_bmi_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ target_include_directories(testbmicppmodel PRIVATE ../bmi-cxx/ )
set_target_properties(testbmicppmodel PROPERTIES VERSION ${PROJECT_VERSION})

set_target_properties(testbmicppmodel PROPERTIES PUBLIC_HEADER include/test_bmi_cpp.hpp)
set_target_properties(testbmicppmodel PROPERTIES CXX_VISIBILITY_PRESET default)

include(GNUInstallDirs)

Expand Down
2 changes: 0 additions & 2 deletions include/realizations/catchment/Formulation_Constructors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Formulations
#include "Tshirt_Realization.hpp"
#include "Tshirt_C_Realization.hpp"
#include "Simple_Lumped_Model_Realization.hpp"
#include "Bmi_Cpp_Formulation.hpp"
#include "Bmi_C_Formulation.hpp"
#include "Bmi_Fortran_Formulation.hpp"
Expand Down Expand Up @@ -51,7 +50,6 @@ namespace realization {
#endif // ACTIVATE_PYTHON
{"tshirt", create_formulation_constructor<Tshirt_Realization>()},
{"tshirt_c", create_formulation_constructor<Tshirt_C_Realization>()},
{"simple_lumped", create_formulation_constructor<Simple_Lumped_Model_Realization>()}
#ifdef NGEN_LSTM_TORCH_LIB_ACTIVE
,
{"lstm", create_formulation_constructor<LSTM_Realization>()}
Expand Down
132 changes: 0 additions & 132 deletions include/realizations/catchment/Simple_Lumped_Model_Realization.hpp

This file was deleted.

Loading
Loading