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

Notebooks for MOM6 analysis #190

Closed
adele-morrison opened this issue Jan 11, 2023 · 42 comments
Closed

Notebooks for MOM6 analysis #190

adele-morrison opened this issue Jan 11, 2023 · 42 comments

Comments

@adele-morrison
Copy link
Collaborator

It would be great to have all of the Documented Examples also work for MOM6 output (i.e. with the different grid and diagnostic/coordinate variable names). I'm not sure what the best way to do this is. Do we make a whole new set of Documented Examples? Or can we somehow put a model option at the top of the notebook and it translates variable names and grids for us?

There are some existing COSIMA notebooks for MOM6 analysis here. Should we merge these with the cosima-recipes so people can find them? There are also a bunch of MOM6 notebooks developed by GFDL folks, e.g. here.

@navidcy
Copy link
Collaborator

navidcy commented Jan 14, 2023

This is such a good point. So this goes back to using xgcm and #164. Perhaps the xgcm grid configs should be somehow provided centrally by the cookboo for each model. Then all examples should be similar regardless of model’s native coordinates!

This does suggest the all examples should use xgcm. I’d be in favour of that. Would make examples homogenized across models. It’s a major change though… (major changes are good thing but could seem bit intimidating).

cc @aekiss @micaeljtoliveira @aidanheerdegen @AndyHoggANU

@navidcy
Copy link
Collaborator

navidcy commented Jan 14, 2023

I’m not sure that my suggestion above is the best way forward. But it seems to me that duplicating the examples to work for MOM6 output would create double the amount of maintenance. Also people would update the mom5 version but not the mom6 version. It will be a nightmare and will certainly such a situation will provoke nightmares and disturb my sleep.

@navidcy
Copy link
Collaborator

navidcy commented Jan 17, 2023

For example, one can take the relative vorticity example and make it so that it works for both MOM5 and MOM6 output. Only method 3 (w xgcm) would be model agnostic. That should, btw, promoted to method 1, or even the only method. Then method 2 is only relevant to those who need to close the vorticity budget...

@aidanheerdegen
Copy link
Contributor

This does suggest the all examples should use xgcm. I’d be in favour of that. Would make examples homogenized across models. It’s a major change though… (major changes are good thing but could seem bit intimidating).

I agree that using libraries like xgcm that abstract away details of the underlying data is a good idea. cf-xarray is another such library.

I would suggest adopting these, as they should make it much easier to use these recipes with other models. Clearly MOM6 would be one of these other models, and the one you want to explicitly support, but as we've heard cosima-recipes is used as a resource by researchers worldwide, so the easier the recipes are to adapt to other systems the better. It makes the work more useful, and increases the impact of COSIMA.

It may be too ambitious to try and transition all recipes as @navidcy says. I agree as a first step a few recipes could be targeted and used as template for other recipes.

As for having xgcm grids being available in the Cookbook, there is a long history of doing nothing about grids

COSIMA/cosima-cookbook#191

COSIMA/cosima-cookbook#312

As a first step defining those grids in cosima-recipes would be a good first step I think. You would get a lot of benefit from it without too much work, and if/when grids are properly supported in cosima-cookbook it wouldn't be difficult to change or adapt to that.

@navidcy
Copy link
Collaborator

navidcy commented Jan 18, 2023

Who of the new mom6 users is planning to join the Hackathon v2.0? Perhaps we can tag them here to get a vibe of what's the best strategy forward?

@julia-neme, @schmidt-christina, @AndyHoggANU, .... (others?)

@navidcy
Copy link
Collaborator

navidcy commented Jan 18, 2023

is Hangyu joining? is he on GitHub?

@adele-morrison
Copy link
Collaborator Author

adele-morrison commented Jan 18, 2023

@ChrisC28
Copy link

I'll make an attempt to be there.

@willaguiar
Copy link
Collaborator

I'll be there!

@ashjbarnes
Copy link
Collaborator

Sorry I'm late to the party - I'll be there tomorrow!

@navidcy
Copy link
Collaborator

navidcy commented Jan 23, 2023

Sorry I'm late to the party - I'll be there tomorrow!

You are not late! There still ~21hrs until the party....
https://vclock.com/timer/Cosima+Hackathon+v2.0/2023-01-24T09:30:00/

@aekiss
Copy link
Contributor

aekiss commented Jan 23, 2023

I like the idea of making recipes model-agnostic wherever we can, and xgcm seems to go a long way towards doing this.

Maybe we should require all new recipes in this repo to be model-agnostic (or at least MOM5 and MOM6 compatible), and include examples using both MOM5 and MOM6 data. That would require the existing MOM6 notebooks to be made MOM5 compatible before adding them here (and perhaps replacing equivalent MOM5 notebooks). Perhaps too much work though?

Or perhaps as an interim measure we should have separate MOM5, MOM6 and Agnostic directories, and eliminate notebooks from the MOM5 and MOM6 dirs whenever they are replaced by an Agnostic equivalent?

@navidcy
Copy link
Collaborator

navidcy commented Jan 23, 2023

I like this. Notebooks should (most of the times) just deal with physics, not with models and model coordinates, etc!!!

@adele-morrison
Copy link
Collaborator Author

Having 3 directories is a good idea. That way people who are only familiar with one model can still contribute new scripts to their preferred model dir and others at some later stage can upgrade them to the agnostic directory. Keeping the barrier low for people to contribute is important or we won’t get many new notebooks.

@navidcy
Copy link
Collaborator

navidcy commented Jan 23, 2023

Perhaps Hackathon v3.0 will deal with making everything model agnostic. It would be the ideal, and it should --in principle-- just be adding 2-3 lines at the top of the notebook to create the correct xgcm grid. Then everybody would have to work with xgcm and it would be a joyful ride!

But since not even us (me at least) are not as comfortable doing so with both models we can't expect everybody else to do it. They don't have any example to follow.

A task for this hackathon would be to make 1 or 2 notebooks model agnostic. I'll put it forward tomorrow morning see if anybody picks it up. Then by Hackathon v3.0 we'd probably have lots of examples of both models and we'd be ready for the "Complete MOM-model agnostic COSIMA Revolution!"

@julia-neme
Copy link
Collaborator

julia-neme commented Jan 23, 2023

Happy to work on something here. I'll do a notebook on the barotropic streamfunction, and examples of analysis you can do with that

@schmidt-christina
Copy link
Collaborator

I can work on that as well

@reillyja
Copy link

I've got a KE decomposition notebook for MOM6 which I based on the MOM5 COSIMA one. I could clean this up to be more readable.

@adele-morrison
Copy link
Collaborator Author

I think some people may want to listen in to the tutorials and we are all in one room at ANU. Maybe MOM6 people could start working on individual Documented Examples for now (say here which you are doing). And then after the tutorials we can meet in breakout to discuss how to do the model agnostic thing?

@schmidt-christina
Copy link
Collaborator

Ok, I start with Zonally_Averaged_Global_Meridional_Overturning_Circulation.ipynb

@AndyHoggANU
Copy link
Contributor

@AndyHoggANU
Copy link
Contributor

Oh - @schmidt-christina - snap.
Have you started yet?

@ashjbarnes
Copy link
Collaborator

I'll work on the regional model script.

@angus-g I think it's still waiting for that pull request though. Were some changes you wanted made that I could implement?

@AndyHoggANU
Copy link
Contributor

Actually, @schmidt-christina - maybe we can both have a go and see how different it is!!

@ChrisC28
Copy link

There's a few of us in Hobart in a breakout room. Is there a zoom link?

@claireyung
Copy link
Collaborator

I'll try to do something about how to plot transects and vertical layers

@AndyHoggANU
Copy link
Contributor

Hi @ChrisC28 - let's listen to Angus' GitHub thing then break out.

@rmholmes
Copy link
Collaborator

@ChrisC28 it's just the usual COSIMA meeting zoom link, Just click on breakouts and join room 1.

@ChrisC28
Copy link

A few of us in Hobart are looking revisiting the set of scripts made by @angus-g and @ashjbarnes to setup a regional configuration, and make them a little more general. We might look at generallising the horizontal resolution. Any takers?

@ChrisC28
Copy link

Sorry, having some problems with zoom.

@schmidt-christina
Copy link
Collaborator

Julia and I will join the break out room in a minute

@schmidt-christina
Copy link
Collaborator

We are in room 1

@aekiss
Copy link
Contributor

aekiss commented Jan 24, 2023

/g/data/ik11/grids/ocean_grid_01.nc is currently missing metric data (dxt, dyt, dxu, dyu, area_t and area_u) needed for some operations with xgcm - see #212 (comment)

/g/data/ik11/grids/ocean_grid_10.nc and /g/data/ik11/grids/ocean_grid_025.nc are OK.

@adele-morrison
Copy link
Collaborator Author

The MOM6 breakout decided that after the hackathon we will restructure the examples as:

  • MOM6_Documented_Examples
  • MOM5_Documented_Examples
  • Documented_Examples (which is for model agnostic notebooks)

Same 3 directories for Contributed_Examples

@navidcy
Copy link
Collaborator

navidcy commented Jan 24, 2023

how about

├── Documented Examples
    ├── MOM5
    │   ├── example1.ipynb
    │   └── ...
    ├── MOM6
    │   ├── example1.ipynb
    │   └── ...
    └── Model agnostic (work for both MOMs)
        ├── example1.ipynb
        └── ...

@adele-morrison
Copy link
Collaborator Author

I'm happy with either structure.

@julia-neme
Copy link
Collaborator

Who will do this? I don't want to mess it up, but I have a notebook ready for mom6

@angus-g
Copy link
Contributor

angus-g commented Jan 24, 2023

You can create a PR with your notebook in the DocumentedExamples/MOM6/ directory and it will be fine! We can handle moving things to the right place as they come.

@julia-neme
Copy link
Collaborator

Streamfunction was pushed :)

@adele-morrison
Copy link
Collaborator Author

Closing this issue, so we can start with a clean issue #331 for Hackathon 4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment