ocean-transport / scale-aware-air-sea

Repo for collaborative project on scale-aware air-sea fluxes
2 stars 0 forks source link

Apply filtering to CM2.6 data #17

Closed paigem closed 1 year ago

paigem commented 2 years ago

This issue is to track any progress made on applying GCM-filters to CM2.6 data.

Pertinent information:

How to access CM2.6 data (more info at #6):

# Load atmosphere data: daily fields
import xarray as xr
import gcsfs
gcs = gcsfs.GCSFileSystem()

path = f'gs://cmip6/GFDL_CM2_6/control/atmos_daily.zarr'
ds_atm = xr.open_zarr(gcs.get_mapper(path))
# Load ocean data: monthly air-sea flux output
from intake import open_catalog
cat = open_catalog("https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/ocean/GFDL_CM2.6.yaml")
ds_oc  = cat["GFDL_CM2_6_control_ocean_boundary_flux"].to_dask()

# Load ocean model grid data
ds_oc_grid  = cat["GFDL_CM2_6_grid"].to_dask()

Tasks:

@dhruvbalwada and I will meet to kick this off tomorrow.

paigem commented 2 years ago

Great chat with @dhruvbalwada today! We discussed a few things:

Link to notebook

Question for @jbusecke: For the CM2.6 ocean data, there is a separate zarr store that has the ocean grid variables. Is there a similar dataset that has atmospheric grid variables?

jbusecke commented 2 years ago

Question for @jbusecke: For the CM2.6 ocean data, there is a separate zarr store that has the ocean grid variables. Is there a similar dataset that has atmospheric grid variables?

Good question. Short answer: I did not find anything like that in the original repository. What information would you need exactly? Cell area?

jbusecke commented 2 years ago

Also great progress! This looks awesome. I personally do not understand that much about the intricacies of filters. It might be worth having some sort of synchronous meeting about it?

paigem commented 2 years ago

Good question. Short answer: I did not find anything like that in the original repository. What information would you need exactly? Cell area?

Also a good question. I guess we will need to look at exactly which variables we will need to filter, but if we do want to filter atmospheric fields then yes, we will likely need cell area and potentially other grid variables (e.g. cell width) as well.

But, thinking about this more, I wonder how we plan to handle the different ocean and atmosphere grids (as we discussed in the Miro brainstorming session). The atmospheric variables are already on the coarser atmosphere grid, so would we interpolate first to the high-res ocean grid and then filter as for the ocean fields? Or would we filter the atmospheric fields directly. In the first case, we wouldn't need the atmosphere grid info (at least for the filtering stage - we would need grid info for the interpolation to the ocean grid).

I personally do not understand that much about the intricacies of filters. It might be worth having some sort of synchronous meeting about it?

I agree - it would probably be worthwhile to have a meeting about filtering at some point! I personally find that most of my questions will arise as I code, so maybe we can make it a hacking/discussion session. 🙂

paigem commented 2 years ago

Also @dhruvbalwada - I just noticed a new PR in GCM-filters that addresses the units/dimensionality issue that we were confused about: https://github.com/ocean-eddy-cpt/gcm-filters/pull/146. The PR will clarify whether dx_min should be 1 (non dimensional unit) or a physical length scale.

jbusecke commented 2 years ago

But, thinking about this more, I wonder how we plan to handle the different ocean and atmosphere grids (as we discussed in the Miro brainstorming session). The atmospheric variables are already on the coarser atmosphere grid, so would we interpolate first to the high-res ocean grid and then filter as for the ocean fields? Or would we filter the atmospheric fields directly. In the first case, we wouldn't need the atmosphere grid info (at least for the filtering stage - we would need grid info for the interpolation to the ocean grid).

Uh this is another great question. I would tend to first interpolate, then filter, just to avoid any ambiguity when working with filter details on different grids. If we interpolate first, we know that the filter is doing exactly the same thing on both the ocean and atmospheric fields. Curious what @rabernat thinks?

paigem commented 2 years ago

@jbusecke and I made some progress on this today! 🎉 You can check out the notebook I just added via PR #22.

A few take-aways from today's session where we used the MOM5T Laplacian implemented in GCM-filters to filter a single time slice of MOM5 sensible heat data:

Also, in parallel, Julius was working on the interpolation code to interpolate atmospheric data onto the ocean grid, and appeared to be successful with that too! Productive day! 😄 💪

paigem commented 1 year ago

Closing since we are not using gcm-filters and have a working workflow already (see notebook in #32 )