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

select/delete: add support for negative timesteps

parent d0369052
......@@ -5,6 +5,7 @@
2014-04-15 Uwe Schulzweida
* select/delete: add support for negative timesteps
* seltimestep: add support for negative timesteps [patch from: Etienne Tourigny]
2014-04-14 Uwe Schulzweida
......
......@@ -283,7 +283,6 @@ int pml_add_entry(pml_entry_t *entry, char *arg)
void pmlProcess(pml_entry_t *entry, int argc, char **argv)
{
int i;
int len;
char *parg;
char *epos;
......@@ -606,7 +605,7 @@ void *Select(void *argument)
vlistDefFlag(vlistID1, varID, levID, TRUE);
}
}
else
else if ( operatorID == SELECT )
{
result = TRUE;
}
......@@ -789,6 +788,20 @@ void *Select(void *argument)
vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
}
/* add support for negative timestep values */
if ( npar_timestep > 0 && ntsteps > 0 && nfiles == 1 )
{
for ( i = 0; i < npar_timestep; i++ )
{
if ( par_timestep[i] < 0 )
{
if ( cdoVerbose )
cdoPrint("timestep %d changed to %d", par_timestep[i], ntsteps + 1 + par_timestep[i]);
par_timestep[i] = ntsteps + 1 + par_timestep[i];
}
}
}
if ( ! lcopy )
{
gridsize = vlistGridsizeMax(vlistID1);
......
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