-
Notifications
You must be signed in to change notification settings - Fork 32
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
warning on timesteps written #697
Comments
Not sure how trivial, but should be corrected, I think. Could be a problem between python and C??? |
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 Lines 3162 to 3248 in 7714266
Near the end of the function outside of the conditional statement for whether Line 3277 in 7714266
|
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. |
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 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. |
For the C function of For Fortran and Python, omitting this parameter will set it to a default of zero. The length of the |
I think this is just a minor issue, but i get a misleading warning when i write several timesteps with
cmor.write
. For example, using the python5 example, i get the warning:However, it seems that everything is written correctly and i figured out that i don't get the warning when i pass the number of timesteps explictily, e.g.
However, the documentation states that
if omitted, the number will be assumed to be the size of the time dimension of the data (if there is a time dimension).
So, this warning is a little misleading becausentimes_passed=time.size
should be the default. Just wanted to document it here since it took me some time to figure it out.The text was updated successfully, but these errors were encountered: