Skip to content

Commit 023dade

Browse files
glwagnersimone-silvestrinavidcy
authored
Fix docs + examples (#466)
* fix one issue * one bugfix * using Dates * another bugfix * Clean up one degree simulation (#460) * Update one_degree_simulation.jl * Update make.jl * Update one_degree_simulation.jl * One degree example enhancement (#362) * drop ActiveCellEnstrophyConserving * bump patch release * fix typo + no x/y labels in figs * Update one_degree_simulation.jl * hotfix to change * Fixes docs that don't build on `main` (#388) * infer FT in SimilarityTheoryFluxes from ocean_grid * homogenize compats * drop ClimaOcean * better continents plot * fix papa * minor text formatting * code alignment + spaces, not tab * Implement sea-ice ocean stress (#453) * add sea-ice ocean stress * last index * add this * add a clock * add the arctic * add the metadatum * thos works! * bugfix * Update experiments/arctic_simulation.jl * Update src/OceanSeaIceModels/InterfaceComputations/sea_ice_ocean_fluxes.jl * add a test * remember the allowscalar * more testing * fix test * fix tests * Update test/test_surface_fluxes.jl * Update test/test_surface_fluxes.jl --------- Co-authored-by: Navid C. Constantinou <[email protected]> --------- Co-authored-by: Simone Silvestri <[email protected]> * back to zstar * maybe zstar has too many parameters * updates * dont worry about skipping passes (its buggy) * niceness * Update one_degree_simulation.jl * Update examples_build.yml * tweak one degree * try without restoring * Update one_degree_simulation.jl * Update one_degree_simulation.jl * point buildkite to tartarus * clean up * update * Update examples/one_degree_simulation.jl * use the right julia * minor * fix * reenable plotting * rm duplicate visible devices * Update make.jl * add convenience first_date(dataset) * fixes in docs * fixes in docs * clarify linear tapered polar mask * put restoring back * fix * rm u-forcing * Update examples/one_degree_simulation.jl * fix bug from merge main * go back to 1deg * 100 levels * Update one_degree_simulation.jl * Update metadata.jl * Update one_degree_simulation.jl * Update one_degree_simulation.jl * Update one_degree_simulation.jl * Update one_degree_simulation.jl * Update one_degree_simulation.jl * Update one_degree_simulation.jl * workin on example * seems to work * rm arctic night * comment back in animation * run 1/4 degree on GPU * Update make.jl * Update metadata.jl * fix docs rendering * undo changes to Bathymetry.jl since tests were failing --------- Co-authored-by: Simone Silvestri <[email protected]> Co-authored-by: Navid C. Constantinou <[email protected]>
1 parent c8c85b5 commit 023dade

13 files changed

+176
-260
lines changed

.buildkite/examples_build.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
agents:
2-
queue: new-central
3-
slurm_mem: 8G
4-
modules: climacommon/2024_10_10
5-
slurm_time: 48:00:00
61

72
env:
8-
JULIA_LOAD_PATH: "${JULIA_LOAD_PATH}:${BUILDKITE_BUILD_CHECKOUT_PATH}/.buildkite"
9-
OPENBLAS_NUM_THREADS: 1
10-
OMPI_MCA_opal_warn_on_missing_libcuda: 0
3+
JULIA_VERSION: "1.10.9"
4+
JULIA_MINOR_VERSION: "1.10"
5+
TARTARUS_HOME: "/storage5/buildkite-agent"
6+
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
117
JULIA_NUM_PRECOMPILE_TASKS: 8
8+
JULIA_NUM_THREADS: 8
9+
CUDA_VISIBLE_DEVICES: "2" # Device for building ClimaOcean docs
1210

1311
steps:
1412
- label: "initialize"
1513
key: "init"
14+
env:
15+
JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER"
16+
TEST_GROUP: "init"
17+
JULIA_BINDIR: "$TARTARUS_HOME/julia-$JULIA_VERSION/bin"
18+
TMPDIR: "$TARTARUS_HOME/tmp"
1619
command:
1720
- "echo '--- Instantiate project'"
18-
- "julia --project -e 'using Pkg; Pkg.instantiate(; verbose=true); Pkg.precompile(; strict=true)'"
21+
- "$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes -O0 --project -e 'using Pkg; Pkg.instantiate(; verbose=true); Pkg.precompile(; strict=true)'"
1922
# force the initialization of the CUDA runtime as it is lazily loaded by default
20-
- "julia --project -e 'using CUDA; CUDA.precompile_runtime()'"
21-
23+
- "$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes -O0 --project -e 'using CUDA; CUDA.precompile_runtime()'"
2224
agents:
23-
slurm_mem: 120G
24-
slurm_gpus: 1
25-
slurm_cpus_per_task: 8
25+
queue: ClimaOcean-docs
2626

2727
- wait
2828

2929
- label: "Run documentation"
3030
key: "build_documentation"
3131
commands:
32-
- "julia --color=yes --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'"
33-
- "julia --color=yes --project=docs/ docs/make.jl"
34-
32+
- "$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes -O0 --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'"
33+
- "$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia --color=yes -O0 --project=docs/ docs/make.jl"
3534
agents:
36-
slurm_mem: 120G
37-
slurm_gpus: 1
38-
slurm_cpus_per_task: 8
39-
slurm_ntasks: 1
40-
slurm_gpus_per_task: 1
41-
slurm_time: 48:00:00
35+
queue: ClimaOcean-docs
4236

4337
env:
38+
TMPDIR: "$TARTARUS_HOME/tmp"
39+
JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER"
4440
JULIA_DEBUG: "Documenter"
4541
# This environment variable is needed to avoid SSL verification errors when Downloads.jl
4642
# tries to download the bathymetry data. It should not be required so we need to fix our certificates

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const OUTPUT_DIR = joinpath(@__DIR__, "src/literated")
1414

1515
to_be_literated = [
1616
# "ecco_inspect_temperature_salinity.jl",
17-
"generate_bathymetry.jl",
18-
"generate_surface_fluxes.jl",
17+
# "generate_bathymetry.jl",
18+
# "generate_surface_fluxes.jl",
1919
"single_column_os_papa_simulation.jl",
2020
"one_degree_simulation.jl",
2121
# "mediterranean_simulation_with_ecco_restoring.jl",
@@ -43,8 +43,8 @@ pages = [
4343

4444
"Examples" => [
4545
# "Inspect ECCO2 data" => "literated/ecco_inspect_temperature_salinity.md",
46-
"Generate bathymetry" => "literated/generate_bathymetry.md",
47-
"Surface fluxes" => "literated/generate_surface_fluxes.md",
46+
# "Generate bathymetry" => "literated/generate_bathymetry.md",
47+
# "Surface fluxes" => "literated/generate_surface_fluxes.md",
4848
"Single-column simulation" => "literated/single_column_os_papa_simulation.md",
4949
# "Mediterranean simulation with ECCO restoring" => "literated/mediterranean_simulation_with_ecco_restoring.md",
5050
"One-degree Ocean simulation" => "literated/one_degree_simulation.md",

docs/src/library/internals.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Modules = [ClimaOcean.Diagnostics]
1616
Public = false
1717
```
1818

19-
2019
## InitialConditions
2120

2221
```@autodocs
@@ -38,6 +37,13 @@ Modules = [ClimaOcean.ECCO]
3837
Public = false
3938
```
4039

40+
## EN4
41+
42+
```@autodocs
43+
Modules = [ClimaOcean.EN4]
44+
Public = false
45+
```
46+
4147
## JRA55
4248

4349
```@autodocs
@@ -56,19 +62,19 @@ Public = false
5662

5763
```@autodocs
5864
Modules = [ClimaOcean.VerticalGrids]
59-
Private = false
65+
Public = false
6066
```
6167

6268
## OceanSeaIceModels
6369

6470
```@autodocs
6571
Modules = [ClimaOcean.OceanSeaIceModels]
66-
Private = false
72+
Public = false
6773
```
6874

69-
## CrossRealmFluxes
75+
## InterfaceComputations
7076

7177
```@autodocs
72-
Modules = [ClimaOcean.OceanSeaIceModels.CrossRealmFluxes]
73-
Private = false
78+
Modules = [ClimaOcean.OceanSeaIceModels.InterfaceComputations]
79+
Public = false
7480
```

docs/src/library/public.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ Modules = [ClimaOcean.ECCO]
3939
Private = false
4040
```
4141

42+
## EN4
43+
44+
```@autodocs
45+
Modules = [ClimaOcean.EN4]
46+
Private = false
47+
```
48+
4249
## JRA55
4350

4451
```@autodocs
@@ -52,4 +59,23 @@ Private = false
5259
Modules = [ClimaOcean.Bathymetry]
5360
Private = false
5461
```
62+
## VerticalGrids
63+
64+
```@autodocs
65+
Modules = [ClimaOcean.VerticalGrids]
66+
Private = false
67+
```
5568

69+
## OceanSeaIceModels
70+
71+
```@autodocs
72+
Modules = [ClimaOcean.OceanSeaIceModels]
73+
Private = false
74+
```
75+
76+
## InterfaceComputations
77+
78+
```@autodocs
79+
Modules = [ClimaOcean.OceanSeaIceModels.InterfaceComputations]
80+
Private = false
81+
```

examples/arctic_night.jl

Lines changed: 0 additions & 118 deletions
This file was deleted.

examples/generate_surface_fluxes.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ using ClimaOcean.ECCO
1414
using ClimaOcean.JRA55
1515
using ClimaOcean.OceanSimulations
1616
using Oceananigans
17+
using Dates
1718
using CairoMakie
1819

1920
# # Computing fluxes on the ECCO2 grid
@@ -24,10 +25,10 @@ grid = ECCO_immersed_grid()
2425

2526
# We visualize the bottom height of the ECCO grid using CairoMakie.
2627

27-
fig = Figure()
28-
ax = Axis(fig[1, 1])
29-
heatmap!(ax, interior(grid.immersed_boundary.bottom_height, :, :, 1))
30-
save("ECCO_continents.png", fig) #hide
28+
fig, ax, hm = heatmap(grid.immersed_boundary.bottom_height)
29+
Colorbar(fig[1, 2], hm, height = Relative(3/4), label = "Depth (m)")
30+
31+
save("ECCO_continents.png", fig)
3132

3233
# ![](ECCO_continents.png)
3334

@@ -67,10 +68,10 @@ set!(ocean.model; T=T_metadata, S=S_metadata)
6768

6869
coupled_model = OceanSeaIceModel(ocean; atmosphere, radiation=Radiation(eltype))
6970

70-
# # Now that the surface fluxes are computed, we can extract and visualize them.
71-
# # The turbulent fluxes are stored in `coupled_modelinterfaces.atmosphere_ocean_interface.fluxes`.
71+
# Now that the surface fluxes are computed, we can extract and visualize them.
72+
# The turbulent fluxes are stored in `coupled_model.interfaces.atmosphere_ocean_interface.fluxes`.
7273

73-
fluxes = coupled_model.interfaces.atmosphere_ocean_interface.fluxes
74+
fluxes = coupled_model.interfaces.atmosphere_ocean_interface.fluxes
7475
λ, φ, z = nodes(fluxes.sensible_heat)
7576

7677
fig = Figure(size = (800, 800), fontsize = 15)
@@ -90,6 +91,6 @@ heatmap!(ax, λ, φ, interior(fluxes.y_momentum, :, :, 1); colormap = :bwr)
9091
ax = Axis(fig[3, 1], title = "Water vapor flux (kg m⁻² s⁻¹)", xlabel = "Longitude", ylabel = "Latitude")
9192
heatmap!(ax, λ, φ, interior(fluxes.water_vapor, :, :, 1); colormap = :bwr)
9293

93-
save("fluxes.png", fig)
94+
save("surface_fluxes.png", fig)
9495

95-
# ![](fluxes.png)
96+
# ![](surface_fluxes.png)

examples/idealized_single_column_simulation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using ClimaSeaIce
33
using Oceananigans
44
using Oceananigans.Units
55
using SeawaterPolynomials
6+
using Dates
67

78
# Ocean state parameters
89
T₀ = 0 # Surface temperature, ᵒC

examples/near_global_ocean_simulation.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# # Near-global ocean simulation
22
#
33
# This example sets up and runs a near-global ocean simulation using the Oceananigans.jl and
4-
# ClimaOcean.jl. The simulation covers latitudes from 75°S to 75°N with a horizontal
4+
# ClimaOcean.jl. The simulation covers latitudes from 75°S to 75°N, with a horizontal
55
# resolution of 1/4 degree and 40 vertical levels.
66
#
77
# The simulation's results are visualized with the CairoMakie.jl package.
@@ -31,7 +31,6 @@ using Printf
3131
# Finally, we specify the architecture for the simulation, which in this case is a GPU.
3232

3333
arch = GPU()
34-
3534
Nx = 1440
3635
Ny = 600
3736
Nz = 40
@@ -50,8 +49,8 @@ grid = LatitudeLongitudeGrid(arch;
5049
#
5150
# We use `regrid_bathymetry` to derive the bottom height from ETOPO1 data.
5251
# To smooth the interpolated data we use 5 interpolation passes. We also fill in
53-
# (i) all the minor enclosed basins except the 3 largest `major_basins`, as well as
54-
# (ii) regions that are shallower than `minimum_depth`.
52+
# * all the minor enclosed basins except the 3 largest `major_basins`, as well as
53+
# * regions that are shallower than `minimum_depth`.
5554

5655
bottom_height = regrid_bathymetry(grid;
5756
minimum_depth = 10meters,

0 commit comments

Comments
 (0)