Commit 86954b7a authored by Uwe Schulzweida's avatar Uwe Schulzweida

Invert: fix memory release problem

parent bdf55b81
2006-05-?? Uwe Schulzweida <schulzweida@dkrz.de>
2006-05-04 Uwe Schulzweida <schulzweida@dkrz.de>
* using CDI library version 0.9.7
* New module: Mergetime [request: Stefanie Legutke]
......@@ -6,6 +6,7 @@
* New operator: abs (Math) [request: Reiner Schnur]
* New module: Enlargegrid [request: Tom Hardy] <- docu missing
* New module: Input (input inputext inputsrv)
* Invert: fix memory release problem [report: Tom Hardy]
* setzaxis: set MAX_LINE_LEN from 1024 to 65536 [bug report: Martine Michou]
* enlarge: update for zonal and meridional data [request: Wolfgang Mueller]
* gradsdes: bug fix for unsorted GRIB data [report: Stefan Bauer]
......
......@@ -10,8 +10,7 @@
@BeginDescription
This module compares all fields of dataset with a constant. The resulting
field is a mask with 1 if the comparison is true and 0 if the comparison
is false. The type of the comparison depends on the
actual operator name.
is false. The type of the comparison depends on the actual operator name.
@EndDescription
@EndModule
......
......@@ -8,8 +8,8 @@
@BeginDescription
This module conditional selects field elements from @file{ifile2} and writes the
result to @file{ofile}. The fields in @file{ifile1} are handled as a mask.
A value not equal to zero is treated as "true", zero is treated as "false".
result to @file{ofile}. The fields in @file{ifile1} are handled as a mask. A value
not equal to zero is treated as "true", zero is treated as "false".
@EndDescription
@EndModule
......
......@@ -8,8 +8,8 @@
@BeginDescription
This module creates fields with a constant value or missing value.
The fields in @file{ifile1} are handled as a mask.
A value not equal to zero is treated as "true", zero is treated as "false".
The fields in @file{ifile1} are handled as a mask. A value not equal
to zero is treated as "true", zero is treated as "false".
@EndDescription
@EndModule
......
......@@ -8,8 +8,8 @@
@Operators = copy cat
@BeginDescription
This module contains operators to copy or concatenate datasets.
Each input dataset must have the same variables with complete time steps.
This module contains operators to copy or concatenate datasets. Each
input dataset must have the same variables with complete time steps.
@EndDescription
@EndModule
......
......@@ -13,12 +13,12 @@
@Title = Detrend
@BeginDescription
Every time series in @file{ifile} is linearly detrended.
@IfMan
For every field element x only those time steps t belong to the sample
S(x), which have i(t,x) NE miss.
Every time series in @file{ifile} is linearly detrended. For every field element x
only those time steps t belong to the sample S(x), which have i(t,x) NE miss.
@EndifMan
@IfDoc
Every time series in @file{ifile} is linearly detrended.
For every field element \begin{math}x\end{math} only those time steps \begin{math}t\end{math} belong to the sample
\begin{math}S(x)\end{math}, which have \begin{math}i(t,x) \neq \mbox{miss}\end{math}.
With
......
......@@ -8,8 +8,8 @@
@Operators = diff -diffv
@BeginDescription
Compares the contents of two datasets field by field.
The input datasets must have the same structure and the fields must have
Compares the contents of two datasets field by field. The input
datasets must have the same structure and the fields must have
the same header information and dimensions.
@EndDescription
@EndModule
......
......@@ -10,9 +10,8 @@
@BeginDescription
This module computes statistical values over an ensemble of input files.
Depending on the actual operator name the minimum, maximum, sum, average
or standard deviation over all input files is written to @file{ofile}.
The date information for a time step in @file{ofile} is the date of the
first input file.
or standard deviation over all input files is written to @file{ofile}. The date
information for a time step in @file{ofile} is the date of the first input file.
@EndDescription
@EndModule
......
......@@ -7,13 +7,11 @@
@Operators = gradsdes gradsdes2
@BeginDescription
Creates a GrADS data descriptor file. Supported file formats
are GRIB, SERVICE, EXTRA and IEG. For GRIB files the GrADS map
file is also generated.
For SERVICE and EXTRA files the grid must be specified with
the CDO option '-g <grid>'.
This operator takes @file{ifile} in order to create filenames for
the descriptor (@file{ifile.ctl}) and the map (@file{ifile.gmp}) file.
Creates a GrADS data descriptor file. Supported file formats are GRIB,
SERVICE, EXTRA and IEG. For GRIB files the GrADS map file is also
generated. For SERVICE and EXTRA files the grid must be specified with
the CDO option '-g <grid>'. This operator takes @file{ifile} in order to create
filenames for the descriptor (@file{ifile.ctl}) and the map (@file{ifile.gmp}) file.
@EndDescription
@EndModule
......
......@@ -8,9 +8,9 @@
@Operators = info -infov map
@BeginDescription
This module writes information about the structure and
contents of all input datasets to standard output.
The information displayed depends on the actual operator name.
This module writes information about the structure and contents
of all input datasets to standard output. The information displayed
depends on the actual operator name.
@EndDescription
@EndModule
......@@ -19,8 +19,8 @@ The information displayed depends on the actual operator name.
@Title = Dataset information
@BeginDescription
Prints information and simple statistics for each field of all input datasets.
For each field the operator print in one line the:
Prints information and simple statistics for each field of all
input datasets. For each field the operator print in one line the:
@BeginItemize
@Item = Date and Time
@Item = Code number and Level
......@@ -36,8 +36,8 @@ The mean value is computed without the use of area weights!
@Title = Dataset information
@BeginDescription
The same as operator @oper{info} but using the name instead of the code number
to identify the variables.
The same as operator @oper{info} but using the name instead of the code
number to identify the variables.
@EndDescription
@EndOperator
......@@ -46,8 +46,8 @@ to identify the variables.
@Title = Dataset information and simple map
@BeginDescription
Prints information, simple statistic and a map for each field of all input datasets.
The map will be printed only for fields on a rectangular grid.
Prints information, simple statistic and a map for each field of all input
datasets. The map will be printed only for fields on a rectangular grid.
@EndDescription
@EndOperator
......
......@@ -47,8 +47,8 @@ For a detailed description of this interpolation method see @cite{PINGO}.
@Parameter = grid
@BeginDescription
Performs a bilinear interpolation on all input fields. This is a faster
implementation than @oper{remapbil}. Missing values are not supported yet!
Performs a bilinear interpolation on all input fields. This implementation
is a faster than @oper{remapbil}. Missing values are not supported yet!
@EndDescription
@EndOperator
......
......@@ -11,10 +11,9 @@
@Title = Mass stream function
@BeginDescription
This is a special operator for the post processing of
the atmospheric general circulation model ECHAM.
It computes the mass stream function (code number 272).
The input dataset must be a zonal mean of v-velocity
This is a special operator for the post processing of the atmospheric
general circulation model ECHAM. It computes the mass stream function
(code number 272). The input dataset must be a zonal mean of v-velocity
(code number 132) on pressure levels.
@EndDescription
@EndOperator
......
......@@ -9,11 +9,10 @@
@BeginDescription
This module computes running statistical values over a selected number
of time steps. Depending on the actual operator name the minimum,
maximum, sum, average or standard deviation of a selected number
of consecutive time steps read from @file{ifile} is written to @file{ofile}.
The date information in @file{ofile} is the date of the medium contributing
time step in @file{ifile}.
of time steps. Depending on the actual operator name the minimum, maximum,
sum, average or standard deviation of a selected number of consecutive
time steps read from @file{ifile} is written to @file{ofile}. The date information
in @file{ofile} is the date of the medium contributing time step in @file{ifile}.
@EndDescription
@EndModule
......
......@@ -12,9 +12,9 @@ This module computes statistical values over time steps of the same season.
Depending on the actual operator name the minimum, maximum, sum, average
or standard deviation of time steps of the same season is written to @file{ofile}.
The date information for a time step in @file{ofile} is the date of the last
contributing time step in @file{ifile}. Be careful about the first and
the last output time step, they may be incorrect values if the seasons
have incomplete time steps.
contributing time step in @file{ifile}. Be careful about the first and the last
output time step, they may be incorrect values if the seasons have incomplete
time steps.
@EndDescription
@EndModule
......
......@@ -7,9 +7,9 @@
@Operators = setmissval setctomiss setmisstoc setrtomiss
@BeginDescription
This module sets part of a field to missing value or
missing values to a constant value. Which part of the
field is set depends on the actual operator name.
This module sets part of a field to missing value or missing values
to a constant value. Which part of the field is set depends on the
actual operator name.
@EndDescription
@EndModule
......
......@@ -37,7 +37,7 @@ o_2(1,x) = \frac{\sum\limits_{t \in S(x)}\left(i(t,x) - \frac{1}{\#S(x)} \sum\li
{\sum\limits_{t \in S(x)}\left(t - \frac{1}{\#S(x)} \sum\limits_{t' \in S(x)}t'\right)^{2}}
@EndDisplayMath
@EndifDoc
Thus the estimation for @math{a} is stored in @file{ofile1} and that for @math{b} is
stored in @file{ofile2}. To subtract the trend from the data see operator @mod{subtrend}.
Thus the estimation for @math{a} is stored in @file{ofile1} and that for @math{b} is stored
in @file{ofile2}. To subtract the trend from the data see operator @mod{subtrend}.
@EndDescription
@EndOperator
......@@ -9,10 +9,9 @@
@BeginDescription
Interpolate 3D variables on hybrid model level to pressure or height level.
The input file must contain the log. surface pressure (LSP/code152)
or the surface pressure (APS/code134).
To interpolate the temperature or the geopotential height,
the orography (GEOSP/code129) is also needed.
The input file must contain the log. surface pressure (LSP/code152) or the
surface pressure (APS/code134). To interpolate the temperature or the
geopotential height, the orography (GEOSP/code129) is also needed.
@EndDescription
@EndModule
......
......@@ -350,10 +350,7 @@ void *Invert(void *argument)
gridsize = vlistGridsizeMax(vlistID1);
array1 = (double *) malloc(gridsize*sizeof(double));
if ( operfunc1 == func_all || operfunc1 == func_fld )
array2 = (double *) malloc(gridsize*sizeof(double));
else
array2 = array1;
array2 = (double *) malloc(gridsize*sizeof(double));
tsID = 0;
while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
......@@ -377,6 +374,10 @@ void *Invert(void *argument)
else
invertLonData(array1, array2, gridID1);
}
else
{
memcpy(array2, array1, gridsize*sizeof(double));
}
streamDefRecord(streamID2, varID, levelID);
......
......@@ -7,25 +7,25 @@ static char *InfoHelp[] = {
" <operator> ifiles",
"",
"DESCRIPTION",
" This module writes information about the structure and ",
" contents of all input datasets to standard output.",
" The information displayed depends on the actual operator name.",
" This module writes information about the structure and contents ",
" of all input datasets to standard output. The information displayed ",
" depends on the actual operator name.",
"",
"OPERATORS",
" info Dataset information",
" Prints information and simple statistics for each field of all input datasets.",
" For each field the operator print in one line the:",
" Prints information and simple statistics for each field of all",
" input datasets. For each field the operator print in one line the:",
" - Date and Time",
" - Code number and Level",
" - Size of the grid and number of Missing values",
" - Minimum, Mean and Maximum \\",
" The mean value is computed without the use of area weights!",
" infov Dataset information",
" The same as operator info but using the name instead of the code number",
" to identify the variables.",
" The same as operator info but using the name instead of the code",
" number to identify the variables.",
" map Dataset information and simple map",
" Prints information, simple statistic and a map for each field of all input datasets.",
" The map will be printed only for fields on a rectangular grid.",
" Prints information, simple statistic and a map for each field of all input",
" datasets. The map will be printed only for fields on a rectangular grid.",
NULL
};
......@@ -64,8 +64,8 @@ static char *DiffHelp[] = {
" <operator> ifile1 ifile2",
"",
"DESCRIPTION",
" Compares the contents of two datasets field by field.",
" The input datasets must have the same structure and the fields must have ",
" Compares the contents of two datasets field by field. The input",
" datasets must have the same structure and the fields must have ",
" the same header information and dimensions.",
"",
"OPERATORS",
......@@ -176,8 +176,8 @@ static char *CopyHelp[] = {
" <operator> ifiles ofile",
"",
"DESCRIPTION",
" This module contains operators to copy or concatenate datasets.",
" Each input dataset must have the same variables with complete time steps.",
" This module contains operators to copy or concatenate datasets. Each",
" input dataset must have the same variables with complete time steps.",
"",
"OPERATORS",
" copy Copy datasets",
......@@ -455,8 +455,8 @@ static char *CondHelp[] = {
"",
"DESCRIPTION",
" This module conditional selects field elements from ifile2 and writes the ",
" result to ofile. The fields in ifile1 are handled as a mask. ",
" A value not equal to zero is treated as \"true\", zero is treated as \"false\".",
" result to ofile. The fields in ifile1 are handled as a mask. A value ",
" not equal to zero is treated as \"true\", zero is treated as \"false\".",
"",
"OPERATORS",
" ifthen If then",
......@@ -496,8 +496,8 @@ static char *CondcHelp[] = {
"",
"DESCRIPTION",
" This module creates fields with a constant value or missing value.",
" The fields in ifile1 are handled as a mask.",
" A value not equal to zero is treated as \"true\", zero is treated as \"false\".",
" The fields in ifile1 are handled as a mask. A value not equal ",
" to zero is treated as \"true\", zero is treated as \"false\".",
"",
"OPERATORS",
" ifthenc If then constant",
......@@ -565,8 +565,7 @@ static char *CompcHelp[] = {
"DESCRIPTION",
" This module compares all fields of dataset with a constant. The resulting",
" field is a mask with 1 if the comparison is true and 0 if the comparison ",
" is false. The type of the comparison depends on the",
" actual operator name.",
" is false. The type of the comparison depends on the actual operator name.",
"",
"OPERATORS",
" eqc Equal constant",
......@@ -885,9 +884,9 @@ static char *SetmissHelp[] = {
" setrtomiss,rmin,rmax ifile ofile",
"",
"DESCRIPTION",
" This module sets part of a field to missing value or",
" missing values to a constant value. Which part of the",
" field is set depends on the actual operator name.",
" This module sets part of a field to missing value or missing values",
" to a constant value. Which part of the field is set depends on the ",
" actual operator name.",
"",
"OPERATORS",
" setmissval Set a new missing value",
......@@ -1111,9 +1110,8 @@ static char *EnsstatHelp[] = {
"DESCRIPTION",
" This module computes statistical values over an ensemble of input files.",
" Depending on the actual operator name the minimum, maximum, sum, average",
" or standard deviation over all input files is written to ofile.",
" The date information for a time step in ofile is the date of the",
" first input file.",
" or standard deviation over all input files is written to ofile. The date ",
" information for a time step in ofile is the date of the first input file.",
"",
"OPERATORS",
" ensmin Ensemble minimum",
......@@ -1335,11 +1333,10 @@ static char *RunstatHelp[] = {
"",
"DESCRIPTION",
" This module computes running statistical values over a selected number",
" of time steps. Depending on the actual operator name the minimum, ",
" maximum, sum, average or standard deviation of a selected number ",
" of consecutive time steps read from ifile is written to ofile.",
" The date information in ofile is the date of the medium contributing ",
" time step in ifile.",
" of time steps. Depending on the actual operator name the minimum, maximum,",
" sum, average or standard deviation of a selected number of consecutive ",
" time steps read from ifile is written to ofile. The date information ",
" in ofile is the date of the medium contributing time step in ifile.",
"",
"OPERATORS",
" runmin Running minimum",
......@@ -1574,9 +1571,9 @@ static char *SeasstatHelp[] = {
" Depending on the actual operator name the minimum, maximum, sum, average ",
" or standard deviation of time steps of the same season is written to ofile.",
" The date information for a time step in ofile is the date of the last ",
" contributing time step in ifile. Be careful about the first and",
" the last output time step, they may be incorrect values if the seasons",
" have incomplete time steps.",
" contributing time step in ifile. Be careful about the first and the last ",
" output time step, they may be incorrect values if the seasons have incomplete ",
" time steps.",
"",
"OPERATORS",
" seasmin Seasonally minimum",
......@@ -1733,9 +1730,8 @@ static char *DetrendHelp[] = {
" detrend ifile ofile",
"",
"DESCRIPTION",
" Every time series in ifile is linearly detrended.",
" For every field element x only those time steps t belong to the sample",
" S(x), which have i(t,x) NE miss.",
" Every time series in ifile is linearly detrended. For every field element x ",
" only those time steps t belong to the sample S(x), which have i(t,x) NE miss.",
" This operator has to keep the fields of all time steps concurrently in the memory.",
" If not enough memory is available, use the operators trend and subtrend.",
NULL
......@@ -1753,8 +1749,8 @@ static char *TrendHelp[] = {
" N(a+b*t,S^2) with unknown a, b and S^2. This operator estimates the",
" parameter a and b. For every field element x only those time steps ",
" t belong to the sample S(x), which have i(t,x) NE miss.",
" Thus the estimation for a is stored in ofile1 and that for b is ",
" stored in ofile2. To subtract the trend from the data see operator subtrend.",
" Thus the estimation for a is stored in ofile1 and that for b is stored ",
" in ofile2. To subtract the trend from the data see operator subtrend.",
NULL
};
......@@ -1891,8 +1887,8 @@ static char *IntgridHelp[] = {
" This is the grid interpolation from PINGO.",
" For a detailed description of this interpolation method see PINGO.",
" intgridbil Bilinear grid interpolation",
" Performs a bilinear interpolation on all input fields. This is a faster",
" implementation than remapbil. Missing values are not supported yet!",
" Performs a bilinear interpolation on all input fields. This implementation",
" is a faster than remapbil. Missing values are not supported yet!",
"",
"PARAMETER",
" grid STRING Target grid description file or name",
......@@ -1909,10 +1905,9 @@ static char *IntvertHelp[] = {
"",
"DESCRIPTION",
" Interpolate 3D variables on hybrid model level to pressure or height level.",
" The input file must contain the log. surface pressure (LSP/code152)",
" or the surface pressure (APS/code134).",
" To interpolate the temperature or the geopotential height, ",
" the orography (GEOSP/code129) is also needed.",
" The input file must contain the log. surface pressure (LSP/code152) or the ",
" surface pressure (APS/code134). To interpolate the temperature or the ",
" geopotential height, the orography (GEOSP/code129) is also needed.",
"",
"OPERATORS",
" ml2pl Model to pressure level interpolation",
......@@ -2189,13 +2184,11 @@ static char *GradsdesHelp[] = {
" <operator> ifile",
"",
"DESCRIPTION",
" Creates a GrADS data descriptor file. Supported file formats",
" are GRIB, SERVICE, EXTRA and IEG. For GRIB files the GrADS map",
" file is also generated.",
" For SERVICE and EXTRA files the grid must be specified with",
" the CDO option '-g <grid>'.",
" This operator takes ifile in order to create filenames for",
" the descriptor (ifile.ctl) and the map (ifile.gmp) file.",
" Creates a GrADS data descriptor file. Supported file formats are GRIB,",
" SERVICE, EXTRA and IEG. For GRIB files the GrADS map file is also ",
" generated. For SERVICE and EXTRA files the grid must be specified with",
" the CDO option '-g <grid>'. This operator takes ifile in order to create ",
" filenames for the descriptor (ifile.ctl) and the map (ifile.gmp) file.",
"",
"OPERATORS",
" gradsdes GrADS data descriptor file",
......@@ -2233,10 +2226,9 @@ static char *MastrfuHelp[] = {
" mastrfu ifile ofile",
"",
"DESCRIPTION",
" This is a special operator for the post processing of",
" the atmospheric general circulation model ECHAM.",
" It computes the mass stream function (code number 272).",
" The input dataset must be a zonal mean of v-velocity",
" This is a special operator for the post processing of the atmospheric ",
" general circulation model ECHAM. It computes the mass stream function ",
" (code number 272). The input dataset must be a zonal mean of v-velocity",
" (code number 132) on pressure levels.",
NULL
};
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