Skip to content

Commit

Permalink
Merge pull request #73 from nichollsh/hn/version
Browse files Browse the repository at this point in the history
Check SOCRATES version
  • Loading branch information
nichollsh authored Nov 14, 2024
2 parents 4a605ca + 7f737e0 commit 9769ea5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 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.10.0
version: 0.10.1
doi: 10.xx/xx.xx
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.10.0"
version = "0.10.1"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
],
"identifier": "",
"codeRepository": "https://github.com/nichollsh/AGNI",
"datePublished": "2024-09-13",
"dateModified": "2024-09-13",
"datePublished": "2024-11-14",
"dateModified": "2024-11-14",
"dateCreated": "2024-09-13",
"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.10.0"
"version": "0.10.1"
}
17 changes: 13 additions & 4 deletions src/atmosphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,23 @@ module atmosphere
mkdir(OUT_DIR)
end

@info "Setting-up a new atmosphere struct"
@info "Setting-up a new atmosphere struct"

# Code versions
atmos.AGNI_VERSION = "0.10.0"
atmos.AGNI_VERSION = "0.10.1"
atmos.SOCRATES_VERSION = readchomp(joinpath(ENV["RAD_DIR"],"version"))
@debug "AGNI VERSION = $(atmos.AGNI_VERSION)"
@debug "AGNI VERSION = "*atmos.AGNI_VERSION
@debug "Using SOCRATES at $(ENV["RAD_DIR"])"
@debug "SOCRATES VERSION = $(atmos.SOCRATES_VERSION)"
@debug "SOCRATES VERSION = "*atmos.SOCRATES_VERSION

# Check SOCRATES version is valid
SOCVER_minimum = 2407.2
if parse(Float64, atmos.SOCRATES_VERSION) < SOCVER_minimum
@error "SOCRATES is out of date and cannot be used!"
@error " found at $(ENV["RAD_DIR"])"
@error " version is "*atmos.SOCRATES_VERSION
end


atmos.num_rt_eval = 0

Expand Down
8 changes: 4 additions & 4 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ module solver
divergence, minimising flux loss across a cell by iterating the temperature
profile.
Not compatible with convective adjustment; MLT must be used.
Arguments:
- `atmos::Atmos_t` the atmosphere struct instance to be used.
- `sol_type::Int` solution type, 1: tmp_surf | 2: skin | 3: flux_int | 4: tgt_olr
Expand All @@ -79,6 +77,7 @@ module solver
- `sens_heat::Bool` include sensible heating at the surface
- `conduct::Bool` include conductive heat transport within the atmosphere
- `latent::Bool` include latent heat exchange (condensation/evaporation)
- `reset_vmrs::Bool` reset atmosphere to a well-mixed composition after the phase change calculation
- `dx_max::Float64` maximum step size [K]
- `max_steps::Int` maximum number of solver steps
- `max_runtime::Float64` maximum runtime in wall-clock seconds
Expand Down Expand Up @@ -106,6 +105,7 @@ module solver
chem_type::Int=0,
convect::Bool=true, sens_heat::Bool=true,
conduct::Bool=true, latent::Bool=true,
reset_vmrs::Bool=true,
dx_max::Float64=400.0,
max_steps::Int=400, max_runtime::Float64=900.0,
fdw::Float64=3.0e-5, fdc::Bool=true, fdo::Int=2,
Expand Down Expand Up @@ -172,7 +172,6 @@ module solver
rb2::Array{Float64,1} = zeros(Float64, arr_len) # Backward difference (-2 dx)
x_s::Array{Float64,1} = zeros(Float64, arr_len) # Perturbed row, for jacobian
fd_s::Float64 = 0.0 # Row perturbation amount
drdx::Float64 = 0.0 # Jacobian element dr/dx

# solver
b::Array{Float64,2} = zeros(Float64, (arr_len, arr_len)) # Approximate jacobian (i)
Expand Down Expand Up @@ -244,7 +243,8 @@ module solver
# Calculate fluxes
energy.calc_fluxes!(atmos,
latent, convect, sens_heat, conduct,
convect_sf=easy_sf, latent_sf=easy_sf)
convect_sf=easy_sf, latent_sf=easy_sf,
reset_vmrs=reset_vmrs)

# Energy divergence term
@turbo @. atmos.flux_dif -= atmos.ediv_add
Expand Down

0 comments on commit 9769ea5

Please sign in to comment.