Skip to content

Commit ffaa73d

Browse files
committed
Support for Julia 1.12 and 1.13-rc. Update docs to use same structure as PROTEUS.
1 parent 3d2ddbb commit ffaa73d

7 files changed

Lines changed: 93 additions & 98 deletions

File tree

.github/workflows/install_and_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
3131
# Setup Julia
3232
- name: Setup Julia
33-
uses: julia-actions/setup-julia@v2
33+
uses: julia-actions/setup-julia@v3
3434
with:
35-
version: '1.11'
35+
version: '1.12'
3636

3737
- name: Cache Julia
3838
uses: julia-actions/cache@v3

docs/make.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ makedocs(
1616
pages = [
1717
"Home" => "index.md",
1818

19-
PageNode("Tutorials" => "tutorials/index.md", [
20-
"Getting started" => "tutorials/getting_started.md",
21-
"Example outputs" => "tutorials/examples.md",
22-
]
23-
),
24-
2519
PageNode("How-to guides" => "howto/index.md", [
20+
"Getting started" => "howto/getting_started.md",
2621
"Obtaining input data" => "howto/data.md",
2722
"Configuring AGNI" => "howto/configure.md",
2823
"Using FastChem" => "howto/fastchem.md",
@@ -34,6 +29,11 @@ makedocs(
3429
],
3530
),
3631

32+
PageNode("Tutorials" => "tutorials/index.md", [
33+
"Example outputs" => "tutorials/index.md",
34+
]
35+
),
36+
3737
PageNode("Explanation" => "explanation/index.md", [
3838
"Model description" => "explanation/model.md",
3939
"Related codes" => "explanation/ecosystem.md",
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ GNU/Linux and MacOS (including ARM) are supported.
1616
Do not install Julia using your system package manager. Install only from julialang.org as below.
1717

1818
## Installation
19+
1920
Follow the ordered steps below
2021
1. Install Julia's package manager
2122
- `curl -fsSL https://install.julialang.org | sh`
22-
2. Switch to Julia 1.11
23-
- `juliaup add 1.11 && juliaup default 1.11`
24-
3. Download AGNI
25-
- `git clone https://github.com/nichollsh/AGNI.git`
26-
4. Change directory: `cd AGNI`
27-
5. Setup SOCRATES by doing either **ONE** of the following...
28-
a. Follow the instructions on the [SOCRATES GitHub](https://github.com/FormingWorlds/SOCRATES) page
29-
b. **OR**, run `./src/get_socrates.sh`
30-
6. Setup FastChem
23+
24+
2. Download AGNI
25+
- `git clone https://github.com/nichollsh/AGNI.git && cd AGNI`
26+
27+
3. Setup SOCRATES by doing either **ONE** of the following...
28+
- a) Follow the instructions on the [SOCRATES GitHub](https://github.com/FormingWorlds/SOCRATES) page
29+
- b) **OR**, run `./src/get_socrates.sh`
30+
31+
4. Setup FastChem
3132
- `./src/get_fastchem.sh`
32-
7. Add `RAD_DIR` and `FC_DIR` to your environment and bashrc file
33-
8. Finally, install AGNI
33+
34+
5. Install AGNI
3435
- `./src/get_agni.sh`
3536

3637
AGNI is now installed as a package of the Julia environment in the `AGNI/`
@@ -46,7 +47,7 @@ directory. These steps will have downloaded some basic input data.
4647
## Testing
4748
If you want to run the tests manually, simply use the script in the `test/` folder...
4849
```bash
49-
julia test/runtests.jl
50+
julia --project=. test/runtests.jl
5051
```
5152
This will print information on whether tests passed or failed.
5253

@@ -97,5 +98,5 @@ Potential flags for each species are:
9798
* `COND` - this gas is allowed to condense
9899

99100
Output files are written to the directory specified in the configuration file (default: `out/`).
100-
See [Example outputs](@ref) for illustrative results, and [How-to guides](@ref) for
101+
See [Tutorials](@ref) for illustrative results, and [How-to guides](@ref) for
101102
next steps such as configuring the model for your own science case.

docs/src/howto/troubleshoot.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This page may be useful if you are having problems. Double check that you follow
44
of the [Getting started](@ref) instructions first.
55

66
## Julia version is incompatible / Errors about OpenSSL library
7-
You must use Julia version 1.11 because there are incompatibilities between the OpenSSL
8-
library required by Julia 1.12 and Python.
7+
There have historically been incompatibilities between the OpenSSL
8+
library required by Julia and by Python.
99

1010
Switch Julia versions using the `juliaup` command. E.g:
1111
```bash

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The documentation is structured following the [Diátaxis](https://diataxis.fr/)
1414

1515
| Section | Purpose |
1616
| :---: | :---|
17-
| [**Tutorials**](@ref "Getting started") | Step-by-step guides. Start here to install the code and run your first simulation. |
1817
| [**How-to guides**](@ref "How-to guides") | Task-oriented recipes for specific goals; e.g. configuration, grid runs. |
18+
| [**Tutorials**](@ref "Tutorials") | Step-by-step guides. Start here to install the code and run your first simulation. |
1919
| [**Explanation**](@ref "Model description") | Background reading on the physics, numerics, and ecosystem context. |
2020
| [**Reference**](@ref "Reference") | Complete code API and config-file reference for people who like details. |
2121

docs/src/tutorials/examples.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

docs/src/tutorials/index.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,71 @@
22

33
Tutorials are **learning-oriented**. They guide you through a series of steps so that you can get AGNI running and see what it can do. Start here if you are new to AGNI.
44

5-
| Tutorial | Description |
6-
|:---------|:------------|
7-
| [Getting started](@ref) | Install AGNI and run your first model |
8-
| [Example outputs](@ref) | Worked examples illustrating model capabilities |
5+
These examples illustrate the kinds of results AGNI can produce. You can find
6+
Jupyter notebooks which reproduce these results in the
7+
[tutorials directory](https://github.com/nichollsh/AGNI/tree/main/tutorials) of
8+
the repository.
9+
10+
## Pure steam runaway greenhouse effect
11+
By assuming the atmosphere temperature profile follows a dry adiabat and the water
12+
vapour-condensate coexistence curve defined by the Clausius-Clapeyron relation, we see a
13+
characteristic relationship between the outgoing longwave radiation (OLR) and the surface
14+
temperature ($T_s$). Initially OLR increases with $T_s$, but as the condensing layer
15+
(which is independent of $T_s$) overlaps with the photosphere, OLR and $T_s$ decouple.
16+
Eventually the atmosphere reaches a dry post-runaway state, and OLR increases rapidly
17+
with $T_s$.
18+
19+
![](fig_runaway.png)
20+
21+
22+
## Prescribed convective case
23+
In this case, a temperature profile is prescribed to follow a dry adiabat from the
24+
surface to a moist region, and then a pseudoadiabat to the top of the atmosphere. This is
25+
in line with previous works and the OLR curve above.
26+
27+
![](fig_nosolve_ptprofile.png)
28+
29+
Radiative fluxes are then calculated according to this temperature profile. Because the
30+
profile is prescribed, the fluxes are not balanced locally or globally across the column.
31+
32+
![](fig_nosolve_fluxes.png)
33+
34+
35+
## Radiative-convective solution
36+
Instead, we can model an atmosphere such that energy is globally and locally conserved.
37+
Convection is parameterised using mixing length theory in this case, allowing the system
38+
to be solved using a Newton-Raphson method. In the convective region at ~0.1 bar, we can
39+
see that the radiative fluxes and convective fluxes entirely cancel, because AGNI was
40+
asked to solve for a case with zero total flux transport.
41+
42+
![](fig_withsolve_ptprofile.png)
43+
44+
![](fig_withsolve_fluxes.png)
45+
46+
47+
We can also plot the outgoing emission spectrum and normalised longwave contribution
48+
function (CF). The spectrum clearly demonstrates complex water absorption features, and
49+
exceeds blackbody emission at shorter wavelengths due to Rayleigh scattering. The CF
50+
quantifies how much each pressure level contributes to the outgoing emission spectrum at a
51+
given wavelength -- this is then plotted versus wavelength and pressure.
52+
53+
54+
![](fig_withsolve_emission.png)
55+
56+
57+
## Aerosol radiative properties
58+
AGNI incorporates the radiative effects of aerosols and clouds in the atmosphere. The model supports arbitrary aerosol types, based on Mie theory. Pre-computed aerosol types include soot, ash, sulfate, and nitrate particles.
59+
60+
In the example below, an atmosphere is configured with three aerosol species at different concentrations. The configuration file is located at `res/config/physics/aerosols.toml`
61+
62+
The plot below shows the enforced mixing ratio profiles of the aerosols. Water is plotted with a dotted line because its ratiative effects are disabled in this example.
63+
![](fig_aerosol_cloud.png)
64+
65+
Aerosols modify both shortwave and longwave radiative transfer. The flux profiles below show how aerosols alter the vertical distribution of radiative heating and cooling. Importantly, the shortwave stellar radiation is largely reflected and attenuated at low pressures.
66+
67+
![](fig_aerosol_fluxes.png)
68+
69+
The emission spectrum highlights the fingerprint of the aerosols. The plot shows a distinct shortwave contribution (blue line) due to back-scattering from the aerosols specifically, with some identifiable features.
70+
71+
![](fig_aerosol_emission.png)
72+

0 commit comments

Comments
 (0)