Commit c063df20 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

resource_handle: rename Array to List

parent c7c1dc96
#include <stdio.h>
#include "cdi.h"
extern void reshArrayPrint ( char * filename );
extern void reshListPrint ( char * filename );
int nlon = 12; // Number of longitudes
int nlat = 6; // Number of latitudes
......@@ -49,7 +49,7 @@ int main(void)
streamReadVar(streamID, varID2, var2, &nmiss);
}
reshArrayPrint ( "reshArrayRead" );
reshListPrint ( "reshListRead" );
// Close the input stream
streamClose(streamID);
......
......@@ -4167,9 +4167,9 @@ void gridDefReference(int gridID, const char *reference)
}
void gridGetIndexArray ( int ngrids, int * gridIndexArray )
void gridGetIndexList ( int ngrids, int * gridIndexList )
{
reshGetResHArrayOfType ( ngrids, gridIndexArray, &gridOps );
reshGetResHListOfType ( ngrids, gridIndexList, &gridOps );
}
......
......@@ -81,7 +81,7 @@ const double *gridInqAreaPtr(int gridID);
int gridCompare(int gridID, grid_t grid);
int gridGenerate(grid_t grid);
void gridGetIndexArray ( int, int * );
void gridGetIndexList ( int, int * );
#endif
/*
......
......@@ -222,7 +222,7 @@ int institutInq(int center, int subcenter, const char *name, const char *longnam
instCount = instituteCount ();
instResHs = xmalloc ( instCount * sizeof ( int ));
reshGetResHArrayOfType ( instCount, instResHs, &instituteOps );
reshGetResHListOfType ( instCount, instResHs, &instituteOps );
for( i = 0; i < instCount; i++ )
{
......@@ -318,7 +318,7 @@ int institutInqNumber(void)
instCount = reshCountType ( &instituteOps );
instResHs = xmalloc ( instCount * sizeof ( int ));
reshGetResHArrayOfType ( instCount, instResHs, &instituteOps );
reshGetResHListOfType ( instCount, instResHs, &instituteOps );
for ( i = 0; i < instCount; i++ )
{
......
......@@ -164,7 +164,7 @@ int modelInq(int instID, int modelgribID, char *name)
modelCount = modelSize();
modelResHs = xmalloc ( modelCount * sizeof ( int ));
reshGetResHArrayOfType ( modelCount, modelResHs, &modelOps );
reshGetResHListOfType ( modelCount, modelResHs, &modelOps );
for( i = 0; i < modelCount; i++ )
{
......
......@@ -261,7 +261,7 @@ void varsMapNDeco ( int nNodes, int * nodeSizes )
resHs = xmalloc ( nStreams * sizeof ( resHs[0] ));
streamSizes = xmalloc ( nStreams * sizeof ( streamSizes[0] ));
collectsData = xmalloc ( nProcsColl * sizeof ( collectsData[0] ));
streamGetIndexArray ( nStreams, resHs );
streamGetIndexList ( nStreams, resHs );
xprintArray ( "Echam streams", resHs, nStreams, DATATYPE_INT );
......@@ -272,7 +272,7 @@ void varsMapNDeco ( int nNodes, int * nodeSizes )
varSizes = xmalloc ( nVars * sizeof ( varSizes[0] ));
varMapping = xmalloc ( nVars * sizeof ( varMapping[0] ));
reshArrayPrint ( "reshArrayModelEcham" );
reshListPrint ( "reshListModelEcham" );
for ( i = 0; i < nStreams; i++ )
for ( j = 0; j < * ( streamSizes + i ); j++ )
......@@ -350,7 +350,7 @@ void modelWinCleanup ( void )
static
void modelWinDefBufferSizes ( void )
{
int collID, nstreams, * streamIndexArray, streamNo, vlistID, nvars, varID;
int collID, nstreams, * streamIndexList, streamNo, vlistID, nvars, varID;
int collIDchunk = 0, sumWinBufferSize = 0;
int nProcsColl = commInqNProcsColl ();
int rankGlob = commInqRankGlob ();
......@@ -360,12 +360,12 @@ static
xassert ( winBufferSize != NULL );
nstreams = reshCountType ( &streamOps );
streamIndexArray = xmalloc ( nstreams * sizeof ( streamIndexArray[0] ));
reshGetResHArrayOfType ( nstreams, streamIndexArray, &streamOps );
streamIndexList = xmalloc ( nstreams * sizeof ( streamIndexList[0] ));
reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
for ( streamNo = 0; streamNo < nstreams; streamNo++ )
{
// space required for data
vlistID = streamInqVlist ( streamIndexArray[streamNo] );
vlistID = streamInqVlist ( streamIndexList[streamNo] );
nvars = vlistNvars ( vlistID );
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -385,7 +385,7 @@ static
5 * sizeof ( int ) +
MAXDATAFILENAME );
}
free ( streamIndexArray );
free ( streamIndexList );
for ( collID = 0; collID < nProcsColl; collID++ )
{
......@@ -836,7 +836,7 @@ void pioEndDef ( void )
varsMapNDeco ( commInqNNodes (), commInqNodeSizes ());
reshArrayPrint ( "reshArrayModelEcham" );
reshListPrint ( "reshListModelEcham" );
if ( rankGlob < commInqNProcsColl ())
{
......
......@@ -61,7 +61,7 @@ void serverWinCleanup ()
static
void collDefBufferSizes ()
{
int nstreams, * streamIndexArray, streamNo, vlistID, nvars, varID, iorank;
int nstreams, * streamIndexList, streamNo, vlistID, nvars, varID, iorank;
int modelID, decoChunk, sumGetBufferSizes = 0;
int rankGlob = commInqRankGlob ();
int nProcsModel = commInqNProcsModel ();
......@@ -70,12 +70,12 @@ static
xassert ( getBufferSize != NULL );
nstreams = reshCountType ( &streamOps );
streamIndexArray = xmalloc ( nstreams * sizeof ( streamIndexArray[0] ));
reshGetResHArrayOfType ( nstreams, streamIndexArray, &streamOps );
streamIndexList = xmalloc ( nstreams * sizeof ( streamIndexList[0] ));
reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
for ( streamNo = 0; streamNo < nstreams; streamNo++ )
{
// space required for data
vlistID = streamInqVlist ( streamIndexArray[streamNo] );
vlistID = streamInqVlist ( streamIndexList[streamNo] );
nvars = vlistNvars ( vlistID );
for ( varID = 0; varID < nvars; varID++ )
{
......@@ -98,7 +98,7 @@ static
5 * sizeof ( int ) +
MAXDATAFILENAME );
}
free ( streamIndexArray );
free ( streamIndexList );
for ( modelID = 0; modelID < nProcsModel; modelID++ )
{
......@@ -442,7 +442,7 @@ void IOServer ()
int * resHs;
resHs = xmalloc ( nStreams * sizeof ( resHs[0] ));
streamGetIndexArray ( nStreams, resHs );
streamGetIndexList ( nStreams, resHs );
for ( streamNo = 0; streamNo < nStreams; streamNo++ )
streamClose ( resHs[streamNo] );
free ( resHs );
......@@ -468,7 +468,7 @@ void IOServer ()
xdebug ();
free ( buffer );
if ( ddebug > 0 && commInqRankGlob () == nProcsModel )
reshArrayPrint ( "reshArrayIOServer" );
reshListPrint ( "reshListIOServer" );
serverWinCreate ();
break;
......
......@@ -167,7 +167,7 @@ void printArray ( const char *, char *, const void *, int, int, const char *, co
printArray ( debugString, ps, array, n, datatype, __func__, __FILE__, __LINE__ )
void reshArrayPrint ( char * );
void reshListPrint ( char * );
#endif
/*
......
This diff is collapsed.
......@@ -15,10 +15,8 @@
*/
/*
* for reasons of compatibility with cfortran.h, the handle type is
* int
* for reasons of compatibility with cfortran.h, the handle type is: int
*/
typedef int cdiResH;
/* return 0 on equality, not 0 otherwise */
......@@ -27,8 +25,7 @@ typedef void ( * valDestroyFunc )( void * );
typedef void ( * valPrintFunc )( void *, FILE * );
#ifdef USE_MPI
typedef int ( * valGetPackSizeFunc )( void *, MPI_Comm comm );
typedef void ( * valPackFunc )( void *, void *buf, int size, int *pos,
MPI_Comm comm );
typedef void ( * valPackFunc )( void *, void *buf, int size, int *pos, MPI_Comm comm );
typedef int ( * valTxCodeFunc )( void );
#endif
......@@ -52,7 +49,7 @@ int reshCountType ( resOps * );
void * reshGetVal ( cdiResH, resOps * );
void reshGetResHArrayOfType ( int, int *, resOps * );
void reshGetResHListOfType ( int, int *, resOps * );
#ifdef USE_MPI
void reshPackBufferCreate ( char **, int *, MPI_Comm );
......
......@@ -616,9 +616,9 @@ int streamSize(void)
}
void streamGetIndexArray ( int nstreams, int * streamIndexArray )
void streamGetIndexList ( int nstreams, int * streamIndexList )
{
reshGetResHArrayOfType ( nstreams, streamIndexArray, &streamOps );
reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
}
......
......@@ -309,7 +309,7 @@ int streamInqDimgroupID(int streamID);
int getByteswap(int byteorder);
int streamSize ();
void streamGetIndexArray ( int, int * );
void streamGetIndexList ( int, int * );
......
......@@ -13,7 +13,7 @@
#include "grid.h"
#include "pio_util.h"
extern void zaxisGetIndexArray ( int, int * );
extern void zaxisGetIndexList ( int, int * );
#undef UNDEFID
......@@ -635,7 +635,7 @@ int varDefGrid(int vlistID, grid_t grid, int mode)
int gridID = UNDEFID;
int index;
vlist_t *vlistptr;
int * gridIndexArray, i;
int * gridIndexList, i;
vlistptr = vlist_to_pointer(vlistID);
......@@ -661,18 +661,18 @@ int varDefGrid(int vlistID, grid_t grid, int mode)
ngrids = gridSize();
if ( ngrids > 0 )
{
gridIndexArray = malloc ( ngrids * sizeof ( int ));
gridGetIndexArray ( ngrids, gridIndexArray );
gridIndexList = malloc ( ngrids * sizeof ( int ));
gridGetIndexList ( ngrids, gridIndexList );
for ( i = 0; i < ngrids; i++ )
{
gridID = gridIndexArray[i];
gridID = gridIndexList[i];
if ( gridCompare(gridID, grid) == 0 )
{
gridglobdefined = TRUE;
break;
}
}
if ( gridIndexArray ) free ( gridIndexArray );
if ( gridIndexList ) free ( gridIndexList );
}
ngrids = vlistptr->ngrids;
......@@ -758,7 +758,7 @@ int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbo
int index;
int zaxisglobdefined = 0;
vlist_t *vlistptr;
int * zaxisIndexArray, i;
int * zaxisIndexList, i;
vlistptr = vlist_to_pointer(vlistID);
......@@ -782,18 +782,18 @@ int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbo
nzaxis = zaxisSize();
if ( nzaxis > 0 )
{
zaxisIndexArray = malloc ( nzaxis * sizeof ( int ));
zaxisGetIndexArray ( nzaxis, zaxisIndexArray );
zaxisIndexList = malloc ( nzaxis * sizeof ( int ));
zaxisGetIndexList ( nzaxis, zaxisIndexList );
for ( i = 0; i < nzaxis; i++ )
{
zaxisID = zaxisIndexArray[i];
zaxisID = zaxisIndexList[i];
if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
{
zaxisglobdefined = 1;
break;
}
}
if ( zaxisIndexArray ) free ( zaxisIndexArray );
if ( zaxisIndexList ) free ( zaxisIndexList );
}
nzaxis = vlistptr->nzaxis;
......
......@@ -1782,9 +1782,9 @@ void zaxisPack ( void * voidP, void * packBuffer, int packBufferSize,
#endif
void zaxisGetIndexArray ( int nzaxis, int * zaxisResHs )
void zaxisGetIndexList ( int nzaxis, int * zaxisResHs )
{
reshGetResHArrayOfType ( nzaxis, zaxisResHs, &zaxisOps );
reshGetResHListOfType ( nzaxis, zaxisResHs, &zaxisOps );
}
/*
* Local Variables:
......
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