Skip to content
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

Double gyre example #1085

Closed
wants to merge 54 commits into from
Closed

Double gyre example #1085

wants to merge 54 commits into from

Conversation

navidcy
Copy link
Collaborator

@navidcy navidcy commented Oct 20, 2020

This needs work but following suggestion, I submit a PR and we all work together... :)

Closes #678.

@codecov
Copy link

codecov bot commented Oct 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@fad81b0). Click here to learn what that means.
Patch has no changes to coverable lines.

❗ Current head 32a06cb differs from pull request most recent head 94fdef6. Consider uploading reports for the commit 94fdef6 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1085   +/-   ##
=======================================
  Coverage        ?   57.31%           
=======================================
  Files           ?      162           
  Lines           ?     3882           
  Branches        ?        0           
=======================================
  Hits            ?     2225           
  Misses          ?     1657           
  Partials        ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ali-ramadhan
Copy link
Member

This would make an awesome example!

By modifying the parameters it could also be used at https://github.com/CliMA/OceanModelComparison.jl to compare against the double gyre solution produced by ClimateMachine.jl.

@glwagner
Copy link
Member

By modifying the parameters it could also be used at https://github.com/CliMA/OceanModelComparison.jl to compare against the double gyre solution produced by ClimateMachine.jl.

Indeed. I also want to see if I can get some eddies and do some time-averaging of the barotropic flow for pedagogical purposes.

@navidcy
Copy link
Collaborator Author

navidcy commented Oct 24, 2020

Any chance we use vertically stretched grid?

@glwagner
Copy link
Member

Stretched grid implementation isn't complete...

@navidcy
Copy link
Collaborator Author

navidcy commented Oct 24, 2020

Hint, hint?

@glwagner
Copy link
Member

glwagner commented Oct 25, 2020

We can't use a vertically stretched grid for this example because Oceananigans does not support vertically stretched grids.

@navidcy
Copy link
Collaborator Author

navidcy commented Jan 31, 2022

How long did this take you to run and what resolution did you use?

The animation above is a 10 year run starting from rest.

With a resolution of Nx = 160, Ny = 240, and Nz = 50 it took bit less than an hour on the GPU (or something like that).

@hdrake
Copy link
Contributor

hdrake commented Feb 7, 2022

Would it make sense to initialize with the analytical solution to the (linear or weakly nonlinear) barotropic problem? Even if a simple Laplacian viscosity is a poor parameterization for eddy effects, it should dramatically accelerate the equilibration process, right?

@glwagner
Copy link
Member

@navidcy we definitely want an example of this kind. It's a bit of work though, but perhaps we should bring this PR up to date?

@navidcy
Copy link
Collaborator Author

navidcy commented Apr 21, 2022

@navidcy we definitely want an example of this kind. It's a bit of work though, but perhaps we should bring this PR up to date?

done

@francispoulin
Copy link
Collaborator

I was looking for a reference to compare this to and found this paper by Nadiga and Straub.

They solve a one-layer Quasi-Geostrophic model so it will certainly have some differences, but if we have very low vertical resolution, I woudl expect that they should yield similar results. Sharing it in case it might be of interest.

@francispoulin
Copy link
Collaborator

I updated the code so that it runs with the latest functions, and I also modified it to run with a lat-lon grid. This is a result for the case with $N_z = 1$, which shows the voritcity on the left and the horizontal divergence on the right. I thought it might be nice to have 2x2 plots where the lower row has the streamfunction and the speed.

Also, I can run it with $N_z = 4$, since this example is from the MITgcm, and that case has four leves.

What would people like to see?

double_gyre_output.mp4

@glwagner
Copy link
Member

I was looking for a reference to compare this to and found this paper by Nadiga and Straub.

They solve a one-layer Quasi-Geostrophic model so it will certainly have some differences, but if we have very low vertical resolution, I woudl expect that they should yield similar results. Sharing it in case it might be of interest.

Can you use the MITgcm documentation as a reference?

https://mitgcm.readthedocs.io/en/latest/examples/baroclinic_gyre/baroclinic_gyre.html

@francispoulin
Copy link
Collaborator

I was looking for a reference to compare this to and found this paper by Nadiga and Straub.
They solve a one-layer Quasi-Geostrophic model so it will certainly have some differences, but if we have very low vertical resolution, I woudl expect that they should yield similar results. Sharing it in case it might be of interest.

Can you use the MITgcm documentation as a reference?

https://mitgcm.readthedocs.io/en/latest/examples/baroclinic_gyre/baroclinic_gyre.html

I am using all of the same parameters at the MITgcm Baroclinic Ocean Gyre example.

I looked at it again and see that they have some results from year 100. We can try and reproduce those, but it will take a while to get 100 years.

@glwagner
Copy link
Member

glwagner commented Jun 10, 2022

Also, I can run it with Nz = 4, since this example is from the MITgcm, and that case has four leves.

In my reading of the docs I see Nz = 15:

As in tutorial Barotropic Ocean Gyre, a border row of land cells surrounds the ocean domain, so the full numerical grid size is 62 × 62 in the horizontal. The domain has 15 levels in the vertical, varying from Δz = 50 m deep in the surface layer to 190 m deep in the bottom layer, as shown by the faint red lines in Figure 4.5.

From the first paragraph here: https://mitgcm.readthedocs.io/en/latest/examples/baroclinic_gyre/baroclinic_gyre.html. Is there another reference?

@francispoulin
Copy link
Collaborator

Also, I can run it with Nz = 4, since this example is from the MITgcm, and that case has four leves.

In my reading of the docs I see Nz = 15:

As in tutorial Barotropic Ocean Gyre, a border row of land cells surrounds the ocean domain, so the full numerical grid size is 62 × 62 in the horizontal. The domain has 15 levels in the vertical, varying from Δz = 50 m deep in the surface layer to 190 m deep in the bottom layer, as shown by the faint red lines in Figure 4.5.

From the first paragraph here: https://mitgcm.readthedocs.io/en/latest/examples/baroclinic_gyre/baroclinic_gyre.html. Is there another reference?

My mistake. Yes, 15 points in the vertical. I will work on reproducing some of their diagnostics and confirm things compare.

@ali-ramadhan
Copy link
Member

ali-ramadhan commented Oct 3, 2022

I updated the script and the simulation ran but I got a weird segfault during plotting (Julia 1.6.7). Did not try to replicate on another machine yet.

@navidcy navidcy closed this Apr 25, 2023
@navidcy navidcy deleted the double-gyre branch April 25, 2023 21:49
@navidcy navidcy mentioned this pull request Apr 25, 2023
5 tasks
@navidcy
Copy link
Collaborator Author

navidcy commented Apr 25, 2023

[I moved this work from my fork to an Oceananigans branch.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📜 The sacred scrolls science 🌊 Sometimes addictive, sometimes allergenic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double gyre example
5 participants