Skip to content

Commit

Permalink
Merge pull request #50 from nichollsh/cloud
Browse files Browse the repository at this point in the history
Thermodynamics and clouds, kinda
  • Loading branch information
nichollsh authored Jun 26, 2024
2 parents 2f5f88e + 996a062 commit 06de7dd
Show file tree
Hide file tree
Showing 21 changed files with 674 additions and 431 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Harrison"
orcid: "https://orcid.org/0000-0002-8368-4641"
title: "AGNI"
version: 0.5.0
version: 0.5.1
doi: 10.xx/xx.xx
date-released: 2024-06-25
url: "https://github.com/nichollsh/AGNI"
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name = "AGNI"
uuid = "ede838c1-9ec3-4ebe-8ae8-da4091b3f21c"
authors = ["Harrison Nicholls <[email protected]>"]
version = "0.5.0"
version = "0.5.1"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
BinnedStatistics = "b1065af9-dcad-4f81-8559-1003c45b126b"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Expand Down
301 changes: 274 additions & 27 deletions docs/src/assets/refs.bib

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions docs/src/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ GNU/Linux and MacOS (including ARM) are supported.

## Installation
1. Download AGNI from GitHub, either as a zip from the website or using Git
`git clone https://github.com/nichollsh/AGNI.git`
1. Setup SOCRATES by doing either **ONE** of the following...
`git clone https://github.com/nichollsh/AGNI.git`
2. `cd AGNI`
3. Setup SOCRATES by doing either **ONE** of the following...
- Follow the instructions on the SOCRATES GitHub page
- Run `source get_socrates.sh`
2. `$ julia`
3. `julia> ]`
4. `(@v1.10) pkg> activate .` ← note the dot
5. `(AGNI) pkg> build`
6. Press backspace to exit the package manager
7. `julia> exit()`
4. `$ julia -e 'using Pkg; Pkg.activate("."); Pkg.build()'`
AGNI is now installed as a package into a Julia environment in the AGNI
directory. You should run the tests next.

Expand Down
2 changes: 1 addition & 1 deletion res/config/H2_demo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ title = "Adiabatic H2 demo" # Name for this configuration
cloud = false # Include water cloud radiative properties?
aerosol = false # Include aerosol radiative properties?
overlap_method = 4 # Method for treating line overlap.
thermo_funct = false # Use temperature-dependent thermodynamic properties?
thermo_funct = true # Use temperature-dependent thermodynamic properties?
sensible_heat = false # Include sensible heat transport at the surface?
latent_heat = false # Include heat release from phase change
convection_type = "" # Convection type (mlt = use mixing length theory).
Expand Down
91 changes: 45 additions & 46 deletions res/config/cloud.toml
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
# AGNI configuration file
# This is designed to test clouds
title = "Cloud test" # Name for this configuration file
title = "Test clouds w/ prescribed T(p)"

[planet]
tmp_surf = 1900.0 # Surface temperature [kelvin]
instellation = 10000.0 # Stellar flux at planet's orbital distance [W m-2]
albedo_b = 0.0 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value
s0_fact = 0.375 # Stellar flux scale factor which accounts for planetary rotation (c.f. Cronin+13)
zenith_angle = 48.19 # Characteristic zenith angle for incoming stellar radiation [degrees]
albedo_s = 0.2 # Surface albedo
radius = 6.37e6 # Planet radius at the surface [m]
gravity = 9.81 # Gravitational acceleration at the surface [m s-2]
p_surf = 800.0 # Total surface pressure [bar]
p_top = 1e-6 # Total top-of-atmosphere pressure [bar]
vmr = { H2O = 1.0 } # Volatile volume mixing ratios
tmp_surf = 1900.0
instellation = 10000.0
albedo_b = 0.0
s0_fact = 0.375
zenith_angle = 48.19
albedo_s = 0.2
radius = 6.37e6
gravity = 9.81
p_surf = 800.0
p_top = 1e-6
vmr = { H2O = 1.0 }
condensates = ["H2O"]
tmp_eff = 0.0 # Effective temperature
tmp_eff = 0.0

[files]
clean_output = true
input_sf = "res/spectral_files/Frostflow/16/Frostflow.sf" # Path to SOCRATES spectral file.
input_star = "res/stellar_spectra/sun.txt" # Path to stellar spectrum.
output_dir = "out/" # Path to output directory.
input_sf = "res/spectral_files/Frostflow/48/Frostflow.sf"
input_star = "res/stellar_spectra/sun.txt"
output_dir = "out/"

[execution]
verbosity = 1 # Log level (0: none, 1: normal, 2: debug)
max_steps = 200 # Maximum number of solver steps.
max_runtime = 200 # Maximum wall-clock solver runtime [s].
num_levels = 100 # Number of model levels.
continua = true # Include absorption from continua?
rayleigh = false # Include rayleigh scattering?
cloud = true # Include water cloud radiative properties?
aerosol = false # Include aerosol radiative properties?
overlap_method = 4 # Method for treating line overlap.
thermo_funct = true # Accounting temperature dependence of thermodynamic properties?
sensible_heat = false # Include sensible heat transport at the surface?
latent_heat = false
convection_type = "" # Convection type ("" = no convection, "mlt" = use mixing length theory).
chemistry = 0
solution_type = 1 # Solution type (see wiki).
solvers = [] # Ordered list of solvers to apply (see wiki).
dx_max = 200.0 # Maximum step size [Kelvin], when using nonlinear solvers
initial_state = ["dry","con","H2O"] # Ordered list of requests describing the initial state of the atmosphere (see wiki).
linesearch = false # Use linesearch?
converge_atol = 5.0e-2 # Convergence criterion on absolute flux divergence [W m-2].
converge_rtol = 1.0e-4 # Convergence criterion on relative flux divergence [dimensionless].
verbosity = 1
max_steps = 200
max_runtime = 200
num_levels = 105
continua = true
rayleigh = false
cloud = true
aerosol = false
overlap_method = 4
thermo_funct = true
sensible_heat = false
latent_heat = false
convection_type = ""
chemistry = 0
solution_type = 1
solvers = []
dx_max = 200.0
initial_state = ["dry","con","H2O"]
linesearch = false
converge_atol = 5.0e-2
converge_rtol = 1.0e-4


[plots]
at_runtime = true # Make some plots at runtime?
temperature = true # Plot temperature profile?
fluxes = true # Plot fluxes?
contribution = true # Plot spectral contribution function?
emission = true # Plot emission spectrum?
albedo = true # Plot spectral albedo?
mixing_ratios = true # Plot mixing ratios?
animate = false # Make animation from runtime plots?
at_runtime = true
temperature = true
fluxes = true
contribution = true
emission = true
albedo = true
mixing_ratios = true
animate = false

88 changes: 44 additions & 44 deletions res/config/condense.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
title = "Condensation test" # Name for this configuration file

[planet]
tmp_surf = 2000.0 # Surface temperature [kelvin]
instellation = 1300.0 # Stellar flux at planet's orbital distance [W m-2]
albedo_b = 0.0 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value
s0_fact = 0.375 # Stellar flux scale factor which accounts for planetary rotation (c.f. Cronin+13)
zenith_angle = 48.19 # Characteristic zenith angle for incoming stellar radiation [degrees]
albedo_s = 0.2 # Surface albedo
radius = 6.37e6 # Planet radius at the surface [m]
gravity = 9.81 # Gravitational acceleration at the surface [m s-2]
p_surf = 7000.0 # Total surface pressure [bar]
p_top = 1e-5 # Total top-of-atmosphere pressure [bar]
vmr = { H2O=0.8, CO2=0.1, CH4=0.08, H2=0.02} # Volatile volume mixing ratios
tmp_surf = 2000.0
instellation = 1300.0
albedo_b = 0.0
s0_fact = 0.375
zenith_angle = 48.19
albedo_s = 0.2
radius = 6.37e6
gravity = 9.81
p_surf = 7000.0
p_top = 1e-5
vmr = { H2O=0.8, CO2=0.1, CH4=0.08, H2=0.02}
condensates = ["H2O", "CO2"]
tmp_eff = 0.0 # Effective temperature
tmp_eff = 0.0
turb_coeff = 1.0e-4
wind_speed = 10.0
skin_k = 2.0
Expand All @@ -23,41 +23,41 @@ title = "Condensation test" # Name for this configuration fil

[files]
clean_output = true
input_sf = "res/spectral_files/nogit/Dayspring/16/Dayspring.sf" # Path to SOCRATES spectral file.
input_star = "res/stellar_spectra/sun.txt" # Path to stellar spectrum.
output_dir = "out/" # Path to output directory.
input_sf = "res/spectral_files/nogit/Dayspring/16/Dayspring.sf"
input_star = "res/stellar_spectra/sun.txt"
output_dir = "out/"

[execution]
verbosity = 1 # Log level (0: none, 1: normal, 2: debug)
max_steps = 300 # Maximum number of solver steps.
max_runtime = 200 # Maximum wall-clock solver runtime [s].
num_levels = 40 # Number of model levels.
continua = true # Include absorption from continua?
rayleigh = false # Include rayleigh scattering?
cloud = false # Include water cloud radiative properties?
aerosol = false # Include aerosol radiative properties?
overlap_method = 4 # Method for treating line overlap.
thermo_funct = true # Accounting temperature dependence of thermodynamic properties?
sensible_heat = true # Include sensible heat transport at the surface?
latent_heat = true # Include latent heat release?
convection_type = "mlt" # Convection type ("" = no convection, "mlt" = use mixing length theory).
chemistry = 0
solution_type = 1 # Solution type (see wiki).
solvers = ["newton"] # Ordered list of solvers to apply (see wiki).
dx_max = 600.0 # Maximum step size [Kelvin], when using nonlinear solvers
initial_state = ["iso","2000"] # Ordered list of requests describing the initial state of the atmosphere (see wiki).
linesearch = true # Use linesearch?
converge_atol = 0.1 # Convergence criterion on absolute flux divergence [W m-2].
converge_rtol = 1.0e-3 # Convergence criterion on relative flux divergence [dimensionless].
verbosity = 1
max_steps = 300
max_runtime = 200
num_levels = 40
continua = true
rayleigh = false
cloud = false
aerosol = false
overlap_method = 4
thermo_funct = true
sensible_heat = true
latent_heat = true
convection_type = "mlt"
chemistry = 0
solution_type = 1
solvers = ["newton"]
dx_max = 600.0
initial_state = ["iso","2000"]
linesearch = true
converge_atol = 0.1
converge_rtol = 1.0e-3


[plots]
at_runtime = true # Make some plots at runtime?
temperature = true # Plot temperature profile?
fluxes = true # Plot fluxes?
contribution = true # Plot spectral contribution function?
emission = true # Plot emission spectrum?
albedo = true # Plot spectral albedo?
mixing_ratios = true # Plot mixing ratios?
animate = true # Make animation from runtime plots?
at_runtime = true
temperature = true
fluxes = true
contribution = true
emission = true
albedo = true
mixing_ratios = true
animate = true

2 changes: 1 addition & 1 deletion res/config/hotdry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AGNI configuration file
title = "Hot and dry" # Name for this configuration file
title = "Hot and dry"

[planet]
tmp_surf = 2000.0 # Surface temperature [kelvin]
Expand Down
61 changes: 61 additions & 0 deletions res/config/k2-18b.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# AGNI configuration file
title = "Roughly K2-18b @ IW-4"

[planet]
tmp_surf = 1000.0
instellation = 19261.0
albedo_b = 0.0
s0_fact = 0.6652
zenith_angle = 60.0
albedo_s = 0.0
radius = 1.6628E7
gravity = 12.43
p_surf = 237.473
p_top = 1e-5
vmr = { H2O=0.0085, N2=0.0009, H2=0.7931, CO=0.0111, CH4=0.1864 }
condensates = ["H2O","CH4","CO"]
tmp_eff = 0.0
turb_coeff = 0.001
wind_speed = 2.0

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

[execution]
verbosity = 1
max_steps = 20000
max_runtime = 400
num_levels = 45
continua = true
rayleigh = true
cloud = false
aerosol = false
overlap_method = 4
thermo_funct = true
sensible_heat = true
latent_heat = true
convection_type = "mlt"
condensates = []
chemistry = 0
solution_type = 3
solvers = ["newton"]
dx_max = 200.0
initial_state = ["iso","1000"]
linesearch = false
converge_atol = 1.0e-3
converge_rtol = 1.0e-1

[plots]
at_runtime = true
temperature = true
fluxes = true
contribution = true
emission = true
albedo = true
mixing_ratios = true
animate = false

Loading

0 comments on commit 06de7dd

Please sign in to comment.