-
Notifications
You must be signed in to change notification settings - Fork 24
Add the possibility to use the Veros ocean model as the ocean component in ClimaOcean #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simone-silvestri
wants to merge
276
commits into
main
Choose a base branch
from
ss/adapt-veros
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
276 commits
Select commit
Hold shift + click to select a range
8599314
change names
simone-silvestri bb24633
go ahead
simone-silvestri 4f05dbb
fix it
simone-silvestri fe6dc72
this should work
simone-silvestri 787ebc9
add a new constructor
simone-silvestri 7c519a1
set with ECCOMetadatum
simone-silvestri 78a53cd
some changes
simone-silvestri 1e71d67
improvement to UI
simone-silvestri 4f7fdb2
change examples
simone-silvestri 58662d2
we don't need this
simone-silvestri 22c8d08
chnages
simone-silvestri 79f37eb
export ui functions
simone-silvestri a98669f
last date
simone-silvestri 5405ef3
vestigial dates
simone-silvestri b2ff520
change docstrings
simone-silvestri 992b4d7
better like this
simone-silvestri e65b0ea
add native date range
simone-silvestri e7a0039
Merge branch 'main' into ss/distinguish-constructor
simone-silvestri 40a9f24
change the url
simone-silvestri 58d5c11
fix tests
simone-silvestri 4fc2394
fixing the tests
simone-silvestri 385a44a
fix tests
simone-silvestri 54e5838
it's six dates not 5
simone-silvestri 925981d
Merge branch 'main' into ss/distinguish-constructor
simone-silvestri 62c2f46
Merge branch 'ss/distinguish-constructor' into ss/multi-year-JRA55
simone-silvestri fb35d78
this works
simone-silvestri 65ca9ba
this works
simone-silvestri 18504c5
this should work
simone-silvestri f35345c
done
simone-silvestri 97c91fd
Merge branch 'main' into ss/distinguish-constructor
navidcy 182cbfb
use directory over folder; fix some docstrings
navidcy a23c423
Merge branch 'main' into ss/distinguish-constructor
simone-silvestri f42a187
add an ECCOMetadatum
simone-silvestri 0a6dd9f
Merge branch 'ss/distinguish-constructor' of github.com:CliMA/ClimaOc…
simone-silvestri 790b5e6
spacing
simone-silvestri 1649353
add a top level constant
simone-silvestri 739bc46
correct directory
simone-silvestri 6ef9d7c
add a default dowbload
simone-silvestri 58c38c7
Merge branch 'ss/distinguish-constructor' into ss/multi-year-JRA55
simone-silvestri 4e53f82
almost there
simone-silvestri 29d15c8
Merge branch 'main' into ss/multi-year-JRA55
simone-silvestri 418fa99
revert test ecco
simone-silvestri f8cd74b
Merge branch 'ss/multi-year-JRA55' of github.com:CliMA/ClimaOcean.jl …
simone-silvestri 4761081
Merge branch 'main' into ss/multi-year-JRA55
simone-silvestri 93c6b6f
bugfix
simone-silvestri 0293afd
Merge branch 'ss/multi-year-JRA55' of github.com:CliMA/ClimaOcean.jl …
simone-silvestri cffb7e1
Merge remote-tracking branch 'origin/main' into ss/multi-year-JRA55
simone-silvestri 1febc0e
Merge remote-tracking branch 'origin/main' into ss/multi-year-JRA55
simone-silvestri ce7cbd3
start changes
simone-silvestri fbfe5ce
this should work
simone-silvestri 46940e7
bugfix
simone-silvestri 473dbd7
some bugfixing
simone-silvestri 3ccc9f7
this works
simone-silvestri a35bf04
this works!
simone-silvestri 68b3ff3
add regularization
simone-silvestri 5f53219
bugfix
simone-silvestri 9209bbf
add sea-ice ocean stress
simone-silvestri 62b4629
Merge branch 'main' into ss/multi-year-JRA55
simone-silvestri 4d963ea
fix tests
simone-silvestri 52c91d9
Merge branch 'ss/multi-year-JRA55' of github.com:CliMA/ClimaOcean.jl …
simone-silvestri 1ee41af
bugfix
simone-silvestri 1d58772
Update JRA55_field_time_series.jl
simone-silvestri 0c020d0
Update JRA55_field_time_series.jl
simone-silvestri bafe3c7
simplify
simone-silvestri 350b657
add the inmemory stuff
simone-silvestri 4a49b40
start with this
simone-silvestri fea1854
default to inmemory
simone-silvestri 4441567
Merge remote-tracking branch 'origin/ss/multi-year-JRA55' into ss/omi…
simone-silvestri 7c4aa61
go!
simone-silvestri 24f7d93
add a failsafe + a test
simone-silvestri d231995
some cleanup
simone-silvestri ca1980c
better to write last
simone-silvestri f448eeb
Merge remote-tracking branch 'origin/ss/multi-year-JRA55' into ss/omi…
simone-silvestri fed209b
Merge branch 'main' into ss/sea-ice-momentum-stress
simone-silvestri aeedd2f
last index
simone-silvestri f954c69
Merge branch 'ss/sea-ice-momentum-stress' of github.com:CliMA/ClimaOc…
simone-silvestri ddee7f0
add this
simone-silvestri daeb12f
add a clock
simone-silvestri 629d582
add the arctic
simone-silvestri 54165a0
Merge branch 'ss/sea-ice-momentum-stress' into ss/omip-prototype
simone-silvestri 35fe01d
try it out
simone-silvestri 5548a99
correct dates
simone-silvestri dfb8590
Update experiments/omip_prototype/quarter_degree_omip.jl
simone-silvestri a049dc1
Update experiments/omip_prototype/quarter_degree_omip.jl
simone-silvestri d1e6faf
add stuff
simone-silvestri 7186256
Merge branch 'main' into ss/omip-prototype
simone-silvestri a6d758d
going sixth degree
simone-silvestri 0b8624e
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri f18a772
some changes
simone-silvestri 6679bbd
synchronize the clocks for the moment
simone-silvestri 50a7226
Merge branch 'main' into ss/omip-prototype
simone-silvestri 7975dd4
Update test_jra55.jl
simone-silvestri 77e440b
bugfix
simone-silvestri 5e3c729
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri b05fb83
improve it quickly for now
simone-silvestri 501b3fa
continue
simone-silvestri f258e29
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri 5751899
another try...
simone-silvestri af67adc
bugfix for the salt flux
simone-silvestri d008026
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 83f97e9
try it out
simone-silvestri 03e7f19
correction
simone-silvestri 1e02dd9
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 1eedc44
correct
simone-silvestri 202212c
update
simone-silvestri efa566c
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 0c8d8b1
go for it
simone-silvestri 0f04d0f
Update src/SeaIceSimulations.jl
simone-silvestri e28b9a4
Update SeaIceSimulations.jl
simone-silvestri 0e1d4ca
Merge branch 'ss/default-sea-ice' into ss/omip-prototype
simone-silvestri 2eeed4c
some.. salinity
simone-silvestri b27ac12
Merge branch 'main' into ss/omip-prototype
simone-silvestri 4d09283
Merge branch 'main' into ss/omip-prototype
simone-silvestri 1507936
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 702fe64
update sea ice simulation
simone-silvestri 9664584
try like this for the moment and let it go
simone-silvestri 8392922
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri d28b611
added project
simone-silvestri 4b763ee
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri c306b0f
retry like this
simone-silvestri 83331f8
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri 4857647
hmmm this was explicit
simone-silvestri 668bc53
use a fixed dt
simone-silvestri dcce9e2
update to new syntax
simone-silvestri d5288c1
go like this
simone-silvestri 1322148
add a one-degree to test it out
simone-silvestri 2490da2
Update one_degree_simulation.jl
simone-silvestri c411c71
Update one_degree_simulation.jl
simone-silvestri f762205
try without implicit solver
simone-silvestri 759c1ac
Update Project.toml
simone-silvestri 01e9f05
Update near_global_ocean_simulation.jl
simone-silvestri e48a2b5
Update one_degree_simulation.jl
simone-silvestri 0765874
changes
simone-silvestri 808e6c9
try it in both
simone-silvestri 88bd4e8
Merge branch 'ss/adapt-to-new-oceananigans' into ss/zstar
simone-silvestri 7cacb1d
adding the correct zstar branch
simone-silvestri 7cb8d6b
added CUDA
simone-silvestri 469883a
Update pipeline.yml
simone-silvestri 86d0bce
revert CUDA
simone-silvestri 509d6b4
enforce using a specific branch
navidcy 308c9e3
Delete Manifest.toml
navidcy 06d895c
Update Project.toml
navidcy 6397010
enforce using Oceananigans#ss/fix-zstar-bc
navidcy ea59ebb
drop geebrish
navidcy 352a3ef
enforce using Oceananigans#ss/fix-zstar-bc
navidcy 2beac0e
use julia v1.10.10
navidcy ea86989
precompile again
navidcy 89af369
use julia v1.10.10
navidcy 9e2482b
first oceananigans; then develop
navidcy 9affa64
add CUDA
navidcy 7717533
using CUDA + record from Makie not CUDA
navidcy 6e0be09
Update one_degree_simulation.jl
simone-silvestri 4488c2e
some changes
simone-silvestri 26fde07
Merge branch 'ss/zstar' of github.com:CliMA/ClimaOcean.jl into ss/zstar
simone-silvestri a436bed
increase a bit
simone-silvestri 5746652
add more stuff
simone-silvestri 5127f05
improvements
simone-silvestri 1037980
improve
simone-silvestri 71c82f5
add an equatorial single column
simone-silvestri bc33d07
possibly remove a bug?
simone-silvestri ed0d210
Update atmosphere_sea_ice_fluxes.jl
simone-silvestri 5b5b747
Update atmosphere_sea_ice_fluxes.jl
simone-silvestri 28d3e4e
adding the correct Manifest
simone-silvestri 00a2933
Merge branch 'ss/zstar' of github.com:CliMA/ClimaOcean.jl into ss/zstar
simone-silvestri d7ef440
update
simone-silvestri b0d1fd3
Merge branch 'main' into ss/zstar
navidcy 860ff09
Merge branch 'main' into ss/zstar
simone-silvestri 5637600
Merge branch 'ss/zstar' of github.com:CliMA/ClimaOcean.jl into ss/zstar
simone-silvestri b3ab48b
remove equatorial single column
simone-silvestri d1c7450
remove manifest
simone-silvestri a1ede1f
revert
simone-silvestri 4015bf4
token
simone-silvestri 970ffeb
Revert "token"
simone-silvestri 4b4f64e
Merge remote-tracking branch 'origin/ss/zstar' into ss/omip-prototype
simone-silvestri e6ff0d4
changed JRA55
simone-silvestri ef45d0c
added Project
simone-silvestri d96c32b
merged
simone-silvestri ea3ee12
bugfix
simone-silvestri 9165bd2
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri add5526
this should fix it
simone-silvestri 35e2df6
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 92fda28
change sea ice
simone-silvestri ec70ca0
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 469bcb1
consolidate sea ice temperature
simone-silvestri 736ac4c
adding the manifest
simone-silvestri 6db860a
adding Manifest
simone-silvestri 5e0997c
comment out for now
simone-silvestri 049dacd
go for it
simone-silvestri cf22586
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri 17a2250
improve
simone-silvestri d024542
Merge remote-tracking branch 'origin/main' into ss/omip-prototype
simone-silvestri 7d6ce58
improving the performance
simone-silvestri 5e66a54
speed up
simone-silvestri 9063e3e
recorrect Oceananigans
simone-silvestri 4fb3526
Merge branch 'main' into ss/omip-prototype
simone-silvestri e7845a5
new Manifest
simone-silvestri fca5484
do not add Oceananigans
simone-silvestri 09d22a3
Update make.jl
simone-silvestri 3885668
one-degree-ompi for calibration
simone-silvestri 8bbc3b8
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri 988ec77
update one degree
simone-silvestri 3419022
use the correct value
simone-silvestri b1430e2
remove this for the moment
simone-silvestri abced34
Merge branch 'ss/omip-prototype' of github.com:CliMA/ClimaOcean.jl in…
simone-silvestri 78de681
start with adapting
simone-silvestri 3772b2c
fill it in
simone-silvestri b5befcd
remove manifest
simone-silvestri 1a40428
remove vestigial code
simone-silvestri 0876b41
add a simulation
simone-silvestri dc79dc0
add an OceananigansSimulation
simone-silvestri adb8393
ok this works
simone-silvestri ff57090
add a forced simulation
simone-silvestri 2460b14
update
simone-silvestri b74450f
coupled
simone-silvestri 7792990
some corrections
simone-silvestri bf23df7
back to previous stuff
simone-silvestri 5b03a33
add veros
simone-silvestri 5843397
add the veros experiment
simone-silvestri cc6ca11
dt mom not dt tracer
simone-silvestri 267d985
Apply suggestion from @glwagner
simone-silvestri 8602684
Apply suggestion from @glwagner
simone-silvestri d45906b
Update assemble_net_fluxes.jl
simone-silvestri 29c70ca
Rename fill_up_net_fluxes! to fill_net_fluxes!
simone-silvestri c7ee9ad
Update ext/ClimaOceanPythonCallExt/ClimaOceanPythonCallExt.jl
simone-silvestri c7dbcb0
overload the set! function
simone-silvestri ac8d821
bugfix
simone-silvestri 2d0c16b
bugfix
simone-silvestri 2debe0e
bugfix
simone-silvestri b3c6c46
fixed it
simone-silvestri 8cfb21d
let's go
simone-silvestri 88e937c
add visualization
simone-silvestri 507e81c
Merge branch 'main' into ss/adapt-veros
simone-silvestri 3d99939
Merge branch 'main' into ss/adapt-veros
simone-silvestri da45c7e
Merge branch 'main' into ss/adapt-veros
simone-silvestri 8aa6b13
Merge branch 'main' into ss/adapt-veros
simone-silvestri 62a3cc8
Update TODO comment for fluxes BC in veros
simone-silvestri 90bf962
Merge branch 'main' into ss/adapt-veros
simone-silvestri 792fa31
ok let's go
simone-silvestri dec7ab4
this should work out
simone-silvestri 891d39d
try it out like this
simone-silvestri 171cb40
run only this example
simone-silvestri c6ea397
try adding this
simone-silvestri 31da63f
add pythoncall
simone-silvestri 6d84da9
fix
simone-silvestri 308d494
Merge branch 'main' into ss/adapt-veros
simone-silvestri af0b9be
Update ClimaOceanPythonCallExt to include CondaPkg
simone-silvestri 24d0d23
Merge branch 'main' into ss/adapt-veros
simone-silvestri accfb4a
Merge branch 'main' into ss/adapt-veros
simone-silvestri 61ff994
Merge remote-tracking branch 'origin/main' into ss/adapt-veros
simone-silvestri ca46e70
some changes
simone-silvestri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # # A Python Ocean Simulation at 4ᵒ Resolution Forced by JRA55 Reanalysis and Initialized from ECCO | ||
| # | ||
| # This example showcases the use of ClimaOcean'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 and initialized from the ECCO | ||
| # state estimate. | ||
| # | ||
| # For this example, we need Oceananigans, ClimaOcean, Dates, CUDA, and | ||
| # CairoMakie to visualize the simulation. | ||
|
|
||
| using ClimaOcean | ||
| using PythonCall | ||
| using Oceananigans | ||
| 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(ClimaOcean, :ClimaOceanPythonCallExt) | ||
|
|
||
| VerosModule.install_veros() | ||
| VerosModule.remove_outputs(:global_4deg) | ||
|
|
||
| # Actually loading and instantiating the Veros setup in the variable `ocean`. | ||
| # This setup uses by default a different time-step for tracers and momentum, | ||
| # so we set it to the same value (1800 seconds) for both. | ||
|
|
||
| ocean = VerosModule.VerosOceanSimulation("global_4deg", :GlobalFourDegreeSetup) | ||
|
|
||
| set!(ocean, "dt_tracer", 1800.0; path=:settings) | ||
| set!(ocean, "dt_mom", 1800.0; path=:settings) | ||
|
|
||
| # 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 | ||
| # at every 5 iterations. It also collects the surface velocity fields and the net fluxes | ||
| # into the arrays `s`, `tx`, and `ty` for later visualization. | ||
|
|
||
| wall_time = Ref(time_ns()) | ||
|
|
||
| s = [] | ||
| tx = [] | ||
| ty = [] | ||
|
|
||
| us = coupled_model.interfaces.exchanger.exchange_ocean_state.u | ||
| vs = coupled_model.interfaces.exchanger.exchange_ocean_state.v | ||
|
|
||
| stmp = Field(sqrt(us^2 + vs^2)) | ||
|
|
||
| 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() | ||
|
|
||
| compute!(stmp) | ||
| push!(s, deepcopy(interior(stmp, :, :, 1))) | ||
| push!(tx, deepcopy(interior(coupled_model.interfaces.net_fluxes.ocean_surface.u, :, :, 1) .* 1020)) | ||
| push!(ty, deepcopy(interior(coupled_model.interfaces.net_fluxes.ocean_surface.v, :, :, 1) .* 1020)) | ||
|
|
||
| return nothing | ||
| end | ||
|
|
||
| add_callback!(simulation, progress, IterationInterval(5)) | ||
|
|
||
| # Let's run the simulation! | ||
|
|
||
| run!(simulation) | ||
|
|
||
| # We can now visualize the surface speed and wind stress at the ocean surface | ||
| # over the course of the simulation. | ||
|
|
||
| iter = Observable(1) | ||
| si = @lift(s[$iter]) | ||
| txi = @lift(tx[$iter]) | ||
| tyi = @lift(ty[$iter]) | ||
| Nt = length(s) | ||
|
|
||
| fig = Figure(resolution = (1200, 300)) | ||
| ax1 = Axis(fig[1, 1]; title = "Surface speed (m/s)", xlabel = "Longitude", ylabel = "Latitude") | ||
| ax2 = Axis(fig[1, 2]; title = "Zonal wind stress (N/m²)", xlabel = "Longitude") | ||
| ax3 = Axis(fig[1, 3]; title = "Meridional wind stress (N/m²)", xlabel = "Longitude") | ||
|
|
||
| grid = coupled_model.interfaces.exchanger.exchange_grid | ||
|
|
||
| λ = λnodes(grid, Center()) | ||
| φ = φnodes(grid, Center()) | ||
|
|
||
| heatmap!(ax1, λ, φ, si, colormap = :ice, colorrange = (0, 0.15)) | ||
| heatmap!(ax2, λ, φ, txi, colormap = :bwr, colorrange = (-0.2, 0.2)) | ||
| heatmap!(ax3, λ, φ, tyi, colormap = :bwr, colorrange = (-0.2, 0.2)) | ||
|
|
||
| CairoMakie.record(fig, "veros_ocean_surface.mp4", 1:Nt, framerate = 8) do nn | ||
| iter[] = nn | ||
| end | ||
| nothing #hide | ||
|
|
||
| #  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| module ClimaOceanVerosExt | ||
|
|
||
| using ClimaOcean | ||
| using CondaPkg | ||
| using PythonCall | ||
| using Oceananigans | ||
| using Oceananigans.DistributedComputations: @root | ||
|
|
||
| using Dates: DateTime | ||
|
|
||
| include("VerosOceanSimulations/veros_ocean_simulation.jl") | ||
| include("veros_state_exchanger.jl") | ||
|
|
||
| end # module ClimaOceanVerosExt |
32 changes: 32 additions & 0 deletions
32
ext/ClimaOceanPythonCallExt/VerosOceanSimulations/VerosOceanSimulations.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| module VerosOceanSimulations | ||
|
|
||
| using CondaPkg | ||
|
|
||
| using Oceananigans.Grids: topology | ||
| using ClimaOcean.OceanSeaIceModels: reference_density, heat_capacity, SeaIceSimulation | ||
|
|
||
| import Oceananigans.Fields: set! | ||
| import Oceananigans.TimeSteppers: time_step!, initialize! | ||
|
|
||
| import ClimaOcean.OceanSeaIceModels: OceanSeaIceModel, default_nan_checker | ||
| import Oceananigans.Architectures: architecture | ||
|
|
||
| import Base: eltype | ||
|
|
||
| """ | ||
| install_veros() | ||
|
|
||
| Install the Veros ocean model Marine CLI using CondaPkg. | ||
| Returns a NamedTuple containing package information if successful. | ||
| """ | ||
| function install_veros() | ||
| CondaPkg.add_pip("veros") | ||
| cli = CondaPkg.which("veros") | ||
| @info "... the veros CLI has been installed at $(cli)." | ||
| return cli | ||
| end | ||
|
|
||
| include("veros_ocean_simulation.jl") | ||
| include("veros_state_exchanger.jl") | ||
|
|
||
| end # module VerosOceanSimulations |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't you use a regular JLD2Writer? I think that would be preferred, to illustrate the user interface which is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I meant to change it, this was an initial validation case where is just simpler and faster to code it up like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, makes sense