Skip to content

Commit

Permalink
MEGB added to one version before Sho's localization
Browse files Browse the repository at this point in the history
  • Loading branch information
MiodragRancic-NOAA committed Mar 26, 2024
2 parents 803110b + e050818 commit 0170b66
Show file tree
Hide file tree
Showing 400 changed files with 29,958 additions and 33,972 deletions.
41 changes: 41 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- PLEASE READ -->
<!--
Before opening a PR, please note these guidelines:
- Each PR should only address ONE topic and have an associated issue
- No hardcoded or paths to personal directories should be present
- No temporary or backup files should be committed
- Any code that was disabled by being commented out should be removed
-->

**Description**

<!-- Please include relevant motivation and context. -->
<!-- Please include a summary of the change and which issue is fixed. -->
<!-- List any dependencies that are required for this change. -->

<!-- Please provide reference to the issue this pull request is addressing. -->
<!-- For e.g. Fixes #IssueNumber -->

**Type of change**

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

**How Has This Been Tested?**

<!-- Please describe the tests that you ran to verify your changes and on the platforms these tests were conducted. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->

**Checklist**

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] New and existing tests pass with my changes
- [ ] Any dependent changes have been merged and published
66 changes: 31 additions & 35 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: GCC Linux Build
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

# Use custom shell with -l so .bash_profile is sourced
# without having to do it in manually every step
Expand All @@ -8,88 +8,84 @@ defaults:
shell: bash -leo pipefail {0}

env:
cache_key: gcc3 # The number (#) following the cache_key "gcc" is to flush Action cache.
cache_key: gcc
CC: gcc-10
FC: gfortran-10
CXX: g++-10

# A note on flushing Action cache and relevance to "cache_key" above.
# There is no way to flush the Action cache, and hence a number (#) is appended
# to the "cache_key" (gcc).
# If the dependencies change, increment this number and a new cache will be
# generated by the dependency build step "setup"
# There is a Github issue to force clear the cache.
# See discussion on:
# https://stackoverflow.com/questions/63521430/clear-cache-in-github-actions

# The jobs are split into:
# 1. a dependency build step (setup), and
# 2. a GSI build step (build)
# 2. a GSI build step (gsi)
# The setup is run once and the environment is cached,
# so each build of GSI can reuse the cached dependencies to save time (and compute).
# so each subsequent build of GSI can reuse the cached dependencies to save time (and compute).

jobs:
setup:
runs-on: ubuntu-latest

steps:
# Checkout the GSI to get the ci/spack.yaml file
- name: checkout
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: gsi

# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}

- name: checkout-gsi # This is for getting spack.yaml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
path: GSI
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi/ci/spack.yaml') }}

# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/NOAA-EMC/spack.git
sudo apt-get install cmake
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsi-env GSI/ci/spack.yaml
spack env create gsi-env gsi/ci/spack.yaml
spack env activate gsi-env
spack compiler find
sudo apt install cmake
spack external find
spack add [email protected]
spack concretize
spack install --dirty -v
spack install -v --fail-fast --dirty
spack clean -a
build:
gsi:
needs: setup
runs-on: ubuntu-latest

steps:
- name: checkout-gsi
uses: actions/checkout@v2
- name: checkout
uses: actions/checkout@v4
with:
path: GSI
path: gsi

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi/ci/spack.yaml') }}

- name: build-gsi
- name: build
run: |
source spack/share/spack/setup-env.sh
spack env activate gsi-env
export CC=mpicc
export FC=mpif90
cd GSI
cd gsi
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DGSI_MODE=Regional -DENKF_MODE=GFS -DBUILD_REG_TESTING=OFF -DBUILD_NCDIAG=OFF ..
cmake -DCMAKE_INSTALL_PREFIX=../install -DGSI_MODE=Regional -DENKF_MODE=GFS -DBUILD_REG_TESTING=OFF ..
make -j2 VERBOSE=1
make install
env:
CC: mpicc
FC: mpif90
84 changes: 45 additions & 39 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Intel Linux Build
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

# Use custom shell with -l so .bash_profile is sourced which loads intel/oneapi/setvars.sh
# without having to do it in manually every step
Expand All @@ -9,106 +9,112 @@ defaults:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel3 # The number (#) following the cache_key "intel" is to flush Action cache.
cache_key: intel
CC: icc
FC: ifort
CXX: icpc
I_MPI_CC: icc
I_MPI_F90: ifort

# A note on flushing Action cache and relevance to "cache_key" above.
# There is no way to flush the Action cache, and hence a number (#) is appended
# to the "cache_key" (intel).
# If the dependencies change, increment this number and a new cache will be
# generated by the dependency build step "setup"
# There is a Github issue to force clear the cache.
# See discussion on:
# https://stackoverflow.com/questions/63521430/clear-cache-in-github-actions

# The jobs are split into:
# 1. a dependency build step (setup), and
# 2. a GSI build step (build)
# 2. a GSI build step (gsi)
# The setup is run once and the environment is cached,
# so each build of GSI can reuse the cached dependencies to save time (and compute).
# so each subsequent build of GSI can reuse the cached dependencies to save time (and compute).

jobs:
setup:
runs-on: ubuntu-latest

steps:
# Free up disk space
- name: free-disk-spack
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
# Checkout the GSI to get the ci/spack.yaml file
- name: checkout
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: gsi

# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi/ci/spack.yaml') }}

- name: install-intel-compilers
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
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
sudo apt-get clean
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: checkout-gsi # This is for getting spack.yaml
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
path: GSI

# Install dependencies using Spack
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/NOAA-EMC/spack.git
sudo mv /usr/local/ /usr_local_mv
sudo apt-get install cmake
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsi-env GSI/ci/spack.yaml
spack env create gsi-env gsi/ci/spack.yaml
spack env activate gsi-env
spack compiler find
sudo apt install cmake
spack external find
spack add intel-oneapi-mpi
spack concretize
spack install --dirty -v
spack install -v --fail-fast --dirty
spack clean -a
build:
gsi:
needs: setup
runs-on: ubuntu-latest

steps:
- name: checkout-gsi
uses: actions/checkout@v2
with:
path: GSI

- name: install-intel
run: |
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
- name: checkout
uses: actions/checkout@v4
with:
path: gsi

- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
~/.spack
/opt/intel
key: spack-${{ runner.os }}-${{ env.cache_key }}
key: spack-${{ runner.os }}-${{ env.cache_key }}-${{ hashFiles('gsi/ci/spack.yaml') }}

- name: build-gsi
- name: build
run: |
source spack/share/spack/setup-env.sh
spack env activate gsi-env
export CC=mpiicc
export FC=mpiifort
cd GSI
cd gsi
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install -DGSI_MODE=Regional -DENKF_MODE=GFS -DBUILD_REG_TESTING=OFF -DBUILD_NCDIAG=OFF ..
cmake -DCMAKE_INSTALL_PREFIX=../install -DGSI_MODE=Regional -DENKF_MODE=GFS -DBUILD_REG_TESTING=OFF ..
make -j2 VERBOSE=1
make install
env:
CC: mpiicc
FC: mpiifort
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[submodule "fix"]
path = fix
url = gerrit:GSI-fix
[submodule "ncdiag"]
path = src/ncdiag
url = https://github.com/NOAA-EMC/GSI-ncdiag
branch = v1.0.0
path = fix
url = https://github.com/NOAA-EMC/GSI-fix
branch = develop
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ endif()
# User options
option(OPENMP "Enable OpenMP Threading" OFF)
option(ENABLE_MKL "Use MKL for LAPACK implementation (if available)" ON)
option(BUILD_NCDIAG "Build GSI NetCDF Diagnostic Library" ON)
option(BUILD_GSDCLOUD "Build GSD Cloud Analysis Library" OFF)
option(BUILD_GSI "Build GSI" ON)
option(BUILD_ENKF "Build EnKF" ON)
Expand All @@ -37,7 +36,6 @@ option(BUILD_REG_TESTING "Build the Regression Testing Suite" OFF)
# Echo user options
message(STATUS "OPENMP ................. ${OPENMP}")
message(STATUS "ENABLE_MKL ............. ${ENABLE_MKL}")
message(STATUS "BUILD_NCDIAG ........... ${BUILD_NCDIAG}")
message(STATUS "BUILD_GSDCLOUD ......... ${BUILD_GSDCLOUD}")
message(STATUS "BUILD_GSI .............. ${BUILD_GSI}")
message(STATUS "BUILD_ENKF ............. ${BUILD_ENKF}")
Expand All @@ -46,6 +44,11 @@ message(STATUS "BUILD_REG_TESTING ...... ${BUILD_REG_TESTING}")
# Build components
add_subdirectory(src)

# Download and copy binary fix files if submodule has been cloned
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/fix/CMakeLists.txt)
add_subdirectory(fix)
endif()

if(BUILD_REG_TESTING)
add_subdirectory(regression)
endif()
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ NCEP Libraries (NCEPLibs) compiled with the same compiler and MPI library (where
| SFCIO | 1.4.1 and above |
| NEMSIO | 2.5.2 and above |
| NCIO | 1.0.0 and above |
| NCDIAG | 1.0.0 and above |
| WRF_IO | 1.2.0 and above |

### Building the GSI
Expand Down Expand Up @@ -77,7 +78,6 @@ CMake allows for various options that can be specified on the command line via `
|---------------------|--------------------------------------------------------|
| `OPENMP` | Enable OpenMP Threading (`OFF`) |
| `ENABLE_MKL` | Use MKL (`ON`), If not found use LAPACK |
| `BUILD_NCDIAG` | Build GSI NetCDF Diagnostics Library (`ON`) |
| `BUILD_GSDCLOUD` | Build GSD Cloud Library (`OFF`) |
| `BUILD_GSI` | Build GSI library and executable (`ON`) |
| `BUILD_ENKF` | Build EnKF library and executable (`ON`) |
Expand Down
Loading

0 comments on commit 0170b66

Please sign in to comment.