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

vert_interp_lev3d: added parameter lexpol

parent 5acb7a2d
......@@ -35,9 +35,9 @@ case "${HOSTNAME}" in
--with-netcdf=$HOME/local/netcdf-c-4.3.3.1-threadsafe \
--with-hdf5=$HOME/local/hdf5-1.8.15-threadsafe \
--with-udunits2=/opt/local \
--with-curl=/opt/local"
# --with-proj=/opt/local \
# --with-szlib=$HOME/local \
--with-curl=/opt/local \
--with-proj=/opt/local \
--with-szlib=$HOME/local"
if test "$COMP" = icc ; then
${CONFPATH}configure \
......
......@@ -68,7 +68,7 @@ void *Intlevel3d(void *argument)
cdoInitialize(argument);
int INTLEVEL3D = cdoOperatorAdd("intlevel3d", 0, 0, NULL);
int INTLEVELX3D = cdoOperatorAdd("intlevelx3d", 0, 0, NULL);
int INTLEVELX3D = cdoOperatorAdd("intlevelx3d", 0, 0, NULL);
int operatorID = cdoOperatorID();
......@@ -311,7 +311,7 @@ void *Intlevel3d(void *argument)
streamDefVlist(streamID3, vlistID3);
maxlev = nlevi > nlevo ? nlevi : nlevo;
maxlev = nlevi > nlevo ? nlevi : nlevo;
nvars = vlistNvars(vlistID1);
vars = (int*) malloc(nvars*sizeof(int));
vardata1 = (double**) malloc(nvars*sizeof(double*)); /* input */
......@@ -409,7 +409,7 @@ void *Intlevel3d(void *argument)
missval = vlistInqVarMissval(vlistID1, varID);
gridsize = gridInqSize(gridID);
vert_interp_lev3d(gridsize, missval, vardata1[varID], vardata2[varID],
vert_interp_lev3d(expol, gridsize, missval, vardata1[varID], vardata2[varID],
nlevo, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
for ( levelID = 0; levelID < nlevo; levelID++ )
......
......@@ -417,7 +417,7 @@ void interp_Z(const double * restrict geop, const double * restrict gz, double *
/*
* 3d vertical interpolation routine (see vert_interp_lev() in src/Intlevel.c)
*/
void vert_interp_lev3d(int gridsize, double missval, double *vardata1, double *vardata2,
void vert_interp_lev3d(int lexpol, int gridsize, double missval, double *vardata1, double *vardata2,
int nlev2, int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2)
{
int i, ilev;
......@@ -475,6 +475,43 @@ void vert_interp_lev3d(int gridsize, double missval, double *vardata1, double *v
}
}
}
if ( lexpol )
{
/*
printf("lexpol nlev2 %d!\n", nlev2);
for ( i = 0; i < gridsize; i++ )
{
if ( DBL_IS_EQUAL(vardata2[i], missval) )
{
for ( ilev = 1; ilev < nlev2; ilev++ )
{
if ( !DBL_IS_EQUAL(vardata2[ilev*gridsize+i], missval) ) break;
}
if ( ilev < nlev2 )
{
for ( int k = 0; k < ilev; k++ )
vardata2[k*gridsize+i] = vardata2[ilev*gridsize+i];
}
}
}
for ( i = 0; i < gridsize; i++ )
{
if ( DBL_IS_EQUAL(vardata2[(nlev2-1)*gridsize+i], missval) )
{
for ( ilev = nlev2-2; ilev >= 0; ilev-- )
{
if ( !DBL_IS_EQUAL(vardata2[ilev*gridsize+i], missval) ) break;
}
if ( ilev >= 0 )
{
for ( int k = nlev2-1; k > ilev; k-- )
vardata2[k*gridsize+i] = vardata2[ilev*gridsize+i];
}
}
}
*/
}
}
#if defined(CDO)
......
......@@ -26,7 +26,7 @@ void interp_X(const double * restrict gt, double *pt, const double * restrict hy
const double * restrict plev, long nplev, long ngp, long nhlev, double missval);
void vert_interp_lev3d(int gridsize, double missval, double *vardata1, double *vardata2,
void vert_interp_lev3d(int lexpol, int gridsize, double missval, double *vardata1, double *vardata2,
int nlev2, int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2);
void vert_gen_weights3d(int expol, int nlev1, int gridsize, double *lev1, int nlev2, double *lev2,
int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2);
......
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