Click patmo_install.sh to download

patmo_install.sh is an automated installation script for setting up the PATMO atmospheric photochemical model on Ubuntu 20.04 or newer Linux distributions.
It was written to streamline the installation of compilers, Python scientific packages, and the PATMO source code repository from GitHub.
The script ensures a reproducible environment for model compilation and data analysis. 

Make the script executable: 

chmod +x patmo_install.sh

Run it in your terminal:

./patmo_install.sh

During execution, the script displays progress indicators (e.g., [1/6], [2/6]) so that users can easily track each step. 

Step 1 — System Update

sudo apt update -y
sudo apt upgrade -y

Updates the system package lists and upgrades existing packages.This ensures that all dependencies required for compiling and running PATMO are up to date. 

Step 2 — Install Compilers 

sudo apt install -y gfortran gcc g++

PATMO is primarily written in Fortran, with optional C/C++ components. This step installs:
gfortran – Fortran 2018 compiler used for the PATMO core (patmo.f90, patmo_ode.f90, etc.)
gcc/g++ – C and C++ compilers used for any linked utilities or external libraries

Step 3 — Check Git Installation 

if ! command -v git &> /dev/null; then

    sudo apt install -y git

else

    echo "git already installed."

fi

Checks whether Git is installed on the system. If not, it installs Git automatically. Git is required to clone the PATMO repository from GitHub. 

Step 4 — Install Python and Scientific Libraries 

sudo apt install -y python3 python3-pip \

python3-numpy python3-scipy python3-matplotlib

PATMO uses Python for preprocessing, post-processing, and visualization. 

Step 5 — Verify Installation 

python3 --version

python3 -c "import numpy, scipy, matplotlib; print('Python libs OK!')"

Checks that Python is correctly installed and that the scientific libraries import successfully. If you see:

Python libs OK!

The Python environment is ready for PATMO use. 

Step 6 — Clone the PATMO Repository 

git clone https://github.com/SophiaAtmo/PATMO.git

Downloads the latest version of PATMO from the official GitHub repository.
If a local folder named PATMO already exists, this step is skipped.

Completion Message 

At the end of the installation, the script prints: 

Installation completed successfully!

Repository cloned to ./PATMO

Next step: cd PATMO && ./compile.sh

This confirms that the setup was successful.
The next step is to compile the model:

cd PATMO

./compile.sh