Skip to content

Commit

Permalink
Update readme with UFS module file info
Browse files Browse the repository at this point in the history
and remove most of the Ubuntu instructions
  • Loading branch information
zmoon committed Oct 24, 2024
1 parent 252aa43 commit bafd32d
Showing 1 changed file with 13 additions and 56 deletions.
69 changes: 13 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ pre-commit install --install-hooks

### Setup

#### NOAA Hera
#### Supported UFS machines

Use the official setup.
UFS spack-stack module files are included for Hera, WCOSS2, Orion, etc.
```
module use ./modulefiles
module load hera.intel
```

Input data:
Then, on Hera, for example:
```
module load ufs_hera.intel
```

Hera input data:
```
/scratch1/NCEPDEV/rstprod/nexus_emissions
```
Expand All @@ -41,6 +45,7 @@ Input data:

#### GMU Hopper

Custom modules.
```
. /groups/ESS3/zmoon/nexus/env5
```
Expand All @@ -52,58 +57,10 @@ Input data:

#### Ubuntu

Tested with Ubuntu 22.04.
Using GCC v12 available via `apt`.

Dependencies:
```bash
sudo apt install build-essential gfortran-12 libnetcdf-dev libnetcdff-dev liblapack-dev libopenblas-dev mpi-default-dev mpi-default-bin
```

Build ESMF and prepare for NEXUS build:
```bash
v="8.3.1" # ESMF
gcc="12"
esmf_base=$HOME/esmf

export ESMF_DIR=${esmf_base}/${v}-gcc-${gcc}
cd $esmf_base
mkdir -p $ESMF_DIR
wget https://github.com/esmf-org/esmf/archive/refs/tags/v${v}.tar.gz
tar xzvf v${v}.tar.gz --directory=/tmp && mv /tmp/esmf-${v}/* $ESMF_DIR

export ESMF_COMPILER=gfortran
export ESMF_LAPACK=netlib
export ESMF_COMM=mpi
export ESMF_PIO=internal
export ESMF_NETCDF=nc-config

export OMPI_FC=gfortran-${gcc}
export OMPI_CC=gcc-${gcc}
export OMPI_CXX=g++-${gcc}
export ESMF_F90COMPILER=mpifort
export ESMF_CCOMPILER=mpicc
export ESMF_CXXCOMPILER=mpic++
export ESMF_F90LINKER=/usr/bin/ld
export ESMF_CLINKER=/usr/bin/ld
export ESMF_CXXLINKER=/usr/bin/ld

cd $ESMF_DIR
make lib

# Location of the corresponding `esmf.mk` is needed for CMake to find the lib later
# You can find these with, e.g., `find . -name 'esmf.mk' -exec realpath {} \;`,
# but it should be the following:
ESMFMKFILE=${ESMF_DIR}/lib/libO/Linux.gfortran.64.mpi.default/esmf.mk

# For NEXUS
export CMAKE_Fortran_COMPILER=$ESMF_F90COMPILER
```

To build NEXUS, at least these env vars should be set:
- `ESMFMKFILE`
- `OMPI_FC`
- `CMAKE_Fortran_COMPILER`
See https://github.com/zmoon/gha-esmf for examples of how to build ESMF,
or follow the steps to download and use a pre-built ESMF.

Remember to set `ESMFMKFILE` to point to the `esmf.mk` file of your ESMF build.

### Build

Expand Down

0 comments on commit bafd32d

Please sign in to comment.