This tutorial introduces how to conduct a 0.25-degree Hg simulation for China. Overall, the process consists of two steps: running the global model and the regional model. The former provides boundary conditions for the latter.

Contents:
1. Global Model
1.1 Copying the Code
1.2 Code Compilation
1.3 Run Directory
1.4 Running the Program
2. Regional Model
2.1 Code Compilation
2.2 Run Directory
2.3 Running the Program
3. Additional Information

1. Global Model

For details, please refer to this reference: Shah et al. (2021).

1.1 Copying the Code
Shah’s updated GEOS-Chem code is located at: `/data/Lab/GEOS-Chem/Shah2021/CodeNew`.

First, create a GEOS-Chem directory in your home folder:

mkdir ~/GEOS-Chem

Next, copy the group’s public code version to the newly created directory:

cp -r /data/Lab/GEOS-Chem/Shah2021/CodeNew ~/GEOS-Chem

The latest code can also be downloaded from Harvard University [1].

1.2 Code Compilation
GEOS-Chem is written in Fortran, and it needs to be compiled into an executable file for computation. First, add the necessary environment variables and enter the code directory:

cd ~/GEOS-Chem/
cp -r /data/Lab/GEOS-Chem/env.gc ~/GEOS-Chem
source env.gc
cd ~/GEOS-Chem/CodeNew

Next, compile the model using the `make` command and specify the required meteorological data, grid type, etc.

make -j12 MET=MERRA2 GRID=4x5

After a few minutes, the model will finish compiling. If any errors occur, they will be displayed in red, making them hard to miss. 🙂

1.3 Run Directory
First, copy the group’s public run directory to your GEOS-Chem directory:

cp -r /data/Lab/GEOS-Chem/Shah2021/rundir ~/GEOS-Chem

Then, copy the executable file (geos) compiled earlier to your run directory:

cd ~/GEOS-Chem/rundir
cp ../CodeNew/bin/geos ./geos.r17

1.4 Running the Program
Enter the run directory and submit the task script to the Caramel server to run the task (you can delete line 20 of the `run.GC.Hg` file, as the environment variables were already added during code compilation):

cd ~/GEOS-Chem/rundir
bsub < run.GC.Hg

You can use `bjobs` to check the running status and `bkill` to terminate the model run prematurely. For details, refer to section 6 of this wiki.

2. Regional Model

(Shah’s updated GEOS-Chem regional model is not yet tested. The following is based on the GEOS-Chem-Hg-12.1.0 running tutorial.)

The regional model runs slightly differently from the global model and follows these steps:

2.1 Code Compilation
Enter the code directory (the regional and global models use the same code):

cd ~/GEOS-Chem/Code.12.1.0

Next, compile the model:

make realclean
make -j12 MET=geosfp GRID=025x03125 NEST=ch

Here, `NEST=ch` indicates that the nested region is China.

2.2 Run Directory
First, copy the group’s public run directory to your GEOS-Chem directory:

cp -r ~/data/Lab/GEOS-Chem/rundir/geosfp_025x03125_Hg_ch ~/GEOS-Chem

Then, copy the executable file (geos) compiled earlier to your run directory:

cd ~/GEOS-Chem/geosfp_025x03125_Hg_ch 
cp ../Code.12.0.1/bin/geos ./ 

(Note: During my debugging, I encountered an issue when copying this step.)

Also, note that this folder contains a sub-folder named `BC_4x5_CH`. This folder is a symbolic link to the output results of the global model.

2.3 Running the Program
Enter the run directory and submit the task script to the Caramel server to run the task:

cd ~/GEOS-Chem/geosfp_025x025_Hg
bsub < run.GC.HG

3. Additional Information
For more information, please refer to the GEOS-Chem User’s Guide: [GEOS-Chem User’s Guide](http://wiki.seas.harvard.edu/geos-chem/index.php/Main_Page).