@@ -150,6 +150,7 @@ set( USE_HDF5 OFF CACHE BOOL "USE_HDF5" )
150150set ( USE_JASPER OFF CACHE BOOL "USE_JASPER" )
151151set ( USE_PIO OFF CACHE BOOL "USE_PIO" )
152152set ( USE_IPO OFF CACHE BOOL "USE_IPO" )
153+ set ( USE_PNETCDF OFF CACHE BOOL "USE_PNETCDF" )
153154
154155set ( ENABLE_PNETCDF_QUILT OFF CACHE BOOL "ENABLE_PNETCDF_QUILT" )
155156set ( ENABLE_CHEM OFF CACHE BOOL "ENABLE_CHEM" )
@@ -274,8 +275,12 @@ if ( NOT ${WRFIO_NCD_NO_LARGE_FILE_SUPPORT} )
274275endif ()
275276
276277# PnetCDF options require MPI
277- if ( ${ENABLE_PNETCDF_QUILT} AND NOT ${USE_MPI} )
278- message ( STATUS "PnetCDF features require MPI usage" )
278+ if ( ${ENABLE_PNETCDF_QUILT} AND NOT ${USE_PNETCDF} )
279+ message ( STATUS "PnetCDF Quilt IO requires PnetCDF" )
280+ set ( USE_PNETCDF ON CACHE BOOL "Required by configuration" FORCE )
281+ endif ()
282+ if ( ${USE_PNETCDF} AND NOT ${USE_MPI} )
283+ message ( STATUS "PnetCDF require MPI usage" )
279284 set ( USE_MPI ON CACHE BOOL "Required by configuration" FORCE )
280285endif ()
281286
@@ -483,8 +488,8 @@ endif()
483488
484489# Find this first in case we need to use pnetcdf's netCDF
485490# Priority is given to pnetcdf due to performance
486- if ( ${USE_MPI } )
487- find_package ( PnetCDF QUIET )
491+ if ( ${USE_PNETCDF } )
492+ find_package ( PnetCDF REQUIRED )
488493endif ()
489494
490495# Included is a lightweight finder, but we really should switch to using UniData's netCDF cmake config
0 commit comments