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

gridPrint: added argument index to print the index of the grid

parent 9989affd
...@@ -844,7 +844,7 @@ int main(int argc, char *argv[]) ...@@ -844,7 +844,7 @@ int main(int argc, char *argv[])
vlistPrint(vlistID1); vlistPrint(vlistID1);
ngrids = vlistNgrids(vlistID1); ngrids = vlistNgrids(vlistID1);
nzaxis = vlistNzaxis(vlistID1); nzaxis = vlistNzaxis(vlistID1);
for ( gridID = 0; gridID < ngrids; gridID++ ) gridPrint(gridID, 1); for ( gridID = 0; gridID < ngrids; gridID++ ) gridPrint(gridID, gridID, 1);
for ( zaxisID = 0; zaxisID < nzaxis; zaxisID++ ) zaxisPrint(zaxisID); for ( zaxisID = 0; zaxisID < nzaxis; zaxisID++ ) zaxisPrint(zaxisID);
} }
......
...@@ -601,7 +601,7 @@ int gridInqMaskGME(int gridID, int *mask_vec); ...@@ -601,7 +601,7 @@ int gridInqMaskGME(int gridID, int *mask_vec);
void gridDefMask(int gridID, const int *mask_vec); void gridDefMask(int gridID, const int *mask_vec);
int gridInqMask(int gridID, int *mask_vec); int gridInqMask(int gridID, int *mask_vec);
void gridPrint(int gridID, int opt); void gridPrint(int gridID, int index, int opt);
/* gridCreate: Create a horizontal Grid */ /* gridCreate: Create a horizontal Grid */
int gridCreate(int gridtype, int size); int gridCreate(int gridtype, int size);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
! !
! Author: ! Author:
! ------- ! -------
! Uwe Schulzweida, MPI-MET, Hamburg, December 2014 ! Uwe Schulzweida, MPI-MET, Hamburg, February 2015
! !
INTEGER CDI_MAX_NAME INTEGER CDI_MAX_NAME
...@@ -1380,6 +1380,7 @@ ...@@ -1380,6 +1380,7 @@
! gridPrint ! gridPrint
! (INTEGER gridID, ! (INTEGER gridID,
! INTEGER index,
! INTEGER opt) ! INTEGER opt)
EXTERNAL gridPrint EXTERNAL gridPrint
......
...@@ -281,7 +281,7 @@ FCALLSCSUB2 (gridDefMaskGME, GRIDDEFMASKGME, griddefmaskgme, INT, PINT) ...@@ -281,7 +281,7 @@ FCALLSCSUB2 (gridDefMaskGME, GRIDDEFMASKGME, griddefmaskgme, INT, PINT)
FCALLSCFUN2 (INT, gridInqMaskGME, GRIDINQMASKGME, gridinqmaskgme, INT, PINT) FCALLSCFUN2 (INT, gridInqMaskGME, GRIDINQMASKGME, gridinqmaskgme, INT, PINT)
FCALLSCSUB2 (gridDefMask, GRIDDEFMASK, griddefmask, INT, PINT) FCALLSCSUB2 (gridDefMask, GRIDDEFMASK, griddefmask, INT, PINT)
FCALLSCFUN2 (INT, gridInqMask, GRIDINQMASK, gridinqmask, INT, PINT) FCALLSCFUN2 (INT, gridInqMask, GRIDINQMASK, gridinqmask, INT, PINT)
FCALLSCSUB2 (gridPrint, GRIDPRINT, gridprint, INT, INT) FCALLSCSUB3 (gridPrint, GRIDPRINT, gridprint, INT, INT, INT)
FCALLSCFUN2 (INT, gridCreate, GRIDCREATE, gridcreate, INT, INT) FCALLSCFUN2 (INT, gridCreate, GRIDCREATE, gridcreate, INT, INT)
FCALLSCSUB1 (gridDestroy, GRIDDESTROY, griddestroy, INT) FCALLSCSUB1 (gridDestroy, GRIDDESTROY, griddestroy, INT)
FCALLSCFUN1 (INT, gridDuplicate, GRIDDUPLICATE, gridduplicate, INT) FCALLSCFUN1 (INT, gridDuplicate, GRIDDUPLICATE, gridduplicate, INT)
......
...@@ -3020,14 +3020,11 @@ const double *gridInqYboundsPtr(int gridID) ...@@ -3020,14 +3020,11 @@ const double *gridInqYboundsPtr(int gridID)
} }
void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp) void gridPrintKernel(grid_t * gridptr, int index, int opt, FILE *fp)
{ {
int type; int xdim, ydim;
int gridsize, xsize, ysize, xdim, ydim; int nbyte;
int trunc; int i, iv;
int nbyte0, nbyte;
int i;
int nvertex, iv;
unsigned char uuidOfHGrid[CDI_UUID_SIZE]; unsigned char uuidOfHGrid[CDI_UUID_SIZE];
int gridID = gridptr->self; int gridID = gridptr->self;
const double *area = gridInqAreaPtr(gridID); const double *area = gridInqAreaPtr(gridID);
...@@ -3036,16 +3033,16 @@ void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp) ...@@ -3036,16 +3033,16 @@ void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp)
const double *xbounds = gridInqXboundsPtr(gridID); const double *xbounds = gridInqXboundsPtr(gridID);
const double *ybounds = gridInqYboundsPtr(gridID); const double *ybounds = gridInqYboundsPtr(gridID);
type = gridInqType(gridID); int type = gridInqType(gridID);
trunc = gridInqTrunc(gridID); int trunc = gridInqTrunc(gridID);
gridsize = gridInqSize(gridID); int gridsize = gridInqSize(gridID);
xsize = gridInqXsize(gridID); int xsize = gridInqXsize(gridID);
ysize = gridInqYsize(gridID); int ysize = gridInqYsize(gridID);
nvertex = gridInqNvertex(gridID); int nvertex = gridInqNvertex(gridID);
nbyte0 = 0; int nbyte0 = 0;
fprintf(fp, "#\n"); fprintf(fp, "#\n");
fprintf(fp, "# gridID %d\n", gridID); fprintf(fp, "# gridID %d\n", index);
fprintf(fp, "#\n"); fprintf(fp, "#\n");
fprintf(fp, "gridtype = %s\n", gridNamePtr(type)); fprintf(fp, "gridtype = %s\n", gridNamePtr(type));
fprintf(fp, "gridsize = %d\n", gridsize); fprintf(fp, "gridsize = %d\n", gridsize);
...@@ -3364,11 +3361,11 @@ void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp) ...@@ -3364,11 +3361,11 @@ void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp)
} }
} }
void gridPrint ( int gridID, int opt ) void gridPrint ( int gridID, int index, int opt )
{ {
grid_t *gridptr = gridID2Ptr(gridID); grid_t *gridptr = gridID2Ptr(gridID);
gridPrintKernel ( gridptr, opt, stdout ); gridPrintKernel ( gridptr, index, opt, stdout );
} }
...@@ -3380,7 +3377,7 @@ void gridPrintP ( void * voidptr, FILE * fp ) ...@@ -3380,7 +3377,7 @@ void gridPrintP ( void * voidptr, FILE * fp )
xassert ( gridptr ); xassert ( gridptr );
gridPrintKernel ( gridptr , 0, fp ); gridPrintKernel ( gridptr , gridptr->self, 0, fp );
fprintf ( fp, "precision = %d\n", gridptr->prec); fprintf ( fp, "precision = %d\n", gridptr->prec);
fprintf ( fp, "nd = %d\n", gridptr->nd ); fprintf ( fp, "nd = %d\n", gridptr->nd );
......
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