This tool can be use to build the executable for the model. If you have Gaea C5 access, try the following command directly. Otherwise please check Build CEFI-regional-MOM6 for detailed instructions.
On machine gaea for platform c5 with intel23 compiler:
./linux-build.bash -m gaea -p ncrc5.intel23 -t prod -f mom6sis2This assumes that the files build/gaea/ncrc5.intel23.env and build/gaea/ncrc5.intel23.mk exist.
- build/gaea/ncrc5.intel23.env contains all the necessary environment variables and modules that must be loaded before a build / run on that machine
- build/gaea/ncrc5.intel23.mk contains the compile instructions for the particular compiler and machine
Conda warning: before you install anything or try to build the model, make sure to deactivate your conda environment because it could interfere with brew and the model build process.
conda deactivate.
For PC users:
- Install WSL (Windows Subsystem for Ubuntu and Linux): link and install the following softwares:
sudo apt update
sudo apt install make gfortran git tcsh netcdf-bin libnetcdf-dev libnetcdff-dev openmpi-bin libopenmpi-dev- Container approach: Docker container is available for Window10 or 11: link Then follow the instruction here to build the model.
For MacOS users:
- Install HomeBrew: link and install the following software from terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install make
brew install gfortran
brew install openmpi
brew install netcdf
brew install netcdf-fortran
brew install wget- After
git clone https://github.com/NOAA-GFDL/CEFI-regional-MOM6.git --recursivenavigate to thebuildsdirectory:cd CEFI-regional-MOM6\builds - mkdir
YOUR_MACHINE_DIRECTORY: This should be the name of your system, e.g, mac-m1. Thencd YOUR_MACHINE_DIRECTORY - you will need two files:
NAME_OF_YOUR_mk_FILE.envandNAME_OF_YOUR_mk_FILE.mkin this folder (e.g. gnu.env and gnu.mk or somthing similiar). - The
NAME_OF_YOUR_mk_FILE.envfile is mainly used for the HPC system to allow you to load necessary software to build the model. In most cases, if you already have gfortran, mpi (openmpi or mpich), and netcdf installed on your system, the***.envfile can be left blank. - The
NAME_OF_YOUR_mk_FILE.mkfile may be different depends on your system configurations (e.g. Intel v.s. GNU compilers). We already have a few examples within thebuildsfolder. Users can also find more general templates here. Below are some recommended templates:
| Platform | Template |
|---|---|
gaea |
ncrc5-intel-classic.mk |
Ubuntu |
linux-ubuntu-trusty-gnu.mk |
MacOS |
osx-gnu.mk |
- Use the following command to build the model (Make sure to use correct names that are consistent with both your machine folder and your mk/env files.):
./linux-build.bash -m YOUR_MACHINE_DIRECTORY -p NAME_OF_YOUR_mk_FILE -t repro -f mom6sis2- If the build completes successfully, you should be able to find the executable here:
builds/build/YOUR_MACHINE_DIRECTORY-NAME_OF_YOUR_mk_FILE/ocean_ice/repro/MOM6SIS2
- To test your
MOM6SIS2, first navigate to theexpsfolder:cd ../exps - Download the model input files:
wget ftp://nomads.gfdl.noaa.gov/1/users/cefi/OM4.single_column.COBALT/data/1d_ci_datasets.tar.gz && tar -zxvf 1d_ci_datasets.tar.gz && rm -rf 1d_ci_datasets.tar.gz - navigate to the 1-D example:
cd OM4.single_column.COBALT - USe the following command to run the 1-D example:
mpirun -np 1 ../../builds/build/YOUR_MACHINE_DIRECTORY-NAME_OF_YOUR_mk_FILE/ocean_ice/repro/MOM6SIS2