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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions hamocc/mo_inventory_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ subroutine write_netcdf(iogrp)
nf90_put_att, nf90_put_var, nf90_unlimited, nf90_write
use mod_types, only: r8
use mod_config, only: expcnf, runid, inst_suffix
use mod_time, only: date0, time0, date, time, nstep, nday_of_year,nstep_in_day
use mod_time, only: date0, time0, date, time, nstep, nday_of_year,nstep_in_day,calendar
use mo_bgcmean, only: filefq_bgc, fileann_bgc, filemon_bgc,glb_fnametag
use mo_param1_bgc, only: idicsat,idms,ifdust,iiron,iprefalk,iprefdic,iprefo2,iprefpo4, &
iadust,inos,ibromo,icfc11,icfc12,isf6,icalc13,icalc14,idet13, &
Expand Down Expand Up @@ -827,7 +827,6 @@ 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) )

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.

!--- Define dimensions
if (.not. use_sedbypass) then
Expand All @@ -845,7 +844,10 @@ subroutine write_netcdf(iogrp)

!--- Define variables : time
call nccheck( NF90_DEF_VAR(ncid, 'time', NF90_DOUBLE, time_dimid,time_varid) )
call nccheck( NF90_PUT_ATT(ncid, time_varid, 'units', 'days') )
call nccheck( NF90_PUT_ATT(ncid, time_varid, 'units', timeunits) )
call nccheck( NF90_PUT_ATT(ncid, time_varid, 'calendar', calendar) )
call nccheck( NF90_PUT_ATT(ncid, time_varid, 'long_name', 'time') )


if (.not. use_sedbypass) then
!--- aqueous sediment tracers
Expand Down
Loading