From 2a88896365cdfd0b86e9c4c26940378d2cff51da Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Wed, 22 Oct 2025 12:05:15 -0600 Subject: [PATCH] OUTPUT_CHAN_CONN uses nudging io but not nudging. In the build system nudging io module has been moved to its own directory to make seperate build cleaner --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 11 +++++++++++ src/Routing/CMakeLists.txt | 7 +++++++ src/nudging/CMakeLists.txt | 2 +- src/nudging/io/CMakeLists.txt | 10 ++++++++++ src/nudging/{ => io}/module_nudging_io.F90 | 0 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/nudging/io/CMakeLists.txt rename src/nudging/{ => io}/module_nudging_io.F90 (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5818bdc65..36e472c00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,8 @@ endif() message("OUTPUT_CHAN_CONN = " ${OUTPUT_CHAN_CONN} ) if (OUTPUT_CHAN_CONN STREQUAL "1" ) add_definitions(-DOUTPUT_CHAN_CONN) + # requires nudging io module + set(WRF_HYDRO_NUDGING_IO "1") endif() #set -DPRECIP_DOUBLE from env diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8c7e2f74e..c6575f5df 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,12 @@ if(${PROJECT_NAME} STREQUAL "WRF") add_subdirectory("CPL/WRF_cpl") endif() +if (WRF_HYDRO_NUDGING_IO STREQUAL "1" OR + WRF_HYDRO_NUDGING STREQUAL "1") + add_subdirectory("nudging/io") + add_dependencies(hydro_routing hydro_nudging_io) +endif() + if (WRF_HYDRO_NUDGING STREQUAL "1") add_subdirectory("nudging") add_dependencies(hydro_routing hydro_nudging) @@ -126,6 +132,11 @@ if (HYDRO_LSM MATCHES "NoahMP") # hydro_routing_groundwater_simple ) + if (WRF_HYDRO_NUDGING_IO STREQUAL "1") + target_link_libraries(wrfhydro hydro_nudging_io) + add_dependencies(wrfhydro hydro_nudging_io) + endif() + if (WRF_HYDRO_NUDGING STREQUAL "1") target_link_libraries(wrfhydro hydro_nudging) target_link_libraries(wrfhydro hydro_routing_diversions) diff --git a/src/Routing/CMakeLists.txt b/src/Routing/CMakeLists.txt index 8ca1af4d3..748b941e8 100644 --- a/src/Routing/CMakeLists.txt +++ b/src/Routing/CMakeLists.txt @@ -32,3 +32,10 @@ target_link_libraries(hydro_routing hydro_routing_reservoirs_rfc hydro_routing_diversions ) + +if (WRF_HYDRO_NUDGING_IO STREQUAL "1") + target_link_libraries(hydro_routing + PRIVATE + hydro_nudging_io + ) +endif() diff --git a/src/nudging/CMakeLists.txt b/src/nudging/CMakeLists.txt index 142fce6ec..e7b385667 100644 --- a/src/nudging/CMakeLists.txt +++ b/src/nudging/CMakeLists.txt @@ -1,12 +1,12 @@ # build the version static library add_library(hydro_nudging STATIC module_date_utils_nudging.F90 - module_nudging_io.F90 module_nudging_utils.F90 module_stream_nudging.F90 ) target_link_libraries(hydro_nudging PRIVATE + hydro_nudging_io hydro_mpp hydro_data_rec hydro_orchestrator diff --git a/src/nudging/io/CMakeLists.txt b/src/nudging/io/CMakeLists.txt new file mode 100644 index 000000000..e7fdc6a1e --- /dev/null +++ b/src/nudging/io/CMakeLists.txt @@ -0,0 +1,10 @@ +# build the version static library +add_library(hydro_nudging_io STATIC + module_nudging_io.F90 +) + +target_link_libraries(hydro_nudging_io PRIVATE + hydro_orchestrator + hydro_data_rec + hydro_mpp +) diff --git a/src/nudging/module_nudging_io.F90 b/src/nudging/io/module_nudging_io.F90 similarity index 100% rename from src/nudging/module_nudging_io.F90 rename to src/nudging/io/module_nudging_io.F90