Commit 4d923c8e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Deactivate zaxisXXXCvals() for parallel IO.

parent 6ac43077
......@@ -1406,6 +1406,7 @@ void cdfDefZaxisUUID(stream_t *streamptr, int zaxisID)
}
}
#ifndef USE_MPI
static
void cdfDefZaxisChar(stream_t *streamptr, int zaxisID, char *axisname, int *dimID, size_t dimlen, int zaxisindex)
{
......@@ -1466,6 +1467,7 @@ void cdfDefZaxisChar(stream_t *streamptr, int zaxisID, char *axisname, int *dimI
streamptr->ncmode = 2;
}
#endif
static
void cdfDefZaxis(stream_t *streamptr, int zaxisID)
......@@ -1541,8 +1543,10 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
cdfDefineAttributes(zaxisID, CDI_GLOBAL, fileID, ncvarid);
if ( natts > 0 && streamptr->ncmode == 2 ) cdf_enddef(fileID);
}
#ifndef USE_MPI
else if ( type == ZAXIS_CHAR )
cdfDefZaxisChar(streamptr, zaxisID, axisname, &dimID, dimlen, zaxisindex);
#endif
else
{
dimID = checkDimName(fileID, dimlen, dimname);
......
......@@ -591,8 +591,6 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
{
int nvct = 0;
double *levels = NULL;
char **cvals1 = NULL, **cvals2 = NULL;
size_t clen2 = 0;
double *lbounds = NULL, *ubounds = NULL;
const double *vct = NULL;
char ctemp[CDI_MAX_NAME];
......@@ -627,9 +625,12 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
vct = zaxisInqVctPtr(zaxisID);
}
size_t clen2 = 0;
char **cvals2 = NULL;
#ifndef USE_MPI
if ( zaxisType == ZAXIS_CHAR )
{
cvals1 = zaxisInqCValsPtr(zaxisID);
char **cvals1 = zaxisInqCValsPtr(zaxisID);
size_t clen1 = (size_t)zaxisInqCLen(zaxisID);
for ( int levID = 0; levID < nlevs; ++levID )
if ( vars1[varID].levinfo[levID].flag )
......@@ -651,6 +652,7 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
levID2++;
}
}
#endif
if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
{
......
......@@ -123,8 +123,10 @@ void zaxis_init(zaxis_t *zaxisptr)
zaxisptr->p0name[0] = 0;
zaxisptr->p0value.defined = false;
zaxisptr->vals = NULL;
#ifndef USE_MPI
zaxisptr->cvals = NULL;
zaxisptr->clength = 0;
#endif
zaxisptr->ubounds = NULL;
zaxisptr->lbounds = NULL;
zaxisptr->weights = NULL;
......@@ -269,13 +271,15 @@ void zaxisDestroyKernel( zaxis_t * zaxisptr )
const int id = zaxisptr->self;
if ( zaxisptr->vals ) Free( zaxisptr->vals );
if ( zaxisptr->vals ) Free( zaxisptr->vals );
#ifndef USE_MPI
if ( zaxisptr->cvals )
{
for ( int i=0; i<zaxisptr->size; i++)
Free(zaxisptr->cvals[i]);
Free( zaxisptr->cvals );
}
#endif
if ( zaxisptr->lbounds ) Free( zaxisptr->lbounds );
if ( zaxisptr->ubounds ) Free( zaxisptr->ubounds );
if ( zaxisptr->weights ) Free( zaxisptr->weights );
......@@ -782,6 +786,7 @@ void zaxisDefLevels(int zaxisID, const double *levels)
void zaxisDefCvals(int zaxisID, const char **cvals, int clen)
{
#ifndef USE_MPI
if ( cvals && clen )
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
......@@ -798,6 +803,9 @@ void zaxisDefCvals(int zaxisID, const char **cvals, int clen)
}
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
#else
Error("This function was disabled!");
#endif
}
/*
......@@ -996,11 +1004,13 @@ const double *zaxisInqLevelsPtr(int zaxisID)
}
#ifndef USE_MPI
char **zaxisInqCValsPtr(int zaxisID)
{
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
return zaxisptr->cvals;
}
#endif
/*
@Function zaxisInqLevels
......@@ -1041,8 +1051,10 @@ int zaxisInqCLen(int zaxisID)
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
int clen = 0;
#ifndef USE_MPI
if ( zaxisptr->cvals && zaxisptr->clength)
clen = zaxisptr->clength;
#endif
return clen;
}
......@@ -1052,6 +1064,7 @@ int zaxisInqCVals(int zaxisID, char ***clevels)
zaxis_t *zaxisptr = zaxis_to_pointer(zaxisID);
int size = 0;
#ifndef USE_MPI
if ( zaxisptr->cvals )
{
size = zaxisptr->size;
......@@ -1066,6 +1079,7 @@ int zaxisInqCVals(int zaxisID, char ***clevels)
}
}
}
#endif
return size;
}
......
#ifndef ZAXIS_H
#define ZAXIS_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "cdi_att.h"
typedef struct {
......@@ -20,8 +24,10 @@ typedef struct {
char p0name[CDI_MAX_NAME];
zkey_double_t p0value;
double *vals;
#ifndef USE_MPI
char **cvals;
int clength;
#endif
double *lbounds;
double *ubounds;
double *weights;
......@@ -64,8 +70,9 @@ const resOps *getZaxisOps(void);
const char *zaxisInqNamePtr(int zaxisID);
const double *zaxisInqLevelsPtr(int zaxisID);
#ifndef USE_MPI
char **zaxisInqCValsPtr(int zaxisID);
#endif
void zaxisResize(int zaxisID, int size);
#endif
......
Supports Markdown
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