SEAICE tutorial

From Fluids Wiki
Revision as of 10:38, 16 August 2018 by Tghill (talk | contribs) (Created page with "The SEAICE tutorial is intended to help you carry out the first few runs of the MITgcm in configurations with seaice and external forcing. It is recommended to have run the ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The SEAICE tutorial is intended to help you carry out the first few runs of the MITgcm in configurations with seaice and external forcing. It is recommended to have run the Gravity wave tutorial first.

This tutorial has three cases, which require increasingly more independent work. By the final case, you design your own initial conditions and setup files.

The setup files included in this tutorial should be a good starting point for designing new cases.

This tutorial assumes you have:

For this tutorial, change directories into the SEAICE_tutorial/ directory.


Case 1: Simple ice growth

This case is one of the most basic setups possible with seaice. We start with a shallow lake at constant temperature of +1 C, air temperature -10 C, with no wind and no downward radiation.

Build the model

cd into the case1/build directory. If you have followed the recommended directory structure, the following commands will build the model. The -j flag compiles in parallel.

   ../../../../tools/genmake2 -mods ../code [-of OPTFILE] -mpi
   make depend -j
   make -j

Run the model

Now we can run the model .We have to run the model using the same number of processors as we compiled for. In SIZE.h we set nPx = 4 and nPy = 4 so we use 16 processors. This case takes about 10 minutes to run on Hood for me. cd into the include directory. Run the python scripts:

   python initial_temperature.py
   python meteorological_forcing.py
   python rectangular_flat_bottomed_lake.py

Change into the run/ directory, cd ../run. Copy the necessary files

   cp ../include/data* .
   cp ../include/eedata .
   cp ../include/*bin .
   cp ../build/mitgcmuv .

Now you should be able to run the model. If you are on a system with SLURM (ie, Graham or Mountain Lake servers) you will need to make an SBATCH script, which might look like (Many more resources for making SLURM scripts on the Graham tips page)

   #!/bin/bash
   #SBATCH --time=00-00:30
   #SBATCH --account=ctb-mmstastn
   #SBATCH --job-name="MITgcm tut-01"
   #SBATCH --output=results
   #SBATCH --mem-per-cpu=2G
   #SBATCH --ntasks=16
   srun ./mitgcmuv

Then submit by running the command sbatch submit.sh (or whatever you called your script). If you're on a machine without SLURM (eg. Hood), you can run with

   mpirun -np 16 ./mitgcmuv &

Process the results

First we create netCDF files with the gcmpy.netCDFbinary package. In the directory with the binary output files, run the command

   python -m gcmpy.netCDFbinary T Rho U V W UICE VICE SIarea SIheff SIqnet

Once it finishes you should have some output_*.nc files in the run directory. Change directories into the data_processing directory. Look at the script copydata.sh. This script copies the necessary data from the run directory in the processing directory. Run the script.

Open the file makefigures.py. This script is formatted to make animations of the results with the gcmpy.postprocessing package. To make the animations, run

   python -m gcmpy.postprocessing makefigures.py

Once this finishes you should have 4 animations in the GIF subfolder, and screenshots saved in the PNG folder. This case isn't particularly exciting, but it is a minimal setup to run with the SEAICE and EXF packages.