Skip to content

bugfix: nudging io dependency#862

Merged
scrasmussen merged 1 commit into
NCAR:mainfrom
scrasmussen:fix/nudging_io_dependency
Oct 23, 2025
Merged

bugfix: nudging io dependency#862
scrasmussen merged 1 commit into
NCAR:mainfrom
scrasmussen:fix/nudging_io_dependency

Conversation

@scrasmussen
Copy link
Copy Markdown
Member

TYPE: bugfix

KEYWORDS: nudging, IO

SOURCE: Soren Rasmussen, NSF NCAR

DESCRIPTION OF CHANGES: OUTPUT_CHAN_CONN uses nudging IO but not nudging. The model wouldn't build when trying to use OUTPUT_CHAN_CONN without nudging turned on. This has been fixed and in the build system the nudging IO module has been moved to its own directory to make the separate build cleaner.

RELATED: This PR is built on top of #861

ISSUE: Related to #860

TESTS CONDUCTED: Built with combinations of OUTPUT_CHAN_CONN and WRF_HYDRO_NUDGING turned on. Nudging testcase ran.

@rcabell rcabell requested review from Copilot and rcabell October 22, 2025 23:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a build dependency issue where OUTPUT_CHAN_CONN requires nudging IO functionality but not the full nudging module. The fix separates the nudging IO module into its own build target, allowing OUTPUT_CHAN_CONN to be used independently of WRF_HYDRO_NUDGING.

Key changes:

  • Created separate hydro_nudging_io library target for nudging IO functionality
  • Updated output_chan_connectivity function to use int64 types for node indices
  • Added conditional linking of hydro_nudging_io based on new WRF_HYDRO_NUDGING_IO flag

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/nudging/io/module_nudging_io.F90 Updated function signature and types to use int64 for node indices
src/nudging/io/CMakeLists.txt New build configuration for separate hydro_nudging_io library
src/nudging/CMakeLists.txt Removed IO module from nudging library, added dependency on hydro_nudging_io
src/Routing/CMakeLists.txt Added conditional linking of hydro_nudging_io when flag is enabled
src/CMakeLists.txt Added build logic for hydro_nudging_io with proper dependency management
CMakeLists.txt Set WRF_HYDRO_NUDGING_IO flag when OUTPUT_CHAN_CONN is enabled

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

rcabell
rcabell previously approved these changes Oct 22, 2025
… nudging io module has been moved to its own directory to make seperate build cleaner
@scrasmussen scrasmussen dismissed rcabell’s stale review October 22, 2025 23:41

The merge-base changed after approval.

@scrasmussen scrasmussen force-pushed the fix/nudging_io_dependency branch from ba7ee6b to 2a88896 Compare October 22, 2025 23:41
@scrasmussen scrasmussen merged commit 49a0369 into NCAR:main Oct 23, 2025
5 checks passed
scrasmussen added a commit to scrasmussen/WRF that referenced this pull request Nov 26, 2025
- NCAR/wrf_hydro_nwm_public#756 Add initial support for gage-assisted diversions in channel routing
- NCAR/wrf_hydro_nwm_public#811 bugfix: Diversions Makefiles for configure build
- NCAR/wrf_hydro_nwm_public#816 Revert TYPEL(k) check
- NCAR/wrf_hydro_nwm_public#823 make clean new directories
- NCAR/wrf_hydro_nwm_public#829 Rename fortglob.f90 to fortglob.F90 for preprocessor
- NCAR/wrf_hydro_nwm_public#827 Dropping .exe extension from wrf_hydro binary
- NCAR/wrf_hydro_nwm_public#855 Properly handle unexpected NaNs in diversion observations
- NCAR/wrf_hydro_nwm_public#856 Make diversion init errors non-fatal, proceed without diversions
- NCAR/wrf_hydro_nwm_public#861 Nudging, Fixing type mismatch when nudging turned on
- NCAR/wrf_hydro_nwm_public#862 OUTPUT_CHAN_CONN uses nudging io but not nudging
scrasmussen added a commit to scrasmussen/WRF that referenced this pull request Nov 26, 2025
- NCAR/wrf_hydro_nwm_public#756 Add initial support for gage-assisted diversions in channel routing
- NCAR/wrf_hydro_nwm_public#811 bugfix: Diversions Makefiles for configure build
- NCAR/wrf_hydro_nwm_public#816 Revert TYPEL(k) check
- NCAR/wrf_hydro_nwm_public#823 make clean new directories
- NCAR/wrf_hydro_nwm_public#829 Rename fortglob.f90 to fortglob.F90 for preprocessor
- NCAR/wrf_hydro_nwm_public#827 Dropping .exe extension from wrf_hydro binary
- NCAR/wrf_hydro_nwm_public#855 Properly handle unexpected NaNs in diversion observations
- NCAR/wrf_hydro_nwm_public#856 Make diversion init errors non-fatal, proceed without diversions
- NCAR/wrf_hydro_nwm_public#861 Nudging, Fixing type mismatch when nudging turned on
- NCAR/wrf_hydro_nwm_public#862 OUTPUT_CHAN_CONN uses nudging io but not nudging

