Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/release/hafs_v2' into su…
Browse files Browse the repository at this point in the history
…pport/HAFS
  • Loading branch information
BinLiu-NOAA committed May 20, 2024
2 parents bee2891 + 2abf645 commit 0cf0c81
Show file tree
Hide file tree
Showing 224 changed files with 25,121 additions and 69,438 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
spack add [email protected]
spack concretize
spack install -v --fail-fast --dirty
spack clean --all
build:
needs: setup
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defaults:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel2 # The number (#) following the cache_key "intel" is to flush Action cache.
cache_key: intel3 # The number (#) following the cache_key "intel" is to flush Action cache.
CC: icc
FC: ifort
CXX: icpc
Expand All @@ -33,7 +33,7 @@ env:

jobs:
setup:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: checkout-upp # This is for getting spack.yaml
Expand All @@ -45,7 +45,7 @@ jobs:
# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand All @@ -59,14 +59,13 @@ jobs:
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-mpi-devel intel-oneapi-openmp intel-oneapi-compiler-fortran-2023.2.1 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.1
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
sudo mv /usr/local/ /usr_local_mv
git clone -c feature.manyFiles=true https://github.com/NOAA-EMC/spack.git
source spack/share/spack/setup-env.sh
spack env create upp-env UPP/ci/spack.yaml
Expand All @@ -77,10 +76,11 @@ jobs:
spack add intel-oneapi-mpi
spack concretize
spack install --dirty -v --fail-fast
spack clean --all
build:
needs: setup
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: checkout-upp
Expand All @@ -94,7 +94,7 @@ jobs:
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
path = sorc/ncep_post.fd/post_gtg.fd
url = https://github.com/NCAR/UPP_GTG
update = none
[submodule "sorc/libIFI.fd"]
path = sorc/libIFI.fd
url = https://github.com/NCAR/UPP_IFI
update = none
11 changes: 7 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

# Required
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -17,8 +21,7 @@ sphinx:
formats: all

# Optionally set the version of Python and requirements required to build your docs
#python:
python:
# version: 3.7
# install:

# - requirements: docs/requirements.txt
install:
- requirements: docs/requirements.txt
49 changes: 48 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ file(STRINGS "VERSION" pVersion LIMIT_COUNT 1)
project(
upp
VERSION ${pVersion}
LANGUAGES Fortran)
LANGUAGES Fortran C CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Handle user options.
option(OPENMP "use OpenMP threading" ON)
option(BUILD_POSTEXEC "Build NCEPpost executable" ON)
option(BUILD_WITH_WRFIO "Build NCEPpost with WRF-IO library" OFF)
option(BUILD_WITH_IFI "Build NCEPpost with In-Flight Icing (IFI) library if present" OFF)
option(REQUIRE_IFI "Abort if libIFI is not found ; enables BUILD_WITH_IFI=ON" OFF)
option(BUILD_WITH_GTG "Build NCEPpost with NCAR/GTG" OFF)
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)

Expand Down Expand Up @@ -52,6 +54,35 @@ if(BUILD_WITH_GTG)
find_package(ip REQUIRED)
endif()

if(INTERNAL_IFI)
if(BUILD_WITH_IFI)
message(SEND_ERROR "Cannot use INTERNAL_IFI with either BUILD_WITH_IFI or REQUIRE_IFI.")
endif()
if(IFI_DIR)
message(SEND_ERROR "When INTERNAL_IFI is specified, do not set IFI_DIR.")
endif()
set(REQUIRE_IFI ON)
set(BUILD_WITH_IFI ON)
set(IFI_FOUND ON)
set(IFI_DIR ${CMAKE_INSTALL_DIR})
message(NOTICE "Building IFI inside the post.")
else()
if(REQUIRE_IFI)
set(BUILD_WITH_IFI ON)
endif()

if(BUILD_WITH_IFI)
if(REQUIRE_IFI)
find_package(IFI REQUIRED)
else()
find_package(IFI)
endif()
endif()
if(IFI_FOUND)
message(NOTICE "Linking to IFI external to the post.")
endif()
endif()

if(BUILD_POSTEXEC)
find_package(nemsio REQUIRED)
find_package(sfcio REQUIRED)
Expand All @@ -61,6 +92,22 @@ if(BUILD_POSTEXEC)
if(BUILD_WITH_WRFIO)
find_package(wrf_io REQUIRED)
endif()
if(IFI_FOUND)
if(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel$")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -cxxlib")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^GNU$")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lstdc++")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|AppleClang)$")
# This one is a wild guess. I haven't tried linking a Fortran
# executable with C++ libraries in clang.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
endif()
endif()
endif()

if(IFI_FOUND OR INTERNAL_IFI)
message(NOTICE "Enabling USE_IFI in the post.")
add_definitions(-DUSE_IFI=1)
endif()

add_subdirectory(sorc)
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ Code Managers: Wen Meng, Huiya Chuang, Kate Fossell

## Prerequisites

The UPP requires certain NCEPLIB packages to be installed via
the HPC-Stack project.
The UPP requires certain NCEPLIBS packages to be installed via the
HPC-Stack project. For instructions on installing these packages as a
bundle via HPC-Stack, see: https://hpc-stack.readthedocs.io/en/latest/.
Users may instead install packages via spack-stack. For instructions,
see: https://spack-stack.readthedocs.io/en/latest/.
The `UPP/modulefiles` directory indicates which package versions are
used and supported on Level 1 systems.

Required NCEPLIBS packages:

- [NCEPLIBS-g2](https://github.com/NOAA-EMC/NCEPLIBS-g2)
- [NCEPLIBS-g2tmpl](https://github.com/NOAA-EMC/NCEPLIBS-g2tmpl)
- [NCEPLIBS-sp](https://github.com/NOAA-EMC/NCEPLIBS-sp)
- [NCEPLIBS-ip](https://github.com/NOAA-EMC/NCEPLIBS-ip)
- [NCEPLIBS-bacio](https://github.com/NOAA-EMC/NCEPLIBS-bacio)
- [NCEPLIBS-w3emc](https://github.com/NOAA-EMC/NCEPLIBS-w3emc)
- [NCEPLIBS-w3nco](https://github.com/NOAA-EMC/NCEPLIBS-w3nco)
- [CRTM](https://github.com/noaa-emc/emc_crtm)

Also required to build NCEPpost executable (cmake option
Expand All @@ -89,11 +95,13 @@ option BUILD_WITH_WRFIO).

The following third-party libraries are required:

- [netcdf](https://github.com/Unidata/netcdf)
- [netcdf-c](https://github.com/Unidata/netcdf-c)
- [netcdf-fortran](https://github.com/Unidata/netcdf-fortran)
- [Jasper](https://github.com/jasper-software/jasper)
- [libpng](http://www.libpng.org/pub/png/libpng.html)
- [libz](https://zlib.net/)
- [zlib](https://zlib.net/)
- [hdf5](https://github.com/HDFGroup/hdf5)

## Building

Expand Down Expand Up @@ -128,3 +136,7 @@ Commerce. The Department of Commerce seal and logo, or the seal and
logo of a DOC bureau, shall not be used in any manner to imply
endorsement of any commercial product or activity by DOC or the United
States Government.

## UPP Terms of Use Notice

The UPP Terms of Use Notice is available at: https://github.com/NOAA-EMC/UPP/wiki/UPP-Terms-of-Use-Notice
Loading

0 comments on commit 0cf0c81

Please sign in to comment.