diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c365d018b..f5b504549b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,18 +155,19 @@ set( USE_HDF5 OFF CACHE BOOL "USE_HDF5" ) set( USE_JASPER OFF CACHE BOOL "USE_JASPER" ) set( USE_PIO OFF CACHE BOOL "USE_PIO" ) set( USE_IPO OFF CACHE BOOL "USE_IPO" ) - - -set( ENABLE_CHEM OFF CACHE BOOL "ENABLE_CHEM" ) -set( ENABLE_CMAQ OFF CACHE BOOL "ENABLE_CMAQ" ) -set( ENABLE_CTSM OFF CACHE BOOL "ENABLE_CTSM" ) -set( ENABLE_DFI_RADAR OFF CACHE BOOL "ENABLE_DFI_RADAR" ) -set( ENABLE_HYDRO OFF CACHE BOOL "ENABLE_HYDRO" ) -set( ENABLE_KPP OFF CACHE BOOL "ENABLE_KPP" ) -set( ENABLE_MARS OFF CACHE BOOL "ENABLE_MARS" ) -set( ENABLE_TERRAIN OFF CACHE BOOL "ENABLE_TERRAIN" ) -set( ENABLE_TITAN OFF CACHE BOOL "ENABLE_TITAN" ) -set( ENABLE_VENUS OFF CACHE BOOL "ENABLE_VENUS" ) +set( USE_PNETCDF OFF CACHE BOOL "USE_PNETCDF" ) + +set( ENABLE_PNETCDF_QUILT OFF CACHE BOOL "ENABLE_PNETCDF_QUILT" ) +set( ENABLE_CHEM OFF CACHE BOOL "ENABLE_CHEM" ) +set( ENABLE_CMAQ OFF CACHE BOOL "ENABLE_CMAQ" ) +set( ENABLE_CTSM OFF CACHE BOOL "ENABLE_CTSM" ) +set( ENABLE_DFI_RADAR OFF CACHE BOOL "ENABLE_DFI_RADAR" ) +set( ENABLE_HYDRO OFF CACHE BOOL "ENABLE_HYDRO" ) +set( ENABLE_KPP OFF CACHE BOOL "ENABLE_KPP" ) +set( ENABLE_MARS OFF CACHE BOOL "ENABLE_MARS" ) +set( ENABLE_TERRAIN OFF CACHE BOOL "ENABLE_TERRAIN" ) +set( ENABLE_TITAN OFF CACHE BOOL "ENABLE_TITAN" ) +set( ENABLE_VENUS OFF CACHE BOOL "ENABLE_VENUS" ) # What do these defines even do if they are always on???? set( USE_ALLOCATABLES ON CACHE BOOL "USE_ALLOCATABLES" ) @@ -286,6 +287,16 @@ if ( NOT ${WRFIO_NCD_NO_LARGE_FILE_SUPPORT} ) message( STATUS "netCDF large file support not suppressed, if available it will be used" ) endif() +# PnetCDF options require MPI +if ( ${ENABLE_PNETCDF_QUILT} AND NOT ${USE_PNETCDF} ) + message( STATUS "PnetCDF Quilt IO requires PnetCDF" ) + set( USE_PNETCDF ON CACHE BOOL "Required by configuration" FORCE ) +endif() +if ( ${USE_PNETCDF} AND NOT ${USE_MPI} ) + message( STATUS "PnetCDF require MPI usage" ) + set( USE_MPI ON CACHE BOOL "Required by configuration" FORCE ) +endif() + # Hydro option requires MPI if ( ${ENABLE_HYDRO} AND NOT ${USE_MPI} ) message( STATUS "WRF Hydro requires MPI usage" ) @@ -521,6 +532,12 @@ endif() # Will need our own finder # find_package( GPFS REQUIRED ) +# Find this first in case we need to use pnetcdf's netCDF +# Priority is given to pnetcdf due to performance +if ( ${USE_PNETCDF} ) + find_package( PnetCDF REQUIRED ) +endif() + # Included is a lightweight finder, but we really should switch to using UniData's netCDF cmake config # The reason these are two separate and not COMPONENTS of one larger package is because that is the way UniData # has laid out the cmake configs for each respective package @@ -542,12 +559,10 @@ if ( NOT ${FORCE_NETCDF_CLASSIC} ) endif() endif() -find_package( pnetCDF QUIET ) # Attempt to find zlib packaged with netcdf first set( ZLIB_ROOT ${netCDF_PREFIX} ) find_package( ZLIB REQUIRED ) -find_package( CURL REQUIRED ) ################################################################################ ## @@ -763,6 +778,13 @@ else() list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS WRF_USE_CLM ) endif() +if ( ${PnetCDF_FOUND} ) + list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS PNETCDF ) +endif() +if ( ${ENABLE_PNETCDF_QUILT} ) + list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS PNETCDF_QUILT=1 ) +endif() + # If force classic or no nc-4 support enable classic if ( ${FORCE_NETCDF_CLASSIC} OR ( NOT ${netCDF_HAS_NC4} ) ) list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS NETCDF_classic=1 ) @@ -1075,7 +1097,6 @@ target_include_directories( ${PROJECT_SOURCE_DIR}/external/io_int # Found Packages not handled through :: imported target - ${pnetCDF_INCLUDE_DIRS} ) # Configure core @@ -1093,8 +1114,8 @@ target_link_options( ${PROJECT_NAME}_Core PRIVATE ${WRF_LINK_FLAGS} ) target_link_libraries( ${PROJECT_NAME}_Core PUBLIC - netCDF::netcdff - ${pnetCDF_LIBRARIES} + $ + $ $<$:$> $<$:$> # This will add in target dependencies if they exist diff --git a/cmake/modules/FindPnetCDF.cmake b/cmake/modules/FindPnetCDF.cmake new file mode 100644 index 0000000000..638067a900 --- /dev/null +++ b/cmake/modules/FindPnetCDF.cmake @@ -0,0 +1,156 @@ +# Find pnetcdf +# Eventually replace with PnetCDF's actual config if using that +# Once found this file will define: +# PnetCDF_FOUND - System has pnetcdf +# PnetCDF_INCLUDE_DIRS - The pnetcdf include directories +# PnetCDF_LIBRARIES - The libraries needed to use pnetcdf +# PnetCDF_DEFINITIONS - Compiler switches required for using pnetcdf + +# list( REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ) +# find_package( PnetCDF ) +# list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ) + + +# exit early if we don't even need to be here +if ( PnetCDF_FOUND ) + return() +endif() + +# Use pnetcdf-config +find_program( + PNETCDF_PROGRAM + pnetcdf-config + QUIET + ) + +if ( ${PNETCDF_PROGRAM} MATCHES "-NOTFOUND$" ) + message( STATUS "No pnetcdf-config found" ) +else() + message( STATUS "Found PNETCDF_PROGRAM : ${PNETCDF_PROGRAM}" ) + + execute_process( COMMAND ${PNETCDF_PROGRAM} --includedir OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_INCLUDE_DIR ) + execute_process( COMMAND ${PNETCDF_PROGRAM} --prefix OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_PREFIX ) + execute_process( COMMAND ${PNETCDF_PROGRAM} --libdir OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_LIBDIR ) + execute_process( COMMAND ${PNETCDF_PROGRAM} --version OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_VERSION_RAW ) + + # These are what PnetCDF was built with + execute_process( COMMAND ${PNETCDF_PROGRAM} --ldflags OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_LDFLAGS ) + execute_process( COMMAND ${PNETCDF_PROGRAM} --libs OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_BUILD_LIBS ) + + # Sanitize version + string( REPLACE " " ";" PnetCDF_VERSION_LIST ${PnetCDF_VERSION_RAW} ) + list( GET PnetCDF_VERSION_LIST -1 PnetCDF_VERSION ) + + # These do not pull all options available from nc-config out, but rather mirrors what is available from PnetCDFConfig.cmake.in + set( + PnetCDF_QUERY_YES_OPTIONS + has-c++ + has-fortran + netcdf4 + adios + ) + + foreach( PN_QUERY ${PnetCDF_QUERY_YES_OPTIONS} ) + string( REPLACE "has-" "" PN_QUERY_FILTERED ${PN_QUERY} ) + execute_process( COMMAND ${PNETCDF_PROGRAM} --${PN_QUERY} OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PnetCDF_${PN_QUERY_FILTERED}_LOWERCASE ) + if ( "${PnetCDF_${PN_QUERY_FILTERED}_LOWERCASE}" STREQUAL "" ) + # might be empty + set( PnetCDF_${PN_QUERY_FILTERED}_LOWERCASE no ) + endif() + + string( TOUPPER ${PN_QUERY_FILTERED} PN_QUERY_UPPERCASE ) + string( TOUPPER ${PnetCDF_${PN_QUERY_FILTERED}_LOWERCASE} PN_ANSWER_UPPERCASE ) + + set( PN_QUERY_YES_RESPONSE YES ENABLED ) + list( FIND PN_QUERY_YES_RESPONSE ${PN_ANSWER_UPPERCASE} PN_FIND_ANSWER ) + if ( ${PN_FIND_ANSWER} EQUAL -1 ) + set( PN_ANSWER_UPPERCASE NO ) + else() + set( PN_ANSWER_UPPERCASE YES ) + endif() + + # Convert to PnetCDF_HAS_* = YES/NO - Note this cannot be generator expression if you want to use it during configuration time + set( PnetCDF_HAS_${PN_QUERY_UPPERCASE} ${PN_ANSWER_UPPERCASE} ) + endforeach() + + # Because we may need this for in-situ manual preprocessing do not use genex + set( PnetCDF_INCLUDE_DIRS ${PnetCDF_INCLUDE_DIR} ) + + # Find the actual name of the library + find_library( + PnetCDF_LIBRARY + pnetcdf + PATHS ${PnetCDF_LIBDIR} + NO_DEFAULT_PATH + ) + + set( PnetCDF_DEFINITIONS ) + set( PnetCDF_LIBRARIES ${PnetCDF_LIBRARY} ) +endif() + +include(FindPackageHandleStandardArgs) + +# handle the QUIETLY and REQUIRED arguments and set PnetCDF_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args( + PnetCDF + FOUND_VAR PnetCDF_FOUND + REQUIRED_VARS + PnetCDF_INCLUDE_DIRS + PnetCDF_LIBRARIES + PnetCDF_VERSION + VERSION_VAR PnetCDF_VERSION + HANDLE_VERSION_RANGE + ) + +if ( PnetCDF_FOUND AND NOT TARGET PnetCDF::pnetcdf ) + if ( ${PnetCDF_HAS_NETCDF4} ) + list( APPEND CMAKE_MESSAGE_INDENT " " ) + if ( NOT "${PnetCDF_LDFLAGS}" STREQUAL "" ) + # Find prefix + message( STATUS "Looking for netCDF location provided by ${PNETCDF_PROGRAM}") + foreach( PNETCDF_BUILD_LINK_DIR ${PnetCDF_LDFLAGS} ) + string( REGEX MATCH "^-L([^ ]*)" PN_LIBRARY_LINK_LOCATION_TMP ${PNETCDF_BUILD_LINK_DIR} ) + if ( NOT "${PN_LIBRARY_LINK_LOCATION_TMP}" STREQUAL "" ) + message( STATUS "Searching ${PN_LIBRARY_LINK_LOCATION_TMP}..." ) + set( PN_LIBRARY_LINK_DIR ${CMAKE_MATCH_1} ) + find_library( + netCDF_LIBRARY_FOR_PNETCDF + netcdf + PATHS ${PN_LIBRARY_LINK_DIR} + NO_DEFAULT_PATH + ) + if ( NOT "${netCDF_LIBRARY_FOR_PNETCDF}" MATCHES "-NOTFOUND$" ) + string( REGEX REPLACE "/(lib|lib64)$" "" netCDF_ROOT ${PN_LIBRARY_LINK_DIR} ) + message( STATUS "Using ${netCDF_ROOT} as prefix for netCDF requirements of PnetCDF" ) + break() + endif() # found netcdf location + endif() # found valid link library location + endforeach() # looped over ldflags built with + endif() # see if we should use the built-with ldflags + list( POP_BACK CMAKE_MESSAGE_INDENT ) + find_package( netCDF REQUIRED ) + endif() + + set( PNETCDF_LINK_INTERFACE_LANGUAGES ) + list( APPEND PNETCDF_LINK_INTERFACE_LANGUAGES C ) + if ( ${PnetCDF_HAS_CXX} ) + list( APPEND PNETCDF_LINK_INTERFACE_LANGUAGES CXX ) + endif() + if( ${PnetCDF_HAS_FORTRAN} ) + list( APPEND PNETCDF_LINK_INTERFACE_LANGUAGES Fortran ) + endif() + add_library( PnetCDF::pnetcdf UNKNOWN IMPORTED ) + set_target_properties( + PnetCDF::pnetcdf + PROPERTIES + IMPORTED_LOCATION "${PnetCDF_LIBRARY}" + IMPORTED_LINK_INTERFACE_LANGUAGES "${PNETCDF_LINK_INTERFACE_LANGUAGES}" + INTERFACE_INCLUDE_DIRECTORIES "${PnetCDF_INCLUDE_DIRS}" + ) + if ( ${PnetCDF_HAS_NETCDF4} ) + target_link_libraries( PnetCDF::pnetcdf INTERFACE netCDF::netcdf ) + endif() +endif() + +mark_as_advanced( PnetCDF_FLIBS PnetCDF_PREFIX PnetCDF_LIBRARY_DIR ) diff --git a/cmake/modules/FindpnetCDF.cmake b/cmake/modules/FindpnetCDF.cmake deleted file mode 100644 index 3606b94ba2..0000000000 --- a/cmake/modules/FindpnetCDF.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# Find pnetcdf -# Eventually replace with pnetCDF's actual config if using that -# Once found this file will define: -# pnetCDF_FOUND - System has pnetcdf -# pnetCDF_INCLUDE_DIRS - The pnetcdf include directories -# pnetCDF_LIBRARIES - The libraries needed to use pnetcdf -# pnetCDF_DEFINITIONS - Compiler switches required for using pnetcdf - -# list( REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ) -# find_package( pnetCDF ) -# list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ) - -# Use pnetcdf-config -find_program( - PNETCDF_PROGRAM - pnetcdf-config - QUIET - ) - -if ( ${PNETCDF_PROGRAM} MATCHES "-NOTFOUND$" ) - message( STATUS "No pnetcdf-config found : ${PNETCDF_PROGRAM}" ) -else() - message( STATUS "Found PNETCDF_PROGRAM : ${PNETCDF_PROGRAM}" ) - - execute_process( COMMAND ${PNETCDF_PROGRAM} --includedir OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_INCLUDE_DIR ) - execute_process( COMMAND ${PNETCDF_PROGRAM} --libdir OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_LIBRARY_DIR ) - execute_process( COMMAND ${PNETCDF_PROGRAM} --prefix OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_PREFIX ) - execute_process( COMMAND ${PNETCDF_PROGRAM} --version OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_VERSION_RAW ) - execute_process( COMMAND ${PNETCDF_PROGRAM} --netcdf4 OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_NC4_ENABLED ) - - execute_process( COMMAND ${PNETCDF_PROGRAM} --has-c++ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_CXX_YES ) - execute_process( COMMAND ${PNETCDF_PROGRAM} --has-fortran OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE pnetCDF_FORTRAN_YES ) - - # check for large file support - find_file( pnetCDF_INCLUDE_FILE pnetcdf.inc ${pnetCDF_INCLUDE_DIR} ) - file( READ ${pnetCDF_INCLUDE_FILE} pnetCDF_INCLUDE_FILE_STR ) - string( FIND "${pnetCDF_INCLUDE_FILE_STR}" "nf_format_64bit" pnetCDF_LARGE_FILE_SUPPORT_FOUND ) - if ( ${pnetCDF_LARGE_FILE_SUPPORT_FOUND} EQUAL -1 ) - set( pnetCDF_LARGE_FILE_SUPPORT "NO" ) - else() - set( pnetCDF_LARGE_FILE_SUPPORT "YES" ) - endif() - - # Sanitize version - string( REPLACE " " ";" pnetCDF_VERSION_LIST ${pnetCDF_VERSION_RAW} ) - list( GET pnetCDF_VERSION_LIST -1 pnetCDF_VERSION ) - - # Note that pnetCDF has decided to change things up and use "disabled" instead of "yes/no" - string( TOLOWER ${pnetCDF_NC4_ENABLED} pnetCDF_NC4_ENABLED ) - if ( ${pnetCDF_NC4_ENABLED} STREQUAL "enabled" ) - set( pnetCDF_NC4 "YES" ) - else() - set( pnetCDF_NC4 "NO" ) - endif() - - string( TOUPPER ${pnetCDF_CXX_YES} pnetCDF_CXX ) - string( TOUPPER ${pnetCDF_FORTRAN_YES} pnetCDF_FORTRAN ) - - - set( pnetCDF_DEFINITIONS ) - - # Find libraries - find_library( - pnetCDF_LIBRARY - NAMES pnetcdf - # Hints before PATHS - HINTS ${pnetCDF_LIBRARY_DIR} - NO_DEFAULT_PATH - ) - - - set( pnetCDF_LIBRARIES - $<$:${pnetCDF_LIBRARY}> - $<$:$<$:${pnetCDF_LIBRARY}>> - $<$:$<$:${pnetCDF_LIBRARY}>> - ) - set( pnetCDF_INCLUDE_DIRS ${pnetCDF_INCLUDE_DIR} ) -endif() -find_package( PkgConfig ) -include(FindPackageHandleStandardArgs) - -# handle the QUIETLY and REQUIRED arguments and set pnetCDF_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args( pnetCDF DEFAULT_MSG - pnetCDF_INCLUDE_DIRS - pnetCDF_LIBRARIES - pnetCDF_VERSION - ) - -# mark_as_advanced( pnetCDF_CLIBS pnetCDF_CXXLIBS pnetCDF_FLIBS ) \ No newline at end of file diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index a1fed0df77..3cf4471b19 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -59,7 +59,7 @@ if ( ${netCDF_HAS_PARALLEL} AND ${USE_MPI} ) add_subdirectory( io_netcdfpar ) endif() -if ( ${pnetCDF_FOUND} ) +if ( ${PnetCDF_FOUND} ) message( STATUS "Adding [io_pnetcdf] to configuration" ) add_subdirectory( io_pnetcdf ) endif() diff --git a/external/io_pnetcdf/CMakeLists.txt b/external/io_pnetcdf/CMakeLists.txt index 8c7c138233..81d420154c 100644 --- a/external/io_pnetcdf/CMakeLists.txt +++ b/external/io_pnetcdf/CMakeLists.txt @@ -18,19 +18,18 @@ set_target_properties( target_link_libraries( ${FOLDER_COMPILE_TARGET} PRIVATE - ${netCDF_LIBRARIES} - ${pnetCDF_LIBRARIES} $<$:$> $<$:$> + PnetCDF::pnetcdf ) target_include_directories( ${FOLDER_COMPILE_TARGET} + PUBLIC + $ + $ + $ PRIVATE - ${netCDF_INCLUDE_DIRS} - ${pnetCDF_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../ioapi_share - ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET} ) diff --git a/external/io_pnetcdf/ext_pnc_get_dom_ti.code b/external/io_pnetcdf/ext_pnc_get_dom_ti.code index 3722fab352..aae048e860 100644 --- a/external/io_pnetcdf/ext_pnc_get_dom_ti.code +++ b/external/io_pnetcdf/ext_pnc_get_dom_ti.code @@ -38,7 +38,7 @@ use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element TYPE_DATA diff --git a/external/io_pnetcdf/ext_pnc_get_var_td.code b/external/io_pnetcdf/ext_pnc_get_var_td.code index 99aced5f0d..9762d94d70 100644 --- a/external/io_pnetcdf/ext_pnc_get_var_td.code +++ b/external/io_pnetcdf/ext_pnc_get_var_td.code @@ -37,7 +37,7 @@ use wrf_data_pnc use ext_pnc_support_routines implicit none -# include "pnetcdf.inc" + include "pnetcdf.inc" include 'wrf_status_codes.h' integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element diff --git a/external/io_pnetcdf/ext_pnc_get_var_ti.code b/external/io_pnetcdf/ext_pnc_get_var_ti.code index 4f82eb2902..a659659331 100644 --- a/external/io_pnetcdf/ext_pnc_get_var_ti.code +++ b/external/io_pnetcdf/ext_pnc_get_var_ti.code @@ -38,7 +38,7 @@ use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element character*(*) ,intent(in) :: Var diff --git a/external/io_pnetcdf/ext_pnc_put_dom_ti.code b/external/io_pnetcdf/ext_pnc_put_dom_ti.code index a86f5c23dd..b9ad88a2c7 100644 --- a/external/io_pnetcdf/ext_pnc_put_dom_ti.code +++ b/external/io_pnetcdf/ext_pnc_put_dom_ti.code @@ -38,7 +38,7 @@ use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element TYPE_DATA diff --git a/external/io_pnetcdf/ext_pnc_put_var_td.code b/external/io_pnetcdf/ext_pnc_put_var_td.code index 544f190a8e..16bab06a43 100644 --- a/external/io_pnetcdf/ext_pnc_put_var_td.code +++ b/external/io_pnetcdf/ext_pnc_put_var_td.code @@ -38,7 +38,7 @@ use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element character*(*) ,intent(in) :: DateStr diff --git a/external/io_pnetcdf/ext_pnc_put_var_ti.code b/external/io_pnetcdf/ext_pnc_put_var_ti.code index 31a48b317a..baa6f6890e 100644 --- a/external/io_pnetcdf/ext_pnc_put_var_ti.code +++ b/external/io_pnetcdf/ext_pnc_put_var_ti.code @@ -38,7 +38,7 @@ use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Element character*(*) ,intent(in) :: Var diff --git a/external/io_pnetcdf/wrf_io.F90 b/external/io_pnetcdf/wrf_io.F90 index 9d9c3733b4..ff36d104b3 100644 --- a/external/io_pnetcdf/wrf_io.F90 +++ b/external/io_pnetcdf/wrf_io.F90 @@ -359,7 +359,7 @@ end subroutine GetName subroutine GetTimeIndex(IO,DataHandle,DateStr,TimeIndex,Status) use wrf_data_pnc include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character (*) ,intent(in) :: IO integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: DateStr @@ -643,7 +643,7 @@ end subroutine UpperCase subroutine netcdf_err(err,Status) use wrf_data_pnc include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: err integer ,intent(out) :: Status character(len=80) :: errmsg @@ -664,7 +664,7 @@ subroutine FieldIO(IO,DataHandle,DateStr,Starts,Length,MemoryOrder & ,FieldType,NCID,VarID,XField,Status) use wrf_data_pnc include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character (*) ,intent(in) :: IO integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: DateStr @@ -895,7 +895,7 @@ subroutine ext_pnc_open_for_read(DatasetName, Comm1, Comm2, SysDepInfo, DataHand use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character *(*), INTENT(IN) :: DatasetName integer , INTENT(IN) :: Comm1, Comm2 character *(*), INTENT(IN) :: SysDepInfo @@ -916,7 +916,7 @@ subroutine ext_pnc_open_for_read_commit(DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer, intent(in) :: DataHandle integer, intent(out) :: Status type(wrf_data_handle) ,pointer :: DH @@ -944,7 +944,7 @@ subroutine ext_pnc_open_for_read_begin( FileName, Comm, IOComm, SysDepInfo, Data use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character*(*) ,intent(IN) :: FileName integer ,intent(IN) :: Comm integer ,intent(IN) :: IOComm @@ -1077,7 +1077,7 @@ subroutine ext_pnc_open_for_update( FileName, Comm, IOComm, SysDepInfo, DataHand use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character*(*) ,intent(IN) :: FileName integer ,intent(IN) :: Comm integer ,intent(IN) :: IOComm @@ -1211,7 +1211,7 @@ SUBROUTINE ext_pnc_open_for_write_begin(FileName,Comm,IOComm,SysDepInfo,DataHand use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character*(*) ,intent(in) :: FileName integer ,intent(in) :: Comm integer ,intent(in) :: IOComm @@ -1328,7 +1328,7 @@ subroutine ext_pnc_open_for_write (DatasetName, Comm1, Comm2, & use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" character *(*), intent(in) ::DatasetName integer , intent(in) ::Comm1, Comm2 character *(*), intent(in) ::SysDepInfo @@ -1344,7 +1344,7 @@ SUBROUTINE ext_pnc_open_for_write_commit(DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle),pointer :: DH @@ -1380,7 +1380,7 @@ subroutine ext_pnc_ioclose(DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle),pointer :: DH @@ -1430,7 +1430,7 @@ subroutine ext_pnc_iosync( DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle),pointer :: DH @@ -1477,7 +1477,7 @@ subroutine ext_pnc_redef( DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle),pointer :: DH @@ -1525,7 +1525,7 @@ subroutine ext_pnc_enddef( DataHandle, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle),pointer :: DH @@ -1618,7 +1618,7 @@ subroutine ext_pnc_ioexit(Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer , INTENT(INOUT) ::Status integer :: error type(wrf_data_handle),pointer :: DH @@ -2307,7 +2307,7 @@ subroutine ext_pnc_write_field(DataHandle,DateStr,Var,Field,FieldType,Comm, & use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: DateStr character*(*) ,intent(in) :: Var @@ -2629,7 +2629,7 @@ subroutine ext_pnc_read_field(DataHandle,DateStr,Var,Field,FieldType,Comm, & use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: DateStr character*(*) ,intent(in) :: Var @@ -3075,7 +3075,7 @@ subroutine ext_pnc_get_next_var(DataHandle, VarName, Status) use ext_pnc_support_routines implicit none include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle character*(*) ,intent(out) :: VarName integer ,intent(out) :: Status @@ -3122,7 +3122,7 @@ subroutine ext_pnc_end_of_frame(DataHandle, Status) use wrf_data_pnc use ext_pnc_support_routines implicit none -# include "pnetcdf.inc" + include "pnetcdf.inc" include 'wrf_status_codes.h' integer ,intent(in) :: DataHandle integer ,intent(out) :: Status @@ -3138,7 +3138,7 @@ subroutine ext_pnc_get_var_info(DataHandle,Name,NDim,MemoryOrder,Stagger,DomainS use wrf_data_pnc use ext_pnc_support_routines implicit none -# include "pnetcdf.inc" + include "pnetcdf.inc" include 'wrf_status_codes.h' integer ,intent(in) :: DataHandle character*(*) ,intent(in) :: Name @@ -3284,7 +3284,7 @@ subroutine ext_pnc_warning_str( Code, ReturnString, Status) use wrf_data_pnc use ext_pnc_support_routines implicit none -# include "pnetcdf.inc" + include "pnetcdf.inc" include 'wrf_status_codes.h' integer , intent(in) ::Code @@ -3480,7 +3480,7 @@ subroutine ext_pnc_error_str( Code, ReturnString, Status) use wrf_data_pnc use ext_pnc_support_routines implicit none -# include "pnetcdf.inc" + include "pnetcdf.inc" include 'wrf_status_codes.h' integer , intent(in) ::Code @@ -3528,7 +3528,7 @@ subroutine ext_pnc_end_independent_mode(DataHandle, Status) use wrf_data_pnc use ext_pnc_support_routines include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle) ,pointer :: DH @@ -3551,7 +3551,7 @@ subroutine ext_pnc_start_independent_mode(DataHandle, Status) use wrf_data_pnc use ext_pnc_support_routines include 'wrf_status_codes.h' -# include "pnetcdf.inc" + include "pnetcdf.inc" integer ,intent(in) :: DataHandle integer ,intent(out) :: Status type(wrf_data_handle) ,pointer :: DH