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

merge: bug fix for usage in pipes

parent 4c632512
......@@ -13,6 +13,7 @@
* Arith: add filltype FILL_RECTS [request: Wolfgang Mueller]
* inputsrv: use -f format if set (bug fix)
* Seasstat: warning message for seasons with less than 3 input time steps
* merge: bug fix for usage in pipes [report: lvaro M. Valdebenito]
* remapcon: change max_subseg from 100000 to 1000
* remapbil: 2. bug fix for cross_product eq zero
* gridWeights: bug fix for areas greater than hemisphere [report: Malte Heinemann]
......
......@@ -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-2008 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2009 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
......@@ -35,7 +35,7 @@ void *Diff(void *argument)
int operatorID;
int i;
int indg;
int varID, recID;
int varID1, varID2, recID;
int gridsize;
int gridID, zaxisID, code, vdate, vtime;
int nrecs, nrecs2;
......@@ -105,21 +105,21 @@ void *Diff(void *argument)
for ( recID = 0; recID < nrecs; recID++ )
{
streamInqRecord(streamID1, &varID, &levelID);
streamInqRecord(streamID2, &varID, &levelID);
streamInqRecord(streamID1, &varID1, &levelID);
streamInqRecord(streamID2, &varID2, &levelID);
indg += 1;
code = vlistInqVarCode(vlistID1, varID);
gridID = vlistInqVarGrid(vlistID1, varID);
zaxisID = vlistInqVarZaxis(vlistID1, varID);
code = vlistInqVarCode(vlistID1, varID1);
gridID = vlistInqVarGrid(vlistID1, varID1);
zaxisID = vlistInqVarZaxis(vlistID1, varID1);
gridsize = gridInqSize(gridID);
missval1 = vlistInqVarMissval(vlistID1, varID);
missval2 = vlistInqVarMissval(vlistID2, varID);
missval1 = vlistInqVarMissval(vlistID1, varID1);
missval2 = vlistInqVarMissval(vlistID2, varID2);
if ( operatorID == DIFFV || operatorID == DIFF )
{
if ( operatorID == DIFFV ) vlistInqVarName(vlistID1, varID, varname);
if ( operatorID == DIFFV ) vlistInqVarName(vlistID1, varID1, varname);
if ( operatorID == DIFFV )
fprintf(stdout, "%6d : %4.4d-%2.2d-%2.2d %2.2d:%2.2d %-8s ",
......
......@@ -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-2008 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2009 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
......@@ -67,7 +67,6 @@ void *Merge(void *argument)
vlistID1 = streamInqVlist(streamID1);
vlistIDs[index] = vlistID1;
if ( cdoVerbose ) vlistPrint(vlistID1);
}
vlistID1 = vlistIDs[0];
......@@ -79,7 +78,11 @@ void *Merge(void *argument)
/* for ( index = 1; index < nmerge; index++ ) vlistCat(vlistID2, vlistIDs[index]); */
for ( index = 1; index < nmerge; index++ ) vlistMerge(vlistID2, vlistIDs[index]);
if ( cdoVerbose ) vlistPrint(vlistID2);
if ( cdoVerbose )
{
for ( index = 0; index < nmerge; index++ ) vlistPrint(vlistIDs[index]);
vlistPrint(vlistID2);
}
streamID2 = streamOpenWrite(cdoStreamName(streamCnt-1), cdoFiletype());
if ( streamID2 < 0 ) cdiError(streamID2, "Open failed on %s", cdoStreamName(streamCnt-1));
......@@ -131,8 +134,8 @@ void *Merge(void *argument)
{
streamInqRecord(streamID1, &varID, &levelID);
varID2 = vlistFlagVar(vlistID1, varID);
levelID2 = vlistFlagLevel(vlistID1, varID, levelID);
varID2 = vlistMergedVar(vlistID1, varID);
levelID2 = vlistMergedLevel(vlistID1, varID, levelID);
if ( cdoVerbose ) cdoPrint("var %d %d %d %d", varID, levelID, varID2, levelID2);
......
......@@ -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-2008 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2009 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
......@@ -85,7 +85,8 @@ void printFiletype(int streamID, int vlistID)
for ( varID = 0; varID < nvars; varID++ )
{
if ( ztype = vlistInqVarZtype(vlistID, varID) )
ztype = vlistInqVarZtype(vlistID, varID);
if ( ztype )
{
if ( ztype == COMPRESS_SZIP )
printf(" SZIP");
......
......@@ -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-2007 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2009 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
......
......@@ -392,10 +392,10 @@ void vlistDefIndex(int vlistID, int varID, int levID, int index);
int vlistInqIndex(int vlistID, int varID, int levID);
void vlistDefFlag(int vlistID, int varID, int levID, int flag);
int vlistInqFlag(int vlistID, int varID, int levID);
int vlistFlagVar(int vlistID, int varID);
int vlistFlagLevel(int vlistID, int varID, int levelID);
int vlistFindVar(int vlistID, int fvarID);
int vlistFindLevel(int vlistID, int fvarID, int flevelID);
int vlistMergedVar(int vlistID, int varID);
int vlistMergedLevel(int vlistID, int varID, int levelID);
/* VLIST attributes */
......
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