Skip to content

Commit

Permalink
fix toggle for ryf turning on or off modulo attr on time
Browse files Browse the repository at this point in the history
  • Loading branch information
ashjbarnes committed Dec 15, 2023
1 parent 0bd2260 commit 7917447
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions regional_mom6/regional_mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7917447

Please sign in to comment.