Skip to content

Getting Started

Alper Altuntas edited this page Jun 22, 2017 · 7 revisions

Getting Started

For detailed instructions, see NOAA-GFDL wiki.

The steps of running MOM6 cases:

  1. Downloading NCAR/MOM6-cases
  2. Setting up the compiler environment
  3. Compiling cases
  4. Running cases

Downloading NCAR MOM6 cases

Clone NCAR/MOM6-cases git repository as follows:

$ git clone --recursive https://github.com/NCAR/MOM6-cases.git

In the rest of this wiki, your local NCAR/MOM6 clone directory will be referred to as $MOM6-cases/

Note that the option --recursive is to clone the submodules simultaneously.

Setting up the compiler environment

Cheyenne & Intel compiler:

Load the modules as follows:

$ module load ncarenv
$ module load intel
$ module load netcdf
$ module load ncarcompilers
$ module load mpt/2.15f

To automate this step, see section Cheyenne Compiler Environment

Other machines and compilers

see NOAA-GFDL wiki

Compiling cases

Overview

NCAR/MOM6-cases currently depends on two external libraries:

  • FMS: a framework for constructing and executing cases
  • mkmf: a tool to construct case makefiles

These are saved under src/ directory along with NCAR/MOM6 submodule. (These two libraries will eventually be replaced by NCAR/MOM6- and CESM-specific packages.)

Work Flow

As described in NOAA-GFDL wiki, the common phases of compiling FMS (shared library) and MOM6 executable are:

  1. Using the list_path tool that comes with mkmf, create a path_names file that contains the relative path to the source files.

  2. Using mkmf script, create a makefile.

  3. Compile the shared library or MOM6 executable.

Compiling the FMS shared library

Before compiling MOM6, compile the FMS shared code.

First, generate the makefile for FMS. In the MOM6-cases/ directory:

$ cd $MOM6-cases/
$ mkdir -p build/intel/shared/repro/
$ cd build/intel/shared/repro/
$ rm -f path_names
$ ../../../../src/mkmf/bin/list_paths ../../../../src/FMS
$ ../../../../src/mkmf/bin/mkmf -t ../../../../src/mkmf/templates/cheyenne-intel.mk -p libfms.a -c "-Duse_libMPI -Duse_netCDF -DSPMD" path_names

Build FMS (libfms.a):

make NETCDF=3 REPRO=1 libfms.a -j

Compiling MOM6 in ocean-only mode:

With the FMS library compiled, generate the makefile for NCAR/MOM6:

$ cd $MOM6-cases/
$ mkdir -p build/intel/ocean_only/repro/
$ cd build/intel/ocean_only/repro/
$ rm -f path_names
$ ../../../../src/mkmf/bin/list_paths ./ ../../../../src/MOM6/{config_src/dynamic,config_src/solo_driver,src/{*,*/*}}
$ ../../../../src/mkmf/bin/mkmf -t ../../../../src/mkmf/templates/cheyenne-intel.mk -o '-I../../shared/repro' -p MOM6 -l '-L../../shared/repro -lfms' -c '-Duse_libMPI -Duse_netCDF -DSPMD' path_names

Finally, compile NCAR/MOM6:

make NETCDF=3 REPRO=1 MOM6 -j

Running cases

TODO

Clone this wiki locally