Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Prepare for alternate core selections #2086

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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