Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time attributes to be cdo/xr-conform #449

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

jmaerz
Copy link
Collaborator

@jmaerz jmaerz commented Dec 12, 2024

Hi @TomasTorsvik and @JorgSchwinger , when I was running some python-xarray routines to plot the netcdf-inventory written out by iHAMOCC, I realized that xarray had issues to interpret the time dimension correctly. Some attributes for the time dimension were missing, which I introduce with this PR. I hope it doesn't break any of your own post-processing pipelines - please check carefully and let me know.

@TomasTorsvik , since you have written this inventory part: please check carefully (also, whether the time is correctly set - I assumed that the previous global attribute date was linked to the time dimension).

Only tested in single column mode. Limited idea, why the build fails here.

@jmaerz jmaerz added enhancement New feature or request iHAMOCC Issue mainly concerns the iHAMOCC code base labels Dec 12, 2024
@jmaerz jmaerz added this to the NorESM2.3 - BLOM/iHAMOCC milestone Dec 12, 2024
@jmaerz jmaerz self-assigned this Dec 12, 2024
@TomasTorsvik
Copy link
Contributor

@jmaerz - it has been a while since I looked into this file. Will need some time to test and see what is going on.

Copy link
Contributor

@TomasTorsvik TomasTorsvik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmaerz - looks good to me. Not sure why the date was defined as a global attribute in the first place.

Copy link
Contributor

@JorgSchwinger JorgSchwinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing this.

@@ -827,7 +827,7 @@ subroutine write_netcdf(iogrp)
!--- Define global attributes
call nccheck(NF90_PUT_ATT(ncid,NF90_GLOBAL,'title','Global inventory for marine bgc') )
call nccheck(NF90_PUT_ATT(ncid,NF90_GLOBAL,'history','Global inventory for marine bgc') )
call nccheck(NF90_PUT_ATT(ncid,NF90_GLOBAL,'date', timeunits) )
!call nccheck(NF90_PUT_ATT(ncid,NF90_GLOBAL,'date', timeunits) )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be deleted instead of commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jmaerz jmaerz merged commit 23cd458 into NorESMhub:master Dec 13, 2024
2 of 4 checks passed
@jmaerz jmaerz deleted the fix_inventory_time branch December 13, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iHAMOCC Issue mainly concerns the iHAMOCC code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants