Commit 2a4176ef authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added patch from Florian Prill: Lesen von 'number_of_grid_used', GRID_REFERENCE

parent 8c2a62c3
......@@ -2,6 +2,10 @@
* Version 1.6.1 released
2013-06-03 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* added patch from Florian Prill: Lesen von 'number_of_grid_used', GRID_REFERENCE (bug fix)
2013-05-29 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netCDF: skip 4D variables without time dimension (bug fix)
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for cdi 1.6.1rc3.
# Generated by GNU Autoconf 2.68 for cdi 1.6.1rc4.
#
# Report bugs to <http://code.zmaw.de/projects/cdi>.
#
......@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='cdi'
PACKAGE_TARNAME='cdi'
PACKAGE_VERSION='1.6.1rc3'
PACKAGE_STRING='cdi 1.6.1rc3'
PACKAGE_VERSION='1.6.1rc4'
PACKAGE_STRING='cdi 1.6.1rc4'
PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdi'
PACKAGE_URL=''
 
......@@ -1403,7 +1403,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures cdi 1.6.1rc3 to adapt to many kinds of systems.
\`configure' configures cdi 1.6.1rc4 to adapt to many kinds of systems.
 
Usage: $0 [OPTION]... [VAR=VALUE]...
 
......@@ -1473,7 +1473,7 @@ fi
 
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of cdi 1.6.1rc3:";;
short | recursive ) echo "Configuration of cdi 1.6.1rc4:";;
esac
cat <<\_ACEOF
 
......@@ -1630,7 +1630,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
cdi configure 1.6.1rc3
cdi configure 1.6.1rc4
generated by GNU Autoconf 2.68
 
Copyright (C) 2010 Free Software Foundation, Inc.
......@@ -2391,7 +2391,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
 
It was created by cdi $as_me 1.6.1rc3, which was
It was created by cdi $as_me 1.6.1rc4, which was
generated by GNU Autoconf 2.68. Invocation command line was
 
$ $0 $@
......@@ -3288,7 +3288,7 @@ fi
 
# Define the identity of the package.
PACKAGE='cdi'
VERSION='1.6.1rc3'
VERSION='1.6.1rc4'
 
 
cat >>confdefs.h <<_ACEOF
......@@ -27453,7 +27453,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by cdi $as_me 1.6.1rc3, which was
This file was extended by cdi $as_me 1.6.1rc4, which was
generated by GNU Autoconf 2.68. Invocation command line was
 
CONFIG_FILES = $CONFIG_FILES
......@@ -27519,7 +27519,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
cdi config.status 1.6.1rc3
cdi config.status 1.6.1rc4
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
 
......
# Process this file with autoconf to produce a configure script.
AC_INIT([cdi], [1.6.1rc3], [http://code.zmaw.de/projects/cdi])
AC_INIT([cdi], [1.6.1rc4], [http://code.zmaw.de/projects/cdi])
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
......
......@@ -5243,7 +5243,7 @@ void copy_numeric_projatts(int gridID, int ncvarID, int ncfileID)
/* define all input grids */
static
void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars, int timedimid, char *uuidOfHGrid)
void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars, int timedimid, char *uuidOfHGrid, int number_of_grid_used)
{
int ncvarid, ncvarid2;
int ndims;
......@@ -5674,6 +5674,12 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
}
}
if ( number_of_grid_used != UNDEFID )
{
grid.type = GRID_REFERENCE;
grid.number = number_of_grid_used;
}
if ( ncvars[ncvarid].gmapid >= 0 && ncvars[ncvarid].gridtype != GRID_CURVILINEAR )
{
cdf_inq_varnatts(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, &nvatts);
......@@ -5790,7 +5796,8 @@ void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nva
#endif
ncvars[ncvarid].gridID = varDefGrid(vlistID, grid, 1);
if ( uuidOfHGrid[0] != 0 && grid.type == GRID_UNSTRUCTURED )
if ( uuidOfHGrid[0] != 0 &&
(grid.type == GRID_UNSTRUCTURED || grid.type == GRID_REFERENCE) )
gridDefUUID(ncvars[ncvarid].gridID, uuidOfHGrid);
if ( ncvars[ncvarid].chunked )
......@@ -6323,7 +6330,7 @@ void define_all_vars(stream_t *streamptr, int vlistID, int instID, int modelID,
static
void scan_global_attributtes(int fileID, int vlistID, stream_t *streamptr, int ngatts,
int *instID, int *modelID, int *ucla_les, char *uuidOfHGrid)
int *instID, int *modelID, int *ucla_les, char *uuidOfHGrid, int *number_of_grid_used)
{
nc_type xtype;
size_t attlen;
......@@ -6389,15 +6396,23 @@ void scan_global_attributtes(int fileID, int vlistID, stream_t *streamptr, int n
}
else if ( xtype == NC_SHORT || xtype == NC_INT )
{
int *attint;
attint = (int *) malloc(attlen*sizeof(int));
cdfGetAttInt(fileID, NC_GLOBAL, attname, attlen, attint);
if ( xtype == NC_SHORT )
vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT16, (int)attlen, attint);
else
vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, (int)attlen, attint);
free(attint);
}
if ( strcmp(attname, "number_of_grid_used") == 0 )
{
(*number_of_grid_used) = UNDEFID;
cdfGetAttInt(fileID, NC_GLOBAL, attname, 1, number_of_grid_used);
}
else
{
int *attint;
attint = (int *) malloc(attlen*sizeof(int));
cdfGetAttInt(fileID, NC_GLOBAL, attname, attlen, attint);
if ( xtype == NC_SHORT )
vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT16, (int)attlen, attint);
else
vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, (int)attlen, attint);
free(attint);
}
}
else if ( xtype == NC_FLOAT || xtype == NC_DOUBLE )
{
double *attflt;
......@@ -6444,6 +6459,7 @@ int cdfInqContents(stream_t *streamptr)
int format = 0;
int ucla_les = FALSE;
char uuidOfHGrid[17];
int number_of_grid_used = UNDEFID;
uuidOfHGrid[0] = 0;
......@@ -6515,7 +6531,7 @@ int cdfInqContents(stream_t *streamptr)
}
/* scan global attributtes */
scan_global_attributtes(fileID, vlistID, streamptr, ngatts, &instID, &modelID, &ucla_les, uuidOfHGrid);
scan_global_attributtes(fileID, vlistID, streamptr, ngatts, &instID, &modelID, &ucla_les, uuidOfHGrid, &number_of_grid_used);
/* find time dim */
if ( unlimdimid >= 0 )
......@@ -6816,7 +6832,7 @@ int cdfInqContents(stream_t *streamptr)
/* define all grids */
define_all_grids(streamptr, vlistID, ncdims, nvars, ncvars, timedimid, uuidOfHGrid);
define_all_grids(streamptr, vlistID, ncdims, nvars, ncvars, timedimid, uuidOfHGrid, number_of_grid_used);
/* read VCT */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment