Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
HaixiaLiu-NOAA authored Nov 10, 2021
2 parents 2f9dda9 + 2bcedcb commit 3273311
Show file tree
Hide file tree
Showing 1,002 changed files with 53,962 additions and 71,104 deletions.
53 changes: 29 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,38 @@ project(GSI)
option(BUILD_GLOBAL "Build GSI without WRF (regional) module " OFF)
option(BUILD_ENKF "Build the Enkf executable " ON)
option(USE_BASELINE "Use baseline control runs" ON)
SET(ENKF_MODE "GFS" CACHE STRING "EnKF build mode: GFS, WRF, NMMB")
SET(ENKF_MODE "GFS" CACHE STRING "EnKF build mode: GFS, WRF, NMMB, and FV3reg")
string(TOUPPER ${ENKF_MODE} ENKF_MODE)
if (ENKF_MODE MATCHES "^GFS$")
message("Build the EnKF with GFS module")
option(BUILD_GFS "Build the Enkf with GFS module " ON)
option(BUILD_NMMB "Build the Enkf with NMMB module " OFF)
option(BUILD_WRF "Build the Enkf with WRF module " OFF)
option(BUILD_FV3reg "Build the Enkf with FV3reg module " OFF)
elseif (ENKF_MODE MATCHES "^WRF$")
message("Build the EnKF with WRF module")
option(BUILD_GFS "Build the Enkf with GFS module " OFF)
option(BUILD_NMMB "Build the Enkf with NMMB module " OFF)
option(BUILD_WRF "Build the Enkf with WRF module " ON)
option(BUILD_FV3reg "Build the Enkf with FV3reg module " OFF)
elseif (ENKF_MODE MATCHES "^NMMB$")
message("Build the EnKF with NMMB module")
option(BUILD_GFS "Build the Enkf with GFS module " OFF)
option(BUILD_NMMB "Build the Enkf with NMMB module " ON)
option(BUILD_WRF "Build the Enkf with WRF module " OFF)
option(BUILD_FV3reg "Build the Enkf with FV3reg module " OFF)
elseif (ENKF_MODE MATCHES "^FV3REG$")
message("Build the EnKF with FV3reg module")
option(BUILD_GFS "Build the Enkf with GFS module " OFF)
option(BUILD_NMMB "Build the Enkf with NMMB module " OFF)
option(BUILD_WRF "Build the Enkf with WRF module " OFF)
option(BUILD_FV3reg "Build the Enkf with FV3reg module " ON)
else()
message("unkown ENKF_MODE: ${ENKF_MODE} !\nBuild the EnKF with GFS module by default")
option(BUILD_GFS "Build the Enkf with GFS module " ON)
option(BUILD_NMMB "Build the Enkf with NMMB module " OFF)
option(BUILD_WRF "Build the Enkf with WRF module " OFF)
option(BUILD_FV3reg "Build the Enkf with FV3reg module " OFF)
endif()
option(BUILD_UTIL "Build the Enkf utilities " OFF)

Expand Down Expand Up @@ -107,18 +117,14 @@ project(GSI)
endif(BUILD_REG_TESTING)

cmake_policy(SET CMP0009 NEW)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0074 NEW)
find_package(OpenMP)
message("found openmp with flag ${OPENMP_Fortran_FLAGS}")

# Set Host specific flags and options
setHOST()

if(FIND_HDF5_HL)
find_package(HDF5 COMPONENTS C HL)
elseif(FIND_HDF5)
find_package(HDF5)
endif()

