Skip to content

Create your own repository of experiments

Matthew Harrison edited this page Jul 18, 2016 · 10 revisions

In other documentation we describe our to clone the MOM6-examples repository of experiment configurations. Here we describe how to construct your own independent repository in which you can keep your own configurations.

Minimum setup for ocean-only experiments

First create a new folder and initialize git:

mkdir My_experiments
cd My_experiments
git init

By default git will use branch "master". If you want to develop on a different branch (MOM6 use "dev/master" for development) then do:

git checkout -b dev/master

Now add the software and source code needed to build an ocean-only model:

git submodule init
git submodule add https://github.com/NOAA-GFDL/mkmf.git src/mkmf
git submodule add https://github.com/NOAA-GFDL/FMS.git src/FMS
git submodule add [email protected]:my_github_account_name/MOM6.git src/MOM6

Note that we used the "https" transfer protocol for repositories which we never expect to need to fork and push to (i.e. read-only). For the MOM6 repository we used the git transfer protocol and pointed to your fork (replace "my_github_account_name" with your GitHub account name). If you don't have or want your own fork of MOM6, then replace the url with "https://github.com/NOAA-GFDL/MOM6.git".

This is what your directory will look like

% tree -L 2 .
.
`-- src
    |-- FMS
    |-- mkmf
    `-- MOM6

3 directories, 0 files

and git status reports:

% git status
On branch dev/master

Initial commit

Changes to be committed: (use "git rm --cached ..." to unstage)

    new file:   .gitmodules
    new file:   src/FMS
    new file:   src/MOM6
    new file:   src/mkmf

Let's commit this before adding an experiment:

git commit -m "Added source needed for ocean-only experiments"

Other source for ice-ocean experiments

If you plan to use the sea-ice model with your ocean then we need some other components:

git submodule add https://github.com/NOAA-GFDL/SIS2.git src/SIS2
git submodule add https://github.com/NOAA-GFDL/atmos_null.git src/atmos_null
git submodule add https://github.com/NOAA-GFDL/coupler.git src/coupler
git submodule add https://github.com/NOAA-GFDL/land_null.git src/land_null
git submodule add https://github.com/NOAA-GFDL/icebergs.git src/icebergs

Unfortunately there are some little bits of code that are not yet available on GitHub in a self-contained repository:

wget -o/dev/null -O- https://github.com/NOAA-GFDL/MOM6-examples/archive/dev/master.tar.gz | tar -zxv --strip-components=1 -f - MOM6-examples-dev-master/src/ice_ocean_extras

which should populate "src/ice_ocean_extras" with the folders diag_integral, ice_param and monin_obukhov.

Let's commit these additions:

git add .
git commit -m "Added components needed for ice-ocean experiments"

Create your own ocean-only experiment

First name your experiment and create a directory (here we use "expt1"):

mkdir expt1
cd expt1

The bare minimum of input files you need are input.nml, MOM_input, diag_table. Create input.nml with

cat << EOFA > input.nml
 &MOM_input_nml
         output_directory = './',
         input_filename = 'n'
         restart_input_dir = 'INPUT/',
         restart_output_dir = 'RESTART/',
         parameter_filename = 'MOM_input' /

 &diag_manager_nml
 /

 &fms_nml
        domains_stack_size = 955296
        stack_size =0 /
EOFA

Note that if you like to use the MOM_override model of perturbation parameters change parameter_filename = 'MOM_input','MOM_override'.

Grab a working MOM_input

wget -o/dev/null -O- https://github.com/NOAA-GFDL/MOM6-examples/archive/dev/master.tar.gz | tar -zxv --strip-components=3 -f - MOM6-examples-dev-master/ocean_only/benchmark/MOM_input

Create a simple diag_table with:

cat << EOFA > diag_table
"Experiment expt1"                             
1 1 1 0 0 0                                            
"output",      1,"days",1,"days","time",                 

#This is the field section of the diag_table.

# Prognostic Ocean fields:
#=========================

"ocean_model","u","u","output","all",.false.,"none",2
"ocean_model","v","v","output","all",.false.,"none",2
"ocean_model","h","h","output","all",.false.,"none",1
"ocean_model","e","e","output","all",.false.,"none",2
"ocean_model","temp","temp","output","all",.false.,"none",2
EOFA

Add the experiment to your repository

cd ../ # Back to top level
git add expt1
git commit -m "Added ocean-only experiment expt1 (based on benchmark from MOM6-examples)"