This guide explains how to run the MITgcm ocean plastic model. The example used in this guide is located at `/data3/home/xlwang/MITgcm/verification/global_microp_igsm` and is based on personal understanding of the model.

Contents:
1. Introduction
2. Research Overview
3. Code Overview
4. Build
5. Code
6. Run
7. Running Tutorial

1. Introduction
This guide is based on the code found at `/data3/home/xlwang/MITgcm/verification/global_microp_igsm`. The instructions are designed to explain how to simulate the spatial and temporal evolution of global ocean plastic from 1950 to 2018.

2. Research Overview
The model simulates the distribution and movement of ocean plastics over time, from 1950 to 2018.

3. Code Overview
In your working directory, the important folders include `build`, `code`, and `run`, which are described below:

4. Build

The `build` directory contains the compiled code. Relevant code files are located in the `pkg` directory (path: `/data3/home/xlwang/MITgcm/pkg`) and in the `code` directory. Most of the code related to ocean plastic simulation is located in `code`.

5. Code

Some key files that may require modification during the research process include:

– Header Files (Global Variables):
– `PTRACERS_SIZE.h`: Sets the number of plastic tracers.
– `SIZE.h`: Configures the number of CPU cores for running the model. The values `nPx * nPy` set the number of cores, while `sNx * nPx = 144` and `sNy * nPy = 90` configure the grid resolution.

– Run Code Files:
– `Microp_fields_load.F`: Reads plastic input data and environmental variables.
– `Microp_forcing.F`: Distributes input plastics by particle size.
– `Microp_surfforcing*.F`: Calculates the surface concentration of plastics in the ocean.
– `Microp_readparms.F`: Initializes and reads the plastic parameter settings.
– `Microp_process.F`: Main program defining plastic tracers, including density and radius.
– `Microp_p_beaching.F`: Simulates plastic beaching.
– `Microp_p_biofouling.F`: Simulates biofouling on plastics.
– `Microp_p_degradablement.F`: Simulates plastic degradation.
– `Microp_p_sediment.F`: Simulates the sinking of plastics.

6. Run

– Key Files for Running the Model:
– `data.ptracer` and `data.diagnostics*`: Describe the attributes of plastic tracers.
– `data.microp`: Provides file paths and parameter settings for input data.
– `data`: Sets the model’s time steps and other parameters.
– `run.microp`: This file is used for running the model. You must specify the run file, the available server nodes, and the number of nodes to use before starting the simulation.

– The `diags` folder contains the model’s output data, including beached plastics, etc.
– The `input*` folder contains input data needed by the model.

7. Running Tutorial

1. Create a Working Directory:
First, copy all the necessary files into your working directory:

cp -r /data3/home/xlwang/MITgcm ./

2. Set Alias for Compilation:
In your `.bashrc` file, set up an alias for the `premake` command:

alias premake='../../../tools/genmake2 -mpi -mods=../code -optfile=../../../tools/build_options/linux_ifort_impi'

3. Source Code Compilation:

Navigate to the `build` directory:

cd ~/MITgcm/verification/global_microp_igsm/build

In the `build` folder, run the following commands:

premake

4. Compile and Link:
Once the build files are generated, use these commands to compile the model:

make depend
make

After compilation, copy the executable file to the `run` folder:

cp ./mitgcmuv ../run/mitgcmuv

5. Run the Model:

Navigate to the `run` directory and submit the job:

cd ~/MITgcm/verification/global_microp_igsm/run
bsub <run.microp

This will start the simulation for the ocean plastic model.