MESSAGE(${CMAKE_CURRENT_SOURCE_DIR})
# make sure that the default is a RELEASE
if (NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -172,25 +178,18 @@ project(GSI)
if( USE_BASELIBS )
find_package(Baselibs REQUIRED)
else()
find_package( NetCDF REQUIRED)
if(NETCDF4)
if(CMAKE_MAJOR_VERSION GREATER 2)
find_package( ZLIB )
endif()
find_package( CURL )
endif()
find_package( NetCDF COMPONENTS C Fortran REQUIRED)
endif()
if(( NOT HOST-WCOSS_D ) AND ( NOT HOST-WCOSS_C ) AND ( NOT HOST-Gaea ) )
message(" trying to find lapack, ${host}")
find_package( LAPACK )
endif()
# build the WRF I/O libraries
if(DEFINED ENV{GSIWRF_LIB})
set(wrflib "$ENV{GSIWRF_LIB}" CACHE INTERNAL "WRFIO library" )
if(DEFINED ENV{WRF_IO_LIB})
set(wrflib "$ENV{WRF_IO_LIB}" CACHE INTERNAL "WRFIO library" )
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libsrc/wrflib)
add_subdirectory(libsrc/wrflib)
else()
message("libsrc/wrflib not pulled from git, looking for WRF dependencies locally")
message("libsrc/wrflib not pulled from git, looking for WRF dependencies locally")
find_package( WRF )
endif()
Expand All @@ -204,7 +203,7 @@ project(GSI)
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
set(CFLAGS "-I. -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 -Dfunder")
set (CMAKE_Fortran_INC_FLAGS "-I ./ -I ${CORE_INCS} -I ${NETCDF_INCLUDES} ")
set (CMAKE_Fortran_INC_FLAGS "-I ./ -I ${CORE_INCS} -I ${NETCDF_INCLUDE_DIRS} ")
set (CFLAGS_N "-I. -DFortranByte=char -DFortranInt=int -DFortranLlong='long long' -O3 -Dfunder")


Expand Down Expand Up @@ -271,12 +270,18 @@ project(GSI)
endif(BUILD_ENKF)
if(BUILD_UTIL)
add_subdirectory(util/EnKF/gfs/src)
add_subdirectory(util/Ozone_Monitor/nwprod/oznmon_shared.v2.0.0/sorc/oznmon_horiz.fd)
add_subdirectory(util/Ozone_Monitor/nwprod/oznmon_shared.v2.0.0/sorc/oznmon_time.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared.v3.0.0/sorc/verf_radang.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared.v3.0.0/sorc/verf_radbcoef.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared.v3.0.0/sorc/verf_radbcor.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared.v3.0.0/sorc/verf_radtime.fd)
add_subdirectory(util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_horiz.fd)
add_subdirectory(util/Ozone_Monitor/nwprod/oznmon_shared/sorc/oznmon_time.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radang.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcoef.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radbcor.fd)
add_subdirectory(util/Radiance_Monitor/nwprod/radmon_shared/sorc/verf_radtime.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sig.fd)
add_subdirectory(util/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd)
endif(BUILD_UTIL)
find_package( NDATE )
if( NOT NDATE )
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/FindBUFR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ endif()

set( NO_DEFAULT_PATH )
if(NOT BUILD_BUFR )
if(DEFINED ENV{BUFR_LIBd} )
set(BUFR_LIBRARY $ENV{BUFR_LIBd} )
if(DEFINED ENV{BUFR_LIBd_DA} )
set(BUFR_LIBRARY $ENV{BUFR_LIBd_DA} )
message("BUFR library ${BUFR_LIBRARY} set via Environment variable")
else()
find_library( BUFR_LIBRARY
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/FindCORELIBS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ else()
set( w3nco "w3nco${libsuffix}")
endif()
if(NOT BUILD_BUFR )
if(DEFINED ENV{BUFR_LIBd} )
set(BUFR_LIBRARY $ENV{BUFR_LIBd} )
if(DEFINED ENV{BUFR_LIBd_DA} )
set(BUFR_LIBRARY $ENV{BUFR_LIBd_DA} )
else()
find_library( BUFR_LIBRARY
NAMES libbufr.a libbufr_d_64.a libbufr_i4r8.a libbufr_v${BUFR_VER}_d_64.a
Expand Down
2 changes: 2 additions & 0 deletions cmake/Modules/FindGSICONTROL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ find_file( CONTROL_EXE
/gpfs/hps3/emc/da/noscrub/Michael.Lueken/svn1/build/bin
/gpfs/hps3/emc/da/noscrub/Michael.Lueken/svn1/src
/scratch1/NCEPDEV/da/Michael.Lueken/svn1/build/bin
/lfs1/NESDIS/nesdis-rdo2/David.Huber/save/gsi_control/exec

${NO_DEFAULT_PATH})

Expand All @@ -45,6 +46,7 @@ find_file( ENKF_CONTROL_EXE
/gpfs/hps3/emc/da/noscrub/Michael.Lueken/svn1/build/bin
/gpfs/hps3/emc/da/noscrub/Michael.Lueken/svn1/src/enkf
/scratch1/NCEPDEV/da/Michael.Lueken/svn1/build/bin
/lfs1/NESDIS/nesdis-rdo2/David.Huber/save/gsi_control/exec

${NO_DEFAULT_PATH})

Expand Down
Loading

0 comments on commit 3273311

Please sign in to comment.