From 79174472635db9cd0700b7a52d46d4775a7e9231 Mon Sep 17 00:00:00 2001 From: ashjbarnes Date: Fri, 15 Dec 2023 16:50:14 +1100 Subject: [PATCH] fix toggle for ryf turning on or off modulo attr on time --- regional_mom6/regional_mom6.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/regional_mom6/regional_mom6.py b/regional_mom6/regional_mom6.py index 2a45db09..20dc307e 100644 --- a/regional_mom6/regional_mom6.py +++ b/regional_mom6/regional_mom6.py @@ -1720,7 +1720,6 @@ def brushcut(self, ryf=False): segment_out.time.attrs = { "calendar": "julian", "units": f"{self.time_units} since {self.startdate}", - "modulo": " ", } # Dictionary we built for encoding the netcdf at end encoding_dict = { @@ -1832,10 +1831,14 @@ def brushcut(self, ryf=False): hgrid_seg.y.data, ) - with ProgressBar(): + # If repeat year forcing, add modulo coordinate + if ryf: segment_out["time"] = segment_out["time"].assign_attrs( {"modulo": " "} - ) ## Add modulo attribute for MOM6 to treat as repeat forcing + ) + + with ProgressBar(): + segment_out.load().to_netcdf( self.outfolder / f"forcing/forcing_obc_{self.seg_name}.nc", encoding=encoding_dict,