Co-authored-by: Ryan Cabell <rcabell@users.noreply.github.com>
Co-authored-by: Andrew Song <andrewsoong@users.noreply.github.com>
islas pushed a commit to wrf-model/WRF that referenced this pull request Feb 12, 2026
TYPE: bugfix, enhancement

KEYWORDS: syncing WRF-Hydro/hydro, gage-assisted diversion, bugfixes

SOURCE: internal hydro team + contributor 
 - Soren Rasmussen, NSF NCAR
 - Ryan Cabell, NSF NCAR
- Andrew Song, Inner Mongolia Meteorological Service / China
Meteorological Administration (Wrote PR#829)

DESCRIPTION OF CHANGES: This PR updates the hydro directory to the
[NCAR/wrf_hydro_nwm_public](https://github.com/NCAR/wrf_hydro_nwm_public)
repository. It includes the following PRs
- NCAR/wrf_hydro_nwm_public#756
- NCAR/wrf_hydro_nwm_public#811
- NCAR/wrf_hydro_nwm_public#816
- NCAR/wrf_hydro_nwm_public#823
- NCAR/wrf_hydro_nwm_public#829
- NCAR/wrf_hydro_nwm_public#827
- NCAR/wrf_hydro_nwm_public#855
- NCAR/wrf_hydro_nwm_public#856
- NCAR/wrf_hydro_nwm_public#861
- NCAR/wrf_hydro_nwm_public#862

LIST OF MODIFIED FILES:
```
$ git diff --name-status develop
M       hydro/CMakeLists.txt
M       hydro/CPL/WRF_cpl/CMakeLists.txt
M       hydro/Data_Rec/module_namelist.F90
M       hydro/Data_Rec/module_namelist_inc.F90
M       hydro/HYDRO_drv/module_HYDRO_drv.F90
M       hydro/Makefile
M       hydro/OrchestratorLayer/config.F90
M       hydro/Routing/CMakeLists.txt
A       hydro/Routing/Diversions/CMakeLists.txt
A       hydro/Routing/Diversions/Makefile
A       hydro/Routing/Diversions/module_diversions.F90
A       hydro/Routing/Diversions/module_diversions_timeslice.F90
M       hydro/Routing/Makefile
M       hydro/Routing/module_channel_routing.F90
M       hydro/arc/Makefile.mpp
D       hydro/arc/Makefile.seq
M       hydro/arc/macros.mpp.cray_fortran
M       hydro/arc/macros.mpp.gfort
M       hydro/arc/macros.mpp.ifort
D       hydro/arc/macros.mpp.ifort.luna
D       hydro/arc/macros.mpp.ifort.summit_has
D       hydro/arc/macros.mpp.ifort.theia
M       hydro/arc/macros.mpp.linux
D       hydro/arc/macros.seq.IBM.xlf90_r
D       hydro/arc/macros.seq.gfort
D       hydro/arc/macros.seq.ifort
D       hydro/arc/macros.seq.linux
D       hydro/arc/macros.theia.debug
D       hydro/arc/macros.yellowstone
D       hydro/arc/macros.yellowstone.debug
M       hydro/configure
M       hydro/nudging/CMakeLists.txt
A       hydro/nudging/io/CMakeLists.txt
R098    hydro/nudging/module_nudging_io.F90     hydro/nudging/io/module_nudging_io.F90
M       hydro/utils/CMakeLists.txt
A       hydro/utils/fortglob/CMakeLists.txt
A       hydro/utils/fortglob/Makefile
A       hydro/utils/fortglob/fortglob.F90
A       hydro/utils/fortglob/libfortglob.c
A       hydro/utils/fortglob/libfortglob.h
```

TESTS CONDUCTED: **NOTE THAT THE PR IS IN DRAFT UNTIL TESTING IS
COMPLETE**. Current building and running
1. [WRF-Hydro Front Range, CO
testcase](https://wrf-hydro.readthedocs.io/en/latest/appendices.html#a2-coupled-wrf-wrf-hydro-test-case-user-guide)
2. Testing multiple configurations of Make and CMake build systems 

RELEASE NOTE: Hydro bug fixes plus modifications to add initial support
for gage-assisted diversions in channel routing, which requires a new
optional Diversion netCDF parameter file. This adds a C compiler
dependency

---------

Co-authored-by: Ryan Cabell <rcabell@users.noreply.github.com>
Co-authored-by: Andrew Song <andrewsoong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants