Skip to content

Commit

Permalink
Version 0.8.3. Now uses F_int rather than T_int for internal flux. Up…
Browse files Browse the repository at this point in the history
…dated docs and paper. New notebooks
  • Loading branch information
nichollsh committed Sep 20, 2024
1 parent bcd6343 commit 865f739
Show file tree
Hide file tree
Showing 17 changed files with 152 additions and 1,754 deletions.
4 changes: 2 additions & 2 deletions 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.8.2
version: 0.8.3
doi: 10.xx/xx.xx
date-released: 2024-09-13
date-released: 2024-09-20
url: "https://github.com/nichollsh/AGNI"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AGNI"
uuid = "ede838c1-9ec3-4ebe-8ae8-da4091b3f21c"
authors = ["Harrison Nicholls <harrison.nicholls@physics.ox.ac.uk>"]
version = "0.8.2"
version = "0.8.3"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</p>

<p align="center">
<b>A radiative-convective atmosphere model designed for interior coupling.</b>
<b>A radiative-convective model for lava planet atmospheres.</b>
</p>


Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"datePublished": "2024-09-13",
"dateModified": "2024-09-13",
"dateCreated": "2024-09-13",
"description": "A radiative-convective model for the atmospheres of rocky planets",
"description": "A radiative-convective model for lava planet atmospheres.",
"keywords": "physics, radiative transfer, exoplanets, astronomy, convection, radiation, planets, atmospheres",
"license": "GPL v3.0",
"title": "AGNI",
"version": "0.8.2"
"version": "0.8.3"
}
4 changes: 2 additions & 2 deletions docs/paper/paper.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'AGNI: A radiative-convective model for the atmospheres of rocky planets'
title: 'AGNI: A radiative-convective model for lava planet atmospheres.'
tags:
- astronomy
- physics,
Expand All @@ -24,7 +24,7 @@ affiliations:
index: 1
- name: Kapteyn Astronomical Institute, University of Groningen, P.O. Box 800, 9700 AV Groningen, The Netherlands
index: 2
date: 16 September 2024
date: 20 September 2024
bibliography: paper.bib

---
Expand Down
2 changes: 1 addition & 1 deletion docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Some parameters:
* `execution.solution_type` tells the model which state to solve for. The allowed values (integers) are...
- 1 : zero flux divergence at fixed `tmp_surf`
- 2 : zero flux divergence, with `tmp_surf` set such that the conductive skin (CBL) conserves energy flux
- 3 : the net upward flux at each layer is equal to `flux_int = sigma * tmp_int^4`
- 3 : the net flux (up minus down) at each layer is equal to `flux_int`

* `execution.solvers` tells the model which solvers to use. This is a list of strings, so multiple solvers can be applied sequentially. An empty string is always appended to the end of this list. Allowed solvers are...
- [empty string] : no solving takes place, so the model just calculates fluxes using the initial state
Expand Down
1,844 changes: 123 additions & 1,721 deletions misc/L98-59d.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion res/config/55cnce_chem.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title = "Roughly 55 Cancri e @ fO2=IW"
surface_material= "res/surface_albedos/basalt_tuff.dat"
radius = 1.1959e7
gravity = 22.304
tmp_int = 0.0
flux_int = 0.0
turb_coeff = 0.001
wind_speed = 2.0

Expand Down
2 changes: 1 addition & 1 deletion res/config/L-98-59d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title = "L 98-59 d"
surface_material= "res/surface_albedos/lunar_marebasalt.dat"
radius = 6.59051e6
gravity = 16.73
tmp_int = 0.0
flux_int = 0.0
turb_coeff = 0.001
wind_speed = 2.0

Expand Down
2 changes: 1 addition & 1 deletion res/config/condense.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title = "Condensation test"
albedo_s = 0.2
radius = 6.37e6
gravity = 9.81
tmp_int = 0.0
flux_int = 0.0
turb_coeff = 1.0e-4
wind_speed = 10.0
skin_k = 2.0
Expand Down
2 changes: 1 addition & 1 deletion res/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title = "Default" # Name for this configuration file
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.
tmp_magma = 3000.0 # Magma temperature [K]. Used when sol_type=2.
tmp_int = 0.0 # Planet's effective interior temperature [K]. Used when sol_type=3.
flux_int = 0.0 # Planet's internal flux [W m-2]. Used when sol_type=3.
turb_coeff = 0.001 # Turbulent exchange coefficient for sensible heat.
wind_speed = 2.0 # Effective wind speed for sensible heat [m s-1].

Expand Down
2 changes: 1 addition & 1 deletion res/config/hotdry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title = "Hot and dry"
albedo_s = 0.0
radius = 6.37e6
gravity = 9.81
tmp_int = 0.0
flux_int = 0.0
turb_coeff = 1.0e-2
wind_speed = 10.0

Expand Down
8 changes: 4 additions & 4 deletions src/AGNI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module AGNI
import .plotting
import .energy
import .solver
import .realgas
import .realgas

# Export
# export atmosphere
Expand Down Expand Up @@ -328,9 +328,9 @@ module AGNI
tmp_magma = cfg["planet"]["tmp_magma"]
end
# effective temperature case
tmp_int::Float64 = 0.0
flux_int::Float64 = 0.0
if sol_type == 3
tmp_int = cfg["planet"]["tmp_int"]
flux_int = cfg["planet"]["flux_int"]
end
# target OLR case
target_olr::Float64 = 0.0
Expand Down Expand Up @@ -358,7 +358,7 @@ module AGNI
overlap_method=overlap,
skin_d=skin_d, skin_k=skin_k, tmp_magma=tmp_magma,
target_olr=target_olr,
tmp_int=tmp_int,
flux_int=flux_int,
surface_material=surface_mat,
albedo_s=albedo_s,
thermo_functions=thermo_funct,
Expand Down
14 changes: 6 additions & 8 deletions src/atmosphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ module atmosphere
surf_e_arr::Array{Float64,1} # Spectral surface emissivity

tmp_surf::Float64 # Surface brightness temperature [K]
tmp_int::Float64 # Effective temperature of the planet [K]
grav_surf::Float64 # Surface gravity [m s-2]
overlap_method::Int # Absorber overlap method to be used

Expand Down Expand Up @@ -269,7 +268,7 @@ module atmosphere
- `skin_k::Float64` skin thermal conductivity [W m-1 K-1].
- `overlap_method::Int` gaseous overlap scheme (2: rand overlap, 4: equiv extinct, 8: ro+resort+rebin).
- `target_olr::Float64` target OLR [W m-2] for sol_type==4.
- `tmp_int::Float64` planet's effective (or internal) brightness temperature [K] for sol_type==3.
- `flux_int::Float64` planet's internal flux for sol_type==3.
- `all_channels::Bool` use all channels available for RT?
- `flag_rayleigh::Bool` include rayleigh scattering?
- `flag_gcontinuum::Bool` include generalised continuum absorption?
Expand Down Expand Up @@ -302,7 +301,7 @@ module atmosphere
skin_k::Float64 = 2.0,
overlap_method::Int = 4,
target_olr::Float64 = 0.0,
tmp_int::Float64 = 0.0,
flux_int::Float64 = 0.0,
all_channels::Bool = true,
flag_rayleigh::Bool = false,
flag_gcontinuum::Bool = false,
Expand All @@ -319,7 +318,7 @@ module atmosphere
end

# Code versions
atmos.AGNI_VERSION = "0.8.2"
atmos.AGNI_VERSION = "0.8.3"
atmos.SOCRATES_VERSION = readchomp(joinpath(ENV["RAD_DIR"],"version"))
@debug "AGNI VERSION = $(atmos.AGNI_VERSION)"
@debug "Using SOCRATES at $(ENV["RAD_DIR"])"
Expand Down Expand Up @@ -356,7 +355,6 @@ module atmosphere
atmos.nlev_c = nlev_centre
atmos.nlev_l = atmos.nlev_c + 1
atmos.tmp_surf = max(tmp_surf, atmos.tmp_floor)
atmos.tmp_int = tmp_int
atmos.grav_surf = max(1.0e-7, gravity)
atmos.zenith_degrees = max(min(zenith_degrees,89.8), 0.2)
atmos.surface_material= surface_material
Expand All @@ -367,7 +365,7 @@ module atmosphere
atmos.toa_heating = atmos.instellation * (1.0 - atmos.albedo_b) *
s0_fact * cosd(atmos.zenith_degrees)

atmos.flux_int = phys.sigma * (atmos.tmp_int)^4.0
atmos.flux_int = flux_int
atmos.target_olr = max(1.0e-20,target_olr)

atmos.C_d = max(0,C_d)
Expand Down Expand Up @@ -425,8 +423,8 @@ module atmosphere
atmos.cloud_arr_f = zeros(Float64, atmos.nlev_c)

# Phase change timescales [seconds]
atmos.phs_tau_mix = 1.0e4 # mixed composition case
atmos.phs_tau_sgl = 1.0e4 # single gas case
atmos.phs_tau_mix = 1.0e5 # mixed composition case
atmos.phs_tau_sgl = 1.0e5 # single gas case

# Hardcoded cloud properties
atmos.cond_alpha = 0.0 # 0% of condensate is retained (i.e. complete rainout)
Expand Down
4 changes: 2 additions & 2 deletions src/dump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module dump
# Scalar quantities
# Create variables
var_tmp_surf = defVar(ds, "tmp_surf", Float64, (), attrib = OrderedDict("units" => "K")) # Surface brightness temperature [K]
var_tmp_int = defVar(ds, "tmp_int", Float64, (), attrib = OrderedDict("units" => "K")) # Effective temperature [K]
var_flux_int = defVar(ds, "flux_int", Float64, (), attrib = OrderedDict("units" => "W m-2")) # Internal flux [W m-2]
var_inst = defVar(ds, "instellation", Float64, (), attrib = OrderedDict("units" => "W m-2")) # Solar flux at TOA
var_s0fact = defVar(ds, "inst_factor", Float64, ()) # Scale factor applied to instellation
var_albbond = defVar(ds, "bond_albedo", Float64, ()) # Bond albedo used to scale-down instellation
Expand All @@ -150,7 +150,7 @@ module dump

# Store data
var_tmp_surf[1] = atmos.tmp_surf
var_tmp_int[1] = atmos.tmp_int
var_flux_int[1] = atmos.flux_int
var_inst[1] = atmos.instellation
var_s0fact[1] = atmos.s0_fact
var_albbond[1] = atmos.albedo_b
Expand Down
2 changes: 1 addition & 1 deletion src/load.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module load
# ----------------------
# Load scalar quantities
atmos.tmp_surf = ds["tmp_surf"][] # Surface brightness temperature [K]
atmos.tmp_int = ds["tmp_int"][] # Effective temperature [K]
atmos.flux_int = ds["flux_int"][] # Internal flux [W m-2]
atmos.instellation = ds["instellation"][] # Solar flux
atmos.s0_fact = ds["inst_factor"][] # Scale factor applied to instellation
atmos.albedo_b = ds["bond_albedo"][] # Bond albedo used to scale-down instellation
Expand Down
6 changes: 2 additions & 4 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module solver
Arguments:
- `atmos::Atmos_t` the atmosphere struct instance to be used.
- `sol_type::Int` solution type, 1: tmp_surf | 2: skin | 3: tmp_int | 4: tgt_olr
- `sol_type::Int` solution type, 1: tmp_surf | 2: skin | 3: flux_int | 4: tgt_olr
- `chem_type::Int` chemistry type (see wiki)
- `convect::Bool` include convection
- `sens_heat::Bool` include sensible heating
Expand Down Expand Up @@ -263,7 +263,6 @@ module solver
elseif (sol_type == 3)
# Zero loss
resid[2:end] .= atmos.flux_dif[1:end]
# Total flux at TOA is equal to sigma*tmp_int^4
resid[1] = atmos.flux_tot[1] - atmos.flux_int

elseif (sol_type == 4)
Expand Down Expand Up @@ -401,8 +400,7 @@ module solver
@info @sprintf(" skin_d = %.2f m", atmos.skin_d)
@info @sprintf(" skin_k = %.2f W K-1 m-1", atmos.skin_k)
elseif (sol_type == 3)
@info @sprintf(" tmp_int = %.2f K", atmos.tmp_int)
@info @sprintf(" f_int = %.2f W m-2", atmos.flux_int)
@info @sprintf(" flux_int = %.2f W m-2", atmos.flux_int)
elseif (sol_type == 4)
@info @sprintf(" tgt_olr = %.2f W m-2", atmos.target_olr)
end
Expand Down

0 comments on commit 865f739

Please sign in to comment.