Skip to content

Commit

Permalink
CMake Prepare for alternate core selections (#2086)
Browse files Browse the repository at this point in the history
TYPE: enhancement

KEYWORDS: cmake, wrfplus, da

SOURCE: internal

DESCRIPTION OF CHANGES:
Problem:
The current CMake build only works with the em core / ARW in mind and
presents a non-intuitive selection when attempting other cores. While
these cores are not yet supported in the CMake build, remove these
selections sets up the configuration script to be able to present a
familiar set of options.

Solution:
Remove normally unselectable options from `configure_new` after
selecting non-ARW cores. Put in place stand-in values for these
unselected variables.
  • Loading branch information
islas authored Oct 14, 2024
1 parent cd8e545 commit f68f0b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ set( WRF_CASE_OPTIONS
EM_CONVRAD
EM_SQUALL2D_X
EM_SQUALL2D_Y

# No case selected, for situations where we are not compiling ARW
NONE
)

set( WRF_CASE "" CACHE STRING "WRF_CASE" )
Expand Down Expand Up @@ -220,6 +223,11 @@ if ( NOT ${WRF_CORE} IN_LIST WRF_CORE_OPTIONS )
message( FATAL_ERROR "WRF Core option not recognized : ${WRF_CORE}" )
endif()

if ( NOT ${WRF_CORE} STREQUAL "ARW" )
message( STATUS "All non-ARW Cores requires using pointers in grid state struct" )
set( USE_ALLOCATABLES OFF CACHE BOOL "Required by configuration" FORCE )
endif()

if ( NOT ${WRF_NESTING} IN_LIST WRF_NESTING_OPTIONS )
message( FATAL_ERROR "WRF Nesting option not recognized : ${WRF_NESTING}" )
endif()
Expand Down
8 changes: 6 additions & 2 deletions arch/configure_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,12 @@ def generateCMakeToolChainFile( cmakeToolChainTemplate, output, stanza, optionsD

def projectSpecificOptions( options, stanzaCfg ) :
coreOption = getStringOptionSelection( options.sourceCMakeFile, "WRF_CORE_OPTIONS", "WRF_CORE" )
nestingOption = getStringOptionSelection( options.sourceCMakeFile, "WRF_NESTING_OPTIONS", "WRF_NESTING", 1 )
caseOption = getStringOptionSelection( options.sourceCMakeFile, "WRF_CASE_OPTIONS", "WRF_CASE" )
if coreOption == "ARW" :
nestingOption = getStringOptionSelection( options.sourceCMakeFile, "WRF_NESTING_OPTIONS", "WRF_NESTING", 1 )
caseOption = getStringOptionSelection( options.sourceCMakeFile, "WRF_CASE_OPTIONS", "WRF_CASE" )
else :
nestingOption = "NONE"
caseOption = "NONE"

# These are yes
yesValues = [ "yes", "y", "true", "1" ]
Expand Down

0 comments on commit f68f0b9

Please sign in to comment.