Commit 6f89349a authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdi_limits: define MAX_STREAMS, MAX_VLISTS, MAX_GRIDS, MAX_ZAXIS

parent d0aaca83
......@@ -3,6 +3,7 @@
* stream: mt safe version
* zaxis: mt safe version
* remove H5 test version
* cdi_limits: define MAX_STREAMS, MAX_VLISTS, MAX_GRIDS, MAX_ZAXIS
* Version 1.0.5 released
2006-11-30 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
......
#ifndef _CDI_LIMITS_H
#define _CDI_LIMITS_H
#define MAX_GRIDS 128 /* maximum of different grids for each file */
#define MAX_ZAXIS 128 /* maximum of different zaxis for each file */
#define MAX_STREAMS 4096 /* maximum number of streams */
#define MAX_VLISTS 4096 /* maximum number of vlists */
#define MAX_GRIDS 1024 /* maximum number of grids */
#define MAX_ZAXIS 1024 /* maximum number of zaxis */
#define MAX_GRIDS_PS 128 /* maximum number of different grids per stream */
#define MAX_ZAXIS_PS 128 /* maximum number of different zaxis per stream */
#endif /* _CDI_LIMITS_H */
......@@ -37,7 +37,7 @@ char *Grids[] = {
static int GRID_Debug = 0; /* If set to 1, debugging */
static int _grid_max = 1024;
static int _grid_max = MAX_GRIDS;
static void grid_initialize(void);
......
......@@ -139,7 +139,7 @@ char *strfiletype(int filetype)
static int STREAM_Debug = 0; /* If set to 1, debugging */
static int _stream_max = 4096;
static int _stream_max = MAX_STREAMS;
static void stream_initialize(void);
......@@ -311,12 +311,12 @@ static void stream_init_entry(STREAM *streamptr)
basetimeInit(&streamptr->basetime);
for ( i = 0; i < MAX_GRIDS; i++ ) streamptr->xdimID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS; i++ ) streamptr->ydimID[i] = UNDEFID;
for ( i = 0; i < MAX_ZAXIS; i++ ) streamptr->zaxisID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS; i++ ) streamptr->ncxvarID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS; i++ ) streamptr->ncyvarID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS; i++ ) streamptr->ncavarID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->xdimID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ydimID[i] = UNDEFID;
for ( i = 0; i < MAX_ZAXIS_PS; i++ ) streamptr->zaxisID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncxvarID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncyvarID[i] = UNDEFID;
for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncavarID[i] = UNDEFID;
}
......
......@@ -201,12 +201,12 @@ typedef struct {
BaseTime basetime;
int ncmode;
int vlistID;
int xdimID[MAX_GRIDS];
int ydimID[MAX_GRIDS];
int zaxisID[MAX_ZAXIS];
int ncxvarID[MAX_GRIDS];
int ncyvarID[MAX_GRIDS];
int ncavarID[MAX_GRIDS];
int xdimID[MAX_GRIDS_PS];
int ydimID[MAX_GRIDS_PS];
int zaxisID[MAX_ZAXIS_PS];
int ncxvarID[MAX_GRIDS_PS];
int ncyvarID[MAX_GRIDS_PS];
int ncavarID[MAX_GRIDS_PS];
int historyID;
int globalatts;
int localatts;
......
......@@ -11,7 +11,7 @@
static int VLIST_Debug = 0; /* If set to 1, debugging */
static int _vlist_max = 1024;
static int _vlist_max = MAX_VLISTS;
static void vlist_initialize(void);
......@@ -710,8 +710,8 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
if ( index ==vlistptr2->ngrids )
{
vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
if (vlistptr2->ngrids >= MAX_GRIDS )
Error(func, "Internal Problem! More than %d grids.", MAX_GRIDS);
if (vlistptr2->ngrids >= MAX_GRIDS_PS )
Error(func, "Internal Problem! More than %d grids.", MAX_GRIDS_PS);
}
for ( index = 0; index <vlistptr2->nzaxis; index++ )
......@@ -720,8 +720,8 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
if ( index ==vlistptr2->nzaxis )
{
vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
if (vlistptr2->nzaxis >= MAX_ZAXIS )
Error(func, "Internal Problem! More than %d zaxis.", MAX_ZAXIS);
if (vlistptr2->nzaxis >= MAX_ZAXIS_PS )
Error(func, "Internal Problem! More than %d zaxis.", MAX_ZAXIS_PS);
}
varID2++;
......@@ -795,8 +795,8 @@ void vlistCat(int vlistID2, int vlistID1)
if ( index == vlistptr2->ngrids )
{
vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
if ( vlistptr2->ngrids >= MAX_GRIDS )
Error(func, "Internal Problem! More than %d grids.", MAX_GRIDS);
if ( vlistptr2->ngrids >= MAX_GRIDS_PS )
Error(func, "Internal Problem! More than %d grids.", MAX_GRIDS_PS);
}
zaxisID = vlistptr1->vars[varID].zaxisID;
......@@ -806,8 +806,8 @@ void vlistCat(int vlistID2, int vlistID1)
if ( index == vlistptr2->nzaxis )
{
vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
if ( vlistptr2->nzaxis >= MAX_ZAXIS )
Error(func, "Internal Problem! More than %d zaxis.", MAX_ZAXIS);
if ( vlistptr2->nzaxis >= MAX_ZAXIS_PS )
Error(func, "Internal Problem! More than %d zaxis.", MAX_ZAXIS_PS);
}
}
}
......
......@@ -61,8 +61,8 @@ typedef struct
int instID;
int modelID;
int varsAllocated;
int gridIDs[MAX_GRIDS];
int zaxisIDs[MAX_ZAXIS];
int gridIDs[MAX_GRIDS_PS];
int zaxisIDs[MAX_ZAXIS_PS];
VARINFO *vars;
int natts;
char *attnames[MAX_ATTRIBUTES];
......
......@@ -207,8 +207,8 @@ int vlistDefVar(int vlistID, int gridID, int zaxisID, int timeID)
if ( index == vlistptr->ngrids )
{
if ( vlistptr->ngrids + 1 >= MAX_GRIDS )
Error(func, "Maximum of %d grids reached", MAX_GRIDS);
if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
Error(func, "Maximum of %d grids reached", MAX_GRIDS_PS);
vlistptr->gridIDs[vlistptr->ngrids] = gridID;
vlistptr->ngrids++;
......@@ -219,8 +219,8 @@ int vlistDefVar(int vlistID, int gridID, int zaxisID, int timeID)
if ( index == vlistptr->nzaxis )
{
if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS )
Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS);
if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS_PS )
Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS_PS);
vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
vlistptr->nzaxis++;
......@@ -1208,8 +1208,8 @@ void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID)
if ( index == vlistptr->nzaxis )
{
if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS )
Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS);
if ( vlistptr->nzaxis + 1 >= MAX_ZAXIS_PS )
Error(func, "Maximum of %d zaxis reached", MAX_ZAXIS_PS);
vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
vlistptr->nzaxis++;
......@@ -1248,8 +1248,8 @@ void vlistChangeVarGrid(int vlistID, int varID, int gridID)
if ( index == vlistptr->ngrids )
{
if ( vlistptr->ngrids + 1 >= MAX_GRIDS )
Error(func, "Maximum of %d grids reached", MAX_GRIDS);
if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
Error(func, "Maximum of %d grids reached", MAX_GRIDS_PS);
vlistptr->gridIDs[vlistptr->ngrids] = gridID;
vlistptr->ngrids++;
......
......@@ -59,7 +59,7 @@ ZAXIS;
static int ZAXIS_Debug = 0; /* If set to 1, debugging */
static int _zaxis_max = 1024;
static int _zaxis_max = MAX_ZAXIS;
static void zaxis_initialize(void);
......
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