From 2b6e9adb29d5541c017f186e8a8c6c1bbbe3b48e Mon Sep 17 00:00:00 2001 From: jdldeauna <67194538+jdldeauna@users.noreply.github.com> Date: Fri, 15 Apr 2022 10:21:14 -1000 Subject: [PATCH 1/2] adjusted MPI-ESM1-2-LR and NorESM2-LM, added CMCC-ESM2 --- cmip6_preprocessing/specs/staggered_grid_config.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmip6_preprocessing/specs/staggered_grid_config.yaml b/cmip6_preprocessing/specs/staggered_grid_config.yaml index b7e11e49..08a9bd5b 100644 --- a/cmip6_preprocessing/specs/staggered_grid_config.yaml +++ b/cmip6_preprocessing/specs/staggered_grid_config.yaml @@ -302,11 +302,11 @@ NorESM1-F: NorESM2-LM: gn: axis_shift: - X: right + X: left Y: left gr: axis_shift: - X: right + X: left Y: left NorESM2-MM: gn: @@ -336,5 +336,10 @@ UKESM1-0-LL: MPI-ESM1-2-LR: gn: axis_shift: - X: left + X: right Y: left +CMCC-ESM2: + gn: + axis_shift: + X: right + Y: right From a5a60e36daa0fb30e2fdb62b846713fb2d5dafef Mon Sep 17 00:00:00 2001 From: jdldeauna <67194538+jdldeauna@users.noreply.github.com> Date: Thu, 19 May 2022 18:42:59 -1000 Subject: [PATCH 2/2] cmip6_preprocessing/grids.py --- cmip6_preprocessing/grids.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmip6_preprocessing/grids.py b/cmip6_preprocessing/grids.py index b8be0ccd..edf2c0d9 100644 --- a/cmip6_preprocessing/grids.py +++ b/cmip6_preprocessing/grids.py @@ -179,7 +179,7 @@ def recreate_metrics(ds, grid): ) dist = distance(lon0, lat0, lon1, lat1) ds.coords["dx_gy"] = xr.DataArray( - dist, coords=grid.interp(ds.lon, "Y", boundary="extrapolate").coords + dist, coords=grid.interp(ds.lon, "Y", boundary="extend").coords ) # infer dy at the east/west face @@ -191,7 +191,7 @@ def recreate_metrics(ds, grid): ) dist = distance(lon0, lat0, lon1, lat1) ds.coords["dy_gx"] = xr.DataArray( - dist, coords=grid.interp(ds.lon, "X", boundary="extrapolate").coords + dist, coords=grid.interp(ds.lon, "X", boundary="extend").coords ) # for the distances that dont line up with the cell boundaries we need some different logic @@ -265,8 +265,8 @@ def recreate_metrics(ds, grid): ) metrics_dict = { - "X": [co for co in ["dx_t", "dx_gy", "dx_gx"] if co in ds.coords], - "Y": [co for co in ["dy_t", "dy_gy", "dy_gx"] if co in ds.coords], + "X": [co for co in ["dx_t", "dx_gy", "dx_gx", "dx_gxgy"] if co in ds.coords], + "Y": [co for co in ["dy_t", "dy_gy", "dy_gx", "dy_gxgy"] if co in ds.coords], "Z": [co for co in ["dz_t"] if co in ds.coords], } # # only put out axes that have entries