From 8f9e20c901f2c9e31d13503d403e21a506af6b4c Mon Sep 17 00:00:00 2001 From: "michael.lueken" Date: Mon, 11 Jul 2022 11:27:48 +0000 Subject: [PATCH] GitHub Issue NOAA-EMC/GSI#431. Replace ncdiag submodule with hpc-stack ncdiag/1.0.0. --- .gitmodules | 4 ---- CMakeLists.txt | 2 -- INSTALL.md | 2 +- modulefiles/gsi_common.lua | 2 ++ modulefiles/gsi_wcoss2.lua | 2 ++ src/CMakeLists.txt | 5 ----- src/enkf/cmake/PackageConfig.cmake.in | 2 +- src/gsi/CMakeLists.txt | 9 +-------- src/gsi/cmake/PackageConfig.cmake.in | 5 +---- src/ncdiag | 1 - 10 files changed, 8 insertions(+), 26 deletions(-) delete mode 160000 src/ncdiag diff --git a/.gitmodules b/.gitmodules index 2343fa0059..641f07f69e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ [submodule "fix"] path = fix url = gerrit:GSI-fix -[submodule "ncdiag"] - path = src/ncdiag - url = https://github.com/NOAA-EMC/GSI-ncdiag - branch = v1.0.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index d0bc4bca4c..8ec0bb414d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,6 @@ endif() # User options option(OPENMP "Enable OpenMP Threading" OFF) option(ENABLE_MKL "Use MKL for LAPACK implementation (if available)" ON) -option(BUILD_NCDIAG "Build GSI NetCDF Diagnostic Library" ON) option(BUILD_GSDCLOUD "Build GSD Cloud Analysis Library" OFF) option(BUILD_GSI "Build GSI" ON) option(BUILD_ENKF "Build EnKF" ON) @@ -37,7 +36,6 @@ option(BUILD_REG_TESTING "Build the Regression Testing Suite" OFF) # Echo user options message(STATUS "OPENMP ................. ${OPENMP}") message(STATUS "ENABLE_MKL ............. ${ENABLE_MKL}") -message(STATUS "BUILD_NCDIAG ........... ${BUILD_NCDIAG}") message(STATUS "BUILD_GSDCLOUD ......... ${BUILD_GSDCLOUD}") message(STATUS "BUILD_GSI .............. ${BUILD_GSI}") message(STATUS "BUILD_ENKF ............. ${BUILD_ENKF}") diff --git a/INSTALL.md b/INSTALL.md index 026f53d5cb..8e3187f603 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -40,6 +40,7 @@ NCEP Libraries (NCEPLibs) compiled with the same compiler and MPI library (where | SFCIO | 1.4.1 and above | | NEMSIO | 2.5.2 and above | | NCIO | 1.0.0 and above | +| NCDIAG | 1.0.0 and above | | WRF_IO | 1.2.0 and above | ### Building the GSI @@ -77,7 +78,6 @@ CMake allows for various options that can be specified on the command line via ` |---------------------|--------------------------------------------------------| | `OPENMP` | Enable OpenMP Threading (`OFF`) | | `ENABLE_MKL` | Use MKL (`ON`), If not found use LAPACK | -| `BUILD_NCDIAG` | Build GSI NetCDF Diagnostics Library (`ON`) | | `BUILD_GSDCLOUD` | Build GSD Cloud Library (`OFF`) | | `BUILD_GSI` | Build GSI library and executable (`ON`) | | `BUILD_ENKF` | Build EnKF library and executable (`ON`) | diff --git a/modulefiles/gsi_common.lua b/modulefiles/gsi_common.lua index 3fd4581154..06b3870d00 100644 --- a/modulefiles/gsi_common.lua +++ b/modulefiles/gsi_common.lua @@ -15,6 +15,7 @@ local nemsio_ver=os.getenv("nemsio_ver") or "2.5.2" local wrf_io_ver=os.getenv("wrf_io_ver") or "1.2.0" local ncio_ver=os.getenv("ncio_ver") or "1.1.2" local crtm_ver=os.getenv("crtm_ver") or "2.3.0" +local ncdiag_ver=os.getenv("ncdiag_ver") or "1.0.0" load(pathJoin("netcdf", netcdf_ver)) @@ -29,4 +30,5 @@ load(pathJoin("nemsio", nemsio_ver)) load(pathJoin("wrf_io", wrf_io_ver)) load(pathJoin("ncio", ncio_ver)) load(pathJoin("crtm", crtm_ver)) +load(pathJoin("ncdiag",ncdiag_ver)) diff --git a/modulefiles/gsi_wcoss2.lua b/modulefiles/gsi_wcoss2.lua index 50e8e5a478..63b67b2910 100644 --- a/modulefiles/gsi_wcoss2.lua +++ b/modulefiles/gsi_wcoss2.lua @@ -20,11 +20,13 @@ load(pathJoin("prod_util", prod_util_ver)) load("gsi_common") unload("ncio") +unload("ncdiag") pushenv("HPC_OPT", "/apps/ops/para/libs") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304") prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.7") load("ncio/1.1.2") +load("ncdiag/1.0.0") whatis("Description: GSI environment on WCOSS2") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04c58e2f67..a2eb249456 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,11 +3,6 @@ if(BUILD_GSDCLOUD) add_subdirectory(GSD) endif() -if(BUILD_NCDIAG) - message(STATUS "Building GSI NetCDF diagnostic library") - add_subdirectory(ncdiag) -endif() - if(BUILD_GSI) message(STATUS "Building GSI") add_subdirectory(gsi) diff --git a/src/enkf/cmake/PackageConfig.cmake.in b/src/enkf/cmake/PackageConfig.cmake.in index c4062dd09c..407f4b9b4d 100644 --- a/src/enkf/cmake/PackageConfig.cmake.in +++ b/src/enkf/cmake/PackageConfig.cmake.in @@ -11,7 +11,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-config-version.cmake") include(CMakeFindDependencyMacro) # Get the ENKF_MODE attribute --set(ENKF_MODE @ENKF_MODE@) +set(ENKF_MODE @ENKF_MODE@) find_dependency(MPI) find_dependency(NetCDF COMPONENTS Fortran) diff --git a/src/gsi/CMakeLists.txt b/src/gsi/CMakeLists.txt index 6d1273a39d..af94224c05 100644 --- a/src/gsi/CMakeLists.txt +++ b/src/gsi/CMakeLists.txt @@ -67,6 +67,7 @@ find_package(sigio REQUIRED) find_package(sfcio REQUIRED) find_package(nemsio REQUIRED) find_package(ncio REQUIRED) +find_package(ncdiag REQUIRED) find_package(sp REQUIRED) find_package(ip REQUIRED) find_package(w3emc REQUIRED) @@ -79,11 +80,6 @@ endif() # See https://github.com/NOAA-EMC/NCEPLIBS-nemsio/pull/22 target_link_libraries(nemsio::nemsio INTERFACE w3emc::w3emc_d bacio::bacio_4) -# NetCDF Diagnostic IO library dependency -if(NOT TARGET ncdiag) - find_package(ncdiag REQUIRED) -endif() - # GSD Cloud Analysis library dependency if(USE_GSDCLOUD) if(NOT TARGET gsdcloud) @@ -155,9 +151,6 @@ target_link_libraries(gsi_fortran_obj PUBLIC crtm::crtm) if(GSI_MODE MATCHES "Regional") target_link_libraries(gsi_fortran_obj PUBLIC wrf_io::wrf_io) endif() -if(TARGET ncdiag) - add_dependencies(gsi_fortran_obj ncdiag) -endif() target_link_libraries(gsi_fortran_obj PUBLIC ncdiag::ncdiag) if(USE_GSDCLOUD) if(TARGET gsdcloud) diff --git a/src/gsi/cmake/PackageConfig.cmake.in b/src/gsi/cmake/PackageConfig.cmake.in index 1c5816e2b6..48dfe7aa37 100644 --- a/src/gsi/cmake/PackageConfig.cmake.in +++ b/src/gsi/cmake/PackageConfig.cmake.in @@ -35,6 +35,7 @@ find_dependency(sigio REQUIRED) find_dependency(sfcio REQUIRED) find_dependency(nemsio REQUIRED) find_dependency(ncio REQUIRED) +find_dependency(ncdiag REQUIRED) find_dependency(sp REQUIRED) find_dependency(ip REQUIRED) find_dependency(w3emc REQUIRED) @@ -45,10 +46,6 @@ if(${GSI_MODE} MATCHES "Regional") find_dependency(wrf_io REQUIRED) endif() -# This gives more trouble since GSIApp is a nested project of projects -# and targets are built in the GSIApp project -#find_dependency(ncdiag REQUIRED) - # Get the build type from library target get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@ IMPORTED_CONFIGURATIONS) diff --git a/src/ncdiag b/src/ncdiag deleted file mode 160000 index ad714a4924..0000000000 --- a/src/ncdiag +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ad714a4924a437770fd266c75226fb2a848ed530