Skip to content

Commit

Permalink
Add atmos get_field for :co2
Browse files Browse the repository at this point in the history
Add a default get_field for :co2 with AtmosModelSimulation,
and a method definition for ClimaAtmosSimulation. Note that this
returns a scalar.
  • Loading branch information
imreddyTeja committed Feb 26, 2025
1 parent 7647fb2 commit fc11b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions experiments/ClimaEarth/components/atmosphere/climaatmos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ Interfacer.get_field(sim::ClimaAtmosSimulation, ::Val{:cos_zenith_angle}) = CC.F
sim.integrator.p.radiation.rrtmgp_model.cos_zenith,
CC.Fields.level(axes(sim.integrator.u.c), 1),
)
Interfacer.get_field(sim::ClimaAtmosSimulation, ::Val{:co2}) =
sim.integrator.p.radiation.rrtmgp_model.volume_mixing_ratio_co2[]
function Interfacer.get_field(sim::ClimaAtmosSimulation, ::Val{:diffuse_fraction})
radiation_model = sim.integrator.p.radiation.rrtmgp_model
# only take the first level
Expand Down
1 change: 1 addition & 0 deletions src/Interfacer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ get_field(
sim::AtmosModelSimulation,
val::Union{
Val{:cos_zenith_angle},
Val{:co2},
Val{:diffuse_fraction},
Val{:energy},
Val{:height_int},
Expand Down

0 comments on commit fc11b05

Please sign in to comment.