find_path(PNETCDF_INCLUDE_DIR NAMES pnetcdf/pnetcdf.h)
find_library(PNETCDF_LIBRARY NAMES pnetcdf)

if(PNETCDF_INCLUDE_DIR AND PNETCDF_LIBRARY)
  set(PNETCDF_FOUND TRUE)
endif(PNETCDF_INCLUDE_DIR AND PNETCDF_LIBRARY)

if(PNETCDF_FOUND)
  if(NOT PNETCDF_FIND_QUIETLY)
    message(STATUS "Found PNETCDF: ${PNETCDF_LIBRARY}")
  endif(NOT PNETCDF_FIND_QUIETLY)
else(PNETCDF_FOUND)
  if(PNETCDF_FIND_REQUIRED)
    message(FATAL_ERROR "Could not find parallel-netcdf library.")
  endif(PNETCDF_FIND_REQUIRED)
endif(PNETCDF_FOUND)
