PATMO Course / Lecture 1 of 7

This lecture introduces PATMO as the main model tool of this course. The goal is to understand what kind of model it is, what kinds of questions it can help you explore, and why the modern sulfur cycle is used as the main training case throughout the semester.

Main Point. PATMO is a one-dimensional atmospheric photochemistry model used for controlled and interpretable computational experiments.

If you finish this page and can clearly answer the questions in the check section at the end, then you have understood the main point of Lecture 1.

After reading this page, you should be able to:

  • identify what kind of model PATMO is
  • recognize the key files in tests/modern_sulfur_cycle/ and what each one does
  • understand how the modern sulfur cycle becomes a runnable PATMO case
  • know which output files to inspect after a run

On This Page

  1. PATMO as a model
  2. A simplified modern sulfur cycle
  3. Modern sulfur cycle input files and initial conditions
  4. How PATMO uses these files in code
  5. What PATMO produces after a run
  6. Check yourself

PATMO as a Model

At the most basic level, PATMO is a numerical model for atmospheric chemistry and related physical processes. It is a structured way to describe a scientific setup and compute how that setup evolves under clearly stated assumptions.

PATMO architecture for the modern sulfur cycle case shown as a one-dimensional atmospheric column with solar flux, chemistry, transport, source, and sink processes.
Figure. Architecture of PATMO in the modern sulfur cycle case.

In this course, the word model does not mean “automatic truth.” It means a simplified and computable representation of reality that helps you run repeatable and comparable experiments.

If you want a short external overview of common atmospheric model families, see this climate modelling overview from AC2.

One-Dimensional

When we say that PATMO is one-dimensional, we mean that it focuses on the vertical direction. Instead of representing the entire atmosphere in longitude, latitude, and height, it treats the atmosphere as a single vertical column divided into layers.

Continuous Vertical Form

ni (z,t) t = Pi (z,t) Li (z,t) Φi (z,t) z

In a 1D atmospheric column, the abundance of species i changes because of local production, local loss, and the vertical divergence of flux.

Layer-by-Layer Discretization

d n i,k dt = Pi,k Li,k Φ i,k+1/2 Φ i,k1/2 Δzk

Here, k = 1, 2, ..., N labels the vertical layers. This is the key idea behind a 1D model: the atmosphere is represented as a stack of coupled layers, and each layer exchanges material with the layers above and below.

  • temperature can vary by layer
  • density can vary by layer
  • species abundances can vary by layer
  • radiation conditions can vary by layer

This is why the output of a 1D model is often a profile rather than a single number. The model is solving the atmosphere one layer at a time, while still allowing neighboring layers to interact through transport.

Textbook note. The use of altitude as a vertical coordinate and the species continuity equation as the basis for layer-by-layer atmospheric modeling are discussed in Jacobson, Fundamentals of Atmospheric Modeling, Second Edition, Section 5.2 “Altitude coordinate” (p. 143) and Section 7.3 “The species continuity equation” (p. 211).

Photochemistry

When we say that PATMO is a photochemistry model, we mean that radiation directly affects chemistry. Some molecules absorb photons, change chemically, and then alter the rest of the reaction network.

So radiation is not just a background setting in PATMO; it is one of the active drivers of chemical evolution.

1. Opacity

τλ (z) = z i ni (z) σi,λ (z) dz

This is the wavelength-dependent optical depth above altitude z. It measures how much absorbing material lies overhead and how strongly that material interacts with radiation at wavelength λ.

2. Solar Flux in Each Layer

Iλ (z) = Iλ () e τλ (z) cosθ

Once the optical depth is known, the incoming solar radiation is attenuated as it travels downward. Larger optical depth means less radiation survives to a given layer. The angle θ is the solar zenith angle.

3. Photochemical Rate Constant

Ji (z) = λ1 λ2 φi (λ) σi (λ) Iλ (z) dλ

This gives the photolysis rate of species i at altitude z. It combines three ingredients: how efficiently absorbed photons trigger reaction (φi, the quantum yield), how strongly the species absorbs light (σi, the cross section), and how much radiation is actually available locally (Iλ).

In short, the logic is: opacity controls how much solar radiation survives to a given layer, and that surviving radiation sets the local photochemical rate constants.

Textbook note. The links among optical depth, solar zenith angle, radiative transfer, and photolysis coefficients are discussed in Jacobson, Fundamentals of Atmospheric Modeling, Second Edition, Section 9.6 “Optical depth” (p. 313), Section 9.7 “Solar zenith angle” (p. 316), Section 9.8 “The radiative transfer equation” (p. 317), and Section 9.8.4 “Heating rates and photolysis coefficients” (p. 332).

What PATMO Is Not

PATMO is not an observational instrument, not a database, and not a machine that automatically decides whether your scientific interpretation is correct.

Box Model

   atmosphere
      |
      v
 +-----------+
 | one box   |
 | well      |
 | mixed     |
 +-----------+

A box model treats the whole system as one mixed compartment. There is no vertical structure inside the box.

  • space resolved: none
  • state variables: one value per species
  • best for: the simplest chemical thinking

1D Model

      top
       ^
 +-----------+
 | layer 4   |
 +-----------+
 | layer 3   |
 +-----------+
 | layer 2   |
 +-----------+
 | layer 1   |
 +-----------+
       ^
    surface

A 1D model resolves the atmosphere vertically. Each layer can have its own temperature, density, radiation field, and species abundances.

  • space resolved: altitude only
  • state variables: one profile per species
  • best for: vertical structure, photochemistry, and diffusion

3D Model

          z
          ^
          |
     +----+----+
    /|   /|   /|
   +----+----+ |
   | +--|--+-| +
   |/   |/   |/
   +----+----+ --> x
  /
 v
y

A 3D model resolves the atmosphere as a full volume. Conditions can vary in longitude, latitude, and height at the same time.

  • space resolved: horizontal and vertical directions
  • state variables: one 3D field per species
  • best for: global transport and spatially complex systems

Why this is a good teaching model.

A 1D photochemistry model is more informative than a single box model, but still much easier to understand than a full 3D model. That makes it a strong choice for learning how model inputs, chemistry, transport, and outputs connect.

A Simplified Modern Sulfur Cycle

Before reading the PATMO case directory, it helps to have one simple picture in mind: which sulfur species are released near the surface, which ones can reach the stratosphere, and how they are converted into sulfate aerosol.

Simplified atmospheric modern sulfur cycle showing surface emissions of COS, SO2, CS2, H2S, and DMS, oxidation pathways, transport to the stratosphere, conversion to H2SO4 and stratospheric sulfur aerosol, and return to the surface by deposition.
Figure. A simplified atmospheric modern sulfur cycle schematic.

How to Read This Figure

In this simplified picture, sulfur enters the atmosphere through near-surface release of COS, SO2, CS2, H2S, and DMS. Among these species, CS2, H2S, and DMS are oxidized in the lower atmosphere and feed the production of COS and SO2.

SO2 is usually oxidized efficiently near the surface and in the troposphere, so it does not easily survive long enough to reach the stratosphere. In practice, direct injection by strong events such as volcanic eruptions is one important way for SO2 to appear there.

COS is relatively stable compared with the other reduced sulfur gases. That makes it an effective carrier of sulfur into the stratosphere, where it is oxidized through a sequence of reactions that eventually produces SO2.

Once SO2 is present in the stratosphere, further oxidation produces H2SO4. That sulfuric acid then contributes to the formation of stratospheric sulfur aerosol (SSA).

Finally, SSA does not remain suspended forever. It is removed through physical processes such as sedimentation and deposition, which return sulfur to lower levels and eventually back toward the surface.

Why this figure matters for PATMO.

The rest of Lecture 1 shows how this simplified sulfur-cycle picture is turned into a runnable PATMO case through input files, a driver program, and diagnostic outputs.

Modern Sulfur Cycle Input Files and Initial Conditions

If you want to understand how the modern sulfur cycle is represented in PATMO, the most useful place to start is the case directory tests/modern_sulfur_cycle/. This folder contains the input package for the case: editable spreadsheet inputs, runtime text files, the Fortran driver, and helper files for source and sink processes.

tests/modern_sulfur_cycle/
├── settings.xlsx          -> options.opt
├── profile.xlsx           -> profile.dat
├── solar_flux.xlsx        -> solar_flux.txt
├── reaction_network.xlsx  -> reaction_network.ntw
├── test.f90
├── copylist.pcp
└── helper deposition / rainout files

In this case, the spreadsheet files are convenient for human inspection and editing. The runtime files such as options.opt, profile.dat, solar_flux.txt, and reaction_network.ntw are the files used by the model during execution.

1. Main input-file types

File Kind of input What it contains Why it matters
settings.xlsx
options.opt
Case settings Grid size, wavelength range, switches, emissions, dry deposition, fixed species Controls how the case is configured before the model runs
profile.xlsx
profile.dat
Initial vertical column Altitude, Kzz, temperature, and species number densities in each layer Defines the initial state of the 1D atmosphere
solar_flux.xlsx
solar_flux.txt
Radiation input Top-of-atmosphere spectral solar flux Drives opacity, local solar flux, and photolysis rates
reaction_network.xlsx
reaction_network.ntw
Chemical mechanism Reactants, products, and rate information for the sulfur chemistry Defines which reactions PATMO is allowed to solve
test.f90 Driver code The case-specific Fortran program that initializes the model and writes outputs Shows how this case is actually executed in code
copylist.pcp and helper .txt files Case support files Files copied into the build directory, including deposition and rainout inputs Provide auxiliary data needed by this specific sulfur-cycle case

2. Initial conditions in profile.xlsx

profile.xlsx is the clearest place to see what the atmospheric column looks like at the beginning of the simulation. The first columns define the vertical structure, and the remaining columns store number densities for individual species.

Column group Meaning
index Layer number in the 1D column
alt Altitude in km
dummy An auxiliary profile column carried with the prepared input file; not the main teaching focus in Lecture 1
Kzz Eddy diffusion coefficient used for vertical mixing
Tgas Gas temperature in each layer
Species columns Initial number densities in cm^-3 for each species
Two-panel plot of initial number-density profiles from profile.xlsx, with altitude in kilometers on the vertical axis and number density on the horizontal axis, showing only the non-zero species.
Figure. Initial number-density profiles from profile.xlsx. Only non-zero species are plotted.

What the Plot Shows

The non-zero initial profiles are mainly background gases and oxidants: N2, O2, CO2, H2O, O3, O, OH, HO2, CO, and total number density M.

This is a good reminder that a PATMO case is not just chemistry. It also needs a physically defined background atmosphere in which that chemistry can evolve.

What Starts at Zero

In this case, the sulfur-bearing species in the initial profile are set to zero: COS, CS2, CS, H2S, SH, S, SO, SO2, SO3, HSO, HSO2, HSO3, H2SO4, DMS, SO4, CS2E, and CH4O3S.

That means the sulfur cycle is not initialized by a pre-existing sulfur column. Instead, sulfur is introduced mainly through the source terms defined in the case settings and then evolves through chemistry and transport.

3. What settings.xlsx controls

settings.xlsx is the human-readable summary of the case configuration. In this workflow, it is converted into options.opt, which is the runtime settings file read by PATMO.

Parameter Value in this case What it means Why it matters here
cellsNumber 60 Number of vertical layers Sets the vertical resolution of the 1D column
cellThickness 1000 m Thickness of each model layer With 60 layers, this gives a 60 km atmospheric column
photoBinsNumber 4400 Number of wavelength bins used for photochemistry Controls the spectral resolution of the radiation calculation
wavelengMin 120 nm Short-wavelength limit of the radiation grid Defines the lower bound of the photochemical spectrum
wavelengMax 400 nm Long-wavelength limit of the radiation grid Defines the upper bound of the photochemical spectrum
zenith_angle 60 degree Solar zenith angle Enters the attenuation formula for local solar flux
TOA_para 0.5 Scaling factor applied at the top-of-atmosphere flux boundary In this case, the incoming solar flux is reduced by half at the top boundary
usePhotochemistry T Turns photochemistry on Necessary because radiation-driven chemistry is central to this case
useHescape F Turns hydrogen escape off This process is not part of the teaching focus of the modern sulfur cycle case
useWaterRemoval F Turns water removal off Keeps the case focused on the sulfur-cycle processes being introduced here
useAerosolformation T Allows aerosol formation processes to operate Needed because sulfuric-acid production is linked to sulfate aerosol formation
gravity_species SO4:gd(j) Assigns gravitational settling behavior to SO4 Represents the fact that sulfur aerosol is removed physically as well as chemically
constant_species 12 species Species held fixed instead of being fully integrated as prognostic variables Simplifies the case while preserving an oxidizing background atmosphere
drydep_species 5 sulfur species Dry-deposition velocities at the lower boundary Represents surface removal of sulfur gases
emission_species 5 sulfur species Surface emission source strengths These emissions are the main way sulfur enters the column in this case

emission_species

Species Emission rate Unit
COS8.1001d2molecule cm^-3 s^-1
CS25.9886d2molecule cm^-3 s^-1
H2S84.7910d2molecule cm^-3 s^-1
SO2615.84d2molecule cm^-3 s^-1
CH3SCH3 (DMS)39.50274d3molecule cm^-3 s^-1

drydep_species

Species Deposition velocity Unit
COS9.5d-3cm s^-1
CS24.48d-2cm s^-1
SO21cm s^-1
H2S1.7d-1cm s^-1
CH3SCH3 (DMS)1.48d-1cm s^-1

constant_species

The species held fixed in this case are: HO2, N, CO2, H2O, CO, O2, N2, OH, O, H2, H, and O3.

This keeps a prescribed oxidizing background while the sulfur species respond to emissions, photochemistry, transport, and deposition.

4. Boundary-condition summary for the modern sulfur cycle case

As a final summary, the table below collects the main lower-boundary sulfur inputs and removal terms in converted teaching units. The emission and dry-deposition entries are consistent with the case settings, while the Henry's-constant column is included as supporting boundary-condition context for sulfur uptake and removal.

Species Emission
(Tg year-1)
Dry deposition
(cm s-1)
Henry's constant
(mol L-1 atm-1)
COS 1.3 9.5 × 10-3 0.02
CS2 1.2 4.48 × 10-2 0.05
SO2 105.4 1 4000
H2S 7.72 1.7 × 10-1 0.1
DMS 65.57 1.48 × 10-1 --
SSA -- -- 5 × 104

Read this table as a compact reminder of how sulfur enters and leaves the model column: gaseous sulfur species are supplied at the lower boundary by emissions, some are removed there by dry deposition, and highly soluble sulfur species are also connected to aqueous uptake through large Henry's constants.

How PATMO Uses These Files in Code

The spreadsheet files are not the final objects read by the runtime model. In this workflow, compile_modern_sulfur_cycle.sh converts the editable spreadsheets into the text files that PATMO actually uses when the case is built and executed.

settings.xlsx          -> options.opt
profile.xlsx           -> profile.dat
solar_flux.xlsx        -> solar_flux.txt
reaction_network.xlsx  -> reaction_network.ntw

1. options.opt as the switchboard

cellsNumber = 60
zenith_angle = 60
usePhotochemistry = T
emission_species = COS:..., CS2:..., H2S:..., SO2:..., CH3SCH3:...
drydep_species = COS:..., CS2:..., SO2:..., H2S:..., CH3SCH3:...

Once settings.xlsx has been converted, options.opt becomes the central runtime settings file. It tells PATMO how many layers to use, what solar geometry to apply, whether photochemistry is active, and which sulfur gases are emitted or removed at the lower boundary.

2. reaction_network.ntw as the chemistry file

13,H2S,OH,,H2O,SH,,...
26,SO2,O,M,SO3,M,,...
33,SO2,OH,M,HSO3,M,,...
34,SO3,H2O,,H2SO4,,,...
37,SO2,,,SO4,,,0

This file is where the sulfur cycle becomes an explicit mechanism that the solver can evaluate. It is the bridge between the conceptual sulfur-cycle diagram and the actual reaction network used in the model.

3. test.f90 as the case driver

call patmo_init()
call patmo_loadInitialProfile("profile.dat",unitH="km",unitX="1/cm3")
call patmo_setFluxBB()
call patmo_dumpJValue("jvalue.dat")
call patmo_dumpOpacity("opacity.dat")
call patmo_dumpAllRates("rates.dat")
call patmo_dumpAllMixingRatioToFile("allNDs.dat")

This is the Fortran driver program for the case. It shows, in code, how the runtime inputs are loaded: first the model is initialized, then the atmospheric profile is read, then the radiation field is set, and finally the diagnostic outputs are written. If you want to see where this PATMO run actually starts and ends, this is the file to open.

Practical takeaway.

The modern sulfur cycle becomes runnable in PATMO only when these files work together: the spreadsheet inputs define the case, the converted text files are read at runtime, and test.f90 provides the code path that actually launches the experiment.

What PATMO Produces After a Run

At the end of tests/modern_sulfur_cycle/test.f90, the case writes four output files that you will repeatedly use in later lectures:

call patmo_dumpJValue("jvalue.dat")
call patmo_dumpOpacity("opacity.dat")
call patmo_dumpAllRates("rates.dat")
call patmo_dumpAllMixingRatioToFile("allNDs.dat")

In addition to those named diagnostic files, this case also writes species-specific density profiles through patmo_dumpDensityToFile. After your 60-year rerun, these outputs appear as build/fort.* files.

call patmo_dumpDensityToFile(35,t,patmo_idx_COS)
call patmo_dumpDensityToFile(36,t,patmo_idx_S2)
call patmo_dumpDensityToFile(37,t,patmo_idx_HSO)
call patmo_dumpDensityToFile(38,t,patmo_idx_HSO2)
call patmo_dumpDensityToFile(39,t,patmo_idx_HSO3)
call patmo_dumpDensityToFile(40,t,patmo_idx_CS2)
call patmo_dumpDensityToFile(41,t,patmo_idx_SO3)
call patmo_dumpDensityToFile(42,t,patmo_idx_CH4O3S)
call patmo_dumpDensityToFile(43,t,patmo_idx_SO4)
call patmo_dumpDensityToFile(44,t,patmo_idx_S)
call patmo_dumpDensityToFile(45,t,patmo_idx_SO2)
call patmo_dumpDensityToFile(46,t,patmo_idx_CS)
call patmo_dumpDensityToFile(47,t,patmo_idx_SCSOH)
call patmo_dumpDensityToFile(48,t,patmo_idx_H2SO4)
call patmo_dumpDensityToFile(49,t,patmo_idx_H2S)
call patmo_dumpDensityToFile(50,t,patmo_idx_SH)
call patmo_dumpDensityToFile(51,t,patmo_idx_SO)
call patmo_dumpDensityToFile(52,t,patmo_idx_CH3SCH3)
Multi-panel plot of sulfur-species number-density profiles from fort outputs after a 60-year PATMO run, with altitude in kilometers on the vertical axis and number density on the horizontal axis.
Figure. Final sulfur-species number-density profiles from the fort.* outputs after a 60-year run. In panels with extremely large dynamic range, the left end of the x-axis is clipped for readability.

allNDs.dat

This is the first file to inspect if you want to know what the atmosphere looks like after the run. It contains the vertical abundances or mixing ratios of the modeled species. For the modern sulfur cycle case, this is where you begin if you want to see the final profiles of species such as H2S, SO2, H2SO4, or SO4.

jvalue.dat

This file contains photolysis rates. It tells you how quickly radiation-driven reactions proceed in each layer.

opacity.dat

This file helps you understand why the photolysis rates look the way they do. It records how radiation is attenuated through the atmospheric column.

rates.dat

This file is where chemistry becomes interpretable. If you want to know which sulfur pathway is important, this is the file you need. It helps you move from “the profile changed” to “this particular reaction pathway is responsible.”

fort.* density dumps

These are species-specific profile outputs written directly from test.f90. They are especially useful when you want a quick look at the final vertical distribution of selected sulfur intermediates and products without first parsing the larger combined output files.

A useful reading order.

First inspect allNDs.dat to see the resulting sulfur profiles. Then look at jvalue.dat and opacity.dat to understand the radiative environment. Finally, open rates.dat to identify which reactions are controlling the result.

Check Yourself

Before you move on to Lecture 2, answer the questions below. If you can answer them correctly, then the main idea of Lecture 1 is already in place.

1

Which spreadsheet is the best place to inspect the altitude-dependent initial number densities of species in this case?

2

In this lecture, why are many sulfur species zero in profile.xlsx at the start of the run?

3

Which parameter in settings.xlsx contains the surface source strengths that inject sulfur gases into the atmospheric column?

4

Which of the following is a question that PATMO is well suited to explore?

5

Which of the following is not something PATMO is meant to do?