Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .buildkite/Manifest-v1.11.toml
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ weakdeps = ["CUDA", "MPI"]

[[deps.ClimaCore]]
deps = ["Adapt", "BandedMatrices", "BlockArrays", "ClimaComms", "CubedSphere", "DataStructures", "ForwardDiff", "GaussQuadrature", "GilbertCurves", "HDF5", "InteractiveUtils", "IntervalSets", "KrylovKit", "LazyBroadcast", "LinearAlgebra", "MultiBroadcastFusion", "NVTX", "PkgVersion", "RecursiveArrayTools", "RootSolvers", "SparseArrays", "StaticArrays", "Statistics", "UnrolledUtilities"]
git-tree-sha1 = "ca717446978d2815b4fa23a62a2131861e44d1e8"
git-tree-sha1 = "a2acae071e36c1c69c94a83d1fb74b25e8b0fde0"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
version = "0.14.42"
version = "0.14.43"
weakdeps = ["CUDA", "Krylov"]

[deps.ClimaCore.extensions]
Expand Down Expand Up @@ -1864,7 +1864,7 @@ version = "2.5.5+0"
[[deps.OpenLibm_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
version = "0.8.5+0"
version = "0.8.1+4"

[[deps.OpenMPI_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML", "Zlib_jll"]
Expand Down
60 changes: 34 additions & 26 deletions .buildkite/PrecompileCI/src/PrecompileCI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module PrecompileCI
using PrecompileTools, Logging
import ClimaAtmos as CA
import ClimaComms
import ClimaCore: InputOutput, Meshes, Spaces, Quadratures
import ClimaParams

@compile_workload begin
Expand All @@ -14,34 +13,43 @@ import ClimaParams
x_elem = y_elem = 2
x_max = y_max = 1e8
z_max = FT(30000.0)
dz_bottom = FT(500) # other values?
z_stretch = Meshes.HyperbolicTangentStretching(dz_bottom) # Meshes.Uniform()
bubble = true # false
parsed_args =
Dict{String, Any}("topography" => "NoWarp", "topo_smoothing" => false)
comms_ctx = ClimaComms.context(ClimaComms.CPUSingleThreaded())
deep = false

# constants
quad = Quadratures.GLL{4}()
dz_bottom = FT(500)
z_stretch = true
bubble = true
nh_poly = 3 # GLL{4} = nh_poly + 1
# TODO: compile CUDA methods as well
context = ClimaComms.context(ClimaComms.CPUSingleThreaded())
topography = CA.NoTopography()
params = CA.ClimaAtmosParameters(FT)
radius = CA.Parameters.planet_radius(params)

# Sphere
horz_mesh = CA.cubed_sphere_mesh(; radius, h_elem)
h_space = CA.make_horizontal_space(horz_mesh, quad, comms_ctx, bubble)
CA.make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args)

# box
horizontal_mesh = CA.periodic_rectangle_mesh(; x_max, y_max, x_elem, y_elem)
h_space = CA.make_horizontal_space(horizontal_mesh, quad, comms_ctx, bubble)
# This is broken
# CA.make_hybrid_spaces(h_space, z_max, z_elem, z_stretch; parsed_args)

# plane
horizontal_mesh = CA.periodic_line_mesh(; x_max, x_elem)
h_space = CA.make_horizontal_space(horizontal_mesh, quad, comms_ctx, bubble)
sphere_grid = CA.SphereGrid(
FT;
context,
radius, h_elem, nh_poly,
z_elem, z_max, z_stretch, dz_bottom,
bubble, topography,
)
box_grid = CA.BoxGrid(
FT;
context,
x_elem, x_max, y_elem, y_max, nh_poly, periodic_x = true, periodic_y = true,
z_elem, z_max, z_stretch, dz_bottom,
bubble, topography,
)
plane_grid = CA.PlaneGrid(
FT;
context,
x_elem, x_max, nh_poly, periodic_x = true,
z_elem, z_max, z_stretch, dz_bottom,
bubble, topography,
)
column_grid = CA.ColumnGrid(
FT; context, z_elem, z_max, z_stretch, dz_bottom,
)
all_grids = (sphere_grid, box_grid, plane_grid, column_grid)
foreach(CA.get_spaces, all_grids)
end
end

end # module Precompile
end # module PrecompileCI
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ steps:
CLIMACOMMS_DEVICE: "CUDA"
CLIMA_NAME_CUDA_KERNELS_FROM_STACK_TRACE: "true"
agents:
slurm_mem: 24GB
slurm_mem: 28GB
slurm_gpus: 1

- group: "Flame graphs"
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ClimaAtmos.jl Release Notes
main
-------

PR [#4021](https://github.com/CliMA/ClimaAtmos.jl/pull/4021) uses ClimaCore
convenience constructors to create spaces without an AtmosConfig.

v0.31.5
-------
PR [#3975](https://github.com/CliMA/ClimaAtmos.jl/pull/3975) updates the pressure gradient formulation to subtract a reference state and use the Exner pressure.
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ ArgParse = "1"
Artifacts = "1"
AtmosphericProfilesLibrary = "0.1.7"
ClimaComms = "0.6.9"
ClimaCore = "0.14.37"
ClimaDiagnostics = "0.2.12"
ClimaCore = "0.14.43"
ClimaDiagnostics = "0.2.13"
ClimaInterpolations = "0.1.0"
ClimaParams = "1.0.2"
ClimaTimeSteppers = "0.8.2"
ClimaUtilities = "0.1.23"
ClimaUtilities = "0.1.27"
CloudMicrophysics = "0.28, 0.29"
Dates = "1"
ForwardDiff = "1"
Expand Down
4 changes: 2 additions & 2 deletions calibration/experiments/gcm_driven_scm/helper_funcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ CLIMADIAGNOSTICS_LES_NAME_MAP =
"""Get z cell centers coordinates for CA run, given config. """
function get_z_grid(atmos_config; z_max = nothing)
params = CA.ClimaAtmosParameters(atmos_config)
spaces =
CA.get_spaces(atmos_config.parsed_args, params, atmos_config.comms_ctx)
grid = CA.get_grid(atmos_config.parsed_args, params, atmos_config.comms_ctx)
spaces = CA.get_spaces(grid, atmos_config.comms_ctx)
coord = CA.Fields.coordinate_field(spaces.center_space)
z_vec = convert(Vector{Float64}, parent(coord.z)[:])
if !isnothing(z_max)
Expand Down
13 changes: 12 additions & 1 deletion docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,21 @@ ClimaAtmos.InitialConditions.Soares
ClimaAtmos.InitialConditions.RCEMIPIIProfile
```

### Helper
## Helper

```@docs
ClimaAtmos.InitialConditions.ColumnInterpolatableField
```

## Grids

```@docs
ClimaAtmos.ColumnGrid
ClimaAtmos.SphereGrid
ClimaAtmos.PlaneGrid
ClimaAtmos.BoxGrid
```

## Jacobian

```@docs
Expand All @@ -69,6 +78,8 @@ ClimaAtmos.ScharTopography
ClimaAtmos.EarthTopography
ClimaAtmos.DCMIP200Topography
ClimaAtmos.Hughes2023Topography
ClimaAtmos.SLEVEWarp
ClimaAtmos.LinearWarp
```

### Internals
Expand Down
20 changes: 14 additions & 6 deletions examples/topography_spectra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ import ClimaCoreSpectra: power_spectrum_2d

const AA = AtmosArtifacts

using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Grids, Hypsography, Fields
using ClimaComms
using ClimaUtilities: SpaceVaryingInputs.SpaceVaryingInput

function mask(x::FT) where {FT}
return x * FT(x > 0)
# Include helper functions from test directory
include(joinpath(@__DIR__, "..", "test", "test_helpers.jl"))

# h_elem is the number of elements per side of every panel (6 panels in total)
function cubed_sphere_mesh(; radius, h_elem)
domain = Domains.SphereDomain(radius)
return Meshes.EquiangularCubedSphere(domain, h_elem)
end

"""
Expand All @@ -37,10 +46,10 @@ function generate_spaces(;
)
FT = Float32
cubed_sphere_mesh =
CA.cubed_sphere_mesh(; radius = FT(planet_radius), h_elem)
cubed_sphere_mesh(; radius = FT(planet_radius), h_elem)
quad = Quadratures.GLL{4}()
comms_ctx = ClimaComms.context()
h_space = CA.make_horizontal_space(cubed_sphere_mesh, quad, comms_ctx, true)
h_space = make_horizontal_space(cubed_sphere_mesh, quad, comms_ctx, true)
Δh_scale = Spaces.node_horizontal_length_scale(h_space)
@assert h_space isa CC.Spaces.SpectralElementSpace2D
coords = CC.Fields.coordinate_field(h_space)
Expand All @@ -49,7 +58,6 @@ function generate_spaces(;
"z",
h_space,
)
elev_from_file = @. mask(elev_from_file)
# Fractional damping of smallest resolved scale
# Approximated as k₀ ≈ 1/Δx, with n_attenuation
# the factor by which we wish to damp wavenumber
Expand All @@ -58,7 +66,7 @@ function generate_spaces(;
κ = diff_courant * Δh_scale^2
maxiter = Int(round(log(n_attenuation) / diff_courant))
diffuse_surface_elevation!(elev_from_file; κ, dt = FT(1), maxiter)
elev_from_file = @. mask(elev_from_file)
@. elev_from_file = max(elev_from_file, FT(0))
return elev_from_file
end

Expand Down
Loading
Loading