Comments (10)
I am looking at file_suffix
code and hopefully, I can get that to work soon. I don't remember changing that code, so it must be a something I introduced.
I am not aware of the problem with append-mode. I will try to create a test to reproduce this. If you can provide some of your code using the cmor.write()
function that will help me investigate it.
Thanks!
from cmor3_documentation.
After registering all variables and axes I am looping over all time steps to write data of each variable however the error also occurs when not looping.
cmor_write(vars[i].cmor_varID, vars[i].data, vars[i].datatype, chunk_files[i], 1, &time_val, time_bndsp, NULL);
The chunk_files[i]
parameter is gone in CMOR3. If a zfactor is needed for this variable, I call cmor_write a second time for that time step:
if ( vars[i].zfactor_id > 0 ) cmor_write(vars[i].zfactor_id, vars[ps_index].data, vars[ps_index].datatype, chunk_files[i], 1, &time_val, time_bndsp, &vars[i].cmor_varID);
This works well for all variables (for now) but not in append mode for variables with zfactors. In append mode, the first time_val
of the variable which is to append on the chunk is lost in the output - either an Error occurs if the time_val does not fit in the time series or a warning occurs.
Thanks for the quick answer.
from cmor3_documentation.
I will get to it this week, and let you know by Friday. Thanks for the code....
from cmor3_documentation.
Hi Denis,
may I draw your attention to this issue again? I still struggle with the APPEND_MODE. In cmor.c we have
ierr = mkstemp(outname);
unlink(outname);
and
/* -------------------------------------------------------------------- */
/* Decides NetCDF mode */
/* -------------------------------------------------------------------- */
ncid = cmor_validateFilename(outname, var_id);
In validateFilename
it is:
fperr = fopen(outname, "r");
if (fperr == NULL) {
/* -------------------------------------------------------------------- */
/* ok it does not exists... we will open as new */
/* -------------------------------------------------------------------- */
ierr = nc_create(outname, NC_CLOBBER | cmode, &ncid);
} else { /*ok it was there already */
But how can it be there already if mkstemp is used? And how can I use NetCDF APPEND_MODE then? How can I pass the chunk to append on?
Best regards,
Fabi
from cmor3_documentation.
It seems that this functionality was stripped when converting to 3.0.0. I will work on it today and will create a nightly version for you to try.
from cmor3_documentation.
I added back this functionality, you can give it a try using the following conda file.
https://anaconda.org/PCMDI/cmor/files?version=2017.09.22.3.2.8&channel=nightly
You can install the latest version using this command.
conda install -c conda-forge -c pcmdi/label/nightly cmor==2017.09.22.3.2.8
I also created a test for it.
https://github.com/PCMDI/cmor/blob/master/Test/test_python_appending.py
from cmor3_documentation.
@wachsylon did you give it a try? Thanks!
from cmor3_documentation.
Thanks for the enhancement! Sorry for the late answer.
It worked in my tests, also for hybrid zaxis.
from cmor3_documentation.
@dnadeau4 It looks like @wachsylon was satisfied by these changes. Should we close this issue.
In the API documentation, https://cmor.llnl.gov/mydoc_cmor3_api/, there is this sentence for the file_suffix
parameter of cmor_write
.
CMOR2 will be smart enough to figure out if a suffix was used when creating that file.
Should that be CMOR3 instead?
from cmor3_documentation.
@mauzey1 you can close it. Charles removed me from the PCMDI group due to the private repository authentication.
from cmor3_documentation.
Related Issues (20)
- DOE VDP info in footer
- Contact page is out of date HOT 2
- Testing CMOR 3.7.1 fails with " No module named testsrunner" error HOT 7
- Can't access CMOR docs on cmor.llnl.gov HOT 2
- Installation Guide Issues HOT 2
- help moving cmor2 code to cmor3 HOT 1
- "Control Vocabulary" should be named "Controlled Vocabulary" HOT 2
- PrePARE documentation is out of date
- Corrections needed on examples
- CMOR /PrePARE documentation improvements HOT 7
- Bad URL to CF conventions grid mapping list in index.md
- cannot subscribe to cmor mailing list HOT 6
- Add links to the CMIP6_CV github from Control Vocabulary (CMIP6) HOT 2
- Move "Control Vocabulary" from Examples to Appendix?
- Add a New MIP tables Cookbook? HOT 4
- possible error in cmor documentation HOT 1
- Typo in 'CMIP6 User Input' doc page
- Web site: mentioning cdms2 and improving the Installation section? HOT 3
- Cannot install cmor3 HOT 7
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 cmor3_documentation.