Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Dec 20, 2023
1 parent 643c24d commit 6800ed5
Show file tree
Hide file tree
Showing 50 changed files with 349 additions and 82 deletions.
9 changes: 8 additions & 1 deletion benchmarks/3d/vector_laplacian.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

using ClimaComms
using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Operators, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Spaces,
Fields,
Operators,
Quadratures
using CUDA, BenchmarkTools

hdomain = Domains.SphereDomain(6.37122e6)
Expand Down
9 changes: 8 additions & 1 deletion examples/bickleyjet/bickleyjet_cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ using ClimaComms
using LinearAlgebra

import ClimaCore:
Domains, Fields, Geometry, Meshes, Operators, Spaces, Topologies, Quadratures
Domains,
Fields,
Geometry,
Meshes,
Operators,
Spaces,
Topologies,
Quadratures
import ClimaCore.Geometry:

using OrdinaryDiffEq: ODEProblem, solve, SSPRK33
Expand Down
9 changes: 8 additions & 1 deletion examples/bickleyjet/bickleyjet_cg_unsmesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ using ClimaComms
using LinearAlgebra

import ClimaCore:
Domains, Fields, Geometry, Meshes, Operators, Spaces, Topologies, Quadratures
Domains,
Fields,
Geometry,
Meshes,
Operators,
Spaces,
Topologies,
Quadratures
import ClimaCore.Geometry:

using OrdinaryDiffEq: ODEProblem, solve, SSPRK33
Expand Down
10 changes: 9 additions & 1 deletion examples/hybrid/sphere/deformation_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ using Test
using Statistics: mean

using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Operators, Limiters, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Spaces,
Fields,
Operators,
Limiters,
Quadratures
using ClimaTimeSteppers

using Logging
Expand Down
3 changes: 2 additions & 1 deletion examples/hybrid/sphere/remap_pipeline.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ClimaCore
using ClimaCore: Geometry, Meshes, Domains, Topologies, Spaces, Operators, Quadratures
using ClimaCore:
Geometry, Meshes, Domains, Topologies, Spaces, Operators, Quadratures
using NCDatasets
using ClimaCoreTempestRemap

Expand Down
10 changes: 9 additions & 1 deletion examples/plane/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ using ClimaComms
using LinearAlgebra

import ClimaCore:
Domains, Fields, Geometry, Meshes, Operators, Spaces, Topologies, Limiters, Quadratures
Domains,
Fields,
Geometry,
Meshes,
Operators,
Spaces,
Topologies,
Limiters,
Quadratures

using OrdinaryDiffEq: ODEProblem, solve
using ClimaTimeSteppers
Expand Down
10 changes: 9 additions & 1 deletion examples/sphere/limiters_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ using ClimaComms
using LinearAlgebra

import ClimaCore:
Domains, Fields, Geometry, Meshes, Operators, Spaces, Topologies, Limiters, Quadratures
Domains,
Fields,
Geometry,
Meshes,
Operators,
Spaces,
Topologies,
Limiters,
Quadratures

using OrdinaryDiffEq, Test

Expand Down
9 changes: 8 additions & 1 deletion examples/sphere/solidbody.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ using ClimaComms
using LinearAlgebra

import ClimaCore:
Domains, Fields, Geometry, Meshes, Operators, Spaces, Topologies, Quadratures
Domains,
Fields,
Geometry,
Meshes,
Operators,
Spaces,
Topologies,
Quadratures

using OrdinaryDiffEq: ODEProblem, solve, SSPRK33

Expand Down
3 changes: 2 additions & 1 deletion lib/ClimaCoreTempestRemap/src/ClimaCoreTempestRemap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export def_time_coord, def_space_coord

using ClimaComms
import ClimaCore
using ClimaCore: Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures

using NCDatasets, Dates, PkgVersion, LinearAlgebra, TempestRemap_jll

Expand Down
3 changes: 2 additions & 1 deletion lib/ClimaCoreTempestRemap/test/mpi_tests/online_remap.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import ClimaCore
import ClimaCoreTempestRemap as CCTR
using ClimaComms
using ClimaCore: Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures
using Test
# use these packages for manual inspection of solutions
# using Plots
Expand Down
9 changes: 8 additions & 1 deletion lib/ClimaCoreTempestRemap/test/netcdf.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import ClimaCore
using ClimaComms
using ClimaCore:
Geometry, Meshes, Domains, Topologies, Spaces, Fields, Hypsography, Quadratures
Geometry,
Meshes,
Domains,
Topologies,
Spaces,
Fields,
Hypsography,
Quadratures
using NCDatasets
using TempestRemap_jll
using Test
Expand Down
13 changes: 4 additions & 9 deletions lib/ClimaCoreTempestRemap/test/online_remap.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ClimaCore
using ClimaComms
using ClimaCore: Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Meshes, Domains, Topologies, Spaces, Fields, Quadratures
using NCDatasets
using Test
using ClimaCoreTempestRemap
Expand Down Expand Up @@ -59,10 +60,7 @@ end
ClimaComms.SingletonCommsContext(),
mesh_i,
)
space_i = Spaces.SpectralElementSpace2D(
topology_i,
Quadratures.GLL{nq_i}(),
)
space_i = Spaces.SpectralElementSpace2D(topology_i, Quadratures.GLL{nq_i}())
coords_i = Fields.coordinate_field(space_i)

# construct target mesh
Expand All @@ -71,10 +69,7 @@ end
ClimaComms.SingletonCommsContext(),
mesh_o,
)
space_o = Spaces.SpectralElementSpace2D(
topology_o,
Quadratures.GLL{nq_o}(),
)
space_o = Spaces.SpectralElementSpace2D(topology_o, Quadratures.GLL{nq_o}())
coords_o = Fields.coordinate_field(space_o)

# generate test data in the Field format
Expand Down
18 changes: 5 additions & 13 deletions lib/ClimaCoreVTK/src/space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ an unstuctured mesh of linear cells, suitable for passing to
`vtk_grid`.
"""
function vtk_cells_linear(gridspace::Spaces.SpectralElementSpace2D)
Nq = Quadratures.degrees_of_freedom(
Spaces.quadrature_style(gridspace),
)
Nq = Quadratures.degrees_of_freedom(Spaces.quadrature_style(gridspace))
Nh = Topologies.nlocalelems(gridspace)
ind = LinearIndices((1:Nq, 1:Nq, 1:Nh))
cells = [
Expand Down Expand Up @@ -226,20 +224,14 @@ This generally does two things:
- Modifies the vertical space to be on the centers.
"""
function vtk_cell_space(gridspace::Spaces.SpectralElementSpace1D)
@assert Spaces.quadrature_style(gridspace) isa
Quadratures.ClosedUniform
Nq = Quadratures.degrees_of_freedom(
Spaces.quadrature_style(gridspace),
)
@assert Spaces.quadrature_style(gridspace) isa Quadratures.ClosedUniform
Nq = Quadratures.degrees_of_freedom(Spaces.quadrature_style(gridspace))
quad = Quadratures.Uniform{Nq - 1}()
return Spaces.SpectralElementSpace1D(Spaces.topology(gridspace), quad)
end
function vtk_cell_space(gridspace::Spaces.SpectralElementSpace2D)
@assert Spaces.quadrature_style(gridspace) isa
Quadratures.ClosedUniform
Nq = Quadratures.degrees_of_freedom(
Spaces.quadrature_style(gridspace),
)
@assert Spaces.quadrature_style(gridspace) isa Quadratures.ClosedUniform
Nq = Quadratures.degrees_of_freedom(Spaces.quadrature_style(gridspace))
quad = Quadratures.Uniform{Nq - 1}()
return Spaces.SpectralElementSpace2D(Spaces.topology(gridspace), quad)
end
Expand Down
9 changes: 8 additions & 1 deletion lib/ClimaCoreVTK/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ using ClimaComms
using ClimaCoreVTK
using IntervalSets
import ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Operators, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Spaces,
Fields,
Operators,
Quadratures

OUTPUT_DIR = mkpath(get(ENV, "CI_OUTPUT_DIR", tempname()))
mkpath(joinpath(OUTPUT_DIR, "series"))
Expand Down
4 changes: 1 addition & 3 deletions test/Fields/field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,7 @@ end
TU.bycolumnable(space) || continue
hspace = Spaces.horizontal_space(space)
Nh = Topologies.nlocalelems(hspace)
Nq = Quadratures.degrees_of_freedom(
Spaces.quadrature_style(hspace),
)
Nq = Quadratures.degrees_of_freedom(Spaces.quadrature_style(hspace))
if nameof(typeof(space)) == :SpectralElementSpace1D
@test Fields.ncolumns(space) == Nh * Nq
else
Expand Down
10 changes: 9 additions & 1 deletion test/Fields/field_opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import ClimaCore
import ClimaCore.Utilities: PlusHalf, half
import ClimaCore.DataLayouts: IJFH
import ClimaCore:
Fields, slab, Domains, Topologies, Meshes, Operators, Spaces, Geometry, Quadratures
Fields,
slab,
Domains,
Topologies,
Meshes,
Operators,
Spaces,
Geometry,
Quadratures

using FastBroadcast
using LinearAlgebra: norm
Expand Down
10 changes: 9 additions & 1 deletion test/Limiters/distributed/dlimiter.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
using ClimaCore:
DataLayouts, Fields, Domains, Geometry, Topologies, Meshes, Spaces, Limiters, Quadratures
DataLayouts,
Fields,
Domains,
Geometry,
Topologies,
Meshes,
Spaces,
Limiters,
Quadratures
using ClimaCore.RecursiveApply
using ClimaCore: slab
using Test
Expand Down
10 changes: 9 additions & 1 deletion test/Limiters/limiter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import CUDA
CUDA.allowscalar(false)
using ClimaComms
using ClimaCore:
DataLayouts, Fields, Domains, Geometry, Topologies, Meshes, Spaces, Limiters, Quadratures
DataLayouts,
Fields,
Domains,
Geometry,
Topologies,
Meshes,
Spaces,
Limiters,
Quadratures
using ClimaCore.RecursiveApply
using ClimaCore: slab
using Test
Expand Down
9 changes: 8 additions & 1 deletion test/MatrixFields/matrix_field_test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import Random: seed!

import ClimaComms
import ClimaCore:
Geometry, Domains, Meshes, Topologies, Hypsography, Spaces, Fields, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Hypsography,
Spaces,
Fields,
Quadratures
using ClimaCore.MatrixFields

# Test that an expression is true and that it is also type-stable.
Expand Down
3 changes: 2 additions & 1 deletion test/Operators/finitedifference/implicit_stencils_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ using ClimaComms
using Random: seed!
seed!(1) # ensures reproducibility

using ClimaCore: Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures
using ClimaCore: Operators
import ClimaCore.Operators as OP

Expand Down
3 changes: 2 additions & 1 deletion test/Operators/finitedifference/linsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import ClimaCore
# To avoid JET failures in the error message
ClimaCore.Operators.allow_mismatched_fd_spaces() = true

using ClimaCore: Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures

FT = Float32
radius = FT(1e7)
Expand Down
3 changes: 2 additions & 1 deletion test/Operators/finitedifference/opt_implicit_stencils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ using Test
using ClimaComms
using Random: seed!

using ClimaCore: Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures
using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Quadratures
using ClimaCore: Operators

struct CurriedTwoArgOperator{O, A}
Expand Down
12 changes: 9 additions & 3 deletions test/Operators/finitedifference/tensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ using Test

using ClimaComms
using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Operators, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Spaces,
Fields,
Operators,
Quadratures
using LinearAlgebra

for FT in (Float32, Float64)
hdomain = Domains.SphereDomain{FT}(6.37122e6)
hmesh = Meshes.EquiangularCubedSphere(hdomain, 30)
htopology = Topologies.Topology2D(hmesh)
hspace =
Spaces.SpectralElementSpace2D(htopology, Quadratures.GLL{4}())
hspace = Spaces.SpectralElementSpace2D(htopology, Quadratures.GLL{4}())

vdomain = Domains.IntervalDomain(
Geometry.ZPoint{FT}(0.0),
Expand Down
9 changes: 8 additions & 1 deletion test/Operators/finitedifference/wfact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import ClimaCore
ClimaCore.Operators.allow_mismatched_fd_spaces() = true

using ClimaCore:
Geometry, Domains, Meshes, Topologies, Spaces, Fields, Operators, Quadratures
Geometry,
Domains,
Meshes,
Topologies,
Spaces,
Fields,
Operators,
Quadratures

import ClimaCore.Utilities: half
import LinearAlgebra: norm_sqr
Expand Down
Loading

0 comments on commit 6800ed5

Please sign in to comment.