Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cycle_noahmp
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Mar 1, 2023
2 parents 4e724bb + 26167e3 commit 0df4d60
Show file tree
Hide file tree
Showing 22 changed files with 267 additions and 181 deletions.
35 changes: 34 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,39 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# User options.
option(OPENMP "use OpenMP threading" ON)
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)

# Utilities to be built (Default: ALL)
option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON)
option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON)
option(GCYCLE "Enable building global_cycle.fd" ON)
option(FRENCTOOLS "Enable building fre-nctools.fd" ON)
option(GRIDTOOLS "Enable building grid_tools.fd" ON)
option(CHGRES "Enable building chgres_cube.fd" ON)
option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" ON)
option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON)
option(VCOORD_GEN "Enable building vcoord_gen.fd" ON)
option(FVCOMTOOLS "Enable building fvcom_tools.fd" ON)
option(GBLEVENTS "Enable building gblevents.fd" ON)
option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON)
option(WEIGHT_GEN "Enable building weight_gen.fd" ON)

# Option to build application specific utilities
option(GFS "Enable building GFS-only utilities" OFF)

# When building the GFS, the following need not be built
if(GFS)
message(STATUS "Building utilities specific to the GFS")
set(FRENCTOOLS OFF CACHE BOOL "Disable building fre-nctools.fd" FORCE)
set(GRIDTOOLS OFF CACHE BOOL "Disable building grid_tools.fd" FORCE)
set(OROG_MASK_TOOLS OFF CACHE BOOL "Disable building orog_mask_tools.fd" FORCE)
set(SFC_CLIMO_GEN OFF CACHE BOOL "Disable building sfc_climo_gen.fd" FORCE)
set(VCOORD_GEN OFF CACHE BOOL "Disable building vcoord_gen.fd" FORCE)
set(FVCOMTOOLS OFF CACHE BOOL "Disable building fvcom_tools.fd" FORCE)
set(GBLEVENTS OFF CACHE BOOL "Disable building gblevents.fd" FORCE)
set(CPLD_GRIDGEN OFF CACHE BOOL "Disable building cpld_gridgen.fd" FORCE)
set(WEIGHT_GEN OFF CACHE BOOL "Disable building weight_gen.fd" FORCE)
endif()

SET(TEST_FILE_DIR "." CACHE STRING "Check this directory for test files before using FTP.")

# Set the build type.
Expand Down Expand Up @@ -80,7 +113,7 @@ find_package(sigio 2.3.0 REQUIRED)
if(ENABLE_DOCS)
find_package(Doxygen REQUIRED)
set(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
add_subdirectory(docs)
add_subdirectory(docs)
endif()

add_subdirectory(sorc)
Expand Down
17 changes: 6 additions & 11 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,21 @@ else
set -x
fi


# The unit test data download is part of the build system. Not all machines can
# access the EMC ftp site, so turn off the build (-DBUILD_TESTING=OFF) of the units tests accordingly.
# Those with access to the EMC ftp site are: Orion and Hera.

if [[ "$target" == "hera" || "$target" == "orion" || "$target" == "wcoss2" ]]; then
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=ON"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DENABLE_DOCS=ON -DBUILD_TESTING=ON"
else
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DENABLE_DOCS=ON -DBUILD_TESTING=OFF"
fi
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"

# Allow users of this script to provide CMake options e.g. -DGFS=ON|OFF to build GFS specific utilities only
CMAKE_OPTS=${CMAKE_OPTS:-}

rm -fr ./build
mkdir ./build && cd ./build

cmake .. ${CMAKE_FLAGS}
cmake .. ${CMAKE_FLAGS} ${CMAKE_OPTS}

make -j 8 VERBOSE=1
make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-}
make install

#ctest
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/build.hera.gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ load(pathJoin("bacio", bacio_ver))
g2_ver=os.getenv("g2_ver") or "3.4.3"
load(pathJoin("g2", g2_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.0.0"
load(pathJoin("ip", ip_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/build.hera.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ load(pathJoin("bacio", bacio_ver))
g2_ver=os.getenv("g2_ver") or "3.4.5"
load(pathJoin("g2", g2_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.0.0"
load(pathJoin("ip", ip_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.4"
Expand Down
2 changes: 1 addition & 1 deletion modulefiles/build.jet.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ load(pathJoin("w3nco", w3nco_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.0.0"
load(pathJoin("ip", ip_ver))

bacio_ver=os.getenv("bacio_ver") or "2.4.1"
Expand Down
34 changes: 0 additions & 34 deletions modulefiles/build.odin.intel

This file was deleted.

4 changes: 2 additions & 2 deletions modulefiles/build.orion.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Load environment to compile UFS_UTILS on Orion
cmake_ver=os.getenv("cmake_ver") or "3.17.3"
load(pathJoin("cmake", cmake_ver))

prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack")
prepend_path("MODULEPATH", "/apps/contrib/NCEP/hpc-stack/libs/hpc-stack/modulefiles/stack")

hpc_ver=os.getenv("hpc_ver") or "1.2.0"
load(pathJoin("hpc", hpc_ver))
Expand All @@ -22,7 +22,7 @@ load(pathJoin("bacio", bacio_ver))
g2_ver=os.getenv("g2_ver") or "3.4.5"
load(pathJoin("g2", g2_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.0.0"
load(pathJoin("ip", ip_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.4"
Expand Down
3 changes: 1 addition & 2 deletions modulefiles/build.wcoss2.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ load(pathJoin("intel", intel_ver))
cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.7"
load(pathJoin("cray-mpich", cray_mpich_ver))


libjpeg_ver=os.getenv("libjpeg_ver") or "9c"
load(pathJoin("libjpeg", libjpeg_ver))

Expand Down Expand Up @@ -51,7 +50,7 @@ load(pathJoin("sigio", sigio_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.0.0"
load(pathJoin("ip", ip_ver))

g2_ver=os.getenv("g2_ver") or "3.4.5"
Expand Down
60 changes: 43 additions & 17 deletions sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,47 @@
# UFS_UTILS project.
#
# George Gayno
add_subdirectory(emcsfc_ice_blend.fd)
add_subdirectory(emcsfc_snow2mdl.fd)
if (OpenMP_FOUND)
add_subdirectory(global_cycle.fd)
add_subdirectory(lsm_routines.fd)
else()
message(STATUS "OpenMP is required for global_cycle.fd and was NOT found, skipping ...")
endif()
add_subdirectory(fre-nctools.fd)
add_subdirectory(grid_tools.fd)
add_subdirectory(chgres_cube.fd)
add_subdirectory(orog_mask_tools.fd)
add_subdirectory(sfc_climo_gen.fd)
add_subdirectory(vcoord_gen.fd)
add_subdirectory(fvcom_tools.fd)
add_subdirectory(gblevents.fd)
if(ICEBLEND)
add_subdirectory(emcsfc_ice_blend.fd)
endif()
if(SNOW2MDL)
add_subdirectory(emcsfc_snow2mdl.fd)
endif()
if(GCYCLE)
if (OpenMP_Fortran_FOUND)
add_subdirectory(global_cycle.fd)
add_subdirectory(lsm_routines.fd)
else()
message(STATUS "OpenMP is required for global_cycle.fd and was NOT found, skipping ...")
endif()
endif()
if(FRENCTOOLS)
add_subdirectory(fre-nctools.fd)
endif()
if(GRIDTOOLS)
add_subdirectory(grid_tools.fd)
endif()
if(CHGRES)
add_subdirectory(chgres_cube.fd)
endif()
if(OROG_MASK_TOOLS)
add_subdirectory(orog_mask_tools.fd)
endif()
if(SFC_CLIMO_GEN)
add_subdirectory(sfc_climo_gen.fd)
endif()
if(VCOORD_GEN)
add_subdirectory(vcoord_gen.fd)
endif()
if(FVCOMTOOLS)
add_subdirectory(fvcom_tools.fd)
endif()
if(GBLEVENTS)
add_subdirectory(gblevents.fd)
endif()
if(CPLD_GRIDGEN)
add_subdirectory(cpld_gridgen.fd)
add_subdirectory(weight_gen.fd)
endif()
if(WEIGHT_GEN)
add_subdirectory(weight_gen.fd)
endif()
3 changes: 3 additions & 0 deletions sorc/emcsfc_snow2mdl.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian")
endif()
if(ip_VERSION GREATER_EQUAL 4.0.0)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4")
endif()

set(exe_name emcsfc_snow2mdl)

Expand Down
Loading

0 comments on commit 0df4d60

Please sign in to comment.