Open ekluzek opened 4 years ago
@mnlevy1981 and Gary Strand feel this is important. We are pretty sure WACCM already disallows this as well.
The issue I see is in the units
attribute of the time
variable written to netcdf by POP:
$ ncdump -h b.e22b05.B1850.f09_g17.timeseries_output_for_intake.pop.h.0001-01.nc | grep time:[a-z]
time:long_name = "time" ;
time:units = "days since 0000-01-01 00:00:00" ;
time:bounds = "time_bound" ;
time:calendar = "noleap" ;
I'm unclear on who sets this metadata -- CIME? PIO? The components themselves? Because it looks like CICE output from the same run has different units...
$ ncdump -h b.e22b05.B1850.f09_g17.timeseries_output_for_intake.cice.h.0001-01.nc | grep time:[a-z]
time:long_name = "model time" ;
time:units = "days since 0001-01-01 00:00:00" ;
time:calendar = "noleap" ;
time:bounds = "time_bounds" ;
The behavior I see in cime right now (for branch_tags/cime5.8.24_a01) is that negative start years are get converted to positive numbers, and the reference date is always the start year. This is because it just simply removes the "-" in the strings (so the leading dash gets removed as well). This is done in the scripting level, so any checks on this would need to be done there.
It looks like CAM has some tests that set the start year to 0000 as well (silhs). POP might have this hardcoded in, tavg.F90
Although it looks like maybe this is not a big deal as of cf_units
2.0.1 and xarray
0.15.0, as I can now open POP history files without the decode_times=False
option.
Note, also that for Paleo-work allowing negative years would be something useful to represent BCE periods. But, that's a somewhat different issue than this is.
@mnlevy1981 @ekluzek @klindsay28 is this still an issue or should it be closed?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This still should be done. Year zero really shouldn't be allowed.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Some rationales for not fixing this in POP are
Are there components besides POP that have zero for start and reference year?
Some NetCDF processing tools have trouble with having a year zero. This is because in the BCE, AD calendar there is NOT a year zero. So we should change both the defaults to not have a year zero as well as prevent it being set to zero.