Merge remote-tracking branch 'Unidata/master'

This commit is contained in:
Dennis Heimbigner 2020-05-16 15:13:28 -06:00
commit 173339759f
7 changed files with 55 additions and 27 deletions

View File

@ -60,6 +60,10 @@ are set when opening a binary file on Windows. */
#define strcasecmp _stricmp
#endif
#ifndef strincasecmp
#define strncasecmp _strnicmp
#endif
#ifndef snprintf
#if _MSC_VER<1900
#define snprintf _snprintf
@ -595,12 +599,16 @@ with zip */
/* Define to `unsigned long if <sys/types.h> does not define. */
#cmakedefine uintptr_t unsigned long
/* Define strcasecmp, snprintf on Win32 systems. */
/* Define strcasecmp, strncasecmp, snprintf on Win32 systems. */
#ifdef _WIN32
#ifndef HAVE_STRCASECMP
#define strcasecmp _stricmp
#endif
#ifndef HAVE_STRNCASECMP
#define strncasecmp _strnicmp
#endif
#ifndef HAVE_SNPRINTF
#define snprintf _snprintf
#endif

View File

@ -846,7 +846,8 @@ AC_CHECK_HEADERS([ftw.h])
AC_CHECK_FUNCS([strlcat snprintf strcasecmp fileno \
strdup strtoll strtoull \
mkstemp mktemp random \
getrlimit gettimeofday fsync MPI_Comm_f2c MPI_Info_f2c])
getrlimit gettimeofday fsync MPI_Comm_f2c MPI_Info_f2c \
strncasecmp])
# disable dap4 if netcdf-4 is disabled
#if test "x$enable_netcdf_4" = "xno" ; then
@ -1468,9 +1469,10 @@ AC_SUBST([HAS_PAR_FILTERS], [$hdf5_supports_par_filters])
# Include some specifics for netcdf on windows.
#AH_VERBATIM([_WIN32_STRICMP],
AH_BOTTOM(
[/* Define strcasecmp, snprintf on Win32 systems. */
[/* Define strcasecmp, strncasecmp, snprintf on Win32 systems. */
#ifdef _WIN32
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define snprintf _snprintf
#endif])

View File

@ -1,10 +1,21 @@
<hr size="2"/>
<address style="text-align: center;">
<a href="http://www.unidata.ucar.edu/software/netcdf/">Return to the Main Unidata NetCDF page.</a><br>
<img src="http://www.unidata.ucar.edu/images/logos/uniLogo.png">
<!-- HTML footer for doxygen 1.8.17-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"> <!-- id is needed for treeview function! -->
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<div> <!-- id unnecessary if treeview is not used -->
<!--END !GENERATE_TREEVIEW-->
<hr size="2" />
<address style="text-align: center;">
<a href="http://www.unidata.ucar.edu/software/netcdf/">Return to the Main Unidata NetCDF page.</a><br>
<img src="http://www.unidata.ucar.edu/images/logos/uniLogo.png">
</address>
<address style="text-align: right;"><small>
Generated on $datetime for $projectname. NetCDF is
a <a href="http://www.unidata.ucar.edu/">Unidata</a> library.</small></address>
<address style="text-align: right;"><small>
Generated on $datetime for $projectname. NetCDF is
a <a href="http://www.unidata.ucar.edu/">Unidata</a> library.</small>
</address>
</div>
</body>
</html>

View File

@ -338,28 +338,28 @@ cdParseRelunits(cdCalenType timetype, char* relunits, cdUnitTime* unit, cdCompTi
}
/* Get the units */
cdTrim(charunits,CD_MAX_RELUNITS);
if(!strncmp(charunits,"sec",3) || !strcmp(charunits,"s")){
if(!strncasecmp(charunits,"sec",3) || !strcasecmp(charunits,"s")){
*unit = cdSecond;
}
else if(!strncmp(charunits,"min",3) || !strcmp(charunits,"mn")){
else if(!strncasecmp(charunits,"min",3) || !strcasecmp(charunits,"mn")){
*unit = cdMinute;
}
else if(!strncmp(charunits,"hour",4) || !strcmp(charunits,"hr")){
else if(!strncasecmp(charunits,"hour",4) || !strcasecmp(charunits,"hr")){
*unit = cdHour;
}
else if(!strncmp(charunits,"day",3) || !strcmp(charunits,"dy")){
else if(!strncasecmp(charunits,"day",3) || !strcasecmp(charunits,"dy")){
*unit = cdDay;
}
else if(!strncmp(charunits,"week",4) || !strcmp(charunits,"wk")){
else if(!strncasecmp(charunits,"week",4) || !strcasecmp(charunits,"wk")){
*unit = cdWeek;
}
else if(!strncmp(charunits,"month",5) || !strcmp(charunits,"mo")){
else if(!strncasecmp(charunits,"month",5) || !strcasecmp(charunits,"mo")){
*unit = cdMonth;
}
else if(!strncmp(charunits,"season",6)){
else if(!strncasecmp(charunits,"season",6)){
*unit = cdSeason;
}
else if(!strncmp(charunits,"year",4) || !strcmp(charunits,"yr")){
else if(!strncasecmp(charunits,"year",4) || !strcasecmp(charunits,"yr")){
if(!(timetype & cdStandardCal)){
cdError("Error on relative units conversion: climatological units cannot be 'years'.\n");
return 1;

View File

@ -85,7 +85,7 @@ calendar_type(int ncid, int varid) {
NC_CHECK(nc_get_att(ncid, varid, CF_CAL_ATT_NAME, calstr));
calstr[catt.len] = '\0';
for(itype = 0; itype < ncals; itype++) {
if(strncmp(calstr, calmap[itype].attname, catt.len) == 0) {
if(strncasecmp(calstr, calmap[itype].attname, catt.len) == 0) {
ctype = calmap[itype].type;
break;
}
@ -128,28 +128,28 @@ is_valid_time_unit(const char *units) {
return false;
/* Check for unit compatible with cdtime library, no attempt
* to enforce CF-compliance or udunits compliance here ... */
if(!strncmp(charunits,"sec",3) || !strcmp(charunits,"s")){
if(!strncasecmp(charunits,"sec",3) || !strcasecmp(charunits,"s")){
okunit = true;
}
else if(!strncmp(charunits,"min",3) || !strcmp(charunits,"mn")){
else if(!strncasecmp(charunits,"min",3) || !strcasecmp(charunits,"mn")){
okunit = true;
}
else if(!strncmp(charunits,"hour",4) || !strcmp(charunits,"hr")){
else if(!strncasecmp(charunits,"hour",4) || !strcasecmp(charunits,"hr")){
okunit = true;
}
else if(!strncmp(charunits,"day",3) || !strcmp(charunits,"dy")){
else if(!strncasecmp(charunits,"day",3) || !strcasecmp(charunits,"dy")){
okunit = true;
}
else if(!strncmp(charunits,"week",4) || !strcmp(charunits,"wk")){
else if(!strncasecmp(charunits,"week",4) || !strcasecmp(charunits,"wk")){
okunit = true;
}
else if(!strncmp(charunits,"month",5) || !strcmp(charunits,"mo")){
else if(!strncasecmp(charunits,"month",5) || !strcasecmp(charunits,"mo")){
okunit = true;
}
else if(!strncmp(charunits,"season",6)){
else if(!strncasecmp(charunits,"season",6)){
okunit = true;
}
else if(!strncmp(charunits,"year",4) || !strcmp(charunits,"yr")){
else if(!strncasecmp(charunits,"year",4) || !strcasecmp(charunits,"yr")){
okunit = true;
}
if (!okunit)

View File

@ -6,6 +6,8 @@ dimensions:
variables:
double t1_days(time) ;
t1_days:units = "days since 1500-1-1" ;
double t1_days_case(time) ;
t1_days_case:units = "DaYs since 1500-1-1" ;
double t1_st_days(time) ;
t1_st_days:calendar = "standard" ;
t1_st_days:units = "days since 1500-01-01 00:00:00" ;
@ -91,6 +93,8 @@ data:
t1_days = "2009-01-01" ;
t1_days_case = "2009-01-01" ;
t1_st_days = "2009-01-01" ;
t1_gr_days = "2009-01-01" ;

View File

@ -6,6 +6,8 @@ dimensions:
variables:
double t1_days(time);
t1_days:units = "days since 1500-1-1";
double t1_days_case(time);
t1_days_case:units = "DaYs since 1500-1-1";
double t1_st_days(time);
t1_st_days:calendar = "standard" ; // mixed julian-gregorian
t1_st_days:units = "days since 1500-01-01 00:00:00";
@ -96,6 +98,7 @@ variables:
data:
// Should all represent 2009-01-01 00:00:00
t1_days = 185900;
t1_days_case = 185900;
t1_st_days = 185900;
t1_gr_days = 185900;
t1_pg_days = 185909;