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 a707187
Show file tree
Hide file tree
Showing 70 changed files with 1,541 additions and 1,635 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
2 changes: 1 addition & 1 deletion experiments/AMIP/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "b3a2000766f3d77386965c6863b17e8927e1f502"
project_hash = "2fc20eaba778316ac63fe8ea8b21332008327fd3"

[[deps.ADTypes]]
git-tree-sha1 = "016833eb52ba2d6bea9fcb50ca295980e728ee24"
Expand Down
4 changes: 3 additions & 1 deletion experiments/AMIP/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
HDF5_jll = "0234f1f7-429e-5d53-9886-15a909be8d59"
Insolation = "e98cc03f-d57e-4e3c-b70c-8d51efe9e0d8"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand Down Expand Up @@ -51,7 +50,10 @@ 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"
Expand Down
186 changes: 89 additions & 97 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 a707187

Please sign in to comment.