Skip to content

Commit a443f40

Browse files
committed
Make SMIOL the default I/O layer when running cmake.
The default I/O layer when building MPAS-Model via cmake used to be PIO, but when building via make SMIOL is the default I/O layer. This change makes SMIOL the default I/O layer when building via cmake. The cmake variable MPAS_USE_SMIOL is changed to be MPAS_USE_PIO. The default value of MPAS_USE_PIO is OFF. To build with the PIO library run cmake with -DMPAS_USE_PIO=ON.
1 parent 37aa961 commit a443f40

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ option(MPAS_DOUBLE_PRECISION "Use double precision 64-bit Floating point." TRUE)
2121
option(MPAS_PROFILE "Enable GPTL profiling" OFF)
2222
option(MPAS_OPENMP "Enable OpenMP" OFF)
2323
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
24-
option(MPAS_USE_SMIOL "Build with smiol I/O library" OFF)
24+
option(MPAS_USE_PIO "Build with PIO I/O library" OFF)
2525

2626
message(STATUS "[OPTION] MPAS_CORES: ${MPAS_CORES}")
2727
message(STATUS "[OPTION] MPAS_DOUBLE_PRECISION: ${MPAS_DOUBLE_PRECISION}")
2828
message(STATUS "[OPTION] MPAS_PROFILE: ${MPAS_PROFILE}")
2929
message(STATUS "[OPTION] MPAS_OPENMP: ${MPAS_OPENMP}")
3030
message(STATUS "[OPTION] BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
31-
message(STATUS "[OPTION] MPAS_USE_SMIOL: ${MPAS_USE_SMIOL}")
31+
message(STATUS "[OPTION] MPAS_USE_PIO: ${MPAS_USE_PIO}")
3232

3333
# Build product output locations
3434
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -61,7 +61,7 @@ find_package(OpenMP COMPONENTS Fortran)
6161
find_package(MPI REQUIRED COMPONENTS Fortran)
6262
find_package(NetCDF REQUIRED COMPONENTS Fortran C)
6363
find_package(PnetCDF REQUIRED COMPONENTS Fortran)
64-
if(NOT MPAS_USE_SMIOL)
64+
if(MPAS_USE_PIO)
6565
find_package(PIO REQUIRED COMPONENTS Fortran C)
6666
endif()
6767
if(MPAS_PROFILE)
@@ -92,7 +92,7 @@ set(MPAS_SUBDRIVER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/driver/mpas_subdriver.F)
9292

9393
## Create targets
9494
add_subdirectory(src/external/ezxml) # Target: MPAS::external::ezxml
95-
if(MPAS_USE_SMIOL)
95+
if(NOT MPAS_USE_PIO)
9696
add_subdirectory(src/external/SMIOL) # Target: MPAS::external::smiol
9797
endif()
9898
if(ESMF_FOUND)

cmake/Functions/MPAS_Functions.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ function(mpas_fortran_target target)
8080

8181
# Global Fortran configuration
8282
set_target_properties(${target} PROPERTIES Fortran_FORMAT FREE)
83-
if(MPAS_USE_SMIOL)
83+
if(MPAS_USE_PIO)
8484
set(MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
85-
MPAS_SMIOL_SUPPORT=1
85+
USE_PIO2=1
8686
)
8787
else()
8888
set(MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
89-
USE_PIO2=1
89+
MPAS_SMIOL_SUPPORT=1
9090
)
9191
endif()
9292
list(APPEND MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS _MPI=1)

src/framework/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ set_MPAS_DEBUG_flag(framework)
4141
set(FRAMEWORK_COMPILE_DEFINITIONS
4242
mpas=1
4343
MPAS_NATIVE_TIMERS)
44-
if (MPAS_USE_SMIOL)
45-
list(APPEND FRAMEWORK_COMPILE_DEFINITIONS MPAS_SMIOL_SUPPORT)
46-
set(IO_LIBS
47-
${PROJECT_NAME}::external::smiolf)
48-
else()
44+
if (MPAS_USE_PIO)
4945
list(APPEND FRAMEWORK_COMPILE_DEFINITIONS USE_PIO2 MPAS_PIO_SUPPORT)
5046
set(IO_LIBS
5147
PIO::PIO_Fortran
5248
PIO::PIO_C)
49+
else()
50+
list(APPEND FRAMEWORK_COMPILE_DEFINITIONS MPAS_SMIOL_SUPPORT)
51+
set(IO_LIBS
52+
${PROJECT_NAME}::external::smiolf)
5353
endif()
5454
target_compile_definitions(framework PRIVATE ${FRAMEWORK_COMPILE_DEFINITIONS})
5555

0 commit comments

Comments
 (0)