NCAR / wrf_hydro_nwm_public

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

bugfix: release and debug CMake build types #669

Closed scrasmussen closed 1 year ago

scrasmussen commented 1 year ago

TYPE: bugfix

KEYWORDS: CMake, Optimization, Debug

SOURCE: Soren Rasmussen, NCAR

DESCRIPTION OF CHANGES: Release and debug CMake build types now choose correct optimization flags. Note the key differences: Release build flags will add -O2 while Debug build add -O0 -g with HYDRO_D=1 if HYDRO_D is undefined. This can be changed if we want something different.

TESTS CONDUCTED: built Release and Debug build types

Checklist

scrasmussen commented 1 year ago

I think this is PR is ready to go unless we want to change the Makefile build so that when compile_offline_NoahMP.sh is used and HYDRO_D=1 then we run make debug, with its additional debug compiler flags, instead of just make.

scrasmussen commented 1 year ago

Wanted to make a note that while people don't seem to know why -fallow-argument-mismatch fixes a gfortran 9.2+ and MPICH issue, is does seem to do it. Needed this flag when building on Gust so it is probably worth adding back in? Seems like a bad-practice type of flag but having it might avoid problems with users building on their systems. Note: just added it for the CMake build