From f53c1e6e66c99b0cdc2390e7510c35b758ce6639 Mon Sep 17 00:00:00 2001 From: ashjbarnes Date: Tue, 14 Nov 2023 16:31:43 +1100 Subject: [PATCH 1/2] at this step the intermediate 'topog_raw.nc' file already has vertical coordinate named elevation. Threw an error when vcoord had different name --- regional_mom6/regional_mom6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regional_mom6/regional_mom6.py b/regional_mom6/regional_mom6.py index b6a860e6..1416015d 100644 --- a/regional_mom6/regional_mom6.py +++ b/regional_mom6/regional_mom6.py @@ -1022,7 +1022,7 @@ def bathymetry( ## Ensure correct encoding topog = xr.Dataset( - {"depth": (["ny", "nx"], topog[varnames["elevation"]].values)} + {"depth": (["ny", "nx"], topog["elevation"].values)} ) topog.attrs["depth"] = "meters" topog.attrs["standard_name"] = "topographic depth at T-cell centers" From 39bb6318a750c57b99e593e6529c24e678a4942c Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Tue, 14 Nov 2023 18:27:10 +1100 Subject: [PATCH 2/2] black format --- regional_mom6/regional_mom6.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/regional_mom6/regional_mom6.py b/regional_mom6/regional_mom6.py index 1416015d..c82676d1 100644 --- a/regional_mom6/regional_mom6.py +++ b/regional_mom6/regional_mom6.py @@ -1021,9 +1021,7 @@ def bathymetry( topog = xr.open_dataset(self.mom_input_dir / "topog_raw.nc", engine="netcdf4") ## Ensure correct encoding - topog = xr.Dataset( - {"depth": (["ny", "nx"], topog["elevation"].values)} - ) + topog = xr.Dataset({"depth": (["ny", "nx"], topog["elevation"].values)}) topog.attrs["depth"] = "meters" topog.attrs["standard_name"] = "topographic depth at T-cell centers" topog.attrs["coordinates"] = "zi"