-
Notifications
You must be signed in to change notification settings - Fork 15
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
Initial documentation example graphics failing #327
Comments
can you give a complete script that reproduces the error? We can then use that to solve the problem |
oh.. this might have been a bug introduced by CliMA/Oceananigans.jl#4023? |
What version of Oceananigans you are using to get this error? |
The docs are build fine using the latest Oceananigans version; see https://clima.github.io/ClimaOceanDocumentation/dev/literated/near_global_ocean_simulation/ |
Its v0.95.5, which is the latest according to
github.com/CliMA/Oceananigans.jl and is given by "status" in my Julia
…On Sat, 11 Jan 2025 at 17:05, Navid C. Constantinou < ***@***.***> wrote:
What version of Oceananigans you are using to get this error?
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUPNYEVPUPVOFCAWPNAZRLT2KCJ7VAVCNFSM6AAAAABU7RCNVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBVGA2TINRZGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Here is the script I used taken from the docs and with the simple change
dates=date. It ran in about 8hours clock time on an NVIDIA RX A2000 6GB GPU.
```
using Oceananigans
using Oceananigans.Units
using Dates, CFTime
import ClimaOcean
arch = GPU()
grid = LatitudeLongitudeGrid(arch,
size = (1440, 560, 10),
halo = (7, 7, 7),
longitude = (0, 360),
latitude = (-75, 75),
z = (-3000, 0))
bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry
based on ETOPO1
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
# Build an ocean simulation initialized to the ECCO state estimate on Jan
1, 1993
ocean = ClimaOcean.ocean_simulation(grid)
date = DateTimeProlepticGregorian(1993, 1, 1)
set!(ocean.model, T = ClimaOcean.ECCOMetadata(:temperature; dates=date),
S = ClimaOcean.ECCOMetadata(:salinity; dates=date))
# Build and run an OceanSeaIceModel (with no sea ice component) forced by
JRA55 reanalysis
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch) # changed 8/1/2025
coupled_model = ClimaOcean.OceanSeaIceModel(ocean; atmosphere)
simulation = Simulation(coupled_model, Δt=5minutes, stop_time=40days)
run!(simulation)
#The simulation above achieves approximately 8 simulated years per day of
wall time on an Nvidia H100 GPU.
#Since ocean.model is an Oceananigans.HydrostaticFreeSurfaceModel, we can
leverage Oceananigans features in
#our scripts. For example, to plot the surface speed at the end of the
simulation we write
u, v, w = ocean.model.velocities
speed = Field(sqrt(u^2 + v^2))
compute!(speed)
using GLMakie
fig,ax,hm = heatmap(view(speed, :, :, ocean.model.grid.Nz), colorrange=(0,
0.5), colormap=:magma, nan_color=:lightgray)
Colorbar(fig[:,end+1],hm)
save("speed2.png", fig)
```
…On Sat, 11 Jan 2025 at 16:42, Gregory L. Wagner ***@***.***> wrote:
can you give a complete script that reproduces the error? We can then use
that to solve the problem
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUPNYESUHSXDKLNKRMA6FAT2KCHKXAVCNFSM6AAAAABU7RCNVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBVGA2DQOBTGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thanks - the version of this I was using had some differences. The closest
I can see to what went wrong was the line
```
grid=ImmersedBoundaryGrid(gid, GridFittedBottom(bottom_height);
active_cells_maps=true)
rather than the version with no optional argument and bottom_height
replaced by bathymetry.
…On Sun, 12 Jan 2025 at 13:49, Navid C. Constantinou < ***@***.***> wrote:
The docs are build fine using the latest Oceananigans version; see
https://clima.github.io/ClimaOceanDocumentation/dev/literated/near_global_ocean_simulation/
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUPNYEVOLXB4E6QQVS4HME32KG32LAVCNFSM6AAAAABU7RCNVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBVGQ4TSNBRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm also getting this error for the example in the README.md, using this script after the "dates" fix from issue #224 : using Oceananigans
using Oceananigans.Units
using Dates, CFTime
import ClimaOcean
arch = CPU() #GPU()
grid = LatitudeLongitudeGrid(arch,
size = (1440, 560, 10),
halo = (7, 7, 7),
longitude = (0, 360),
latitude = (-70, 70),
z = (-3000, 0))
bathymetry = ClimaOcean.regrid_bathymetry(grid) # builds gridded bathymetry based on ETOPO1
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(bathymetry))
# Build an ocean simulation initialized to the ECCO state estimate on Jan 1, 1993
ocean = ClimaOcean.ocean_simulation(grid)
dates = DateTimeProlepticGregorian(1993, 1, 1)
set!(ocean.model, T = ClimaOcean.ECCOMetadata(:temperature; dates),
S = ClimaOcean.ECCOMetadata(:salinity; dates))
# Build and run an OceanSeaIceModel (with no sea ice component) forced by JRA55 reanalysis
atmosphere = ClimaOcean.JRA55PrescribedAtmosphere(arch)
coupled_model = ClimaOcean.OceanSeaIceModel(ocean; atmosphere)
simulation = Simulation(coupled_model, Δt=5minutes, stop_time=1hours)
run!(simulation)
# Plot it
using GLMakie
u, v, w = ocean.model.velocities
speed = Field(sqrt(u^2 + v^2))
compute!(speed)
heatmap(view(speed, :, :, ocean.model.grid.Nz), colorrange=(0, 0.5), colormap=:magma, nan_color=:lightgray) Output:
Using julia version 1.11.2 and:
Perhaps the README.md just needs to be updated. |
I think that upgrading Oceananigans to 0.95.6 will fix this issue, because the method is there: When issues with the plotting extension crop up (which seems to happen somewhat often) then the easy fix is to use heatmap(interior(speed, :, :, ocean.model.grid.Nz), colorrange=(0, 0.5), colormap=:magma, nan_color=:lightgray) the difference is that |
Thank you @StevePny! Epic to run this on a laptop. About the stripes: I think the visualization is correct. We also see stripes in the near-global ocean simulation example: They dissipate eventually but it takes some time. In the example it seems to take upwards of 30 days (hard to say actually, since the example movie is lacking time information, meh). A guess about their origin: the stripes may be associated with an "initialization shock"; eg our initial conditions is (a) interpolated from the relatively coarse 1 deg ECCO data (which itself is interpolated to a lat-lon grid from the native ECCO grid) and (b) only uses T, S and not velocities, so it's out of geostrophic balance. That still doesn't explain (to me) why the stripes have so much structure... perhaps there is something about how the ECCO data is interpolated from it's native grid that explains it... We might be able to investigate that hypothesis by using ECCO2 for the initial conditions (which is 1/6th degree? so closer to the resolution of this simulation). On the error, I am puzzled because I think our examples (like the near-global simulation example) are successfully using the Makie extension with |
I tried the initial documentation example of ClimaOcean again last night. The simulation took 6.252 hrs on a NVIDIA RTX A2000 6GB GPU running Windows 11, Julia 1.11.2, ClimaOcean 0.3.3 and Oceananigans 0.95.7. That's good news and a wall-time improvement over the previous successful simulations for this processor. For the graphics, using interior rather than view in the heatmap call gave Using the original view call gave |
The call to heatmap following a successful simulation fails with axis_str. This is in the file
Oceananigans.jl/ext/OceananigansMakieExt.jl
at line 50 for ImmersedBoundaryGrid and called by _create_plot at line 71.
The example code line is
The error is
The stacktrace is
This code was working and gave reasonable answers in early December 2024. Maybe I need to install a different version of Oceananigans.jl, but the status for julia gives v0.95.5 and according to github that is the latest version for Oceananigans.jl.
Thanks. I will try the related example near_global_simulation.jl again.
The text was updated successfully, but these errors were encountered: