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

Netcdf time needs to be double #161

Open
bjarnebuchmann opened this issue Feb 1, 2023 · 1 comment
Open

Netcdf time needs to be double #161

bjarnebuchmann opened this issue Feb 1, 2023 · 1 comment

Comments

@bjarnebuchmann
Copy link

When compute_tidal_elevations.py is used to create netcdf output, time is defined as a float (4-byte, NCFLOAT), using units:
time:units = "days since 1992-01-01T00:00:00" ;
Unfortunately, the default float does not contain enough accuracy for this process. At present time (>30 years after 1992-01-01), most of the significant digits are used on the days-part (integer part), leaving only about 2 digits for time-of-day.
For instance, when I define (input) time as every 10 minutes for an hour of 2023-01-30 (using another time:units), the values are correctly read and converted, but upon output the time values are:
time = 10622, 10622.01, 10622.01, 10622.02, 10622.03, 10622.04, 10622.04 ;
There is a clear loss of accuracy going on.
Other coordinate variables (x,y) are already defined as double. It is necessary that time be defined as double as well.

Thank you, Bjarne

@bjarnebuchmann
Copy link
Author

If possible, take the time kind and units from the input netcdf file and use same in output. The actual values are already present, so they do not need to be converted back from the internal units, as long as they are not thrown away during the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants