In this post, I document the complete process of installing and configuring the GEOS-Chem Classic model, including environmental setup, compilation, and runtime configuration. The log is based on my experience running GEOS-Chem on a Linux HPC system, and covers both the challenges I encountered and the solutions I implemented.
1. Environmental Setup
GEOS-Chem requires a proper build environment.
1 | export DIR=/data/user/hao_y/lib |
2. GEOS-Chem Classic initiiation
2.1 Clone and Initialize
1 | git clone --recurse-submodules https://github.com/geoschem/GCClassic.git |
2.2 Run Directory Configuration
My setting is as follows:
- Simulation: Full chemistry
- Complex SOA with semivolatile POA
- Meteorology: GEOS-FP
- Resolution: 0.25° × 0.3125°
- Domain: Asia (manually adjusted to South Asia later)
- Vertical Levels: 72 (native)
2.3 Compilation
Go into the run directory and install
1 | cd runs/gc_025_SAsia_2018/gc_025x03125_AS_geosfp_fullchem_complexSOA/ |
After building, adjust these configuration files:geoschem_config.yml
,HISTORY.rc
,HEMCO_Config.rc
3. Input Data Handling
3.1 Dry Run and AWS Setup
To determine required meteorological and restart data:
1 | ./gcclassic --dryrun | tee log.dryrun |
3.2 Download the data
1 | ./download_data.py log.dryrun geoschem+aws |
3.3 Fixing restart file timestamp errors
Sometimes AWS pulls a misaligned restart file. Manually download the correct one, for example:
1 | wget http://geoschemdata.wustl.edu/ExternalShare/geos-chem/10yr_benchmarks/14.0.0/GCClassic/Restarts/2018/GEOSChem.Restart.20181001_0000z.nc4 |
Place it into the Restarts/
directory of your run folder.
4. SLURM Run Script (run_gcclassic.slurm
)
Simply run by sbatch run_gcclassic.slurm
to start the simulation, and there will be email to remind when the simulation was done.
1 | #!/bin/bash |
5. Debugging and Errors
5.1 Segmentation Fault
If encoutering:
Investigated via gdb
, pinpointed to cldj_fjx_sub_mod.F90
, line 1457:
1 | DD(I,J,L,K) = -E(I,J)*C(J,L,K) |
Likely due to unallocated or incorrectly dimensioned array.
I found increase the memory could be helpful, so in the
- Increased
--mem=64000
(64 GB) to--mem=400000
. - Ensured
ulimit -s unlimited
applied
6. Output Control and Optimization
6.1. Optmization of exectuable speed
- In
HISTORY.rc
, I disabled species output to save time and space. - In
geoschem_config.yml
,
1 | autoreduce_solver: |
This can help reduce runtime by simplifying the chemical solver dynamically.
7. Job Monitoring
Submit:
1 | sbatch run_gcclassic.slurm |
Monitor:
1 | squeue -u $USER |
Stop
1 | scancel <JOBID> |
Check logs:
1 | cat gcclassic_<JOBID>.out |
A simple example of the results
References
GEOS-Chem User Guides and Documentation
GEOS-Chem Official Website: https://geos-chem.org
User Documentation: https://geos-chem.readthedocs.ioGEOS-Chem GitHub Repository
Source code and run directory setup: https://github.com/geoschem/GCClassicGEOS-Chem Input Data on AWS
https://registry.opendata.aws/geos-chemAWS CLI Installation Guide
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.htmlGEOS-Chem Error Troubleshooting Guide
https://geos-chem.readthedocs.io/en/14.2.2/geos-chem-shared-docs/supplemental-guides/error-guide.html
Comments