This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Pavel, > Ok, so I'm glad to read that I'm on the right way. Interestingly, the > following code (snipplet) produces still warnings: > > #ifdef UT_UNITS2_H_INCLUDED > ut_system* unitSystem; > > ut_set_error_message_handler(ut_ignore); > unitSystem = ut_read_xml(NULL); > ut_set_error_message_handler(ut_write_to_stderr); > #endif > > status = utScan(CHAR(STRING_ELT(unitstring, 0)), &utunit); > if(status != 0) > [...] > > status = utIsTime(&utunit); > if(status == 0) > [...] > > status = utHasOrigin(&utunit); > if(status == 0) > [...] > > count = (int)INTEGER(unitcount)[0]; > for(i=0; i<count; i++) { > utvalue = (double)REAL(values)[i]; > status = utCalendar(utvalue, &utunit, &year, &month, &day, > &hour, &minute, &second); > > Can you please give me any hints where things may get wrong? As result, > I would like to get error messages if the user enters a non-existing > time unit/base (or does something else wrong) and let /dev/null read > carefully all the XML warnings... > > If I omit the line "ut_set_error_message_handler(ut_write_to_stderr);" I > still get the UDUNITS warnings. I'm swomewhat confused... I need more information. What are the error messages? What statements in your code cause them? > > The UDUNITS-2 library should emit these warning messages on all operating > > systems. If that's not the case, then I have no idea why. > > Interesting... On 3 out of 4 systems on which I (let) test the package > (SusE Linux, Max OS X, different versions of R). Maybe there are some > redirections of stderr which are not easy to find. > > > Wish you (and the NetCDF/UDUNITS team) a Merry Christmas and all the > best for 2011! Thanks! And the same to you! > Regards, > Pavel > > -- > ------------------------------------------------------------------------ > > Pavel Michna (PhD Student) Tel: +41 (0)31 631 85 42 > Climatology and Meteorology (KLIMET) Fax: +41 (0)31 631 85 11 > Institute of Geography E-Mail: address@hidden > University of Bern > Hallerstrasse 12 > CH-3012 Bern/Switzerland > > ------------------------------------------------------------------------ Regards, Steve Emmerson Ticket Details =================== Ticket ID: JYQ-941555 Department: Support UDUNITS Priority: Normal Status: Closed