Skip to content

Commit

Permalink
Hydro CMake and Updates (#2009)
Browse files Browse the repository at this point in the history
TYPE: new feature, bug fixes, enhancement

KEYWORDS: CMake, Build System, Hydro

SOURCE: Soren Rasmussen and Ryan Cabell, NCAR

DESCRIPTION OF CHANGES:
- Build Systems:
  - CMake build system added and renaming .F and .f90 files to .F90 so they automatically get preprocessed and the editor recognizes them as free-form
  - added compiler info to all netcdf output files
  - Alma support added
  - Cray compiler fixes:
    - Removes comma after write statement and changes A*-B*C statements to A*(-B)*C
    - Use assumed shape / volatile arrays with ext libs - Replace timestep multiple check with mod operator
  - Update CMake with proper MPI and PGI/NVHPC support

- General:
   - whitespace cleanup

- MPI
  - Optimized inefficient MPI routines. Converted MPP_LAND p2p MPI to collectives, Remove unneeded mpp_land_sync() calls

- Routing changes
  - Add scrape of outer edge of domain so water doesn't pile up
  - Remove 'FATAL ERROR' from SMCRT depletion message
  - Add to retro IO option (NWM)
  - routing bugfix: removed CHANN_K from debug print statement. The variable is unitialized and can change values every time executable is run.
  - bugfix: unallocated variables

- Nudging
  - Update nudging_io to NF90 API
  - Since NetCDF subroutines have been converted to nf90 we can remove the 'include netcdf.inc' statements

- Config
  - config debug: fixes in read_crocus_namelist subroutine


TESTS CONDUCTED: 
1. Currently testing hydro's WRF testcase on new CMake and old Makefile build systems. PR will be draft until fully tested.

RELEASE NOTE: Hydro has added CMake build option. General bug fixes and code cleanup. MPI routine made more efficient. All hydro file suffixes are now `.F90`.

LIST OF MODIFIED FILES:

```
M       CMakeLists.txt
A       hydro/CMakeLists.txt
M       hydro/CPL/WRF_cpl/Makefile
R094    hydro/CPL/WRF_cpl/module_wrf_HYDRO.F    hydro/CPL/WRF_cpl/module_wrf_HYDRO.F90
R096    hydro/CPL/WRF_cpl/module_wrf_HYDRO_downscale.F  hydro/CPL/WRF_cpl/module_wrf_HYDRO_downscale.F90
R093    hydro/CPL/WRF_cpl/wrf_drv_HYDRO.F       hydro/CPL/WRF_cpl/wrf_drv_HYDRO.F90
A       hydro/Data_Rec/CMakeLists.txt
M       hydro/Data_Rec/Makefile
D       hydro/Data_Rec/module_RT_data.F
R069    hydro/Data_Rec/module_gw_gw2d_data.F    hydro/Data_Rec/module_RT_data.F90
A       hydro/Data_Rec/module_gw_gw2d_data.F90
R099    hydro/Data_Rec/module_namelist.F        hydro/Data_Rec/module_namelist.F90
A       hydro/Data_Rec/module_namelist_inc.F90
A       hydro/Data_Rec/module_rt_inc.F90
A       hydro/Debug_Utilities/CMakeLists.txt
M       hydro/Debug_Utilities/Makefile
R100    hydro/Debug_Utilities/debug_dump_variable.F     hydro/Debug_Utilities/debug_dump_variable.F90
A       hydro/HYDRO_drv/CMakeLists.txt
M       hydro/HYDRO_drv/Makefile
R099    hydro/HYDRO_drv/module_HYDRO_drv.F      hydro/HYDRO_drv/module_HYDRO_drv.F90
A       hydro/IO/CMakeLists.txt
M       hydro/IO/Makefile
R100    hydro/IO/netcdf_layer.f90       hydro/IO/netcdf_layer.F90
A       hydro/MPP/CMakeLists.txt
R094    hydro/MPP/CPL_WRF.F     hydro/MPP/CPL_WRF.F90
M       hydro/MPP/Makefile
R099    hydro/MPP/hashtable.F   hydro/MPP/hashtable.F90
R100    hydro/MPP/module_mpp_GWBUCKET.F hydro/MPP/module_mpp_GWBUCKET.F90
R100    hydro/MPP/module_mpp_ReachLS.F  hydro/MPP/module_mpp_ReachLS.F90
D       hydro/MPP/mpp_land.F
A       hydro/MPP/mpp_land.F90
A       hydro/OrchestratorLayer/CMakeLists.txt
M       hydro/OrchestratorLayer/Makefile
R099    hydro/OrchestratorLayer/config.f90      hydro/OrchestratorLayer/config.F90
R098    hydro/OrchestratorLayer/io_manager.f90  hydro/OrchestratorLayer/io_manager.F90
R094    hydro/OrchestratorLayer/orchestrator.f90        hydro/OrchestratorLayer/orchestrator.F90
A       hydro/Routing/CMakeLists.txt
M       hydro/Routing/Makefile
R099    hydro/Routing/Noah_distr_routing.F      hydro/Routing/Noah_distr_routing.F90
R100    hydro/Routing/Noah_distr_routing_overland.F     hydro/Routing/Noah_distr_routing_overland.F90
R100    hydro/Routing/Noah_distr_routing_subsurface.F   hydro/Routing/Noah_distr_routing_subsurface.F90
A       hydro/Routing/Overland/CMakeLists.txt
M       hydro/Routing/Overland/Makefile
R099    hydro/Routing/Noah_distr_routing.F      hydro/Routing/Noah_distr_routing.F90
R100    hydro/Routing/Noah_distr_routing_overland.F     hydro/Routing/Noah_distr_routing_overland.F90
R100    hydro/Routing/Noah_distr_routing_subsurface.F   hydro/Routing/Noah_distr_routing_subsurface.F90
A       hydro/Routing/Overland/CMakeLists.txt
M       hydro/Routing/Overland/Makefile
R100    hydro/Routing/Overland/module_overland.F        hydro/Routing/Overland/module_overland.F90
R100    hydro/Routing/Overland/module_overland_control.F        hydro/Routing/Overland/module_overland_control.F90
R098    hydro/Routing/Overland/module_overland_mass_balance.F   hydro/Routing/Overland/module_overland_mass_balance.F90
R100    hydro/Routing/Overland/module_overland_routing_properties.F     hydro/Routing/Overland/module_overland_routing_properties.F90
R100    hydro/Routing/Overland/module_overland_streams_and_lakes.F      hydro/Routing/Overland/module_overland_streams_and_lakes.F90
R100    hydro/Routing/Overland/overland_tests.F hydro/Routing/Overland/overland_tests.F90
A       hydro/Routing/Reservoirs/CMakeLists.txt
A       hydro/Routing/Reservoirs/Level_Pool/CMakeLists.txt
M       hydro/Routing/Reservoirs/Level_Pool/Makefile
R100    hydro/Routing/Reservoirs/Level_Pool/module_levelpool.F  hydro/Routing/Reservoirs/Level_Pool/module_levelpool.F90
R100    hydro/Routing/Reservoirs/Level_Pool/module_levelpool_properties.F       hydro/Routing/Reservoirs/Level_Pool/module_levelpool_properties.F90
R100    hydro/Routing/Reservoirs/Level_Pool/module_levelpool_state.F    hydro/Routing/Reservoirs/Level_Pool/module_levelpool_state.F90
R100    hydro/Routing/Reservoirs/Level_Pool/module_levelpool_tests.F    hydro/Routing/Reservoirs/Level_Pool/module_levelpool_tests.F90
M       hydro/Routing/Reservoirs/Makefile
A       hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/CMakeLists.txt
M       hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/Makefile
R100    hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persistence_levelpool_hybrid.F    hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persisten\
ce_levelpool_hybrid.F90
R100    hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persistence_levelpool_hybrid_properties.F hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_p\
ersistence_levelpool_hybrid_properties.F90
R100    hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persistence_levelpool_hybrid_state.F      hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_p\
ersistence_levelpool_hybrid_state.F90
R100    hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_persistence_levelpool_hybrid_tests.F      hydro/Routing/Reservoirs/Persistence_Level_Pool_Hybrid/module_p\
ersistence_levelpool_hybrid_tests.F90
A       hydro/Routing/Reservoirs/RFC_Forecasts/CMakeLists.txt
M       hydro/Routing/Reservoirs/RFC_Forecasts/Makefile
R100    hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts.F   hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts.F90
R100    hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_properties.F        hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_properties.F90
R100    hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_state.F     hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_state.F90
R100    hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_tests.F     hydro/Routing/Reservoirs/RFC_Forecasts/module_rfc_forecasts_tests.F90
R100    hydro/Routing/Reservoirs/module_reservoir.F     hydro/Routing/Reservoirs/module_reservoir.F90
R100    hydro/Routing/Reservoirs/module_reservoir_read_rfc_time_series_data.F   hydro/Routing/Reservoirs/module_reservoir_read_rfc_time_series_data.F90
R100    hydro/Routing/Reservoirs/module_reservoir_read_timeslice_data.F hydro/Routing/Reservoirs/module_reservoir_read_timeslice_data.F90
R100    hydro/Routing/Reservoirs/module_reservoir_utilities.F   hydro/Routing/Reservoirs/module_reservoir_utilities.F90
R100    hydro/Routing/Reservoirs/reservoir_tests.F      hydro/Routing/Reservoirs/reservoir_tests.F90
A       hydro/Routing/Subsurface/CMakeLists.txt
M       hydro/Routing/Subsurface/Makefile
R100    hydro/Routing/Subsurface/module_subsurface.F    hydro/Routing/Subsurface/module_subsurface.F90
R100    hydro/Routing/Subsurface/module_subsurface_grid_transform.F     hydro/Routing/Subsurface/module_subsurface_grid_transform.F90
R100    hydro/Routing/Subsurface/module_subsurface_input.F      hydro/Routing/Subsurface/module_subsurface_input.F90
R100    hydro/Routing/Subsurface/module_subsurface_output.F     hydro/Routing/Subsurface/module_subsurface_output.F90
R100    hydro/Routing/Subsurface/module_subsurface_properties.F hydro/Routing/Subsurface/module_subsurface_properties.F90
R100    hydro/Routing/Subsurface/module_subsurface_state.F      hydro/Routing/Subsurface/module_subsurface_state.F90
R098    hydro/Routing/Subsurface/module_subsurface_static_data.F        hydro/Routing/Subsurface/module_subsurface_static_data.F90
R100    hydro/Routing/Subsurface/subsurface_tests.F     hydro/Routing/Subsurface/subsurface_tests.F90
R097    hydro/Routing/module_GW_baseflow.F      hydro/Routing/module_GW_baseflow.F90
R099    hydro/Routing/module_HYDRO_io.F hydro/Routing/module_HYDRO_io.F90
R088    hydro/Routing/module_HYDRO_utils.F      hydro/Routing/module_HYDRO_utils.F90
R098    hydro/Routing/module_NWM_io.F   hydro/Routing/module_NWM_io.F90
R099    hydro/Routing/module_NWM_io_dict.F      hydro/Routing/module_NWM_io_dict.F90
R100    hydro/Routing/module_RT.F       hydro/Routing/module_RT.F90
R094    hydro/Routing/module_UDMAP.F    hydro/Routing/module_UDMAP.F90
R099    hydro/Routing/module_channel_routing.F  hydro/Routing/module_channel_routing.F90
R100    hydro/Routing/module_date_utilities_rt.F        hydro/Routing/module_date_utilities_rt.F90
R097    hydro/Routing/module_gw_gw2d.F  hydro/Routing/module_gw_gw2d.F90
R099    hydro/Routing/module_lsm_forcing.F      hydro/Routing/module_lsm_forcing.F90
R093    hydro/Routing/module_noah_chan_param_init_rt.F  hydro/Routing/module_noah_chan_param_init_rt.F90
R099    hydro/Routing/module_reservoir_routing.F        hydro/Routing/module_reservoir_routing.F90
M       hydro/arc/Makefile.NoahMP
A       hydro/nudging/CMakeLists.txt
M       hydro/nudging/Makefile
R100    hydro/nudging/module_date_utils_nudging.F       hydro/nudging/module_date_utils_nudging.F90
R090    hydro/nudging/module_nudging_io.F       hydro/nudging/module_nudging_io.F90
R085    hydro/nudging/module_nudging_utils.F    hydro/nudging/module_nudging_utils.F90
R100    hydro/nudging/module_stream_nudging.F   hydro/nudging/module_stream_nudging.F90
A       hydro/utils/CMakeLists.txt
M       hydro/utils/Makefile
R100    hydro/utils/module_hydro_stop.F hydro/utils/module_hydro_stop.F90
R100    hydro/utils/module_version.F    hydro/utils/module_version.F90
```
  • Loading branch information
scrasmussen committed Mar 15, 2024
1 parent 01228e7 commit 9e265af
Show file tree
Hide file tree
Showing 109 changed files with 4,494 additions and 3,847 deletions.
86 changes: 48 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()
# list( APPEND CMAKE_MODULE_PATH )
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/ ${PROJECT_SOURCE_DIR}/cmake/modules )

