Conversation
| @info "Downloading ORCA2 data: $(metadatum.name) to $(metadatum.dir)..." | ||
| Downloads.download(fileurl, fileroute*"ORCA2L75.tar.gz"; progress=download_progress) | ||
| open(GzipDecompressorStream, fileroute*"ORCA2L75.tar.gz") do io | ||
| Tar.extract(io, fileroute*"/ORCA2L75") |
There was a problem hiding this comment.
Tar.extract doesn't like the destination fileroute so the files actually live at fileroute*"/ORCA2L75/ORCA2L75"
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Is this a tripolar grid? Does it have a zipper bc? Can we call it ORCATripolarGrid? |
@giordano is this correct or should we use an extension @jagoosw one possibility is to put this in a new package (we can put it in NumericalEarth) and then add an extension for the deps |
I think this is correct: if this was in an extension, users would need to know in advance what kind of files they're downloading and explicitly load |
Yeah its very similar to ORCA1 which is already in the file I added to, they just have some regional refinement too. |
I think you're right that Tar was already loaded |
|
When I try to run the example I get NaNs on the first time step, it seems ORCA1 does the same too? (@simone-silvestri) (The example I added is a copy of the one degree example, I don't know if we want it in the examples folder in this PR but there doesn't seem to be a validation folder) |
| z = ExponentialDiscretization(Nz, -depth, 0; scale = depth/4, mutable = true) | ||
|
|
||
| grid = ORCAGri(arch, z = z.face, Nz, dataset = ORCA2()) | ||
| grid = ORCAGrid(arch; z, Nz, dataset = ORCA2(), halo = (5, 5, 4)) |
|
There were a couple of bugs that have been solved, now I can run an ORCA1 with 30minutes quite stably |
|
I'm just sorting out the conflicts and everything is straight forward except the tests. I had modified the tests to do do all the same tests on the ORCA2 grid as the ORCA1 grid, but the incoming changes for ORCA12 don't test everything like metric consistency. Thinking about it now we probably don't need todo all the tests on all the grids because if the constructor works for one it should work for all of them? Should I make the tests just do basic tests on ORCA2 like ORCA12, or should I extend to include ORCA12 in all the tests, or do all the tests on 1 and 2 but not 12? @simone-silvestri @taimoorsohail |
|
I think they are quite simple tests so worth to add also ORCA12 to the more in-depth testing |
|
Okay I added them and ORCA12 is failing the metric consistency tests: ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102
Expression: all((x->begin
#= /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 =#
x > 0
end), interior) == true
Evaluated: false == true
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:102 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:121
Expression: n_west / Nx > 0.95
Evaluated: 0.5002313743637204 > 0.95
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:121 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:129
Expression: nsouth / length(φC) > 0.95
Evaluated: 0.4337215751525236 > 0.95
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:129 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
ORCATripolarGrid (ORCA12) metric consistency: Test Failed at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:140
Expression: boundary_jump < 10interior_variation + 1.0e-10
Evaluated: NaN < NaN
Stacktrace:
[1] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:140 [inlined]
[3] macro expansion
@ ~/.julia/juliaup/julia-1.10.10+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[4] top-level scope
@ ~/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:80
Test Summary: | Pass Fail Total Time
ORCATripolarGrid (ORCA12) metric consistency | 20 15 35 17.0s
ERROR: LoadError: Some tests did not pass: 20 passed, 15 failed, 0 errored, 0 broken.
in expression starting at /Users/jago/Documents/Projects/NumericalEarth.jl/test/test_orca_tripolar_grid.jl:17@taimoorsohail have you managed to run a model using the ORCA12 grid? |
|
Ok then I guess and issue that tracks the failure is more suited 😅 So we can merge this PR and deal with ORCA12 in another PR |
|
To summarise I think the tests are telling us that:
|
~okay I'll mark the tests as broken ~ I've commented out ORCA12 from the tests because it was easier than marking every test as broken |
|
I think this is ready for review now. @simone-silvestri do you think I should reduce the stop time for the example? |
| # Now we are ready to build the coupled ocean--sea ice model and bring everything | ||
| # together into a `simulation`. | ||
|
|
||
| # With Runge-Kutta 3rd order time-stepping we can safely use a timestep of 20 minutes. |
There was a problem hiding this comment.
| # With Runge-Kutta 3rd order time-stepping we can safely use a timestep of 20 minutes. | |
| # With Runge-Kutta 3rd order time-stepping we can safely use a timestep of 90 minutes. |
| vertical_mixing = CATKEVerticalDiffusivity(VerticallyImplicitTimeDiscretization(); | ||
| maximum_tracer_diffusivity = 1, | ||
| maximum_tke_diffusivity = 1, | ||
| maximum_viscosity = 1) |
There was a problem hiding this comment.
we cannot use the default_ocean_closure?
There was a problem hiding this comment.
I think I was getting instability when I didn't have it capped, but I'll rerun and check
There was a problem hiding this comment.
I don't think we should have any examples that don't use the default --- we should fix the default instead.
| tracer_advection = WENO(order=5) | ||
|
|
||
| dates = DateTime(1993, 1, 1) : Month(1) : DateTime(1993, 11, 1) | ||
| mask = LinearlyTaperedPolarMask(southern=(-80, -70), northern=(70, 90), z=(-100, 0)) |
There was a problem hiding this comment.
do we need to restore under sea ice?
There was a problem hiding this comment.
Not sure, should I try without the mask?
| @test size(bathy) == (Nx0, Ny0) | ||
| @test maximum(bathy) > 5000 # Deep ocean | ||
| end | ||
| end No newline at end of file |
There was a problem hiding this comment.
| end | |
| end | |
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
|
I think I've resolved the test conflicts but because I've renamed the test file it didn't show me the diffs automatically, is it just the new bit to predownload the datasets? |
|
I think the last bit before merging is to add these to the CATKE defaults: maximum_tracer_diffusivity = 1
maximum_tke_diffusivity = 1
maximum_viscosity = 1(If they are truly needed). I don't think it will damage the accuracy of the simulation, given that 1 |
you mean for |
|
I just checked and when I run without the limits I got NaNs. If I recall correctly, when I originally investigated this it was coming from a storm. I think maybe its a problem that is manifesting on coarse grids because if e.g. we interpolate the atmosphere fields and the coarse point happens to be near a very high wind speed point then that high wind speed is applied over the whole cell injecting a lot more momentum than on a more refined grid that resolves the variability in the atmosphere. I don't know if there are other strategies for downscaling the atmosphere some kind of averaging that people use? |
|
My main concern is that the limiters are unphysical. A diffusivity that large can occur for winds of 33 m/s and a 1 m mixing length, which seems possible in extreme conditions for sure. The question is why 1 m^2 / s lead to blow up. |
1m^2/s was an arbitrary choice, I can try running with it higher to see what the stable maximum is. I'm not sure exactly how the instability is arising, I think there can be a feedback with the bulk formula fluxs if the fluxs become large which could happen if theres a deep mixing event and e.g. the SST suddenly drops? |
This PR adds ORCA2 grids to data wrangling and makes some changes to grid construction to get it working. It also renamed
ORCAGridtoORCATripolarGrid, adds a "coarse" example on ORCA2, and adds the option to remove closed basins int he grid constructor.ORCA2 is strange because it has regional refinement in the Mediterranean, Red, Black and Caspian Seas, as well as at the equator and south pole.
The underlying grid:

I had to add Tar and CodecZlib to the dependancies because the Zenodo I found with the grid has them in a tarball.
@simone-silvestri @glwagner