Comments (6)
@mauzey1 this seems like a trivial update, I'll label this against the 3.9.0 milestone as it would be useful to cleanup if there is a sensible solution
@taylor13 ping
from cmor.
Not sure how trivial, but should be corrected, I think. Could be a problem between python and C???
from cmor.
I think this issue might be originating from the following section of the function cmor_write_var_to_file. This is the section that writes the time and time bound values from the axis if ntimes_passed
is set to zero. Is it assuming that it is writing data for all of the timesteps in the time axis? If the bounds value of the time axis are not null, then it will set the start of the time values to zero otherwise it will be set to the ntimes_written
value of the variable. What is the reasoning for this behavior? Shouldn't the start be set to zero for this case whether or not the bounds are not null?
Lines 3162 to 3248 in 7714266
Near the end of the function outside of the conditional statement for whether ntimes_passed
is zero, the ntimes_passed
value is added to the variable's ntimes_written
value. Should the length of the time axis be added to the ntimes_written
value, or should the ntimes_written
value be set to the length of the time axis?
Line 3277 in 7714266
from cmor.
Thanks, Chris, for this nice analysis. I'll try to take a look tomorrow at the. coding and hope to understand how we had hoped to handle this situation. If you don't hear back in a couple of days, could you please ping me? thanks.
Karl
from cmor.
I really don't know C well enough to be sure, but I think ntimes_written should actually keep track of how many times have been written to the file. In the case that times_passed is missing, then it should be set within the function (and not remain at a default value of 0. I would simply insert after line 3248 something like
ntimes_written = counts[0]
(if counts[0] is the number of time written in this call to the function).
By the way a basic question: If an optional integer argument is missing in a call to a function, does it's value get set to 0?
I'll also try to answer one of your other questions:
** Is it assuming that it is writing data for all of the timesteps in the time axis?
I don't think so ... I think it can write some of the time-steps and then add more timesteps on a later call to the function.
** If the bounds value of the time axis are not null, then it will set the start of the time values to zero otherwise it will be set to the ntimes_written value of the variable. What is the reasoning for this behavior? Shouldn't the start be set to zero for this case whether or not the bounds are not null?
I don't know.
Let me know if you think my suggestion above is consistent with your reasoning.
from cmor.
By the way a basic question: If an optional integer argument is missing in a call to a function, does it's value get set to 0?
For the C function of cmor_write
, you cannot omit the ntimes_passed
parameter from the function call. You must set it to zero if you are using the time dimension size for the number of times passed.
For Fortran and Python, omitting this parameter will set it to a default of zero. The length of the time_vals
parameter will be used if it is passed without the ntimes_passed
parameter.
from cmor.
Related Issues (20)
- "call to undeclared function 'calculate_leadtime_coord'" error in recent Xcode/Clang build for OSX HOT 4
- Python 3.12 build
- Renaming default branch to 'main' on October 11, 2023 HOT 1
- CMOR 3.7.3
- CMOR segfaults with mip cmor tables and CMIP6Plus CV.json HOT 14
- Test suite cleanup
- Exposing latest netcdf 4.9.x library functionality: quantize, zstandard HOT 13
- Remove unused attributes when processing CMIP6Plus datasets HOT 14
- Exposing latest netcdf 4.9.x library functionality: quantize, zstandard HOT 48
- unclear warning... HOT 5
- bounds required on singleton lon and lat? HOT 5
- avoid attributes of bounds of auxilliary coordinates (`vertices_latitudes` / `vertices_longitude`) HOT 5
- Calibrating CMOR3 & 4 forward development plans HOT 7
- CMOR 3.8.0 Release HOT 4
- Update README.md to remove v3.7 reference
- default `realm = "REALM"` is always written although not required by CV HOT 2
- order in `required_global_attributes` matters HOT 1
- input time type as INT HOT 3
- CircleCI current image deprecated HOT 1
- Numpy 2.0 compatibility issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmor.