Skip to content

Commit 97c4cfa

Browse files
Merge branch 'develop' into feature/sfc_climo_gen.frac
Fixes ufs-community#709.
2 parents 6d2b2d3 + 5b67e4d commit 97c4cfa

12 files changed

+201
-119
lines changed

CMakeLists.txt

+34-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,39 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1515
# User options.
1616
option(OPENMP "use OpenMP threading" ON)
1717
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)
18+
19+
# Utilities to be built (Default: ALL)
20+
option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON)
21+
option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON)
22+
option(GCYCLE "Enable building global_cycle.fd" ON)
23+
option(FRENCTOOLS "Enable building fre-nctools.fd" ON)
24+
option(GRIDTOOLS "Enable building grid_tools.fd" ON)
25+
option(CHGRES "Enable building chgres_cube.fd" ON)
26+
option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" ON)
27+
option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON)
28+
option(VCOORD_GEN "Enable building vcoord_gen.fd" ON)
29+
option(FVCOMTOOLS "Enable building fvcom_tools.fd" ON)
30+
option(GBLEVENTS "Enable building gblevents.fd" ON)
31+
option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON)
32+
option(WEIGHT_GEN "Enable building weight_gen.fd" ON)
33+
34+
# Option to build application specific utilities
35+
option(GFS "Enable building GFS-only utilities" OFF)
36+
37+
# When building the GFS, the following need not be built
38+
if(GFS)
39+
message(STATUS "Building utilities specific to the GFS")
40+
set(FRENCTOOLS OFF CACHE BOOL "Disable building fre-nctools.fd" FORCE)
41+
set(GRIDTOOLS OFF CACHE BOOL "Disable building grid_tools.fd" FORCE)
42+
set(OROG_MASK_TOOLS OFF CACHE BOOL "Disable building orog_mask_tools.fd" FORCE)
43+
set(SFC_CLIMO_GEN OFF CACHE BOOL "Disable building sfc_climo_gen.fd" FORCE)
44+
set(VCOORD_GEN OFF CACHE BOOL "Disable building vcoord_gen.fd" FORCE)
45+
set(FVCOMTOOLS OFF CACHE BOOL "Disable building fvcom_tools.fd" FORCE)
46+
set(GBLEVENTS OFF CACHE BOOL "Disable building gblevents.fd" FORCE)
47+
set(CPLD_GRIDGEN OFF CACHE BOOL "Disable building cpld_gridgen.fd" FORCE)
48+
set(WEIGHT_GEN OFF CACHE BOOL "Disable building weight_gen.fd" FORCE)
49+
endif()
50+
1851
SET(TEST_FILE_DIR "." CACHE STRING "Check this directory for test files before using FTP.")
1952

2053
# Set the build type.
@@ -80,7 +113,7 @@ find_package(sigio 2.3.0 REQUIRED)
80113
if(ENABLE_DOCS)
81114
find_package(Doxygen REQUIRED)
82115
set(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
83-
add_subdirectory(docs)
116+
add_subdirectory(docs)
84117
endif()
85118

86119
add_subdirectory(sorc)

build_all.sh

+6-11
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,21 @@ else
2626
set -x
2727
fi
2828

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

34-
if [[ "$target" == "hera" || "$target" == "orion" || "$target" == "wcoss2" ]]; then
35-
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"
36-
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=ON"
37-
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DENABLE_DOCS=ON -DBUILD_TESTING=ON"
38-
else
39-
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"
40-
#CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DENABLE_DOCS=ON -DBUILD_TESTING=OFF"
41-
fi
33+
CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=../ -DCMAKE_INSTALL_BINDIR=exec -DBUILD_TESTING=OFF"
34+
35+
# Allow users of this script to provide CMake options e.g. -DGFS=ON|OFF to build GFS specific utilities only
36+
CMAKE_OPTS=${CMAKE_OPTS:-}
4237

4338
rm -fr ./build
4439
mkdir ./build && cd ./build
4540

46-
cmake .. ${CMAKE_FLAGS}
41+
cmake .. ${CMAKE_FLAGS} ${CMAKE_OPTS}
4742

48-
make -j 8 VERBOSE=1
43+
make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-}
4944
make install
5045

5146
#ctest

modulefiles/build.hera.gnu.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ load(pathJoin("bacio", bacio_ver))
3131
g2_ver=os.getenv("g2_ver") or "3.4.3"
3232
load(pathJoin("g2", g2_ver))
3333

34-
ip_ver=os.getenv("ip_ver") or "3.3.3"
34+
ip_ver=os.getenv("ip_ver") or "4.0.0"
3535
load(pathJoin("ip", ip_ver))
3636

3737
nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"

modulefiles/build.hera.intel.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ load(pathJoin("bacio", bacio_ver))
2525
g2_ver=os.getenv("g2_ver") or "3.4.5"
2626
load(pathJoin("g2", g2_ver))
2727

28-
ip_ver=os.getenv("ip_ver") or "3.3.3"
28+
ip_ver=os.getenv("ip_ver") or "4.0.0"
2929
load(pathJoin("ip", ip_ver))
3030

3131
nemsio_ver=os.getenv("nemsio_ver") or "2.5.4"

modulefiles/build.jet.intel.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ load(pathJoin("w3nco", w3nco_ver))
3737
sp_ver=os.getenv("sp_ver") or "2.3.3"
3838
load(pathJoin("sp", sp_ver))
3939

