Skip to content
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
444 commits
Select commit Hold shift + click to select a range
b3ab48b
remove equatorial single column
simone-silvestri Jul 22, 2025
d1c7450
remove manifest
simone-silvestri Jul 22, 2025
a1ede1f
revert
simone-silvestri Jul 22, 2025
4015bf4
token
simone-silvestri Jul 22, 2025
970ffeb
Revert "token"
simone-silvestri Jul 22, 2025
4b4f64e
Merge remote-tracking branch 'origin/ss/zstar' into ss/omip-prototype
simone-silvestri Jul 22, 2025
e6ff0d4
changed JRA55
simone-silvestri Jul 22, 2025
ef45d0c
added Project
simone-silvestri Jul 22, 2025
d96c32b
merged
simone-silvestri Jul 22, 2025
ea3ee12
bugfix
simone-silvestri Jul 22, 2025
9165bd2
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri Jul 22, 2025
add5526
this should fix it
simone-silvestri Jul 22, 2025
35e2df6
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri Jul 25, 2025
92fda28
change sea ice
simone-silvestri Jul 28, 2025
ec70ca0
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri Jul 29, 2025
469bcb1
consolidate sea ice temperature
simone-silvestri Jul 30, 2025
736ac4c
adding the manifest
simone-silvestri Jul 30, 2025
6db860a
adding Manifest
simone-silvestri Aug 1, 2025
5e0997c
comment out for now
simone-silvestri Aug 1, 2025
049dacd
go for it
simone-silvestri Aug 8, 2025
cf22586
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri Aug 8, 2025
17a2250
improve
simone-silvestri Aug 8, 2025
d024542
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri Aug 8, 2025
7d6ce58
improving the performance
simone-silvestri Aug 18, 2025
5e66a54
speed up
simone-silvestri Aug 18, 2025
9063e3e
recorrect Oceananigans
simone-silvestri Aug 18, 2025
4fb3526
Merge branch 'main' into ss/omip-prototype
simone-silvestri Aug 18, 2025
e7845a5
new Manifest
simone-silvestri Aug 18, 2025
fca5484
do not add Oceananigans
simone-silvestri Aug 18, 2025
09d22a3
Update make.jl
simone-silvestri Aug 18, 2025
3885668
one-degree-ompi for calibration
simone-silvestri Aug 20, 2025
8bbc3b8
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri Aug 20, 2025
988ec77
update one degree
simone-silvestri Aug 20, 2025
3419022
use the correct value
simone-silvestri Aug 20, 2025
b1430e2
remove this for the moment
simone-silvestri Aug 20, 2025
abced34
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri Aug 20, 2025
78de681
start with adapting
simone-silvestri Aug 20, 2025
3772b2c
fill it in
simone-silvestri Aug 21, 2025
b5befcd
remove manifest
simone-silvestri Aug 21, 2025
1a40428
remove vestigial code
simone-silvestri Aug 21, 2025
0876b41
add a simulation
simone-silvestri Aug 21, 2025
dc79dc0
add an OceananigansSimulation
simone-silvestri Aug 21, 2025
adb8393
ok this works
simone-silvestri Aug 21, 2025
ff57090
add a forced simulation
simone-silvestri Aug 21, 2025
2460b14
update
simone-silvestri Aug 21, 2025
b74450f
coupled
simone-silvestri Aug 21, 2025
7792990
some corrections
simone-silvestri Aug 21, 2025
bf23df7
back to previous stuff
simone-silvestri Aug 21, 2025
5b03a33
add veros
simone-silvestri Aug 21, 2025
5843397
add the veros experiment
simone-silvestri Aug 21, 2025
cc6ca11
dt mom not dt tracer
simone-silvestri Aug 21, 2025
267d985
Apply suggestion from @glwagner
simone-silvestri Aug 22, 2025
8602684
Apply suggestion from @glwagner
simone-silvestri Aug 22, 2025
d45906b
Update assemble_net_fluxes.jl
simone-silvestri Aug 22, 2025
29c70ca
Rename fill_up_net_fluxes! to fill_net_fluxes!
simone-silvestri Aug 22, 2025
c7ee9ad
Update ext/ClimaOceanPythonCallExt/ClimaOceanPythonCallExt.jl
simone-silvestri Aug 22, 2025
c7dbcb0
overload the set! function
simone-silvestri Aug 22, 2025
ac8d821
bugfix
simone-silvestri Aug 22, 2025
2d0c16b
bugfix
simone-silvestri Aug 22, 2025
2debe0e
bugfix
simone-silvestri Aug 22, 2025
b3c6c46
fixed it
simone-silvestri Aug 26, 2025
8cfb21d
let's go
simone-silvestri Aug 26, 2025
88e937c
add visualization
simone-silvestri Aug 26, 2025
507e81c
Merge branch 'main' into ss/adapt-veros
simone-silvestri Aug 27, 2025
3d99939
Merge branch 'main' into ss/adapt-veros
simone-silvestri Sep 1, 2025
da45c7e
Merge branch 'main' into ss/adapt-veros
simone-silvestri Sep 4, 2025
8aa6b13
Merge branch 'main' into ss/adapt-veros
simone-silvestri Oct 13, 2025
62a3cc8
Update TODO comment for fluxes BC in veros
simone-silvestri Oct 13, 2025
90bf962
Merge branch 'main' into ss/adapt-veros
simone-silvestri Nov 7, 2025
792fa31
ok let's go
simone-silvestri Nov 11, 2025
dec7ab4
this should work out
simone-silvestri Nov 11, 2025
891d39d
try it out like this
simone-silvestri Nov 11, 2025
171cb40
run only this example
simone-silvestri Nov 11, 2025
c6ea397
try adding this
simone-silvestri Nov 11, 2025
31da63f
add pythoncall
simone-silvestri Nov 12, 2025
6d84da9
fix
simone-silvestri Nov 12, 2025
308d494
Merge branch 'main' into ss/adapt-veros
simone-silvestri Nov 12, 2025
af0b9be
Update ClimaOceanPythonCallExt to include CondaPkg
simone-silvestri Nov 16, 2025
24d0d23
Merge branch 'main' into ss/adapt-veros
simone-silvestri Nov 16, 2025
accfb4a
Merge branch 'main' into ss/adapt-veros
simone-silvestri Nov 17, 2025
61ff994
Merge remote-tracking branch 'origin/main' into ss/adapt-veros
simone-silvestri Dec 4, 2025
ca46e70
some changes
simone-silvestri Dec 6, 2025
fcb94d1
start restructuring
simone-silvestri Dec 6, 2025
d621218
start changing everything
simone-silvestri Dec 9, 2025
584771f
move references
simone-silvestri Dec 9, 2025
62e5331
some more changes
simone-silvestri Dec 9, 2025
862b5f1
simplify
simone-silvestri Dec 9, 2025
ba0e4b1
continue changing
simone-silvestri Dec 9, 2025
3c3c6f3
interpolate the states
simone-silvestri Dec 9, 2025
90c5707
separate more stuff out
simone-silvestri Dec 9, 2025
b5a39d4
more changes
simone-silvestri Dec 9, 2025
13dd0d0
add a `ComponentExchanger`
simone-silvestri Dec 9, 2025
0d81dad
more changes
simone-silvestri Dec 9, 2025
22fcc5f
more changes
simone-silvestri Dec 9, 2025
235b40f
more chnages
simone-silvestri Dec 9, 2025
0c69e9f
make sure imports are correct
simone-silvestri Dec 9, 2025
5a18304
improving imports
simone-silvestri Dec 9, 2025
8b913f5
more changes
simone-silvestri Dec 9, 2025
9625acb
more changes
simone-silvestri Dec 9, 2025
48f3788
more simplification and generalization
simone-silvestri Dec 9, 2025
ee12ed5
everything we need to import
simone-silvestri Dec 9, 2025
d94b101
more cleanup
simone-silvestri Dec 9, 2025
9a5b230
one degree ocean simulation compiles
simone-silvestri Dec 9, 2025
5897ac4
one dergee almost runs
simone-silvestri Dec 9, 2025
b94f586
include all relevant imports
simone-silvestri Dec 9, 2025
cbe8fb6
this should at least run the currect tests / examples
simone-silvestri Dec 9, 2025
3e45169
the one degree runs
simone-silvestri Dec 9, 2025
48fcda4
Merge remote-tracking branch 'origin/main' into ss/interpolate-all-st…
simone-silvestri Dec 9, 2025
b6731c0
fix CI
simone-silvestri Dec 9, 2025
e4b5389
another fix
simone-silvestri Dec 9, 2025
fa315d9
update stuff
simone-silvestri Dec 9, 2025
017de06
clean up a bit
simone-silvestri Dec 9, 2025
4da3147
another bugfix
simone-silvestri Dec 9, 2025
9c2f44a
Update net fluxes + tutorial
simone-silvestri Dec 9, 2025
d537eda
changes
simone-silvestri Dec 9, 2025
45b868b
fix FreezingLimitedSeaIceModel
glwagner Dec 11, 2025
f7efe13
fix jra55
glwagner Dec 11, 2025
4ecce39
see if this works, then modify the tutorial
simone-silvestri Dec 11, 2025
1181d23
Merge branch 'ss/interpolate-all-states' of github.com:CliMA/ClimaOce…
simone-silvestri Dec 11, 2025
d241ffa
new oceanigans in docs
simone-silvestri Dec 11, 2025
f5de100
fix slab ocean
simone-silvestri Dec 11, 2025
fae7edb
make slab_ocean a julia file
simone-silvestri Dec 11, 2025
954a534
some fixes for speedy
simone-silvestri Dec 11, 2025
bd37d09
couple more fixes
simone-silvestri Dec 11, 2025
b013369
Apply suggestion from @simone-silvestri
simone-silvestri Dec 11, 2025
476cbdf
update the slab_ocean.jl file
simone-silvestri Dec 11, 2025
9bb8918
Merge branch 'ss/interpolate-all-states' of github.com:CliMA/ClimaOce…
simone-silvestri Dec 11, 2025
597dffa
another fix
simone-silvestri Dec 11, 2025
9103331
more slab ocean stuff
simone-silvestri Dec 11, 2025
c2674a6
some more fixes
simone-silvestri Dec 11, 2025
e7045d2
fix another test
simone-silvestri Dec 11, 2025
e1dc0c6
another doctest fix
simone-silvestri Dec 11, 2025
c06265b
go ahead
simone-silvestri Dec 11, 2025
53796dc
more changes
simone-silvestri Dec 11, 2025
de00176
fix speedy tests
simone-silvestri Dec 12, 2025
5d386fa
no need for this
simone-silvestri Dec 12, 2025
cc9f1e2
some disambiguation
simone-silvestri Dec 15, 2025
751a29b
fix doctest
simone-silvestri Dec 15, 2025
882d328
more changes
simone-silvestri Dec 15, 2025
ecbe429
Merge remote-tracking branch 'origin/main' into ss/interpolate-all-st…
simone-silvestri Dec 15, 2025
9287999
more cleanup
simone-silvestri Dec 15, 2025
6a30ac3
only an ocean
simone-silvestri Dec 15, 2025
1b02089
add this fallback
simone-silvestri Dec 15, 2025
95f53f6
also this works
simone-silvestri Dec 15, 2025
4e605b2
change names
simone-silvestri Dec 15, 2025
c9e2cc2
disambiguate
simone-silvestri Dec 15, 2025
5c27db8
some disambiguations
simone-silvestri Dec 15, 2025
c71b10a
very annoying doctest fix
simone-silvestri Dec 15, 2025
ce221fc
fix the slab ocean test
simone-silvestri Dec 15, 2025
004f30f
another fix
simone-silvestri Dec 16, 2025
4294c4a
clear depot once
simone-silvestri Dec 16, 2025
ea031ea
why is it not clearing?
simone-silvestri Dec 16, 2025
657c253
force it to the correct depot
simone-silvestri Dec 16, 2025
3577e74
remove the clear docs from pipeline
simone-silvestri Dec 16, 2025
9f5e7b1
Merge branch 'ss/interpolate-all-states' into ss/adapt-veros
simone-silvestri Dec 16, 2025
6b300a4
changes
simone-silvestri Dec 16, 2025
b940b2a
fix a bit the example
simone-silvestri Dec 16, 2025
ec67593
no double ticks
simone-silvestri Dec 16, 2025
bfe7729
add CondaPkg
simone-silvestri Dec 16, 2025
2aa0fe9
embellish slab ocean example
simone-silvestri Dec 16, 2025
dc32759
gpuify the example
simone-silvestri Dec 16, 2025
db7ab5c
increase the resolution
simone-silvestri Dec 16, 2025
6e19835
increase fontsize
simone-silvestri Dec 16, 2025
f8a8960
a better description
simone-silvestri Dec 16, 2025
9588881
fix rendering of list
simone-silvestri Dec 16, 2025
7e75f77
add correct branch
simone-silvestri Dec 16, 2025
1008114
correct
simone-silvestri Dec 16, 2025
9de5cfc
tripolar grid + readd examples
simone-silvestri Dec 17, 2025
c8a6a56
add commits
simone-silvestri Dec 17, 2025
cb1e5a3
try it like this
simone-silvestri Dec 17, 2025
9711993
Merge branch 'main' into ss/interpolate-all-states
glwagner Dec 18, 2025
9ddfb25
fix major basins
simone-silvestri Dec 18, 2025
94c7ada
Merge branch 'ss/interpolate-all-states' of github.com:CliMA/ClimaOce…
simone-silvestri Dec 18, 2025
5c6624e
Revert "fix major basins"
simone-silvestri Dec 18, 2025
64a3482
improve slab ocean example
simone-silvestri Dec 18, 2025
8f205d8
Merge branch 'ss/interpolate-all-states' into ss/adapt-veros
simone-silvestri Dec 18, 2025
a61f4f3
more changes
simone-silvestri Dec 18, 2025
1f99aa7
Merge branch 'main' into ss/adapt-veros
simone-silvestri Dec 19, 2025
c3e5335
add this
simone-silvestri Dec 19, 2025
d5a7534
some renaming
simone-silvestri Dec 23, 2025
2a83b7a
this should work now
simone-silvestri Dec 27, 2025
50679ee
ok this works
simone-silvestri Dec 27, 2025
7d7de3e
Merge branch 'main' into ss/adapt-veros
simone-silvestri Dec 27, 2025
2295c90
reduce the output length
simone-silvestri Dec 27, 2025
0d807aa
Merge branch 'ss/adapt-veros' of github.com:CliMA/ClimaOcean.jl into …
simone-silvestri Dec 27, 2025
1b59c97
do not hide the python part
simone-silvestri Dec 27, 2025
3b8a20a
plot temperature and salinity
simone-silvestri Dec 27, 2025
e2a10ab
fix a couple of bugs
simone-silvestri Dec 27, 2025
ca29a60
make the veros simulation
simone-silvestri Dec 27, 2025
0003bc6
write forcing link
simone-silvestri Dec 27, 2025
ec1636e
make sure we have the correct output
simone-silvestri Dec 27, 2025
e98e5f8
import KernelOutput
simone-silvestri Dec 27, 2025
92020e7
fix another bug
simone-silvestri Dec 27, 2025
c45366e
patch error signal
simone-silvestri Dec 27, 2025
259f7dc
Merge branch 'main' into ss/adapt-veros
simone-silvestri Dec 27, 2025
0b5d370
remove duplicate developers
simone-silvestri Dec 27, 2025
92038d0
Merge branch 'ss/adapt-veros' of github.com:CliMA/ClimaOcean.jl into …
simone-silvestri Dec 27, 2025
e0f913f
remove duplicate ClimaOcean
simone-silvestri Dec 27, 2025
22ef2f5
Delete ext/ClimaOceanVerosExt/flexible_veros_simulation.py
simone-silvestri Dec 27, 2025
56311b0
change this timestep inside the timestepping function
simone-silvestri Dec 27, 2025
6a3993b
bugfix
simone-silvestri Dec 27, 2025
0cd2a29
this should be interior
simone-silvestri Dec 27, 2025
b791361
adapt
simone-silvestri Dec 27, 2025
51363c4
Apply suggestion from @simone-silvestri
simone-silvestri Dec 27, 2025
46e4497
download the data beforehand
simone-silvestri Dec 27, 2025
b5cc65b
Merge branch 'ss/adapt-veros' of github.com:CliMA/ClimaOcean.jl into …
simone-silvestri Dec 27, 2025
6ca464e
uninformative errors
simone-silvestri Dec 27, 2025
3fbd6cc
add back all the examples
simone-silvestri Dec 27, 2025
cc429e2
not sure what is going wrong with Distributed
simone-silvestri Dec 27, 2025
0278b4d
do not make the quarter degree
simone-silvestri Dec 28, 2025
9df72ec
Update docs/make.jl
simone-silvestri Dec 28, 2025
5303b76
reinstate all examples
simone-silvestri Dec 28, 2025
991f19c
Update veros_ocean_forced_simulation.jl
simone-silvestri Dec 28, 2025
60c191f
try like this
simone-silvestri Dec 29, 2025
d9dcddf
Merge branch 'ss/adapt-veros' of github.com:CliMA/ClimaOcean.jl into …
simone-silvestri Dec 29, 2025
8e57cea
generate the CPU examples on one CPU
simone-silvestri Dec 29, 2025
7f22ceb
another bugfix
simone-silvestri Dec 29, 2025
a764433
bugfix again
simone-silvestri Dec 29, 2025
d22be0f
Update CPU example page reference for Veros simulation
simone-silvestri Dec 29, 2025
6464960
remove slab sea ice
simone-silvestri Dec 29, 2025
5d26ebe
Merge branch 'main' into ss/adapt-veros
simone-silvestri Dec 29, 2025
649369d
fix examples
simone-silvestri Jan 2, 2026
4798f40
update
simone-silvestri Jan 2, 2026
f944ba6
Merge branch 'main' into ss/adapt-veros
simone-silvestri Jan 6, 2026
7eba40c
Adjust figure resolution for ocean simulation plot
simone-silvestri Jan 6, 2026
b05a913
Merge branch 'main' into ss/adapt-veros
simone-silvestri Jan 15, 2026
a2ad336
Merge branch 'main' into ss/adapt-veros
simone-silvestri Jan 21, 2026
6a4e135
Merge branch 'main' into ss/adapt-veros
simone-silvestri Jan 22, 2026
155d3a2
Merge branch 'main' into ss/adapt-veros
simone-silvestri Jan 23, 2026
f7fad12
Remove unnecessary comments in simulation script
simone-silvestri Jan 23, 2026
f6b4edf
Merge remote-tracking branch 'origin/main' into ss/adapt-veros
simone-silvestri Jan 26, 2026
8a90fb2
replace everything with NumericalEarth
simone-silvestri Jan 26, 2026
40cad6a
more coupling
simone-silvestri Jan 26, 2026
5451529
add a very simple test
simone-silvestri Jan 26, 2026
446360b
Merge branch 'ss/adapt-veros' of github.com:NumericalEarth/NumericalE…
simone-silvestri Jan 26, 2026
565a53a
take the extension
simone-silvestri Jan 26, 2026
c895330
Merge remote-tracking branch 'origin/main' into ss/adapt-veros
simone-silvestri Feb 15, 2026
896ebea
change
simone-silvestri Feb 15, 2026
48f5468
remove OceanSeaIceModel
simone-silvestri Feb 15, 2026
1ab8742
make sure eveything works
simone-silvestri Feb 15, 2026
a8f0b3a
fix docs
simone-silvestri Feb 15, 2026
bebc167
another bugfix
simone-silvestri Feb 15, 2026
a258a1a
another bugfix
simone-silvestri Feb 15, 2026
da11f16
Apply suggestion from @glwagner
simone-silvestri Feb 16, 2026
be5fb62
use fields
simone-silvestri Feb 16, 2026
9a1358b
fix alignment
simone-silvestri Feb 16, 2026
37be639
Merge branch 'main' into ss/adapt-veros
simone-silvestri Feb 23, 2026
6fb1145
fix the veros example
simone-silvestri Feb 23, 2026
cd0e1b8
extend the exhange_grid
simone-silvestri Feb 23, 2026
bd98113
import method
simone-silvestri Feb 23, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
- checkpointing
- speedy_weather
- downloading
- veros
steps:
- name: Show available storage before cleanup
run: |
Expand Down
7 changes: 6 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[weakdeps]
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
CopernicusMarine = "cd43e856-93a3-40c8-bc9e-6146cdce14fa"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
SpeedyWeather = "9e226e20-d153-4fed-8a5b-493def4f21a9"
Expand All @@ -45,13 +47,15 @@ NumericalEarthCopernicusClimateDataStoreExt = "CopernicusClimateDataStore"
NumericalEarthCopernicusMarineExt = "CopernicusMarine"
NumericalEarthReactantExt = "Reactant"
NumericalEarthSpeedyWeatherExt = ["SpeedyWeather", "XESMF"]
NumericalEarthVerosExt = ["PythonCall", "CondaPkg"]

[compat]
Adapt = "4"
CFTime = "0.1, 0.2"
CUDA = "5.9.5"
CUDA_Compiler_jll = "v0.3.1"
ClimaSeaIce = "0.4.2"
CondaPkg = "0.2.33"
CopernicusClimateDataStore = "0.1"
CopernicusMarine = "0.1.1"
CubicSplines = "0.2"
Expand All @@ -68,6 +72,7 @@ NCDatasets = "0.12, 0.13, 0.14"
Oceananigans = "0.104.2"
OffsetArrays = "1.14"
PrecompileTools = "1"
PythonCall = "0.9.28"
Reactant = "0.2.45"
Scratch = "1"
SeawaterPolynomials = "0.3.5"
Expand All @@ -87,4 +92,4 @@ MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Coverage", "Test", "MPIPreferences", "CUDA_Runtime_jll", "Reactant", "CopernicusClimateDataStore", "CopernicusMarine", "XESMF", "SpeedyWeather"]
test = ["Coverage", "Test", "MPIPreferences", "CUDA_Runtime_jll", "Reactant", "CopernicusClimateDataStore", "CopernicusMarine", "XESMF", "SpeedyWeather", "PythonCall", "CondaPkg"]
3 changes: 2 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
NumericalEarth = "904d977b-046a-4731-8b86-9235c0d1ef02"
Oceananigans = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
SeawaterPolynomials = "d496a93d-167e-4197-9f49-d3af4ff8fe40"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
SpeedyWeather = "9e226e20-d153-4fed-8a5b-493def4f21a9"
XESMF = "2e0b0046-e7a1-486f-88de-807ee8ffabe5"

Expand All @@ -22,4 +24,3 @@ NumericalEarth = {path = ".."}
Documenter = "1"
DocumenterCitations = "1.3"
Literate = "2.2"
XESMF = "0.1.6"
4 changes: 3 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ examples = [
Example("One-degree ocean--sea ice simulation", "one_degree_simulation", false),
Example("Near-global ocean simulation", "near_global_ocean_simulation", false),
Example("Global climate simulation", "global_climate_simulation", false),
Example("Veros ocean simulation", "veros_ocean_forced_simulation", true), # For the moment just to test, then put it to false
]

# Developer examples from docs/src/developers/ directory
Expand Down Expand Up @@ -99,8 +100,9 @@ pages = [

modules = Module[]
NumericalEarthSpeedyWeatherExt = isdefined(Base, :get_extension) ? Base.get_extension(NumericalEarth, :NumericalEarthSpeedyWeatherExt) : NumericalEarth.NumericalEarthSpeedyWeatherExt
NumericalEarthVerosExt = isdefined(Base, :get_extension) ? Base.get_extension(NumericalEarth, :NumericalEarthVerosExt) : NumericalEarth.NumericalEarthVerosExt

for m in [NumericalEarth, NumericalEarthSpeedyWeatherExt]
for m in [NumericalEarth, NumericalEarthSpeedyWeatherExt, NumericalEarthVerosExt]
if !isnothing(m)
push!(modules, m)
end
Expand Down
145 changes: 145 additions & 0 deletions examples/veros_ocean_forced_simulation.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# # An Ocean Simulation at 4ᵒ Resolution Forced by JRA55 Reanalysis
#
# This example showcases the use of NumericalEarth's PythonCall extension to run a
# near-global ocean simulation at 4-degree resolution using the Veros ocean model.
# The ocean is forced by the JRA55 reanalysis data
#
# For this example, we need Oceananigans, NumericalEarth, Dates, CUDA, and
# CairoMakie to visualize the simulation.

using NumericalEarth
using PythonCall
using Oceananigans, Oceananigans.Units
using CairoMakie
using Printf

# We import the Veros 4 degree ocean simulation setup, which consists of a near-global ocean
# with a uniform resolution of 4 degrees in both latitude and longitude and a latitude range spanning
# from 80S to 80N. The setup is defined in the `veros.setups.global_4deg` module.

# Before importing the setup, we need to ensure that the Veros module is installed and loaded
# and that every output is removed to avoid conflicts.

VerosModule = Base.get_extension(NumericalEarth, :NumericalEarthVerosExt)

VerosModule.install_veros()
VerosModule.remove_outputs(:global_4deg)

# Actually loading and instantiating the Veros setup in the variable `ocean`.

ocean = VerosModule.VerosOceanSimulation("global_4deg", :GlobalFourDegreeSetup)

# The loaded Veros setup contains a `set_forcing` method which computes the fluxes as restoring from climatology.
# We replace it with a custom function that only computes the TKE forcing (which depends on the wind stresses
# that we set in NumericalEarth). This way our u, v, T, S forcings are not overwritten.
# The `set_forcing_tke_only` method defined below is modified from the `set_forcing` method defined in
# https://github.com/team-ocean/veros/blob/main/veros/setups/global_4deg/global_4deg.py

pyexec("""
def set_forcing_tke_only(state):
from veros.core.operators import numpy as npx, update, at
from veros import KernelOutput

vs = state.variables
settings = state.settings

if settings.enable_tke:
vs.forc_tke_surface = update(
vs.forc_tke_surface,
at[1:-1, 1:-1],
npx.sqrt(
(0.5 * (vs.surface_taux[1:-1, 1:-1] + vs.surface_taux[:-2, 1:-1]) / settings.rho_0) ** 2
+ (0.5 * (vs.surface_tauy[1:-1, 1:-1] + vs.surface_tauy[1:-1, :-2]) / settings.rho_0) ** 2
) ** 1.5,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Veros uses TKE as a prognostic variable for which it defines a boundary condition based on the wind stress.
This particular setup we are using has a ocean.set_forcing method we need to overload.
At the moment, the easiest way to do it, to avoid writing a long python setup and to avoid changing the flux computation to introduce extra tracers (which is something I would like to do in another PR) is to overload it from within python with the same method of the setup
https://github.com/team-ocean/veros/blob/f90669d73b2dec8ab8b04d5a7dc574f69510b6e8/veros/setups/global_4deg/global_4deg.py#L227-L274
pruning the extra computation of wind stress and heat flux.

I would like to change this by actually writing the veros setup in the example in python rather than having this fix, and add extra tracers to the flux computation, but I think we can do it in another PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would actually be interesting to write a GPU veros script and run it in the examples

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

veros should do this internally. That's what we do with CATKE.

)

return KernelOutput(
surface_taux=vs.surface_taux,
surface_tauy=vs.surface_tauy,
forc_tke_surface=vs.forc_tke_surface,
forc_temp_surface=vs.forc_temp_surface,
forc_salt_surface=vs.forc_salt_surface,
)

ocean.set_forcing = set_forcing_tke_only
""", Main, (ocean=ocean.setup,))

# We force the 4-degree setup with a prescribed atmosphere based on the JRA-55 reanalysis data.
# This includes 2-meter wind velocity, temperature, humidity, downwelling longwave and shortwave
# radiation, as well as freshwater fluxes.

atmos = JRA55PrescribedAtmosphere(; backend = JRA55NetCDFBackend(10))

# The coupled ocean--atmosphere model.
# We use the default radiation model and we do not couple an ice model for simplicity.

radiation = Radiation()
coupled_model = OceanSeaIceModel(ocean, nothing; atmosphere=atmos, radiation)
simulation = Simulation(coupled_model; Δt = 1800, stop_time = 60days)

# We set up a progress callback that will print the current time, iteration, and maximum velocities
# every 10days. We also set up another callback that collects the surface prognostic variables
# into arrays for later visualization.

wall_time = Ref(time_ns())

function progress(sim)
ocean = sim.model.ocean
umax = maximum(PyArray(ocean.setup.state.variables.u))
vmax = maximum(PyArray(ocean.setup.state.variables.v))
wmax = maximum(PyArray(ocean.setup.state.variables.w))

step_time = 1e-9 * (time_ns() - wall_time[])

msg1 = @sprintf("time: %s, iteration: %d, Δt: %s, ", prettytime(sim), iteration(sim), prettytime(sim.Δt))
msg5 = @sprintf("maximum(u): (%.2f, %.2f, %.2f) m/s, ", umax, vmax, wmax)
msg6 = @sprintf("wall time: %s \n", prettytime(step_time))

@info msg1 * msg5 * msg6

wall_time[] = time_ns()

return nothing
end

u = []
v = []

function save_variables(sim)
push!(u, deepcopy(sim.model.interfaces.exchanger.ocean.state.u))
push!(v, deepcopy(sim.model.interfaces.exchanger.ocean.state.v))
end

add_callback!(simulation, progress, TimeInterval(10days))
add_callback!(simulation, save_variables, IterationInterval(10))

# Let's run the simulation!

run!(simulation)

iter = Observable(1)
ui = @lift(u[$iter])
vi = @lift(v[$iter])
Nt = length(u)

fig = Figure(resolution = (1000, 700))
ax1 = Axis(fig[1, 1]; title = "Surface zonal velocity (m/s)", xlabel = "", ylabel = "Latitude")
ax2 = Axis(fig[2, 1]; title = "Surface meridional velocity (m/s)", xlabel = "", ylabel = "Latitude")

grid = coupled_model.interfaces.exchanger.grid

λ = λnodes(grid, Center())
φ = φnodes(grid, Center())

hm1 = heatmap!(ax1, λ, φ, ui, colormap = :bwr, colorrange = (-0.2, 0.2))
hm2 = heatmap!(ax2, λ, φ, vi, colormap = :bwr, colorrange = (-0.2, 0.2))

Colorbar(fig[1, 2], hm1)
Colorbar(fig[2, 2], hm2)

CairoMakie.record(fig, "veros_ocean_surface.mp4", 1:Nt, framerate = 8) do nn
iter[] = nn
end
nothing #hide

# ![](veros_ocean_surface.mp4)
1 change: 0 additions & 1 deletion ext/NumericalEarthCopernicusMarineExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using NumericalEarth.DataWrangling.GLORYS: GLORYSMetadata, GLORYSMetadatum

import NumericalEarth.DataWrangling: download_dataset


# Download each date individually, instead of downloading the entire dataset at once.
# This is useful for a possible extension of the temporal horizon of the dataset.
function download_dataset(metadata::GLORYSMetadata; kwargs...)
Expand Down
11 changes: 11 additions & 0 deletions ext/NumericalEarthVerosExt/NumericalEarthVerosExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module NumericalEarthVerosExt

using NumericalEarth
using CondaPkg
using PythonCall
using Oceananigans

include("veros_ocean_simulation.jl")
include("veros_state_exchanger.jl")

end # module NumericalEarthVerosExt
Loading
Loading