Skip to content

zmoon/very-basic-nuopc-example

Repository files navigation

very-basic-nuopc-example

The goal is to demonstrate how an external library ("model") can be used

  • in a standalone program
  • in a NUOPC "single model driver" framework 1
  • in NUOPC, one-way coupling to a "data model"
  • NUOPC two-way coupling

Build and run the programs using just:

just test

Background

Getting ESMF

Note that NUOPC is included with ESMF.

On NOAA Hera

We can follow the hpc-stack usage instructions to get ESMF.

Below current as of 2022-09-06

module use /scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack
module load hpc/1.2.0
module load hpc-intel/2022.1.2 hpc-impi/2022.1.2
module load esmf/8.3.0

After this, ESMFMKFILE and other env vars (env | grep ^ESMF) are set: ESMF is ready to go.

Prepare to build:

module load cmake/3.20.1
export FC=mpiifort

Installing on Ubuntu

Tested on WSL2 Ubuntu 20.04.5 LTS; based on this guide

Basics:

sudo apt install build-essential gfortran

Minimal but sufficient ESMF deps:

sudo apt install libnetcdf-dev libnetcdff-dev liblapack-dev libopenblas-dev

Download the source code from ESMF releases. The unpacked directory, which contains build, src, etc., subdirectories, is what you use for ESMF_DIR below.

Settings:

export ESMF_DIR=/full/path/to/ESMF/dir
# export ESMF_INSTALL_PREFIX=/set/if/different/from/ESMF_DIR

export ESMF_LAPACK=netlib
export ESMF_COMPILER=gfortran
export ESMF_COMM=mpiuni  # MPI bypass

# system GCC
export ESMF_F90COMPILER=/usr/bin/gfortran
export ESMF_CCOMPILER=/usr/bin/gcc
export ESMF_CXXCOMPILER=/usr/bin/g++

Build and run some tests (takes minutes):

make check

Set ESMFMKFILE (location of esmf.mk; important for being to find the built library):

export ESMFMKFILE=$ESMF_INSTALL_PREFIX/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk  # e.g.

Footnotes

  1. See the SingleModelProto example.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published