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

added interface function zaxisInqVct to read the VCT

parent c84d452a
2011-07-23 Pier Giuseppe Fogli <piergiuseppe.fogli@cmcc.it>
* added interface function zaxisInqVct to read the VCT
2011-07-23 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* netcdf input: correct wrong formatted time units [request: Harald Anlauf]
......
CDI NEWS
--------
Version 1.5.2 (?? ??? 2011):
New functions:
* zaxisInqVct - read VCT
Version 1.5.1 (12 July 2011):
New features:
......
......@@ -743,6 +743,7 @@ int zaxisInqLtype(int zaxisID);
const double *zaxisInqLevelsPtr(int zaxisID);
void zaxisDefVct(int zaxisID, int size, const double *vct_vec);
void zaxisInqVct(int zaxisID, double *vct_vec);
int zaxisInqVctSize(int zaxisID);
const double *zaxisInqVctPtr(int zaxisID);
int zaxisInqLbounds(int zaxisID, double *lbounds_vec);
......
! This file was automatically generated, don't edit!
!
! Fortran interface for CDI library version 1.5.0
! Fortran interface for CDI library version 1.5.1
!
! Author:
! -------
! Uwe Schulzweida, MPI-MET, Hamburg, June 2011
! Uwe Schulzweida, MPI-MET, Hamburg, July 2011
!
INTEGER CDI_MAX_NAME
......@@ -1657,6 +1657,11 @@
! DOUBLEPRECISION vct_vec)
EXTERNAL zaxisDefVct
! zaxisInqVct
! (INTEGER zaxisID,
! DOUBLEPRECISION vct_vec)
EXTERNAL zaxisInqVct
INTEGER zaxisInqVctSize
! (INTEGER zaxisID)
EXTERNAL zaxisInqVctSize
......
......@@ -350,6 +350,7 @@ FCALLSCFUN1 (INT, zaxisInqPositive, ZAXISINQPOSITIVE, zaxisinqpositive, INT)
FCALLSCSUB2 (zaxisDefLtype, ZAXISDEFLTYPE, zaxisdefltype, INT, INT)
FCALLSCFUN1 (INT, zaxisInqLtype, ZAXISINQLTYPE, zaxisinqltype, INT)
FCALLSCSUB3 (zaxisDefVct, ZAXISDEFVCT, zaxisdefvct, INT, INT, PDOUBLE)
FCALLSCSUB2 (zaxisInqVct, ZAXISINQVCT, zaxisinqvct, INT, PDOUBLE)
FCALLSCFUN1 (INT, zaxisInqVctSize, ZAXISINQVCTSIZE, zaxisinqvctsize, INT)
FCALLSCFUN2 (INT, zaxisInqLbounds, ZAXISINQLBOUNDS, zaxisinqlbounds, INT, PDOUBLE)
FCALLSCFUN2 (INT, zaxisInqUbounds, ZAXISINQUBOUNDS, zaxisinqubounds, INT, PDOUBLE)
......@@ -437,12 +438,3 @@ FCALLSCFUN1 (INT, streamInqHistorySize, STREAMINQHISTORYSIZE, streaminqhistorysi
FCALLSCSUB2 (streamInqHistoryString, STREAMINQHISTORYSTRING, streaminqhistorystring, INT, PSTRING)
#endif
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
......@@ -2105,7 +2105,6 @@ void cdfDefVCT(int streamID, int zaxisID)
size_t count = 1;
int ncdimid, ncdimid2;
int hyaiid, hybiid, hyamid, hybmid;
const double *vctptr = zaxisInqVctPtr(zaxisID);
double mval;
char tmpname[256];
......@@ -2159,6 +2158,8 @@ void cdfDefVCT(int streamID, int zaxisID)
cdf_enddef(fileID);
streamptr->ncmode = 2;
const double *vctptr = zaxisInqVctPtr(zaxisID);
cdf_put_var_double(fileID, hyaiid, vctptr);
cdf_put_var_double(fileID, hybiid, vctptr+ilev);
......@@ -2168,7 +2169,7 @@ void cdfDefVCT(int streamID, int zaxisID)
mval = (vctptr[i] + vctptr[i+1]) * 0.5;
cdf_put_vara_double(fileID, hyamid, &start, &count, &mval);
mval = (vctptr[ilev+i] + vctptr[ilev+i+1]) * 0.5;
cdf_put_vara_double(fileID, hybmid, &start, &count, &mval);
cdf_put_vara_double(fileID, hybmid, &start, &count, &mval);
}
}
}
......
......@@ -1963,7 +1963,7 @@ void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int lev
else
{
ISEC2_NumVCP = vctsize;
memcpy(&fsec2[10], zaxisInqVctPtr(zaxisID), vctsize*sizeof(double));
zaxisInqVct(zaxiID, &fsec2[10]);
}
break;
}
......
......@@ -634,8 +634,8 @@ void vlistCopyFlag(int vlistID2, int vlistID1)
nvct = zaxisInqVctSize(zaxisID);
vct = zaxisInqVctPtr(zaxisID);
}
lbounds = 0; /* <------------ have to define */
levels2 = NULL; /* <------------ have to define */
lbounds = 0; /* <------------ have to defined */
levels2 = NULL; /* <------------ have to defined */
zaxisID2 = vlistInqZaxis(vlistID2, zaxisType, nlevs2, levels, lbounds, levels2, nvct, vct);
free(levels);
......
......@@ -1053,6 +1053,18 @@ void zaxisDefVct(int zaxisID, int size, const double *vct)
}
void zaxisInqVct(int zaxisID, double *vct)
{
zaxis_t *zaxisptr;
zaxisptr = zaxis_to_pointer(zaxisID);
zaxis_check_ptr(zaxisID, zaxisptr);
memcpy(vct, zaxisptr->vct, zaxisptr->vctsize*sizeof(double));
}
int zaxisInqVctSize(int zaxisID)
{
zaxis_t *zaxisptr;
......
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