From f53c1e6e66c99b0cdc2390e7510c35b758ce6639 Mon Sep 17 00:00:00 2001 From: ashjbarnes Date: Tue, 14 Nov 2023 16:31:43 +1100 Subject: [PATCH 1/4] 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/4] 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" From e68d87bb9aa358990b673b3d9d8f60cf0c373d1d Mon Sep 17 00:00:00 2001 From: Ashley Barnes <53282288+ashjbarnes@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:47:08 +1100 Subject: [PATCH 3/4] one line bugfix (#81) B grid error. Not sure how this happened? Means that the demo notebook for ACCESSom2 output stopped working. Need to include B grid example in CI tests --- regional_mom6/regional_mom6.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/regional_mom6/regional_mom6.py b/regional_mom6/regional_mom6.py index c82676d1..81b8aa90 100644 --- a/regional_mom6/regional_mom6.py +++ b/regional_mom6/regional_mom6.py @@ -1401,12 +1401,9 @@ def brushcut(self, ryf=False): ), regridder_tracer( rawseg[ - [self.eta.rename({self.xh: "lon", self.yh: "lat"})] - + [ - self.tracers[i].rename({self.xh: "lon", self.yh: "lat"}) - for i in self.tracers - ] - ] + [self.eta] + + [self.tracers[i] for i in self.tracers] + ].rename({self.xh: "lon", self.yh: "lat"}) ), ] ) From e26cd81f45d46ffcbe82d9a97079b90715fcfe16 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Wed, 15 Nov 2023 11:48:47 +1100 Subject: [PATCH 4/4] black format --- regional_mom6/regional_mom6.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regional_mom6/regional_mom6.py b/regional_mom6/regional_mom6.py index 81b8aa90..fd2e6b14 100644 --- a/regional_mom6/regional_mom6.py +++ b/regional_mom6/regional_mom6.py @@ -1401,8 +1401,7 @@ def brushcut(self, ryf=False): ), regridder_tracer( rawseg[ - [self.eta] - + [self.tracers[i] for i in self.tracers] + [self.eta] + [self.tracers[i] for i in self.tracers] ].rename({self.xh: "lon", self.yh: "lat"}) ), ]