Commit 8df1a248 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

docu update

parent cdf8d754
......@@ -3,6 +3,7 @@
* using EXSE library version 1.0.2
* new ECHAM5 code table [Renate Brokopf]
* stream_ieg: bug fix memory leak [report: Philip Lorenz]
* add function gridIsCyclic
* zaxisDuplicate: bug fix
* cdfInqContents: print warning if cell_measures is missing
* cdfInqContents: check also x/yvarid to compare curvilinear grids
......
......@@ -393,6 +393,8 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
fprintf(stdout, "longitude : first = %.9g last = %.9g", lonfirst, lonlast);
if ( !DBL_IS_EQUAL(loninc, 0) )
fprintf(stdout, " inc = %.9g", loninc);
if ( gridIsCyclic(gridID) )
fprintf(stdout, " cyclic");
fprintf(stdout, "\n");
}
fprintf(stdout, "%*s", nbyte0, "");
......@@ -434,6 +436,11 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
else if ( gridtype == GRID_CURVILINEAR )
{
fprintf(stdout, "size : dim = %d nx = %d ny = %d\n", gridsize, xsize, ysize);
if ( gridIsCyclic(gridID) )
{
fprintf(stdout, "%*s", nbyte0, "");
fprintf(stdout, "longitude : cyclic\n");
}
}
else if ( gridtype == GRID_CELL )
{
......@@ -444,7 +451,14 @@ static void printShortinfo(int streamID, int vlistID, int vardis)
if ( ysize == 0 )
fprintf(stdout, "size : dim = %d\n", gridsize);
else
fprintf(stdout, "size : dim = %d nx = %d ny = %d\n", gridsize, xsize, ysize);
{
fprintf(stdout, "size : dim = %d nx = %d ny = %d\n", gridsize, xsize, ysize);
if ( gridIsCyclic(gridID) )
{
fprintf(stdout, "%*s", nbyte0, "");
fprintf(stdout, "longitude : cyclic\n");
}
}
}
if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_CELL || gridtype == GRID_GENERIC )
......
......@@ -801,7 +801,7 @@ Number of zaxis in a variable list.
\section*{\tt \htmlref{zaxisCreate}{zaxisCreate}}
\begin{verbatim}
int zaxisCreate (intleveltype, intsize);
int zaxisCreate (intzaxistype, intsize);
\end{verbatim}
Create a vertical Z-axis.
......
......@@ -41,7 +41,7 @@ Invalid argument
\item[{\tt CDI\_EUFILETYPE}]
Unsupported file type
\item[{\tt CDI\_ELIBNAVAIL}]
Library not available
Library support not compiled in
\end{deflist}
\end{minipage}
......@@ -101,7 +101,7 @@ Invalid argument
\item[{\tt CDI\_EUFILETYPE}]
Unsupported file type
\item[{\tt CDI\_ELIBNAVAIL}]
Library not available
Library support not compiled in
\end{deflist}
\end{minipage}
......
......@@ -124,7 +124,7 @@
\end{picture}
\begin{flushright}
\large\bf{Climate Data Interface \\ Version 1.0.1 \\ August 2006}
\large\bf{Climate Data Interface \\ Version 1.0.7 \\ June 2007}
\end{flushright}
\vfill
......
......@@ -123,7 +123,7 @@
\end{picture}
\begin{flushright}
\large\bf{Climate Data Interface \\ Version 1.0.1 \\ August 2006}
\large\bf{Climate Data Interface \\ Version 1.0.7 \\ June 2007}
\end{flushright}
\vfill
......
......@@ -807,7 +807,7 @@ Number of zaxis in a variable list.
\section*{\tt \htmlref{zaxisCreate}{zaxisCreate}}
\begin{verbatim}
INTEGER FUNCTION zaxisCreate (INTEGER leveltype, INTEGER size)
INTEGER FUNCTION zaxisCreate (INTEGER zaxistype, INTEGER size)
\end{verbatim}
Create a vertical Z-axis.
......
......@@ -41,7 +41,7 @@ Invalid argument
\item[{\tt CDI\_EUFILETYPE}]
Unsupported file type
\item[{\tt CDI\_ELIBNAVAIL}]
Library not available
Library support not compiled in
\end{deflist}
\end{minipage}
......@@ -101,7 +101,7 @@ Invalid argument
\item[{\tt CDI\_EUFILETYPE}]
Unsupported file type
\item[{\tt CDI\_ELIBNAVAIL}]
Library not available
Library support not compiled in
\end{deflist}
\end{minipage}
......
......@@ -22,7 +22,7 @@ predefined constants:
\item[{\large\tt DATATYPE\_PACK8}] 8 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_PACK16}] 16 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_PACK24}] 24 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_REAL32}] 32 bit floating point
\item[{\large\tt DATATYPE\_REAL64}] 64 bit floating point
\item[{\large\tt DATATYPE\_FLT32}] 32 bit floating point
\item[{\large\tt DATATYPE\_FLT64}] 64 bit floating point
\end{deflist}
\end{minipage}
......@@ -469,6 +469,8 @@ double gridInqYval(int gridID, int index);
double gridInqXinc(int gridID);
double gridInqYinc(int gridID);
int gridIsCyclic(int gridID);
int gridIsRotated(int gridID);
double gridInqXpole(int gridID);
void gridDefXpole(int gridID, double xpole);
......
!
! Fortran interface for CDI library version 1.0.3
! Fortran interface for CDI library version 1.0.7
!
INTEGER CDI_UNDEFID
......@@ -39,8 +39,6 @@
PARAMETER (FILETYPE_SRV = 5)
INTEGER FILETYPE_EXT
PARAMETER (FILETYPE_EXT = 6)
INTEGER FILETYPE_H5
PARAMETER (FILETYPE_H5 = 7)
INTEGER FILETYPE_IEG
PARAMETER (FILETYPE_IEG = 8)
!
......@@ -179,6 +177,8 @@
PARAMETER (ZAXIS_TRAJECTORY = 9)
INTEGER ZAXIS_ALTITUDE
PARAMETER (ZAXIS_ALTITUDE = 10)
INTEGER ZAXIS_SIGMA
PARAMETER (ZAXIS_SIGMA = 11)
!
! TAXIS types
!
......@@ -588,6 +588,17 @@
! INTEGER varID)
EXTERNAL vlistInqVarTime
! vlistDefVarSzip
! (INTEGER vlistID,
! INTEGER varID,
! INTEGER szip)
EXTERNAL vlistDefVarSzip
INTEGER vlistInqVarSzip
! (INTEGER vlistID,
! INTEGER varID)
EXTERNAL vlistInqVarSzip
! vlistDefVarCode
! (INTEGER vlistID,
! INTEGER varID,
......@@ -983,6 +994,10 @@
! (INTEGER gridID)
EXTERNAL gridInqYinc
INTEGER gridIsCyclic
! (INTEGER gridID)
EXTERNAL gridIsCyclic
INTEGER gridIsRotated
! (INTEGER gridID)
EXTERNAL gridIsRotated
......@@ -1146,7 +1161,7 @@
EXTERNAL zaxisName
INTEGER zaxisCreate
! (INTEGER leveltype,
! (INTEGER zaxistype,
! INTEGER size)
EXTERNAL zaxisCreate
......@@ -1238,6 +1253,15 @@
! (INTEGER zaxisID)
EXTERNAL zaxisInqPrec
! zaxisDefLtype
! (INTEGER zaxisID,
! INTEGER ltype)
EXTERNAL zaxisDefLtype
INTEGER zaxisInqLtype
! (INTEGER zaxisID)
EXTERNAL zaxisInqLtype
! zaxisDefVct
! (INTEGER zaxisID,
! INTEGER size,
......@@ -1290,7 +1314,7 @@
! zaxisChangeType
! (INTEGER zaxisID,
! INTEGER leveltype)
! INTEGER zaxistype)
EXTERNAL zaxisChangeType
!
......
......@@ -134,6 +134,8 @@ FCALLSCSUB5 (vlistInqVar, VLISTINQVAR, vlistinqvar, INT, INT, PINT, PINT, PINT)
FCALLSCFUN2 (INT, vlistInqVarGrid, VLISTINQVARGRID, vlistinqvargrid, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarZaxis, VLISTINQVARZAXIS, vlistinqvarzaxis, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarTime, VLISTINQVARTIME, vlistinqvartime, INT, INT)
FCALLSCSUB3 (vlistDefVarSzip, VLISTDEFVARSZIP, vlistdefvarszip, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarSzip, VLISTINQVARSZIP, vlistinqvarszip, INT, INT)
FCALLSCSUB3 (vlistDefVarCode, VLISTDEFVARCODE, vlistdefvarcode, INT, INT, INT)
FCALLSCFUN2 (INT, vlistInqVarCode, VLISTINQVARCODE, vlistinqvarcode, INT, INT)
FCALLSCSUB3 (vlistDefVarDatatype, VLISTDEFVARDATATYPE, vlistdefvardatatype, INT, INT, INT)
......@@ -213,6 +215,7 @@ FCALLSCFUN2 (DOUBLE, gridInqXval, GRIDINQXVAL, gridinqxval, INT, INT)
FCALLSCFUN2 (DOUBLE, gridInqYval, GRIDINQYVAL, gridinqyval, INT, INT)
FCALLSCFUN1 (DOUBLE, gridInqXinc, GRIDINQXINC, gridinqxinc, INT)
FCALLSCFUN1 (DOUBLE, gridInqYinc, GRIDINQYINC, gridinqyinc, INT)
FCALLSCFUN1 (INT, gridIsCyclic, GRIDISCYCLIC, gridiscyclic, INT)
FCALLSCFUN1 (INT, gridIsRotated, GRIDISROTATED, gridisrotated, INT)
FCALLSCFUN1 (DOUBLE, gridInqXpole, GRIDINQXPOLE, gridinqxpole, INT)
FCALLSCSUB2 (gridDefXpole, GRIDDEFXPOLE, griddefxpole, INT, DOUBLE)
......@@ -273,6 +276,8 @@ FCALLSCSUB2 (zaxisInqLongname, ZAXISINQLONGNAME, zaxisinqlongname, INT, PSTRING)
FCALLSCSUB2 (zaxisInqUnits, ZAXISINQUNITS, zaxisinqunits, INT, PSTRING)
FCALLSCSUB2 (zaxisDefPrec, ZAXISDEFPREC, zaxisdefprec, INT, INT)
FCALLSCFUN1 (INT, zaxisInqPrec, ZAXISINQPREC, zaxisinqprec, INT)
FCALLSCSUB2 (zaxisDefLtype, ZAXISDEFLTYPE, zaxisdefltype, INT, INT)
FCALLSCFUN1 (INT, zaxisInqLtype, ZAXISINQLTYPE, zaxisinqltype, INT)
FCALLSCSUB3 (zaxisDefVct, ZAXISDEFVCT, zaxisdefvct, INT, INT, PDOUBLE)
FCALLSCFUN1 (INT, zaxisInqVctSize, ZAXISINQVCTSIZE, zaxisinqvctsize, INT)
FCALLSCFUN2 (INT, zaxisInqLbounds, ZAXISINQLBOUNDS, zaxisinqlbounds, INT, PDOUBLE)
......
......@@ -191,6 +191,7 @@ static void grid_init_entry(GRID *gridptr)
gridptr->size = 0;
gridptr->xsize = 0;
gridptr->ysize = 0;
gridptr->isCyclic = CDI_UNDEFID;
gridptr->isRotated = FALSE;
gridptr->xpole = 0.0;
gridptr->ypole = 0.0;
......@@ -2075,6 +2076,70 @@ void gridChangeType(int gridID, int gridtype)
}
static void grid_check_cyclic(GRID *gridptr)
{
int xsize, ysize, gridsize;
int i1, i2, j, k1, k2, nc;
double xinc, x0;
const double *xvals, *xbounds;
gridptr->isCyclic = FALSE;
gridsize = gridptr->size;
xsize = gridptr->xsize;
ysize = gridptr->ysize;
xvals = gridptr->xvals;
xbounds = gridptr->xbounds;
if ( gridptr->type == GRID_GAUSSIAN || gridptr->type == GRID_LONLAT )
{
if ( xvals && xsize > 1 )
{
xinc = xvals[1] - xvals[0];
x0 = 2*xvals[xsize-1]-xvals[xsize-2]-360;
if ( DBL_IS_EQUAL(x0, xvals[0]) ) gridptr->isCyclic = TRUE;
}
}
else if ( gridptr->type == GRID_CURVILINEAR )
{
if ( xbounds && xsize > 1 )
{
gridptr->isCyclic = TRUE;
for ( j = 0; j < ysize; ++j )
{
i1 = j*xsize*4;
i2 = j*xsize*4+(xsize-1)*4;
nc = 0;
for ( k1 = 0; k1 < 4; ++k1 )
{
for ( k2 = 0; k2 < 4; ++k2 )
{
if ( DBL_IS_EQUAL(xbounds[i1+k1], xbounds[i2+k2]) ) nc++;
}
}
if ( nc != 2 )
{
gridptr->isCyclic = FALSE;
break;
}
}
}
}
}
int gridIsCyclic(int gridID)
{
GRID *gridptr;
gridptr = grid_to_pointer(gridID);
if ( gridptr->isCyclic == CDI_UNDEFID ) grid_check_cyclic(gridptr);
return ( gridptr->isCyclic );
}
int gridIsRotated(int gridID)
{
GRID *gridptr;
......
......@@ -16,6 +16,7 @@ typedef struct {
double xlast, ylast;
double xinc, yinc;
double xpole, ypole, angle; /* rotated north pole */
int isCyclic; /* TRUE for global cyclic grids */
int isRotated; /* TRUE for rotated grids */
int xdef; /* 0: undefined 1:xvals 2:x0+xinc */
int ydef; /* 0: undefined 1:yvals 2:y0+yinc */
......
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