# Use link paths as rpaths
# Use link paths as rpaths
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
set( CMAKE_Fortran_PREPROCESS ON )

Expand All @@ -44,7 +44,7 @@ wrf_git_commit(
)

# Configure file for usage
configure_file(
configure_file(
${PROJECT_SOURCE_DIR}/cmake/template/commit_decl.cmake
${PROJECT_BINARY_DIR}/inc/commit_decl
@ONLY
Expand All @@ -71,7 +71,7 @@ endif()
################################################################################
## WRF Core selection
################################################################################
set( WRF_CORE_OPTIONS
set( WRF_CORE_OPTIONS
# Options listed here
ARW
CONVERT # This exists in compile but not configure
Expand All @@ -89,7 +89,7 @@ endif()
################################################################################
## WRF Nesting selection
################################################################################
set( WRF_NESTING_OPTIONS
set( WRF_NESTING_OPTIONS
# Options listed here
NONE
BASIC
Expand All @@ -108,15 +108,15 @@ endif()
##!TODO Maybe one day make it so this doesn't need to be a selection and all are
## always built?
################################################################################
set( WRF_CASE_OPTIONS
set( WRF_CASE_OPTIONS
# Options listed here
EM_REAL # make this the default
# EM_IDEAL # Technically doable but does anyone build this? It is not a target option in make
EM_FIRE
EM_SCM_XY
EM_TROPICAL_CYCLONE
EM_HELDSUAREZ

# These are sub-categories of ideal - Keep these lower in the list
EM_B_WAVE # Keep this one here as it is used to check index
EM_GRAV2D_X
Expand Down Expand Up @@ -148,14 +148,14 @@ set( USE_IPO OFF CACHE BOOL "USE_IPO" )

set( ENABLE_CHEM OFF CACHE BOOL "ENABLE_CHEM" )
set( ENABLE_CMAQ OFF CACHE BOOL "ENABLE_CMAQ" )
set( ENABLE_KPP OFF CACHE BOOL "ENABLE_KPP" )
set( ENABLE_CTSM OFF CACHE BOOL "ENABLE_CTSM" )
set( ENABLE_DFI_RADAR OFF CACHE BOOL "ENABLE_DFI_RADAR" )
set( ENABLE_TITAN OFF CACHE BOOL "ENABLE_TITAN" )
set( ENABLE_HYDRO OFF CACHE BOOL "ENABLE_HYDRO" )
set( ENABLE_KPP OFF CACHE BOOL "ENABLE_KPP" )
set( ENABLE_MARS OFF CACHE BOOL "ENABLE_MARS" )
set( ENABLE_VENUS OFF CACHE BOOL "ENABLE_VENUS" )
set( ENABLE_VENUS OFF CACHE BOOL "ENABLE_VENUS" )
set( ENABLE_TERRAIN OFF CACHE BOOL "ENABLE_TERRAIN" )
set( ENABLE_CTSM OFF CACHE BOOL "ENABLE_CTSM" )
set( ENABLE_TITAN OFF CACHE BOOL "ENABLE_TITAN" )
set( ENABLE_VENUS OFF CACHE BOOL "ENABLE_VENUS" )

# What do these defines even do if they are always on????
set( USE_ALLOCATABLES ON CACHE BOOL "USE_ALLOCATABLES" )
Expand Down Expand Up @@ -228,7 +228,6 @@ if ( NOT ${WRF_CASE} IN_LIST WRF_CASE_OPTIONS )
message( FATAL_ERROR "WRF Case option not recognized : ${WRF_CASE}" )
endif()


# Handle selection
set( EM_CORE 1 )
# Far easier to write this one as normal logic rather than generator expression
Expand Down Expand Up @@ -263,6 +262,11 @@ if ( NOT ${WRFIO_NCD_NO_LARGE_FILE_SUPPORT} )
message( STATUS "netCDF large file support not suppressed, if available it will be used" )
endif()

# Hydro option requires MPI
if ( ${ENABLE_HYDRO} AND NOT ${USE_MPI} )
message( STATUS "WRF Hydro requires MPI usage" )
set( USE_MPI ON CACHE BOOL "Required by configuration" FORCE )
endif()

# Handle double promotion - doing this here instead of from config.cmake toolchain
# file since the double promotion logic is a nightmare
Expand All @@ -271,7 +275,7 @@ list( FIND WRF_CORE_OPTIONS "DA" START_DA_IDX )
# DA + WRF PLUS cores require double precision
if ( ${CURRENT_WRF_CORE_IDX} GREATER_EQUAL ${START_DA_IDX} AND NOT ${USE_DOUBLE} )
# if ( # Apparently set regardless of compiler
# ${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" OR
# ${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" OR
# ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Fujitsu" )
message( STATUS "DA and PLUS Core builds require double precision" )
set( USE_DOUBLE ON CACHE BOOL "Required by configuration" FORCE )
Expand Down Expand Up @@ -315,7 +319,7 @@ if ( ${USE_MPI} )
# https://cmake.org/cmake/help/latest/module/FindMPI.html#variables-for-locating-mpi
# the find logic makes a mess of things by utilizing <mpi> -show[me]
# Which may or may not get polluted by the environment
# It still technically finds MPI but the output is nonintuitive
# It still technically finds MPI but the output is nonintuitive
# saying things like hdf5 or pthread
find_package( MPI REQUIRED COMPONENTS Fortran C )
add_compile_definitions(
Expand All @@ -336,7 +340,7 @@ if ( ${USE_MPI} )
endif()

# Check if MPI in all its glory has forced IPO down our throats due to hard-coding the wrapper flags
# https://www.open-mpi.org/faq/?category=mpi-apps#why-no-rpath LOL!
# https://www.open-mpi.org/faq/?category=mpi-apps#why-no-rpath LOL!
# Quote "The default installation of Open MPI tries very hard to not include any non-essential flags in the wrapper compilers"
# Okay, yea sure. Maybe it's the distro's lib config that does add all the bloatware flags
if ( NOT ${USE_IPO} )
Expand Down Expand Up @@ -374,7 +378,7 @@ if ( ${USE_OPENMP} )
endif()

if ( ${USE_M4} )
find_program(
find_program(
M4_PROGRAM
m4
REQUIRED
Expand Down Expand Up @@ -432,7 +436,7 @@ find_package( CURL REQUIRED )

################################################################################
##
## Print out final set of options to be used
## Print out final set of options to be used
## DO NOT MODIFY OPTIONS BEYOND THIS POINT
##
################################################################################
Expand All @@ -455,15 +459,15 @@ print_option( USE_OPENMP 20 )
print_option( USE_IPO 20 )

print_option( ENABLE_CHEM 20 )
print_option( ENABLE_CLM 20 )
print_option( ENABLE_CMAQ 20 )
print_option( ENABLE_KPP 20 )
print_option( ENABLE_DFI_RADAR 20 )
print_option( ENABLE_TITAN 20 )
print_option( ENABLE_HYDRO 20 )
print_option( ENABLE_KPP 20 )
print_option( ENABLE_MARS 20 )
print_option( ENABLE_VENUS 20 )
print_option( ENABLE_VENUS 20 )
print_option( ENABLE_TERRAIN 20 )
print_option( ENABLE_CLM 20 )
print_option( ENABLE_TITAN 20 )
print_option( ENABLE_VENUS 20 )

print_option( USE_ALLOCATABLES 20 )
print_option( wrfmodel 20 )
Expand Down Expand Up @@ -504,15 +508,15 @@ add_subdirectory( confcheck )
# Define compile options to be inherited for directories
define_property(
SOURCE
PROPERTY COMPILE_FLAGS
PROPERTY COMPILE_FLAGS
INHERITED
BRIEF_DOCS "brief-doc"
FULL_DOCS "full-doc"
)

define_property(
DIRECTORY
PROPERTY COMPILE_FLAGS
PROPERTY COMPILE_FLAGS
INHERITED
BRIEF_DOCS "brief-doc"
FULL_DOCS "full-doc"
Expand Down Expand Up @@ -589,14 +593,14 @@ add_compile_options(


# Whole project flags
add_compile_options(
add_compile_options(
# $<$<COMPILE_LANGUAGE:Fortran>:-cpp>
# Use "" and ; specifically to evaluate correctly
"$<$<COMPILE_LANG_AND_ID:Fortran,Intel>:-diag-disable;6843>"
$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:${CMAKE_Fortran_COMPILER_VERSION},10>>:-fallow-argument-mismatch>
$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:${CMAKE_Fortran_COMPILER_VERSION},10>>:-fallow-invalid-boz>
$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:${CMAKE_Fortran_COMPILER_VERSION},10>>:-ffree-line-length-none>

# $<AND:$<COMPILE_LANGUAGE:Fortran>,$<STREQUAL:${Fortran_COMPILER_ID},Intel>:-diag-disable;6843>
)

Expand Down Expand Up @@ -626,6 +630,7 @@ add_compile_definitions(
$<$<BOOL:${ENABLE_TITAN}>:WRF_TITAN=$<BOOL:${ENABLE_TITAN}>>
$<$<BOOL:${ENABLE_MARS}>:WRF_MARS=$<BOOL:${ENABLE_MARS}>>
$<$<BOOL:${ENABLE_VENUS}>:WRF_VENUS=$<BOOL:${ENABLE_VENUS}>>
$<$<BOOL:${ENABLE_HYDRO}>:WRF_HYDRO=$<BOOL:${ENABLE_HYDRO}>>

# Because once again we need two defines to control one thing
$<$<BOOL:${ENABLE_CTSM}>:WRF_USE_CTSM=$<BOOL:${ENABLE_CTSM}>>
Expand All @@ -642,11 +647,11 @@ add_compile_definitions(

# Could simplify logic to just check if RPC is available but to be explicit
# Does this actually need to check for EM_CORE (Config.pl:443)
# not enable terran or not rpc_found do
# not enable terran or not rpc_found do
# not ( enable terrain and rpc_found )
$<$<NOT:$<AND:$<BOOL:${ENABLE_TERRAIN}>,$<BOOL:${RPC_FOUND}>>>:LANDREAD_STUB>
$<$<BOOL:${ENABLE_TERRAIN}>:TERRAIN_AND_LANDUSE>


$<$<BOOL:${USE_ALLOCATABLES}>:USE_ALLOCATABLES>
$<$<BOOL:${wrfmodel}>:wrfmodel>
Expand All @@ -665,10 +670,10 @@ add_compile_definitions(
NMM_CORE=$<BOOL:${NMM_CORE}>
NMM_MAX_DIM=2600
NETCDF

#!TODO Change this to a confcheck
NONSTANDARD_SYSTEM_SUBR

EM_CORE=${EM_CORE}
WRFPLUS=$<BOOL:$<STREQUAL:${WRF_CORE},"PLUS">>
DA_CORE=$<BOOL:$<OR:$<STREQUAL:${WRF_CORE},"DA_CORE">,$<STREQUAL:${WRF_CORE},"DA_4D_VAR">>>
Expand Down Expand Up @@ -717,7 +722,7 @@ add_dependencies(
target_include_directories(
${PROJECT_NAME}_Core
PUBLIC
# List module directories first so the compiler does not get confused
# List module directories first so the compiler does not get confused
# about things "not being compiled yet" - yes, yes it is compiled
# These are already set up to be @ install location
$<TARGET_PROPERTY:esmf_time_f90,Fortran_MODULE_DIRECTORY>
Expand All @@ -729,7 +734,7 @@ target_include_directories(

$<TARGET_PROPERTY:${PROJECT_NAME}_Core,Fortran_MODULE_DIRECTORY>


$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/inc>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/frame>
Expand Down Expand Up @@ -782,6 +787,10 @@ if ( ${WRF_CHEM} )
add_subdirectory( chem )
endif()

if ( ${ENABLE_HYDRO} )
add_subdirectory( hydro )
endif()

add_subdirectory( dyn_em )


Expand All @@ -797,7 +806,7 @@ else()
endif()

# Configure core
set_target_properties(
set_target_properties(
${PROJECT_NAME}_Core
PROPERTIES
# Just dump everything in here
Expand Down Expand Up @@ -833,7 +842,7 @@ target_link_libraries( ${PROJECT_NAME}_Core

# "External" io libs
esmf_time_f90

io_grib1
grib1_util
MEL_grib1
Expand All @@ -842,6 +851,7 @@ target_link_libraries( ${PROJECT_NAME}_Core
io_grib_share
fftpack5

$<TARGET_NAME_IF_EXISTS:wrfhydro>
$<TARGET_NAME_IF_EXISTS:atm_ocn>
$<TARGET_NAME_IF_EXISTS:io_adios2>
$<TARGET_NAME_IF_EXISTS:io_esmf>
Expand All @@ -851,10 +861,10 @@ target_link_libraries( ${PROJECT_NAME}_Core
$<TARGET_NAME_IF_EXISTS:io_netcdfpar>
$<TARGET_NAME_IF_EXISTS:io_pnetcdf>
$<TARGET_NAME_IF_EXISTS:io_phdf5>

$<TARGET_NAME_IF_EXISTS:g2lib>
$<TARGET_NAME_IF_EXISTS:bacio-1.3>

$<TARGET_NAME_IF_EXISTS:RSL_LITE>
)

Expand Down Expand Up @@ -907,7 +917,7 @@ install(
${PROJECT_SOURCE_DIR}/cmake/modules/
COMPONENT helpers
DESTINATION share
FILES_MATCHING
FILES_MATCHING
PATTERN "*.cmake"
)
install(
Expand All @@ -918,4 +928,4 @@ install(
${PROJECT_SOURCE_DIR}/cmake/wrf_get_version.cmake
COMPONENT helpers
DESTINATION share
)
)

0 comments on commit 9e265af

Please sign in to comment.