40-
ip_ver=os.getenv("ip_ver") or "3.3.3"
40+
ip_ver=os.getenv("ip_ver") or "4.0.0"
4141
load(pathJoin("ip", ip_ver))
4242

4343
bacio_ver=os.getenv("bacio_ver") or "2.4.1"

modulefiles/build.orion.intel.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Load environment to compile UFS_UTILS on Orion
55
cmake_ver=os.getenv("cmake_ver") or "3.17.3"
66
load(pathJoin("cmake", cmake_ver))
77

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

1010
hpc_ver=os.getenv("hpc_ver") or "1.2.0"
1111
load(pathJoin("hpc", hpc_ver))
@@ -22,7 +22,7 @@ load(pathJoin("bacio", bacio_ver))
2222
g2_ver=os.getenv("g2_ver") or "3.4.5"
2323
load(pathJoin("g2", g2_ver))
2424

25-
ip_ver=os.getenv("ip_ver") or "3.3.3"
25+
ip_ver=os.getenv("ip_ver") or "4.0.0"
2626
load(pathJoin("ip", ip_ver))
2727

2828
nemsio_ver=os.getenv("nemsio_ver") or "2.5.4"

modulefiles/build.wcoss2.intel.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ load(pathJoin("intel", intel_ver))
1717
cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.7"
1818
load(pathJoin("cray-mpich", cray_mpich_ver))
1919

20-
2120
libjpeg_ver=os.getenv("libjpeg_ver") or "9c"
2221
load(pathJoin("libjpeg", libjpeg_ver))
2322

@@ -51,7 +50,7 @@ load(pathJoin("sigio", sigio_ver))
5150
sp_ver=os.getenv("sp_ver") or "2.3.3"
5251
load(pathJoin("sp", sp_ver))
5352

54-
ip_ver=os.getenv("ip_ver") or "3.3.3"
53+
ip_ver=os.getenv("ip_ver") or "4.0.0"
5554
load(pathJoin("ip", ip_ver))
5655

5756
g2_ver=os.getenv("g2_ver") or "3.4.5"

sorc/CMakeLists.txt

+43-17
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,47 @@
22
# UFS_UTILS project.
33
#
44
# George Gayno
5-
add_subdirectory(emcsfc_ice_blend.fd)
6-
add_subdirectory(emcsfc_snow2mdl.fd)
7-
if (OpenMP_FOUND)
8-
add_subdirectory(global_cycle.fd)
9-
add_subdirectory(lsm_routines.fd)
10-
else()
11-
message(STATUS "OpenMP is required for global_cycle.fd and was NOT found, skipping ...")
12-
endif()
13-
add_subdirectory(fre-nctools.fd)
14-
add_subdirectory(grid_tools.fd)
15-
add_subdirectory(chgres_cube.fd)
16-
add_subdirectory(orog_mask_tools.fd)
17-
add_subdirectory(sfc_climo_gen.fd)
18-
add_subdirectory(vcoord_gen.fd)
19-
add_subdirectory(fvcom_tools.fd)
20-
add_subdirectory(gblevents.fd)
5+
if(ICEBLEND)
6+
add_subdirectory(emcsfc_ice_blend.fd)
7+
endif()
8+
if(SNOW2MDL)
9+
add_subdirectory(emcsfc_snow2mdl.fd)
10+
endif()
11+
if(GCYCLE)
12+
if (OpenMP_Fortran_FOUND)
13+
add_subdirectory(global_cycle.fd)
14+
add_subdirectory(lsm_routines.fd)
15+
else()
16+
message(STATUS "OpenMP is required for global_cycle.fd and was NOT found, skipping ...")
17+
endif()
18+
endif()
19+
if(FRENCTOOLS)
20+
add_subdirectory(fre-nctools.fd)
21+
endif()
22+
if(GRIDTOOLS)
23+
add_subdirectory(grid_tools.fd)
24+
endif()
25+
if(CHGRES)
26+
add_subdirectory(chgres_cube.fd)
27+
endif()
28+
if(OROG_MASK_TOOLS)
29+
add_subdirectory(orog_mask_tools.fd)
30+
endif()
31+
if(SFC_CLIMO_GEN)
32+
add_subdirectory(sfc_climo_gen.fd)
33+
endif()
34+
if(VCOORD_GEN)
35+
add_subdirectory(vcoord_gen.fd)
36+
endif()
37+
if(FVCOMTOOLS)
38+
add_subdirectory(fvcom_tools.fd)
39+
endif()
40+
if(GBLEVENTS)
41+
add_subdirectory(gblevents.fd)
42+
endif()
43+
if(CPLD_GRIDGEN)
2144
add_subdirectory(cpld_gridgen.fd)
22-
add_subdirectory(weight_gen.fd)
45+
endif()
46+
if(WEIGHT_GEN)
47+
add_subdirectory(weight_gen.fd)
48+
endif()

sorc/emcsfc_snow2mdl.fd/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
1717
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
1818
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian")
1919
endif()
20+
if(ip_VERSION GREATER_EQUAL 4.0.0)
21+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIP_V4")
22+
endif()
2023

2124
set(exe_name emcsfc_snow2mdl)
2225

0 commit comments

Comments
 (0)