Commit 02e1a747 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced zaxisDefLtype()/zaxisInqLtype() by cdiDefKeyInt()/cdiInqKeyInt() with...

Replaced zaxisDefLtype()/zaxisInqLtype() by cdiDefKeyInt()/cdiInqKeyInt() with CDI_KEY_TYPEOFFIRSTFIXEDSURFACE.
parent 80737277
2019-11-10 Uwe Schulzweida
* Replaced zaxisDefLtype()/zaxisInqLtype() by cdiDefKeyInt()/cdiInqKeyInt() with CDI_KEY_TYPEOFFIRSTFIXEDSURFACE
2019-11-09 Uwe Schulzweida
* Replaced zaxisDefKeyStr()/zaxisInqKeyStr() by cdiDefKeyString()/cdiInqKeyString()
2019-11-09 Uwe Schulzweida
* Replaced gridDefKeyStr()/gridInqKeyStr() by cdiDefKeyString()/cdiInqKeyString()
2019-11-05 Uwe Schulzweida
* Added support for datatype of grid mapping var
......
......@@ -487,13 +487,9 @@ static void
printZaxisGenericInfo(const int ltype, const int zaxistype, const char *zaxisname)
{
if (zaxistype == ZAXIS_GENERIC && ltype != 0)
{
fprintf(stdout, "%-12s (ltype=%3d)", zaxisname, ltype);
}
fprintf(stdout, "%-12s (ltype=%3d)", zaxisname, ltype);
else
{
fprintf(stdout, "%-24s", zaxisname);
}
fprintf(stdout, "%-24s", zaxisname);
}
static void
......@@ -533,7 +529,8 @@ printZaxisInfo(int vlistID)
double zinc = 0;
const int zaxisID = vlistZaxis(vlistID, index);
const int zaxistype = zaxisInqType(zaxisID);
const int ltype = zaxisInqLtype(zaxisID);
int ltype = 0;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
const int levelsize = zaxisInqSize(zaxisID);
// int prec = zaxisInqDatatype(zaxisID);
// int dig = (prec == CDI_DATATYPE_FLT64) ? 15 : 7;
......
......@@ -45,10 +45,10 @@ static int defineGrid()
gridDefNvertex ( gridID, 1 );
gridDefXbounds ( gridID, lons );
gridDefYbounds ( gridID, lats );
for ( i = 0; i < nlon*nlat; i++ )
for ( i = 0; i < nlon*nlat; i++ )
mask_vec[i] = i % 2 ;
gridDefMaskGME ( gridID, mp );
for ( i = 0; i < nlon*nlat; i++ )
for ( i = 0; i < nlon*nlat; i++ )
mask_vec[i] = 1;
gridDefMask ( gridID, mp );
gridDefXname ( gridID, "myXname" );
......@@ -90,7 +90,7 @@ static int defineZaxis ()
zaxisDefLongname ( zaxisID, "myLongname" );
zaxisDefUnits ( zaxisID, "myUnits" );
zaxisDefDatatype ( zaxisID, DOUBLE_PRECISION );
zaxisDefLtype ( zaxisID, 1 );
cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, 1);
zaxisDefVct ( zaxisID, 3, vct );
zaxisDefLbounds ( zaxisID, &levs[0] );
zaxisDefUbounds ( zaxisID, &levs[0] );
......
......@@ -214,7 +214,8 @@ CdiZaxis::CdiZaxis(int zaxisid) {
size = zaxisInqSize(zaxisID);
prec = zaxisInqDatatype(zaxisID);
type = zaxisInqType(zaxisID);
ltype = zaxisInqLtype(zaxisID);
ltype = 0;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
plevels = (double *) malloc(size*sizeof(double));
plbounds = (double *) malloc(size*sizeof(double));
......
......@@ -807,6 +807,8 @@ size_t gridInqYCvals(int gridID, char *ycvals[]);
#define CDI_KEY_UVRELATIVETOGRID 821 // GRIB uvRelativeToGrid
#define CDI_KEY_CONSTITUENTTYPE 822 // GRIB2 constituentType
#define CDI_KEY_TYPEOFTIMEINCREMENT 823 // GRIB2 typeOfTimeIncrement
#define CDI_KEY_TYPEOFFIRSTFIXEDSURFACE 824 // GRIB2 typeOfFirstFixedSurface
#define CDI_KEY_TYPEOFSECONDFIXEDSURFACE 825 // GRIB2 typeOfSecondFixedSurface
#define CDI_KEY_VDIMNAME 920 // Vertex dimension name
#define CDI_KEY_GRIDMAP_VARTYPE 921 // Grid mapping var datatype
......@@ -851,6 +853,8 @@ int cdiInqKeyLen(int cdiID, int varID, int key, int *length);
int cdiCopyKeys(int cdiID1, int varID1, int cdiID2, int varID2);
int cdiCopyKey(int cdiID1, int varID1, int key, int cdiID2);
// GRID routines
// gridDefXname: Define the name of a X-axis
......@@ -1080,12 +1084,6 @@ int zaxisInqPositive(int zaxisID);
void zaxisDefScalar(int zaxisID);
int zaxisInqScalar(int zaxisID);
void zaxisDefLtype(int zaxisID, int ltype);
int zaxisInqLtype(int zaxisID);
void zaxisDefLtype2(int zaxisID, int ltype2);
int zaxisInqLtype2(int zaxisID);
void zaxisDefVct(int zaxisID, int size, const double vct[]);
void zaxisInqVct(int zaxisID, double vct[]);
int zaxisInqVctSize(int zaxisID);
......
......@@ -1610,6 +1610,10 @@
PARAMETER (CDI_KEY_CONSTITUENTTYPE = 822)
INTEGER CDI_KEY_TYPEOFTIMEINCREMENT
PARAMETER (CDI_KEY_TYPEOFTIMEINCREMENT = 823)
INTEGER CDI_KEY_TYPEOFFIRSTFIXEDSURFACE
PARAMETER (CDI_KEY_TYPEOFFIRSTFIXEDSURFACE = 824)
INTEGER CDI_KEY_TYPEOFSECONDFIXEDSURFACE
PARAMETER (CDI_KEY_TYPEOFSECONDFIXEDSURFACE = 825)
INTEGER CDI_KEY_VDIMNAME
PARAMETER (CDI_KEY_VDIMNAME = 920)
INTEGER CDI_KEY_GRIDMAP_VARTYPE
......@@ -1694,6 +1698,13 @@
! INTEGER varID2)
EXTERNAL cdiCopyKeys
INTEGER cdiCopyKey
! (INTEGER cdiID1,
! INTEGER varID1,
! INTEGER key,
! INTEGER cdiID2)
EXTERNAL cdiCopyKey
!
! GRID routines
!
......@@ -2184,24 +2195,6 @@
! (INTEGER zaxisID)
EXTERNAL zaxisInqScalar
! zaxisDefLtype
! (INTEGER zaxisID,
! INTEGER ltype)
EXTERNAL zaxisDefLtype
INTEGER zaxisInqLtype
! (INTEGER zaxisID)
EXTERNAL zaxisInqLtype
! zaxisDefLtype2
! (INTEGER zaxisID,
! INTEGER ltype2)
EXTERNAL zaxisDefLtype2
INTEGER zaxisInqLtype2
! (INTEGER zaxisID)
EXTERNAL zaxisInqLtype2
! zaxisDefVct
! (INTEGER zaxisID,
! INTEGER size,
......
......@@ -543,6 +543,7 @@ FCALLSCFUN4 (INT, cdiDefKeyString, CDIDEFKEYSTRING, cdidefkeystring, INT, INT, I
FCALLSCFUN5 (INT, cdiInqKeyString, CDIINQKEYSTRING, cdiinqkeystring, INT, INT, INT, PSTRING, PINT)
FCALLSCFUN4 (INT, cdiInqKeyLen, CDIINQKEYLEN, cdiinqkeylen, INT, INT, INT, PINT)
FCALLSCFUN4 (INT, cdiCopyKeys, CDICOPYKEYS, cdicopykeys, INT, INT, INT, INT)
FCALLSCFUN4 (INT, cdiCopyKey, CDICOPYKEY, cdicopykey, INT, INT, INT, INT)
/* GRID routines */
......@@ -688,10 +689,6 @@ FCALLSCSUB2 (zaxisDefPositive, ZAXISDEFPOSITIVE, zaxisdefpositive, INT, INT)
FCALLSCFUN1 (INT, zaxisInqPositive, ZAXISINQPOSITIVE, zaxisinqpositive, INT)
FCALLSCSUB1 (zaxisDefScalar, ZAXISDEFSCALAR, zaxisdefscalar, INT)
FCALLSCFUN1 (INT, zaxisInqScalar, ZAXISINQSCALAR, zaxisinqscalar, INT)
FCALLSCSUB2 (zaxisDefLtype, ZAXISDEFLTYPE, zaxisdefltype, INT, INT)
FCALLSCFUN1 (INT, zaxisInqLtype, ZAXISINQLTYPE, zaxisinqltype, INT)
FCALLSCSUB2 (zaxisDefLtype2, ZAXISDEFLTYPE2, zaxisdefltype2, INT, INT)
FCALLSCFUN1 (INT, zaxisInqLtype2, ZAXISINQLTYPE2, zaxisinqltype2, INT)
FCALLSCSUB3 (zaxisDefVct, ZAXISDEFVCT, zaxisdefvct, INT, INT, DOUBLEV)
FCALLSCSUB2 (zaxisInqVct, ZAXISINQVCT, zaxisinqvct, INT, DOUBLEV)
FCALLSCFUN1 (INT, zaxisInqVctSize, ZAXISINQVCTSIZE, zaxisinqvctsize, INT)
......
......@@ -184,16 +184,24 @@ int cdiInqKeyLen(int cdiID, int varID, int key, int *length)
return status;
}
static
void cdi_copy_key(cdi_key_t *keyp, int cdiID, int varID)
{
if ( keyp->type == KEY_INT )
cdiDefKeyInt(cdiID, varID, keyp->key, keyp->v.i);
else if ( keyp->type == KEY_FLOAT )
cdiDefKeyFloat(cdiID, varID, keyp->key, keyp->v.d);
else if ( keyp->type == KEY_BYTES )
cdiDefKeyBytes(cdiID, varID, keyp->key, keyp->v.s, keyp->length);
}
void cdiCopyVarKeys(cdi_keys_t *keysp, int cdiID2, int varID2)
{
for ( size_t keyid = 0; keyid < keysp->nelems; keyid++ )
{
cdi_key_t *keyp = &(keysp->value[keyid]);
if ( keyp->type == KEY_INT )
cdiDefKeyInt(cdiID2, varID2, keyp->key, keyp->v.i);
else if ( keyp->type == KEY_BYTES )
cdiDefKeyBytes(cdiID2, varID2, keyp->key, keyp->v.s, keyp->length);
cdi_copy_key(keyp, cdiID2, varID2);
}
}
......@@ -211,6 +219,22 @@ int cdiCopyKeys(int cdiID1, int varID1, int cdiID2, int varID2)
}
int cdiCopyKey(int cdiID1, int varID1, int key, int cdiID2)
{
int status = CDI_NOERR;
cdi_keys_t *keysp = cdi_get_keysp(cdiID1, varID1);
xassert(keysp != NULL);
cdi_key_t *keyp = find_key(keysp, key);
if (keyp == NULL) return -1;
cdi_copy_key(keyp, cdiID2, varID1);
return status;
}
void cdiDefVarKeyInt(cdi_keys_t *keysp, int key, int value)
{
cdi_key_t *keyp = find_key(keysp, key);
......
......@@ -31,6 +31,17 @@ void cdiDefVarKeyBytes(cdi_keys_t *keysp, int key, const unsigned char *bytes, i
cdi_key_t *find_key(cdi_keys_t *keysp, int key);
const char *cdiInqVarKeyStringPtr(cdi_keys_t *keysp, int key);
static inline
int cdiInqVarKeyInt(cdi_keys_t *keysp, int key)
{
int value = 0;
cdi_key_t *keyp = find_key(keysp, key);
if (keyp && keyp->type == KEY_INT ) value = keyp->v.i;
return value;
}
static inline
const char *cdiInqVarKeyString(cdi_keys_t *keysp, int key)
{
......
......@@ -262,7 +262,9 @@ int cdiFallbackIterator_levelType(CdiIterator *super, int levelSelector, char **
copyString(outStdName, zaxisInqStdname); //FIXME: zaxisInqStdname is unsafe.
copyString(outUnit, zaxisInqUnits); //FIXME: zaxisInqUnits is unsafe.
#undef copyString
return zaxisInqLtype(zaxisId);
int ltype = 0;
cdiInqKeyInt(zaxisId, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
return ltype;
}
int cdiFallbackIterator_level(CdiIterator *super, int levelSelector, double *outValue1, double *outValue2)
......@@ -305,7 +307,9 @@ int cdiFallbackIterator_zaxisUuid(CdiIterator *super, int *outVgridNumber, int *
{
CdiFallbackIterator *me = (CdiFallbackIterator*)(void *)super;
int zaxisId = vlistInqVarZaxis(me->vlistId, me->curVariable);
if(zaxisInqLtype(zaxisId) != ZAXIS_HYBRID) return CDI_EINVAL;
int ltype = 0;
cdiInqKeyInt(zaxisId, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
if(ltype != ZAXIS_HYBRID) return CDI_EINVAL;
if(outVgridNumber) *outVgridNumber = zaxisInqNumber(zaxisId);
if(outLevelCount) *outLevelCount = zaxisInqNlevRef(zaxisId);
if(outUuid) zaxisInqUUID(zaxisId, outUuid);
......
......@@ -481,6 +481,8 @@ module mo_cdi
integer(c_int), public, parameter :: CDI_KEY_UVRELATIVETOGRID = 821
integer(c_int), public, parameter :: CDI_KEY_CONSTITUENTTYPE = 822
integer(c_int), public, parameter :: CDI_KEY_TYPEOFTIMEINCREMENT = 823
integer(c_int), public, parameter :: CDI_KEY_TYPEOFFIRSTFIXEDSURFACE = 824
integer(c_int), public, parameter :: CDI_KEY_TYPEOFSECONDFIXEDSURFACE = 825
integer(c_int), public, parameter :: CDI_KEY_VDIMNAME = 920
integer(c_int), public, parameter :: CDI_KEY_GRIDMAP_VARTYPE = 921
integer(c_int), public, parameter :: CDI_KEY_GRIDMAP_VARNAME = 922
......@@ -503,6 +505,7 @@ module mo_cdi
public :: cdiInqKeyString
public :: cdiInqKeyLen
public :: cdiCopyKeys
public :: cdiCopyKey
public :: gridDefXname
public :: gridInqXname
public :: gridDefXlongname
......@@ -591,10 +594,6 @@ module mo_cdi
public :: zaxisInqPositive
public :: zaxisDefScalar
public :: zaxisInqScalar
public :: zaxisDefLtype
public :: zaxisInqLtype
public :: zaxisDefLtype2
public :: zaxisInqLtype2
public :: zaxisDefVct
public :: zaxisInqVct
public :: zaxisInqVctSize
......@@ -2018,6 +2017,16 @@ module mo_cdi
integer(c_int) :: f_result
end function cdiCopyKeys
function cdiCopyKey(cdiID1_dummy, varID1_dummy, key_dummy, cdiID2_dummy)&
& bind(c, name = 'cdiCopyKey') result(f_result)
import c_int
integer(c_int), value :: cdiID1_dummy
integer(c_int), value :: varID1_dummy
integer(c_int), value :: key_dummy
integer(c_int), value :: cdiID2_dummy
integer(c_int) :: f_result
end function cdiCopyKey
subroutine gridDefDatatype(gridID_dummy, prec_dummy) bind(c, name =&
& 'gridDefDatatype')
import c_int
......@@ -2524,34 +2533,6 @@ module mo_cdi
integer(c_int) :: f_result
end function zaxisInqScalar
subroutine zaxisDefLtype(zaxisID_dummy, ltype_dummy) bind(c, name =&
& 'zaxisDefLtype')
import c_int
integer(c_int), value :: zaxisID_dummy
integer(c_int), value :: ltype_dummy
end subroutine zaxisDefLtype
function zaxisInqLtype(zaxisID_dummy) bind(c, name = 'zaxisInqLtype')&
& result(f_result)
import c_int
integer(c_int), value :: zaxisID_dummy
integer(c_int) :: f_result
end function zaxisInqLtype
subroutine zaxisDefLtype2(zaxisID_dummy, ltype2_dummy) bind(c, name =&
& 'zaxisDefLtype2')
import c_int
integer(c_int), value :: zaxisID_dummy
integer(c_int), value :: ltype2_dummy
end subroutine zaxisDefLtype2
function zaxisInqLtype2(zaxisID_dummy) bind(c, name = 'zaxisInqLtype2')&
& result(f_result)
import c_int
integer(c_int), value :: zaxisID_dummy
integer(c_int) :: f_result
end function zaxisInqLtype2
subroutine zaxisDefVct(zaxisID_dummy, size_dummy, vct_dummy) bind(c, name =&
& 'zaxisDefVct')
import c_double, c_int
......
......@@ -1849,12 +1849,12 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
static bool lwarning_vct = true;
int zaxistype = zaxisInqType(zaxisID);
int ltype = zaxisInqLtype(zaxisID);
int ltype = 0;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
{
Message("Changed zaxis type from %s to %s",
zaxisNamePtr(zaxistype), zaxisNamePtr(ZAXIS_PRESSURE));
Message("Changed zaxis type from %s to %s", zaxisNamePtr(zaxistype), zaxisNamePtr(ZAXIS_PRESSURE));
zaxistype = ZAXIS_PRESSURE;
zaxisChangeType(zaxisID, zaxistype);
zaxisDefUnits(zaxisID, "Pa");
......
......@@ -2385,8 +2385,9 @@ void gribapiDefLevel(int editionNumber, grib_handle *gh, int zaxisID, int levelI
bool lbounds = false;
int zaxistype = zaxisInqType(zaxisID);
long ltype = zaxisInqLtype(zaxisID);
long ltype2 = zaxisInqLtype2(zaxisID);
int ltype = 0, ltype2 = -1;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype);
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFSECONDFIXEDSURFACE, &ltype2);
double level = zaxisInqLevels(zaxisID, NULL) ? zaxisInqLevel(zaxisID, levelID) : levelID+1;
double dlevel1 = level, dlevel2 = 0;
......
......@@ -826,8 +826,11 @@ bool zaxisCompare(int zaxisID, int zaxistype, int nlevels, bool lbounds, const d
{
bool differ = true;
bool ltype1_is_equal = (ltype1 == zaxisInqLtype(zaxisID));
bool ltype2_is_equal = (ltype2 == zaxisInqLtype2(zaxisID));
int ltype1_0 = 0, ltype2_0 = -1;
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, &ltype1_0);
cdiInqKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFSECONDFIXEDSURFACE, &ltype2_0);
bool ltype1_is_equal = (ltype1 == ltype1_0);
bool ltype2_is_equal = (ltype2 == ltype2_0);
if ( ltype1_is_equal && ltype2_is_equal && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
{
......@@ -972,9 +975,8 @@ int varDefZaxis(int vlistID, int zaxistype, int nlevels, const double *levels, c
if ( longname && longname[0] ) zaxisDefLongname(zaxisID, longname);
if ( units && units[0] ) zaxisDefUnits(zaxisID, units);
zaxisDefDatatype(zaxisID, prec);
zaxisDefLtype(zaxisID, ltype1);
//if ( ltype1 != ltype2 && ltype2 != -1 ) zaxisDefLtype2(zaxisID, ltype2);
if ( ltype2 != -1 ) zaxisDefLtype2(zaxisID, ltype2);
cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, ltype1);
if ( ltype2 != -1 ) cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFSECONDFIXEDSURFACE, ltype2);
}
vlistptr->zaxisIDs[nzaxis] = zaxisID;
......
......@@ -707,7 +707,7 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
cdiDefKeyString(zaxisID2, CDI_GLOBAL, CDI_KEY_DIMNAME, dimname);
}
if ( zaxisType == ZAXIS_GENERIC ) zaxisDefLtype(zaxisID2, zaxisInqLtype(zaxisID));
if ( zaxisType == ZAXIS_GENERIC ) cdiCopyKey(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, zaxisID2);
cdiCopyAtts(zaxisID, CDI_GLOBAL, zaxisID2, CDI_GLOBAL);
......
......@@ -122,8 +122,6 @@ void zaxis_init(zaxis_t *zaxisptr)
zaxisptr->lbounds = NULL;
zaxisptr->weights = NULL;
zaxisptr->type = CDI_UNDEFID;
zaxisptr->ltype = 0;
zaxisptr->ltype2 = -1;
zaxisptr->positive = 0;
zaxisptr->scalar = 0;
zaxisptr->direction = 0;
......@@ -523,44 +521,6 @@ int zaxisInqScalar(int zaxisID)
return zaxisptr->scalar;
}
void zaxisDefLtype(int zaxisID, int ltype)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
if (zaxisptr->ltype != ltype)
{
zaxisptr->ltype = ltype;
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
}
int zaxisInqLtype(int zaxisID)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
return zaxisptr->ltype;
}
void zaxisDefLtype2(int zaxisID, int ltype2)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
if ( zaxisptr->ltype2 != ltype2 )
{
zaxisptr->ltype2 = ltype2;
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
}
int zaxisInqLtype2(int zaxisID)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
return zaxisptr->ltype2;
}
/*
@Function zaxisDefLevels
@Title Define the levels of a Z-axis
......@@ -1350,7 +1310,7 @@ int zaxisCompareP(zaxis_t *z1, zaxis_t *z2)
xassert(z1 && z2);
diff |= (z1->type != z2->type)
| (z1->ltype != z2->ltype)
| (cdiInqVarKeyInt(&z1->keys, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE) != cdiInqVarKeyInt(&z2->keys, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE))
| (z1->direction != z2->direction)
| (z1->datatype != z2->datatype)
| (z1->size != z2->size)
......@@ -1430,7 +1390,7 @@ int zaxisTxCode(void)
return ZAXIS;
}
enum { zaxisNint = 8,
enum { zaxisNint = 7,
vals = 1 << 0,
lbounds = 1 << 1,
ubounds = 1 << 2,
......@@ -1520,11 +1480,10 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
zaxisP->datatype = intBuffer[1];
zaxisP->type = intBuffer[2];
zaxisP->ltype = intBuffer[3];
zaxisP->size = intBuffer[4];
zaxisP->direction = intBuffer[5];
zaxisP->vctsize = intBuffer[6];
memberMask = intBuffer[7];
zaxisP->size = intBuffer[3];
zaxisP->direction = intBuffer[4];
zaxisP->vctsize = intBuffer[5];
memberMask = intBuffer[6];
if (memberMask & vals)
{
......@@ -1616,11 +1575,10 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
intBuffer[0] = zaxisP->self;
intBuffer[1] = zaxisP->datatype;
intBuffer[2] = zaxisP->type;
intBuffer[3] = zaxisP->ltype;
intBuffer[4] = zaxisP->size;
intBuffer[5] = zaxisP->direction;
intBuffer[6] = zaxisP->vctsize;
intBuffer[7] = memberMask = zaxisGetMemberMask ( zaxisP );
intBuffer[3] = zaxisP->size;
intBuffer[4] = zaxisP->direction;
intBuffer[5] = zaxisP->vctsize;
intBuffer[6] = memberMask = zaxisGetMemberMask ( zaxisP );
serializePack(intBuffer, zaxisNint, CDI_DATATYPE_INT,
packBuffer, packBufferSize, packBufferPos, context);
......
......@@ -22,8 +22,6 @@ typedef struct {
int datatype;
int scalar;
int type;
int ltype; /* GRIB level type */
int ltype2;
int size;
int direction;
int vctsize;
......@@ -51,8 +49,6 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
int * unpackBufferPos, int originNamespace, void *context,
int force_id);
void zaxisDefLtype2(int zaxisID, int ltype2);
const resOps *getZaxisOps(void);
const char *zaxisInqNamePtr(int zaxisID);
......
......@@ -93,7 +93,7 @@ static int defineZaxis (void)
zaxisDefLongname ( zaxisID, "myLongname" );
zaxisDefUnits ( zaxisID, "myUnits" );
zaxisDefDatatype ( zaxisID, DOUBLE_PRECISION );
zaxisDefLtype ( zaxisID, 1 );
cdiDefKeyInt(zaxisID, CDI_GLOBAL, CDI_KEY_TYPEOFFIRSTFIXEDSURFACE, 1);
zaxisDefVct ( zaxisID, 3, vct );
zaxisDefLbounds ( zaxisID, &levs[0] );
zaxisDefUbounds ( zaxisID, &levs[0] );
......
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