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

Intake conversion Fig4-DrakePassageTransport #345

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

rbeucher
Copy link
Contributor

@rbeucher rbeucher commented Jun 6, 2024

Following the discussion in issue #313, we propose converting the recipes to use Intake, given that the Cookbook is no longer supported and the ACCESS-NRI Intake catalog is now available.

A few months ago, @max-anu began working on this transition. This pull request contains the changes @max-anu made to the notebook specified in the title.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@AndyHoggANU AndyHoggANU self-assigned this Jul 7, 2024
@AndyHoggANU
Copy link
Contributor

I've had to completely renovate this notebook, partly to update it to use experiments that are accessible from the intake catalog - but also I've been able to simplify it a fair bit. Review needed!

@@ -1,80 +1,506 @@
{
Copy link
Collaborator

@navidcy navidcy Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice moving the python comments into Markdown!


Reply via ReviewNB

@navidcy navidcy self-requested a review July 7, 2024 14:32
Copy link
Collaborator

@navidcy navidcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest the following...

Instead of

if this:
    darray = cat_subset[name].search(variable='tx_trans_int_z').to_dask()
    transport = darray
    transport = transport / 1e6 / 1025
else:
    darray_else = cat_subset[name].search(variable='tx_trans_int_z').to_dask()
    transport = darray_else
    transport = transport / 1e6 / 1025

something along the lines of:

ρ0 = 1025 # m / s^3 mean seawater density

if this:
    mass_transport = cat_subset[name].search(variable='tx_trans_int_z').to_dask()
else:
    mass_transport = something_else_cat_subset[name].search(variable='tx_trans_int_z').to_dask()

volume_transport = mass_transport / ρ0 / 1e6 # convert to m/s^3 -> Sv

@navidcy
Copy link
Collaborator

navidcy commented Jul 7, 2024

You can even use pint; have a look at https://cosima-recipes.readthedocs.io/en/latest/Examples/Transport_Through_Straits.html

No need to do that though..

@adele-morrison
Copy link
Collaborator

Probably best to use the same reference density as the default in MOM5 / MOM6, rho0 = 1035.

@AndyHoggANU
Copy link
Contributor

AndyHoggANU commented Jul 7, 2024

@navidcy - I don't really understand where that code you quoted came from, as it's quite different from the code in my notebook ... Apart from the 1036 vs 1025 thing, I have to offset times and then concatenate within my else statement, so your suggested code doesn't really work.

@AndyHoggANU
Copy link
Contributor

OK, I think that after some thought I get it, and the above commit should address your concerns. I didn't use pint - but happy for someone else to add this - either now or later.

@navidcy navidcy self-requested a review July 8, 2024 10:49
Copy link
Collaborator

@navidcy navidcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! I pushed some minor tweaks, mostly beautifications

@navidcy
Copy link
Collaborator

navidcy commented Jul 8, 2024

Thanks @AndyHoggANU! I'm merging!

@navidcy navidcy merged commit 33c3e02 into main Jul 8, 2024
3 checks passed
@navidcy navidcy deleted the INTAKE_Fig4-DrakePassageTransport branch July 8, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants