Skip to content

Commit

Permalink
update import convention
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 committed Apr 10, 2024
1 parent f6a43c2 commit 801c58f
Show file tree
Hide file tree
Showing 68 changed files with 1,539 additions and 1,630 deletions.
8 changes: 0 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ authors = ["CliMA Contributors <clima-software@caltech.edu>"]
version = "0.0.1"

[deps]
ClimaAtmos = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d"
ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884"
ClimaCoreTempestRemap = "d934ef94-cdd4-4710-83d6-720549644b70"
ClimaLand = "08f4d4ce-cf43-44bb-ad95-9d2d5f413532"
ClimaParams = "5c42b081-d73a-476f-9059-fd94b934656c"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Insolation = "e98cc03f-d57e-4e3c-b70c-8d51efe9e0d8"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Expand All @@ -24,15 +20,11 @@ TempestRemap_jll = "8573a8c5-1df0-515e-a024-abad257ee284"
Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"

[compat]
ClimaAtmos = "0.22"
ClimaComms = "0.5.6"
ClimaCore = "0.13"
ClimaCoreTempestRemap = "0.3"
ClimaLand = "0.11"
ClimaParams = "0.10"
Dates = "1"
DocStringExtensions = "0.8, 0.9"
Insolation = "0.9.2"
JLD2 = "0.4"
NCDatasets = "0.11, 0.12, 0.13, 0.14.2"
Plots = "1.39.0"
Expand Down
4 changes: 4 additions & 0 deletions experiments/AMIP/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ ArgParse = "1.1"
ArtifactWrappers = "0.2"
AtmosphericProfilesLibrary = "0.1"
ClimaAnalysis = "0.5"
ClimaAtmos = "0.22"
ClimaCorePlots = "0.2"
ClimaLand = "0.11"
ClimaParams = "0.10"
ClimaTimeSteppers = "0.7"
Colors = "0.12"
Dierckx = "0.5"
ForwardDiff = "0.10"
Glob = "1"
HDF5_jll = "1"
Insolation = "0.9.2"
IntervalSets = "0.5, 0.6, 0.7"
JSON = "0.21"
MPI = "0.20"
Expand Down
187 changes: 89 additions & 98 deletions experiments/AMIP/components/atmosphere/climaatmos.jl

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions experiments/AMIP/components/atmosphere/climaatmos_extra_diags.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# these extensions add extra diagnostics to the atmos model output
import ClimaAtmos.Diagnostics as CAD

import ClimaAtmos.Diagnostics: add_diagnostic_variable!

"""
add_diagnostic_variable!(short_name::String, long_name::String, standard_name::String, units::String, comments::String, compute!::Function)
Expand All @@ -13,7 +11,7 @@ The `compute!` function is called at every atmos time step to compute the diagno
To output these variables, short_name needs to be specified under diagnostics in the required yml file.
"""

add_diagnostic_variable!(
CAD.add_diagnostic_variable!(
short_name = "mse",
long_name = "Moist static energy",
standard_name = "moist_static_energy",
Expand All @@ -24,7 +22,7 @@ add_diagnostic_variable!(
(; ᶜts) = cache.precomputed
c_space = axes(state.c)
thermo_params = CAP.thermodynamics_params(params)
e_pot = CAP.grav(params) .* ClimaCore.Fields.coordinate_field(c_space).z
e_pot = CAP.grav(params) .* CC.Fields.coordinate_field(c_space).z
if isnothing(out)
return TD.moist_static_energy.(thermo_params, ᶜts, e_pot)
else
Expand All @@ -33,7 +31,7 @@ add_diagnostic_variable!(
end,
)

add_diagnostic_variable!(
CAD.add_diagnostic_variable!(
short_name = "lr",
long_name = "Lapse rate",
standard_name = "lapse_rate",
Expand All @@ -45,15 +43,15 @@ add_diagnostic_variable!(
thermo_params = CAP.thermodynamics_params(params)
ᶜT = @. TD.air_temperature(thermo_params, ᶜts)
if isnothing(out)
return ClimaCore.Geometry.WVector.(CAD.ᶜgradᵥ.(CAD.ᶠinterp.(ᶜT))).components.data.:1
return CC.Geometry.WVector.(CAD.ᶜgradᵥ.(CAD.ᶠinterp.(ᶜT))).components.data.:1
else
out .= ClimaCore.Geometry.WVector.(CAD.ᶜgradᵥ.(CAD.ᶠinterp.(ᶜT))).components.data.:1
out .= CC.Geometry.WVector.(CAD.ᶜgradᵥ.(CAD.ᶠinterp.(ᶜT))).components.data.:1
end

end,
)

add_diagnostic_variable!(
CAD.add_diagnostic_variable!(
short_name = "ediff",
long_name = "Eddy diffusivity",
standard_name = "eddy_diffusivity",
Expand All @@ -62,11 +60,11 @@ add_diagnostic_variable!(
compute! = (out, state, cache, time) -> begin
(; ᶜp) = cache.precomputed
(; C_E) = cache.atmos.vert_diff
interior_uₕ = ClimaCore.Fields.level(state.c.uₕ, 1)
interior_uₕ = CC.Fields.level(state.c.uₕ, 1)
ᶠp = ᶠK_E = cache.scratch.ᶠtemp_scalar
ClimaCore.Fields.bycolumn(axes(ᶜp)) do colidx
CC.Fields.bycolumn(axes(ᶜp)) do colidx
@. ᶠp[colidx] = CAD.ᶠinterp(ᶜp[colidx])
ᶜΔz_surface = ClimaCore.Fields.Δz_field(interior_uₕ)
ᶜΔz_surface = CC.Fields.Δz_field(interior_uₕ)
@. ᶠK_E[colidx] = CA.eddy_diffusivity_coefficient(
C_E,
CA.norm(interior_uₕ[colidx]),
Expand Down
Loading

0 comments on commit 801c58f

Please sign in to comment.