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

changed timeID to tsteptype

parent 571bc233
2012-06-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* changed timeID to tsteptype
2012-05-31 Luis Kornblueh <Luis.Kornblueh@zmaw.de>
* arradd: SSE2 version (performance +15%)
......
......@@ -187,7 +187,7 @@ void *CDIwrite(void *argument)
for ( i = 0; i < nvars; ++i )
{
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarCode(vlistID, varID, varID+1);
// vlistDefVarName(vlistID, varID, );
}
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -27,7 +27,6 @@
#include "pstream.h"
#include "util.h"
void vlistDefVarTime(int vlistID, int varID, int timeID);
void *Cat(void *argument)
{
......@@ -90,7 +89,7 @@ void *Cat(void *argument)
if ( ntsteps == 1 )
{
for ( varID = 0; varID < nvars; ++varID )
if ( vlistInqVarTime(vlistID1, varID) == TIME_VARIABLE ) break;
if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
if ( varID == nvars ) ntsteps = 0;
}
......@@ -98,7 +97,7 @@ void *Cat(void *argument)
if ( ntsteps == 0 && nfiles > 1 )
{
for ( varID = 0; varID < nvars; ++varID )
vlistDefVarTime(vlistID2, varID, TIME_VARIABLE);
vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
}
streamDefVlist(streamID2, vlistID2);
......
......@@ -305,7 +305,7 @@ void *Cloudlayer(void *argument)
if ( nvars2 == 1 )
{
varID = vlistDefVar(vlistID2, gridID, surfaceID, TIME_VARIABLE);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
vlistDefVarCode(vlistID2, varID, 33);
vlistDefVarName(vlistID2, varID, "cld_lay");
vlistDefVarLongname(vlistID2, varID, "cloud layer");
......@@ -313,19 +313,19 @@ void *Cloudlayer(void *argument)
}
else
{
varID = vlistDefVar(vlistID2, gridID, surfaceID, TIME_VARIABLE);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
vlistDefVarCode(vlistID2, varID, 34);
vlistDefVarName(vlistID2, varID, "low_cld");
vlistDefVarLongname(vlistID2, varID, "low cloud");
vlistDefVarMissval(vlistID2, varID, missval);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TIME_VARIABLE);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
vlistDefVarCode(vlistID2, varID, 35);
vlistDefVarName(vlistID2, varID, "mid_cld");
vlistDefVarLongname(vlistID2, varID, "mid cloud");
vlistDefVarMissval(vlistID2, varID, missval);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TIME_VARIABLE);
varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
vlistDefVarCode(vlistID2, varID, 36);
vlistDefVarName(vlistID2, varID, "hih_cld");
vlistDefVarLongname(vlistID2, varID, "high cloud");
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -27,7 +27,6 @@
#include "par_io.h"
#include "pstream.h"
void vlistDefVarTime(int vlistID, int varID, int timeID);
void *Copy(void *argument)
{
......@@ -89,7 +88,7 @@ void *Copy(void *argument)
if ( ntsteps == 1 )
{
for ( varID = 0; varID < nvars; ++varID )
if ( vlistInqVarTime(vlistID1, varID) == TIME_VARIABLE ) break;
if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
if ( varID == nvars ) ntsteps = 0;
}
......@@ -97,7 +96,7 @@ void *Copy(void *argument)
if ( ntsteps == 0 && nfiles > 1 )
{
for ( varID = 0; varID < nvars; ++varID )
vlistDefVarTime(vlistID2, varID, TIME_VARIABLE);
vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
}
streamDefVlist(streamID2, vlistID2);
......
......@@ -414,7 +414,7 @@ void *Derivepar(void *argument)
vlistID2 = vlistCreate();
varID = vlistDefVar(vlistID2, gridID, zaxisIDh, TIME_VARIABLE);
varID = vlistDefVar(vlistID2, gridID, zaxisIDh, TSTEP_INSTANT);
vlistDefVarParam(vlistID2, varID, cdiEncodeParam(156, 128, 255));
vlistDefVarName(vlistID2, varID, "geopotheight");
vlistDefVarStdname(vlistID2, varID, "geopotental_height");
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -23,7 +23,6 @@
#define NALLOC_INC 1024
void vlistDefVarTime(int vlistID, int varID, int timeID);
void *Duplicate(void *argument)
{
......@@ -65,7 +64,7 @@ void *Duplicate(void *argument)
if ( ntsteps == 1 )
{
for ( varID = 0; varID < nvars; ++varID )
if ( vlistInqVarTime(vlistID1, varID) == TIME_VARIABLE ) break;
if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
if ( varID == nvars ) ntsteps = 0;
}
......@@ -73,7 +72,7 @@ void *Duplicate(void *argument)
if ( ntsteps == 0 )
{
for ( varID = 0; varID < nvars; ++varID )
vlistDefVarTime(vlistID2, varID, TIME_VARIABLE);
vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
}
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
......@@ -1471,7 +1471,7 @@ void *Echam5ini(void *argument)
{/*
fprintf(stderr, "%d %s %d %d %d %d\n", iv, vars[iv].name, vars[iv].gridID, vars[iv].zaxisID, gridInqSize(vars[iv].gridID), zaxisInqSize(vars[iv].zaxisID));
*/
varID = vlistDefVar(vlistID2, vars[iv].gridID, vars[iv].zaxisID, TIME_CONSTANT);
varID = vlistDefVar(vlistID2, vars[iv].gridID, vars[iv].zaxisID, TSTEP_CONSTANT);
if ( vars[iv].code > 0 ) vlistDefVarCode(vlistID2, varID, vars[iv].code);
if ( vars[iv].name ) vlistDefVarName(vlistID2, varID, vars[iv].name);
if ( vars[iv].longname ) vlistDefVarLongname(vlistID2, varID, vars[iv].longname);
......
......@@ -169,7 +169,7 @@ void *Ensstat3(void *argument)
zaxisDefLevels(zaxisID2,levs);
zaxisDefName(zaxisID2, "histogram_binID");
time_mode = datafunc == TIME? TIME_VARIABLE : TIME_CONSTANT;
time_mode = datafunc == TIME? TSTEP_INSTANT : TSTEP_CONSTANT;
for ( varID=0; varID<nvars; varID++) {
......
......@@ -181,7 +181,7 @@ void *EOF3d(void * argument)
varID2 = (int *) malloc (nvars*sizeof(int));
for ( varID=0; varID<nvars; varID++ )
varID2[varID] = vlistDefVar(vlistID2, gridID2, zaxisID2, TIME_VARIABLE);
varID2[varID] = vlistDefVar(vlistID2, gridID2, zaxisID2, TSTEP_INSTANT);
ngrids = vlistNgrids(vlistID2);
for ( i = 0; i < ngrids; i++ )
vlistChangeGridIndex(vlistID2, i, gridID2);
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -27,7 +27,6 @@
#include "cdo_int.h"
#include "pstream.h"
void vlistDefVarTime(int vlistID, int varID, int timeID);
// NO MISSING VALUE SUPPORT ADDED SO FAR
......@@ -159,7 +158,7 @@ void *Eofcoeff(void * argument)
vlistDefTaxis(vlistID3, taxisID3);
for (varID =0; varID<nvars; varID++)
vlistDefVarTime(vlistID3, varID, TIME_VARIABLE);
vlistDefVarTsteptype(vlistID3, varID, TSTEP_INSTANT);
// open streams for eofcoeff output
streamIDs = (int *) malloc (neof*sizeof(int));
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2011 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......@@ -27,7 +27,6 @@
#include "cdo_int.h"
#include "pstream.h"
void vlistDefVarTime(int vlistID, int varID, int timeID);
// NO MISSING VALUE SUPPORT ADDED SO FAR
......@@ -159,10 +158,8 @@ void *Eofcoeff3d(void * argument)
vlistID3 = vlistCreate();
vlistDefTaxis(vlistID3,taxisID3);
varID3 = (int *) malloc ( nvars * sizeof(int) );
for ( varID=0; varID<nvars; varID++ ) {
varID3[varID] = vlistDefVar(vlistID3,gridID3,zaxisID3,TIME_VARIABLE);
vlistDefVarTime(vlistID3, varID, TIME_VARIABLE);
}
for ( varID=0; varID<nvars; varID++ )
varID3[varID] = vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_INSTANT);
// open streams for eofcoeff output
streamIDs = (int *) malloc (neof*sizeof(int));
......
......@@ -138,7 +138,7 @@ void *Expr(void *argument)
parse_arg.debug = 0;
parse_arg.gridID2 = -1;
parse_arg.zaxisID2 = -1;
parse_arg.timeID2 = -1;
parse_arg.tsteptype2 = -1;
for ( varID = 0; varID < nvars; varID++ )
parse_arg.var_needed[varID] = FALSE;
......
......@@ -132,7 +132,7 @@ void *Gengrid(void *argument)
zaxisID3 = zaxisCreate(ZAXIS_SURFACE, 1);
vlistID3 = vlistCreate();
vlistDefVar(vlistID3, gridID3, zaxisID3, TIME_CONSTANT);
vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_CONSTANT);
vlistDefVarMissval(vlistID3, 0, missval);
vlistDefVarName(vlistID3, 0, "dummy");
vlistDefVarDatatype(vlistID3, 0, DATATYPE_INT8);
......
......@@ -950,7 +950,7 @@ void *Gradsdes(void *argument)
recoffset[varID] = nrecsout;
nvarsout++;
nrecsout += zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
if ( ntsteps != 1 && ntsteps != 0 && vlistInqVarTime(vlistID, varID) == TIME_CONSTANT )
if ( ntsteps != 1 && ntsteps != 0 && vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT )
cdoAbort("Unsupported GrADS record structure! Variable %d has only 1 time step.",
vlistInqVarCode(vlistID, varID));
}
......
......@@ -98,7 +98,7 @@ void *Gridcell(void *argument)
zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
vlistID2 = vlistCreate();
varID = vlistDefVar(vlistID2, gridID, zaxisID, TIME_CONSTANT);
varID = vlistDefVar(vlistID2, gridID, zaxisID, TSTEP_CONSTANT);
if ( operatorID == GRIDAREA )
{
......
......@@ -131,7 +131,7 @@ void *Hi(void *argument)
vlistID4 = vlistCreate();
gridID = vlistInqVarGrid(vlistID1, FIRST_VAR);
zaxisID = vlistInqVarZaxis(vlistID1, FIRST_VAR);
varID4 = vlistDefVar(vlistID4, gridID, zaxisID, TIME_VARIABLE);
varID4 = vlistDefVar(vlistID4, gridID, zaxisID, TSTEP_INSTANT);
taxisID4 = taxisCreate(TAXIS_RELATIVE);
taxisDefTunit(taxisID4, TUNIT_MINUTE);
......
......@@ -53,7 +53,7 @@ void init_amsr_day(int vlistID, int gridID, int zaxisID, int nvars)
for ( i = 0; i < nvars; ++i )
{
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarName(vlistID, varID, name[i]);
vlistDefVarUnits(vlistID, varID, units[i]);
vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
......@@ -99,8 +99,8 @@ void init_amsr_averaged(int vlistID, int gridID, int zaxisID, int nvars)
for ( i = 0; i < nvars; ++i )
{
/* varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_CONSTANT); */
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
/* varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_CONSTANT); */
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarName(vlistID, varID, name[i]);
vlistDefVarUnits(vlistID, varID, units[i]);
vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
......
......@@ -270,7 +270,7 @@ void *Importbinary(void *argument)
if ( nlevels == 0 )
{
nlevels = 1;
varID = vlistDefVar(vlistID, gridID, zaxisIDsfc, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisIDsfc, TSTEP_INSTANT);
}
else
{
......@@ -287,10 +287,10 @@ void *Importbinary(void *argument)
}
if ( vid == ivar ) zid = define_level(&pfi, nlevels);
varID = vlistDefVar(vlistID, gridID, zid, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zid, TSTEP_INSTANT);
}
else
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
}
var_zaxisID[varID] = vlistInqVarZaxis(vlistID, varID);
......
......@@ -1551,9 +1551,9 @@ void *Importcmsaf(void *argument)
for ( ivar = 0; ivar < dsets.nsets; ++ivar )
{
if ( dsets.obj[ivar].nt > 1 )
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
else
varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarName(vlistID, varID, dsets.obj[ivar].name);
if ( dsets.obj[ivar].description )
......
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