Skip to content

Print globally averaged surface temperature for one-degree example #540

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

glwagner
Copy link
Member

This PR adds printing of the globally-averaged surface temperature in the one-degree example. I'd also like to add a few time-series. I'm thinking:

  • globally-averaged surface temperature
  • mixed layer depth
  • globally-averaged fluxes

@glwagner glwagner added the build docs Add this label to built the docs in a PR label May 23, 2025
@glwagner
Copy link
Member Author

Perhaps a plot of zonally-averaged fluxes and SST would be nice too? To show seasonality?

Comment on lines +47 to +48
start_date = DateTime(1993, 6, 1)
stop_date = DateTime(1994, 5, 1)
Copy link
Member

Choose a reason for hiding this comment

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

why?

Copy link
Member Author

Choose a reason for hiding this comment

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

because then the solution won't be biased to heat up as much at the beginning (eg starting during northern hemisphere winter)

@@ -117,15 +117,15 @@ function progress(sim)
u, v, w = ocean.model.velocities
T = ocean.model.tracers.T
e = ocean.model.tracers.e
Tmin, Tmax = minimum(T), maximum(T)
Tmin, Tmax, Tavg = minimum(T), maximum(T), mean(T)
Copy link
Member

Choose a reason for hiding this comment

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

does the mean ignore land? or do we need to do compute!(Field(Average(T)))[1, 1, 1]?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, all reductions of Field will ignore immersed cells

Copy link
Member Author

Choose a reason for hiding this comment

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

following CUDA definition if you call mean with no other arguments, it computes an average over all dimensions and returns the result as a scalar without any need to index further. If you specify dimensions

Copy link
Member Author

Choose a reason for hiding this comment

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

A lot of code has previously used various workarounds, including using interior, because conditional reductions often did not compile on the GPU. But since our revamp of conditional operations, I have found that we can use simple clean syntax now.

We may also want something like mean(view(T, :, :, Nz)) which would compute the surface average

@glwagner
Copy link
Member Author

docs didn't build, I guess i need another commit

@navidcy
Copy link
Member

navidcy commented May 24, 2025

docs didn't build, I guess i need another commit

you need to add the label before you create the PR if you want the docs to built from the first commit

@navidcy
Copy link
Member

navidcy commented May 25, 2025

I ran the 1-degree simulation for 5 years and changed the color range on the SST to go up to 38.

Here's a movie:

https://clima.github.io/ClimaOceanDocumentation/previews/PR540/literated/one_degree_simulation/

Seems like the very big SSTs are just in the Java sea?

cc @taimoorsohail @glwagner @simone-silvestri

@navidcy
Copy link
Member

navidcy commented May 25, 2025

one_degree_global_ocean_surface-3.mp4

@navidcy
Copy link
Member

navidcy commented May 25, 2025

Do you mean you wanna work on these additional diags in this PR @glwagner?

@taimoorsohail
Copy link
Collaborator

For what it's worth, I ran the code with the MutableVerticalDiscretization and it warmed up WAY more - above 60C.

This may be a secondary issue, or may point us to what is causing this (milder) warm up. I thought I would flag it though.

@taimoorsohail
Copy link
Collaborator

taimoorsohail commented May 26, 2025

flux_issue_RYF1deg_mutablegrid
flux_issue_RYF1deg_w_WENO
flux_issue_RYF1deg_wo_mutable
flux_issue_RYF1deg_uniform_vertlevels

@navidcy
Copy link
Member

navidcy commented May 29, 2025

For what it's worth, I ran the code with the MutableVerticalDiscretization and it warmed up WAY more - above 60C.

This may be a secondary issue, or may point us to what is causing this (milder) warm up. I thought I would flag it though.

@simone-silvestri are these you think related to why z-star is behaving differently (or wrong)?

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build docs Add this label to built the docs in a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants