Skip to content

Commit

Permalink
Sanitize gfs-utils (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul committed Oct 20, 2022
1 parent 7bf599f commit af933d3
Show file tree
Hide file tree
Showing 151 changed files with 538 additions and 1,814 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build/
exec/
install/
log*

*.mod
*.[aox]

*.sw[a-p]
~
.DS_Store

78 changes: 35 additions & 43 deletions sorc/CMakeLists.txt → CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.19)

# Get the version from the VERSION file.
#file(STRINGS "VERSION" pVersion)
set(pVersion 1.0.0)
project(gfsutils
VERSION 1.0.0
LANGUAGES Fortran)

project(
workflow_utils
VERSION ${pVersion}
LANGUAGES Fortran)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_DIRECTORY_LABELS ${PROJECT_NAME})

include(GNUInstallDirs)

# User options.
option(OPENMP "use OpenMP threading" ON)

# Build type
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
message(STATUS "Setting build type to 'Release' as none was specified.")
Expand All @@ -25,27 +19,22 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$")
"MinSizeRel" "RelWithDebInfo")
endif()

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Intel)$")
message(WARNING "${CMAKE_Fortran_COMPILER_ID} is not supported.")
endif()

# User options.
option(OPENMP "use OpenMP threading" ON)

# Find packages.
find_package(MPI REQUIRED)
find_package(NetCDF REQUIRED Fortran)

if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

# NCEPLibs dependencies.
find_package(bacio REQUIRED)
find_package(w3nco REQUIRED)
find_package(w3emc REQUIRED)
find_package(sp REQUIRED)
find_package(ip REQUIRED)
Expand All @@ -56,26 +45,29 @@ find_package(g2 REQUIRED)
find_package(bufr REQUIRED)
find_package(landsfcutil REQUIRED)
find_package(wgrib2 REQUIRED)
find_package(gempak REQUIRED)
# find_package(gfortran REQUIRED)
#rdbfmsua.fd needs gempak and gfortran
#but gempak is so old, any hopes of a find_package(gempak) is null
#some things ought to wither and die
#find_package(gempak REQUIRED)
#find_package(gfortran REQUIRED)

# See https://github.com/NOAA-EMC/NCEPLIBS-nemsio/pull/22
target_link_libraries(nemsio::nemsio INTERFACE w3emc::w3emc_d bacio::bacio_4)

# Set compiler flags.
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -fbacktrace")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
endif()

# Build and install code.
add_subdirectory(src)

add_subdirectory(enkf_chgres_recenter.fd)
add_subdirectory(enkf_chgres_recenter_nc.fd)
add_subdirectory(fv3nc2nemsio.fd)
add_subdirectory(regrid_nemsio.fd)
add_subdirectory(gaussian_sfcanl.fd)
add_subdirectory(gfs_bufr.fd)
add_subdirectory(reg2grb2.fd)
add_subdirectory(tocsbufr.fd)
add_subdirectory(fbwndgfs.fd)
add_subdirectory(vint.fd)
add_subdirectory(tave.fd)
add_subdirectory(syndat_qctropcy.fd)
add_subdirectory(syndat_maksynrc.fd)
add_subdirectory(syndat_getjtbul.fd)
add_subdirectory(supvit.fd)
# Install utility scripts.
add_subdirectory(ush)

add_subdirectory(mkgfsawps.fd)
add_subdirectory(overgridid.fd)
# add_subdirectory(rdbfmsua.fd)
add_subdirectory(webtitle.fd)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions modulefiles/gfsutils_common.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
help([[
Load common modules to build GFS utilities on all machines
]])

local netcdf_ver=os.getenv("netcdf_ver") or "4.7.4"

local bufr_ver=os.getenv("bufr_ver") or "11.7.0"
local bacio_ver=os.getenv("bacio_ver") or "2.4.1"
local w3emc_ver=os.getenv("w3emc_ver") or "2.9.2"
local sp_ver=os.getenv("sp_ver") or "2.3.3"
local ip_ver=os.getenv("ip_ver") or "3.3.3"
local sigio_ver=os.getenv("sigio_ver") or "2.3.2"
local nemsio_ver=os.getenv("nemsio_ver") or "2.5.2"
local nemsiogfs_ver=os.getenv("nemsiogfs_ver") or "2.5.3"
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 g2_ver=os.getenv("g2_ver") or "3.4.5"
local landsfcutil_ver=os.getenv("landsfcutil_ver") or "2.4.1"
local gempak_ver=os.getenv("gempak_ver") or "7.14.1"
local wgrib2_ver=os.getenv("wgrib2_ver") or "2.0.8"

load(pathJoin("netcdf", netcdf_ver))

load(pathJoin("bufr", bufr_ver))
load(pathJoin("bacio", bacio_ver))
load(pathJoin("w3emc", w3emc_ver))
load(pathJoin("sp", sp_ver))
load(pathJoin("ip", ip_ver))
load(pathJoin("sigio", sigio_ver))
load(pathJoin("sfcio", sfcio_ver))
load(pathJoin("nemsio", nemsio_ver))
load(pathJoin("wrf_io", wrf_io_ver))
load(pathJoin("ncio", ncio_ver))
load(pathJoin("g2", g2_ver))
load(pathJoin("landsfcutil", landsfcutil_ver))
--load(pathJoin("gempak", gempak_ver))
load(pathJoin("wgrib2", wgrib2_ver))
27 changes: 27 additions & 0 deletions modulefiles/gfsutils_hera.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
help([[
Build environment for GFS utilities on Hera
]])

prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack")

local hpc_ver=os.getenv("hpc_ver") or "1.1.0"
local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.5.274"
local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.0.4"
local cmake_ver=os.getenv("cmake_ver") or "3.20.1"

local jasper_ver=os.getenv("jasper_ver") or "2.0.25"
local zlib_ver=os.getenv("zlib_ver") or "1.2.11"
local libpng_ver=os.getenv("libpng_ver") or "1.6.35"

load(pathJoin("hpc", hpc_ver))
load(pathJoin("hpc-intel", hpc_intel_ver))
load(pathJoin("hpc-impi", hpc_impi_ver))
load(pathJoin("cmake", cmake_ver))

load(pathJoin("jasper", jasper_ver))
load(pathJoin("zlib", zlib_ver))
load(pathJoin("png", libpng_ver))

load("gfsutils_common")

whatis("Description: GFS utilities environment on Hera with Intel Compilers")
27 changes: 27 additions & 0 deletions modulefiles/gfsutils_jet.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
help([[
Build environment for S4 utilities on Jet
]])

prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/nwprod/hpc-stack/libs/modulefiles/stack")

local hpc_ver=os.getenv("hpc_ver") or "1.1.0"
local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.5.274"
local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.4.274"
local cmake_ver=os.getenv("cmake_ver") or "3.20.1"

local jasper_ver=os.getenv("jasper_ver") or "2.0.25"
local zlib_ver=os.getenv("zlib_ver") or "1.2.11"
local libpng_ver=os.getenv("libpng_ver") or "1.6.35"

load(pathJoin("hpc", hpc_ver))
load(pathJoin("hpc-intel", hpc_intel_ver))
load(pathJoin("hpc-impi", hpc_impi_ver))
load(pathJoin("cmake", cmake_ver))

load(pathJoin("jasper", jasper_ver))
load(pathJoin("zlib", zlib_ver))
load(pathJoin("png", libpng_ver))

load("gfsutils_common")

whatis("Description: GFS utilities environment on Jet with Intel Compilers")
27 changes: 27 additions & 0 deletions modulefiles/gfsutils_orion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
help([[
Build environment for GFS utilities on Orion
]])

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

local hpc_ver=os.getenv("hpc_ver") or "1.1.0"
local hpc_intel_ver=os.getenv("hpc_intel_ver") or "2018.4"
local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.4"
local cmake_ver=os.getenv("cmake_ver") or "3.22.1"

local jasper_ver=os.getenv("jasper_ver") or "2.0.25"
local zlib_ver=os.getenv("zlib_ver") or "1.2.11"
local libpng_ver=os.getenv("libpng_ver") or "1.6.35"

load(pathJoin("hpc", hpc_ver))
load(pathJoin("hpc-intel", hpc_intel_ver))
load(pathJoin("hpc-impi", hpc_impi_ver))
load(pathJoin("cmake", cmake_ver))

load(pathJoin("jasper", jasper_ver))
load(pathJoin("zlib", zlib_ver))
load(pathJoin("png", libpng_ver))

load("gfsutils_common")

whatis("Description: GFS utilities environment on Orion with Intel Compilers")
29 changes: 29 additions & 0 deletions modulefiles/gfsutils_s4.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
help([[
Build environment for GFS utilities on S4
]])

prepend_path("MODULEPATH", "/data/prod/hpc-stack/modulefiles/stack")

load("license_intel")

local hpc_ver=os.getenv("hpc_ver") or "1.1.0"
local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.4"
local hpc_impi_ver=os.getenv("hpc_impi_ver") or "18.0.4"
local cmake_ver=os.getenv("cmake_ver") or "3.20.1"

local jasper_ver=os.getenv("jasper_ver") or "2.0.25"
local zlib_ver=os.getenv("zlib_ver") or "1.2.11"
local libpng_ver=os.getenv("libpng_ver") or "1.6.35"

load(pathJoin("hpc", hpc_ver))
load(pathJoin("hpc-intel", hpc_intel_ver))
load(pathJoin("hpc-impi", hpc_impi_ver))
load(pathJoin("cmake", cmake_ver))

load(pathJoin("jasper", jasper_ver))
load(pathJoin("zlib", zlib_ver))
load(pathJoin("png", libpng_ver))

load("gfsutils_common")

whatis("Description: GFS utilities environment on S4 with Intel Compilers")
34 changes: 34 additions & 0 deletions modulefiles/gfsutils_wcoss2.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
help([[
Build environment for GFS utilities on WCOSS2
]])

local PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0"
local intel_ver=os.getenv("intel_ver") or "19.1.3.304"
local craype_ver=os.getenv("craype_ver") or "2.7.10"
local cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.9"
local cmake_ver= os.getenv("cmake_ver") or "3.20.2"

local jasper_ver=os.getenv("jasper_ver") or "2.0.25"
local zlib_ver=os.getenv("zlib_ver") or "1.2.11"
local libpng_ver=os.getenv("libpng_ver") or "1.6.37"

load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver))
load(pathJoin("intel", intel_ver))
load(pathJoin("craype", craype_ver))
load(pathJoin("cray-mpich", cray_mpich_ver))
load(pathJoin("cmake", cmake_ver))

load(pathJoin("jasper", jasper_ver))
load(pathJoin("zlib", zlib_ver))
load(pathJoin("libpng", libpng_ver))

load("gfsutils_common")
unload("ncio")

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")

whatis("Description: GFS utilities environment on WCOSS2 with Intel Compilers")
35 changes: 0 additions & 35 deletions modulefiles/workflow_utils.hera.lua

This file was deleted.

35 changes: 0 additions & 35 deletions modulefiles/workflow_utils.jet.lua

This file was deleted.

Loading

0 comments on commit af933d3

Please sign in to comment.