Skip to content

Commit

Permalink
added cmor variable kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Sep 27, 2024
1 parent f8ac70c commit 94296f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cordex/cmor/cmor.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,14 @@ def _cmor_write(da, table_id, cmorTime, cmorZ, cmorGrid, file_name=True):
coords.append(cmorZ)
coords.append(cmorGrid)

cmor_var = cmor.variable(da.name, da.units, coords)
cmor_var_kwargs = {}
for kwarg in ["positive", "missing_value", "original_name", "history", "comment"]:
if kwarg in da.attrs:
cmor_var_kwargs[kwarg] = da.attrs[kwarg]

cmor_var = cmor.variable(
table_entry=da.name, units=da.units, axis_ids=coords, **cmor_var_kwargs
)

if "time" in da.coords:
ntimes_passed = da.time.size
Expand Down

0 comments on commit 94296f1

Please sign in to comment.