Open orianac opened 2 years ago
Good catch, @orianac! yes, this is relevant for the pyramid generation.
can you implement this fix?
i'm on it
In the event that these weights (or other weights with a similar mismatch issue) are used in other places we should check all of them.
is using the pre-generated weights: https://github.com/carbonplan/cmip6-downscaling/blob/4a41f4d3c99b47127665fdeafa957255080a8825/cmip6_downscaling/methods/common/tasks.py#L335
i presume we'll need to re-generate the pyramids for the bcsd runs.
Cc @norlandrhagen
I just ran into an interesting issue. our postprocess()
function assumes that we are dealing with GCMs on regular lat/lon
grids. However, some of the GCMs use unstructured grids, for e.g.:
Are these GCMs with unstructured grids excluded from the list of GCMs we are downscaling?
Cc @jhamman
Are these GCMs with unstructured grids excluded from the list of GCMs we are downscaling?
Yes, let's skip this model for now.
Okie dokie... i have a prefect flow running for these models ["MIROC6", "AWI-CM-1-1-M", "BCC-CSM2-MR"]
The weights for all the models on regular lat/lon grids have been updated.
https://cmip6downscaling.blob.core.windows.net/static/xesmf_weights/cmip6_pyramids/weights.csv
In the downscaling workflows we open the GCM zarr stores and adjust the lons to a
[-180,180]
range using apostprocess
call (https://github.com/carbonplan/cmip6-downscaling/blob/4a41f4d3c99b47127665fdeafa957255080a8825/cmip6_downscaling/data/cmip.py#L120). The weights generation flow opens GCMs directly without shifting any lons. This means that when we apply those weights they are shifted from the datasets we're applying them to. In other words, an issue arises if the dataset you're applying the weights file to has lons that differ from the dataset used to create the weights file.I think the solution is to add the
postprocess
call to the weights generation routine -my guess is right after L67 would work (https://github.com/carbonplan/cmip6-downscaling/blob/4a41f4d3c99b47127665fdeafa957255080a8825/flows/gcm_obs_weights.py#L67).@andersy005 can you implement this fix? Also, might this be relevant for the pyramid generation steps since I believe they also use weights? In the event that these weights (or other weights with a similar mismatch issue) are used in other places we should check all of them. I checked the ERA5 step and it appears we use the same utility to open ERA5 in the weights generation as in the workflows (which is relevant since we adjust the
lat
ordering at https://github.com/carbonplan/cmip6-downscaling/blob/4a41f4d3c99b47127665fdeafa957255080a8825/cmip6_downscaling/data/observations.py#L45). But in case there is any other place we open ERA5 for the creation of pyramids, as long as we're using weights we need to have that samelat
reordering implemented as well.