Skip to content

Commit

Permalink
Merge pull request #57 from nichollsh/surface_albedo
Browse files Browse the repository at this point in the history
Fixes and extensions to surface albedo model
  • Loading branch information
nichollsh authored Jul 4, 2024
2 parents 45012c2 + 80c21cc commit e7fc4ca
Show file tree
Hide file tree
Showing 49 changed files with 2,073 additions and 151 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ See the Getting Started page in the [documentation](https://nichollsh.github.io/
## Repository structure
* `agni.jl` - AGNI executable
* `LICENSE.txt` - License for use and re-use
* `doc/` - Further documentation
* `out/` - Output files
* `res/` - Resources (configuration files, etc.)
* `deps/` - Package build scripts
* `docs/` - Documentation source files
* `misc/` - Miscellaneous files
* `out/` - Model output
* `res/` - Resources (configs, thermodynamic data, etc.)
* `src/` - Package source code
* `test/` - Package tests
* `tutorials/` - Notebooks and tutorials
Expand Down
5 changes: 3 additions & 2 deletions docs/src/model/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
AGNI models a planetary atmosphere by treating it as a single column (1D) and splitting it up into levels of finite thickness. These levels are defined in pressure-space, and are arranged logarithmically between the surface and the top of the atmosphere. The atmosphere is assumed to be plane-parallel. Quantities such as pressure and temperature are calculated at level-centres and level-edges, while energy fluxes are calculated only at the edges, and thermodynamic properties (e.g. heat capacity) are calculated only at their centres.

## Radiative transfer
Radiative transfer (RT) refers to the transport of radiation energy through a medium subject to the characteristics of the medium. Radiation passing through an atmosphere is absorbed, emitted, scattered, and reflected. In the context of planetary atmospheres, we also have to handle their surfaces, cloud formation, and radiation from the host star.
Radiative transfer (RT) refers to the transport of radiation energy through a medium subject to the characteristics of the medium. Radiation passing through an atmosphere is absorbed, emitted, scattered, and reflected. In the context of planetary atmospheres, we also have to handle their surfaces, cloud formation, and radiation from the host star.

AGNI simulates RT using SOCRATES, a numerical code written by the UK Met Office which solves the RT equation using a two-stream solution. SOCRATES is accessed using a Julia interface originally written by Stuart Daines. The atmosphere is assumed to be hydrostatically supported and to behave as an ideal gas. Opacity is handle using the correlated-k approximation, with either random overlap or equivalent extinction used to account for overlapping absorption in mixtures of gases.

The model uses k-terms fitted to spectral absorption cross-section data from [DACE](https://dace.unige.ch/opacityDatabase/?#). The MT_CKD model is used to estimate water continuum absorption cross-sections. Other continuua are derived from the HITRAN tables. Rayleigh scattering and water cloud radiative properties are also included. You can find tools for fitting k-terms and processing line absorption data in my redistribution of [SOCRATES](https://github.com/nichollsh/SOCRATES) on GitHub. The flowchart below outlines how these absorption data are converted into a 'spectral file'.
```@raw html
<img src="assets/spectral_flowchart.svg" width=100% class="center"/>
```
Surface reflectivity is modelled either as a greybody or with a wavelength-depedent spectral albedo.

## Convection
Convection is a turbulent process which occurs across more than one spatial dimension, so it must be parameterised within 1D models like AGNI. In fact, it is typically parameterised inside 3D global circulation models as resolving convection is numerically expensive. AGNI uses mixing length theory (MLT) to parameterise convection. This is in contrast to convective adjustment, which forcibly adjusts a convectively unstable region of the atmosphere to the corresponding adiabat while ensuring that enthalpy is conserved.
Expand All @@ -29,7 +30,7 @@ heating rate. This is then integrated (from the TOA downwards) to provide a late
Latent heats are temperature-dependent, using values derived from Coker (2007) and Wagner & Pruß (2001).

## Solar flux
A key input to the radiation model is the shortwave downward-directed flux from the star at the top of the atmosphere. This is quantified by the bolometric instellation flux, a scale factor, a grey planetary albedo, and a zenith angle. All of these may be provided to the model through the configuration file. The model also requires a stellar spectrum scaled to the top of the atmosphere.
A key input to the radiation model is the shortwave downward-directed flux from the star at the top of the atmosphere. This is quantified by the bolometric instellation flux, a scale factor, an artificial additional albedo factor, and a zenith angle. All of these may be provided to the model through the configuration file. The model also requires a stellar spectrum scaled to the top of the atmosphere.

## Obtaining a solution

Expand Down
File renamed without changes.
1,165 changes: 1,165 additions & 0 deletions misc/selsis.ipynb

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions res/config/55cnce_chem.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ title = "Roughly 55 Cancri e @ fO2=IW"
instellation = 3.3231e6
albedo_b = 0.0
s0_fact = 0.6652
zenith_angle = 60.0
albedo_s = 0.0
zenith_angle = 60.0
surface_material= "res/surface_albedo/c9mb29.tab"
radius = 1.1959e7
gravity = 22.304
tmp_int = 0.0
turb_coeff = 0.001
wind_speed = 2.0

[files]
input_sf = "res/spectral_files/nogit/Dayspring/256/Dayspring.sf"
input_sf = "res/spectral_files/Dayspring/256/Dayspring.sf"
input_star = "res/stellar_spectra/hd97658.txt"
output_dir = "out/"

[composition]
p_top = 1e-7
# p_dict = { H2O=0.206, CO2=14.184, N2 =16.303, H2 =0.462, CO =211.539 }
p_dict = {H2O = 0.308,CO2 = 15.516,N2 = 16.065,H2 = 0.691,CO = 231.415 }
p_dict = {H2O = 0.308,CO2 = 15.516,N2 = 16.065,H2 = 0.691,CO = 231.415 }
include_all = true
chemistry = 1
condensates = []
Expand Down
5 changes: 3 additions & 2 deletions res/config/condense.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ title = "Condensation test"
instellation = 2500.0
albedo_b = 0.0
s0_fact = 0.375
zenith_angle = 48.19
zenith_angle = 48.19
surface_material= "blackbody"
albedo_s = 0.2
radius = 6.37e6
gravity = 9.81
Expand All @@ -19,7 +20,7 @@ title = "Condensation test"

[files]
clean_output = true
input_sf = "res/spectral_files/nogit/Dayspring/16/Dayspring.sf"
input_sf = "res/spectral_files/Dayspring/16/Dayspring.sf"
input_star = "res/stellar_spectra/sun.txt"
output_dir = "out/"

Expand Down
29 changes: 15 additions & 14 deletions res/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
title = "Default" # Name for this configuration file

[planet]
tmp_surf = 2000.0 # Surface temperature [kelvin]
instellation = 44000.0 # Stellar flux at planet's orbital distance [W m-2]
albedo_b = 0.18 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value
s0_fact = 0.6652 # Stellar flux scale factor which accounts for planetary rotation (c.f. Cronin+13)
zenith_angle = 60.0 # Characteristic zenith angle for incoming stellar radiation [degrees]
albedo_s = 0.0 # Surface albedo
radius = 6.37e6 # Planet radius at the surface [m]
tmp_surf = 2000.0 # Surface temperature [kelvin].
instellation = 44000.0 # Stellar flux at planet's orbital distance [W m-2].
albedo_b = 0.18 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value.
s0_fact = 0.6652 # Stellar flux scale factor which accounts for planetary rotation (c.f. Cronin+13).
zenith_angle = 60.0 # Characteristic zenith angle for incoming stellar radiation [degrees].
surface_material= "blackbody" # Surface material (can be "blackbody" or path to data file).
albedo_s = 0.3 # Grey surface albedo when material=blackbody.
radius = 6.37e6 # Planet radius at the surface [m].
gravity = 9.81 # Gravitational acceleration at the surface [m s-2]
skin_d = 0.01 # Conductive skin thickness [m]. Used when sol_type=2.
skin_k = 2.0 # Conductive skin conductivity [W m-1 K-1]. Used when sol_type=2.
Expand All @@ -22,20 +23,20 @@ title = "Default" # Name for this configuration file

[files]
input_sf = "res/spectral_files/Frostflow/256/Frostflow.sf" # Path to SOCRATES spectral file.
input_star = "res/stellar_spectra/sun.txt" # Path to stellar spectrum.
input_star = "res/stellar_spectra/trappist-1.txt" # Path to stellar spectrum.
output_dir = "out/" # Path to output directory.

[composition]
p_surf = 270.0 # Total surface pressure [bar]
p_top = 1e-5 # Total top-of-atmosphere pressure [bar]
vmr_dict = { H2O = 1.0} # Volatile volume mixing ratios (=mole fractions)
p_surf = 270.0 # Total surface pressure [bar].
p_top = 1e-5 # Total top-of-atmosphere pressure [bar].
vmr_dict = { H2O=1.0 } # Volatile volume mixing ratios (=mole fractions).
vmr_path = "" # Path to input volume mixing ratios. Not required if planet.vmr is passed.
include_all = false # Track extra gases, even when their mixing ratio is zero
chemistry = 0 # Chemistry type (see wiki)
include_all = false # Track extra gases, even when their mixing ratio is zero.
chemistry = 0 # Chemistry type (see wiki).
condensates = [] # List of volatiles which are allowed to condense.

[execution]
clean_output = true # Clean the output folder at model startup
clean_output = true # Clean the output folder at model startup.
verbosity = 1 # Log level (0: none, 1: normal, 2: debug)
max_steps = 20000 # Maximum number of solver steps.
max_runtime = 400 # Maximum wall-clock solver runtime [s].
Expand Down
3 changes: 2 additions & 1 deletion res/config/hotdry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ title = "Hot and dry"
instellation = 44000.0
albedo_b = 0.18
s0_fact = 0.6652
zenith_angle = 60.0
zenith_angle = 60.0
surface_material= "blackbody"
albedo_s = 0.0
radius = 6.37e6
gravity = 9.81
Expand Down
68 changes: 0 additions & 68 deletions res/config/selsis.toml

This file was deleted.

8 changes: 8 additions & 0 deletions res/stellar_spectra/_readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
All spectra scaled to 1 AU.

Solar spectrum from Gueymard
https://www.nrel.gov/grid/solar-resource/spectra.html

All other spectra from MUSCLES
https://archive.stsci.edu/prepds/muscles/#dataaccess

17 changes: 17 additions & 0 deletions res/surface_albedo/_readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Surface reflectance (albedo) lookup data. These are passed to SOCRATES `rho_alb`
variable, assuming no angular dependence of the reflectivity.

All data must be in columns of:
wavelength [nm]
reflectance [dimensionless]

In order of ascending wavelength.

c9mb29.tab
Lunar Meteorite, Igneous, Gabbroic
https://pds-speclib.rsl.wustl.edu/measurement.aspx?lid=urn:nasa:pds:relab:data_reflectance:c9mb29

c1bf01.tab
Terrestrial Sample, Igneous, Basaltic
https://pds-speclib.rsl.wustl.edu/measurement.aspx?lid=urn:nasa:pds:relab:data_reflectance:c1bf01

Loading

0 comments on commit e7fc4ca

Please sign in to comment.