NCAR / wrf_hydro_nwm_public

WRF-Hydro model code
https://ral.ucar.edu/projects/wrf_hydro
Other
181 stars 139 forks source link

Incompatible routing namelist options crash with segfault #529

Open rcabell opened 3 years ago

rcabell commented 3 years ago

If UDMP is turned on in the namelist, but channel routing is set to Diffusive Wave, the model will crash due to attempting to access unallocated routing data structures.

Expected Behavior

If a known set of incompatible namelist options is selected, the code should display a useful error and exit cleanly.

Current Behavior

The model will hang or crash with a segfault

Possible Solution

Identify the conflicting options before uninitialized memory is accessed

Steps to Reproduce (for bugs)

Set UDMP_OPT = 1 and channel_option = 3

rcabell commented 3 years ago

There is a subroutine rt_nlst_check(self) in config.f90 for this exact sort of check. This combination should be added to that routine.