Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
8c484501
Commit
8c484501
authored
Aug 05, 2015
by
Uwe Schulzweida
Browse files
ap2pl: added docu
parent
b39a9f55
Changes
13
Hide whitespace changes
Inline
Side-by-side
.gitattributes
View file @
8c484501
...
...
@@ -241,6 +241,7 @@ doc/tex/mod/Trend -text
doc/tex/mod/Vardup -text
doc/tex/mod/Vargen -text
doc/tex/mod/Vertint -text
doc/tex/mod/Vertintap -text
doc/tex/mod/Vertstat -text
doc/tex/mod/Wct -text
doc/tex/mod/Wind -text
...
...
ChangeLog
View file @
8c484501
...
...
@@ -3,6 +3,10 @@
* using CDI library version 1.7.0
* Version 1.7.0 released
2015-08-05 Uwe Schulzweida
* ap2pl: changed to generalized height
2015-07-27 Uwe Schulzweida
* removed configure option --with-jasper
...
...
NEWS
View file @
8c484501
...
...
@@ -8,6 +8,7 @@ Version 1.7.0 (28 October 2015):
* collgrid: added support for curvilinear grids
New operators:
* setmisstonn: Set missing value to nearest neightbor
* ap2pl: Interpolate 3D variables on hybrid sigma height coordinates to pressure levels
* vertstd1: Vertical standard deviation [Divisor is (n-1)]
* vertvar1: Vertical variance [Divisor is (n-1)]
* seasvar1: Seasonal variance [Divisor is (n-1)]
...
...
OPERATORS
View file @
8c484501
...
...
@@ -462,6 +462,7 @@ Operator catalog:
Remapeta remapeta Remap vertical hybrid level
Vertint ml2pl Model to pressure level interpolation
Vertint ml2hl Model to height level interpolation
Vertintap ap2pl Model to pressure level interpolation
Intlevel intlevel Linear level interpolation
Intlevel3d intlevel3d Linear level interpolation onto a 3d vertical coordinate
Intlevel3d intlevelx3d like intlevel3d but with extrapolation
...
...
config/default
View file @
8c484501
...
...
@@ -42,7 +42,7 @@ case "${HOSTNAME}" in
if
test
"
$COMP
"
=
icc
;
then
${
CONFPATH
}
configure
\
$CDOLIBS
\
CC
=
icc
CFLAGS
=
"-g -Wall -O2 -
vec
-report
2
-march=native"
CXX
=
icpc
CXXFLAGS
=
$CFLAGS
CC
=
icc
CFLAGS
=
"-g -Wall -O2 -
qopt
-report
=5
-march=native"
CXX
=
icpc
elif
test
"
$COMP
"
=
clang
;
then
${
CONFPATH
}
configure
\
$CDOLIBS
\
...
...
@@ -68,7 +68,8 @@ case "${HOSTNAME}" in
# --with-proj=/opt/local \
# --with-cmor=/Users/m214003/work/CMOR \
# --with-curl=/opt/local"
CDOLIBS
=
"--with-fftw3
\
CDOLIBS
=
"--enable-nearpt3
\
--with-fftw3
\
--with-grib_api=
$HOME
/local/gribapi-1.13.0
\
--with-netcdf=
$HOME
/local
\
--with-hdf5=
$HOME
/local
\
...
...
@@ -77,7 +78,7 @@ case "${HOSTNAME}" in
if
test
"
$COMP
"
=
icc
;
then
${
CONFPATH
}
configure
--prefix
=
$HOME
/local
\
$CDOLIBS
\
CC
=
icc
CFLAGS
=
"-g -Wall -O2 -qopt-report=5 -march=native
-openmp"
CC
=
icc
CFLAGS
=
"-g -Wall -O2 -qopt-report=5 -march=native
"
CXX
=
icpc
elif
test
"
$COMP
"
=
clang
;
then
${
CONFPATH
}
configure
\
$CDOLIBS
\
...
...
doc/cdo_refcard.pdf
View file @
8c484501
No preview for this file type
doc/tex/Modules
View file @
8c484501
...
...
@@ -97,6 +97,7 @@ Genweights Interpolation
Remap Interpolation
Remapeta Interpolation
Vertint Interpolation
Vertintap Interpolation
Intlevel Interpolation
Intlevel3d Interpolation
Inttime Interpolation
...
...
doc/tex/mod/Vertint
View file @
8c484501
@BeginModule
@NewPage
@Name =
Intvert
@Name =
Vertintml
@Title = Vertical interpolation
@Section = Interpolation
@Class = Interpolation
...
...
@@ -8,7 +8,7 @@
@Operators = ml2pl ml2hl
@BeginDescription
Interpolate 3D variables on hybrid
model
level
s
to pressure or height levels.
Interpolate 3D variables on hybrid
sigma pressure
level to pressure or height levels.
The input file should contain the log. surface pressure or the surface pressure.
To interpolate the temperature, the surface geopotential is also needed.
The pressure, temperature, and surface geopotential are identified by their GRIB1 code number
...
...
@@ -26,7 +26,7 @@ to extrapolate missing values. This operator requires all variables on the same
@Parameter = plevels
@BeginDescription
Interpolates 3D variables on hybrid
model
level
s
to pressure level
s
.
Interpolates 3D variables on hybrid
sigma pressure
level to pressure level.
@EndDescription
@EndOperator
...
...
@@ -36,7 +36,7 @@ Interpolates 3D variables on hybrid model levels to pressure levels.
@Parameter = hlevels
@BeginDescription
Interpolates 3D variables on hybrid
model
level
s
to height level
s
.
Interpolates 3D variables on hybrid
sigma pressure
level to height level.
The procedure is the same as for the operator @oper{mh2pl} except for
the pressure levels being calculated from the heights by:
@math{plevel = 101325*exp(hlevel/-7000)}
...
...
doc/tex/mod/Vertintap
0 → 100644
View file @
8c484501
@BeginModule
@Name = Vertintap
@Title = Vertical interpolation
@Section = Interpolation
@Class = Interpolation
@Arguments = ifile ofile
@Operators = ap2pl
@BeginDescription
Interpolate 3D variables on hybrid sigma height coordinates to pressure levels.
The input file must contain the 3D air pressure. The air pressure is identified
by the netCDF CF standard name air_pressure.
This operator requires all variables on the same horizontal grid.
@EndDescription
@EndModule
@BeginOperator_ap2pl
@Title = Model to pressure level interpolation
@Parameter = plevels
@EndOperator
@BeginParameter
@Item = plevels
FLOAT Pressure levels in pascal
@EndParameter
@BeginNote
This is a specific implememtation for netCDF files from the ICON model, it may not work with data from other sources.
@EndNote
@BeginExample
To interpolate 3D variables on hybrid sigma height level to pressure levels of 925, 850, 500 and 200 hPa use:
@BeginVerbatim
cdo ap2pl,92500,85000,50000,20000 ifile ofile
@EndVerbatim
@EndExample
src/Vertintap.c
View file @
8c484501
...
...
@@ -32,10 +32,40 @@
#include
"list.h"
#include
"stdnametable.h"
static
int
is_height_axis
(
int
zaxisID
,
int
nlevel
)
{
int
isheight
=
FALSE
;
if
(
nlevel
>
1
)
{
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_GENERIC
)
{
char
units
[
CDI_MAX_NAME
];
char
stdname
[
CDI_MAX_NAME
];
// *units = 0;
// *stdname = 0;
zaxisInqUnits
(
zaxisID
,
units
);
zaxisInqStdname
(
zaxisID
,
stdname
);
printf
(
"stdname %s %s
\n
"
,
stdname
,
units
);
if
(
strcmp
(
stdname
,
"height"
)
==
0
&&
*
units
==
0
)
isheight
=
TRUE
;
}
}
return
isheight
;
}
static
int
is_hybrid_axis
(
int
zaxisID
,
int
nlevel
)
{
int
ishybrid
=
FALSE
;
if
(
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
||
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID_HALF
)
&&
nlevel
>
1
)
ishybrid
=
TRUE
;
return
ishybrid
;
}
void
*
Vertintap
(
void
*
argument
)
{
enum
{
ECHAM_MODE
,
WMO_MODE
};
enum
{
func_pl
,
func_hl
};
enum
{
type_lin
,
type_log
};
int
recID
,
nrecs
;
...
...
@@ -43,7 +73,7 @@ void *Vertintap(void *argument)
int
varID
,
levelID
;
int
zaxisIDp
,
zaxisIDh
=
-
1
,
nzaxis
;
int
gridID
,
zaxisID
;
int
nplev
,
nhlev
=
0
,
nhlevf
=
0
,
nhlevh
=
0
,
nlevel
;
int
nhlev
=
0
,
nhlevf
=
0
,
nhlevh
=
0
,
nlevel
;
int
*
vert_index
=
NULL
;
int
nvct
;
int
apressID
=
-
1
,
dpressID
=
-
1
;
...
...
@@ -55,12 +85,11 @@ void *Vertintap(void *argument)
char
stdname
[
CDI_MAX_NAME
];
double
minval
,
maxval
;
double
missval
;
double
*
plev
=
NULL
,
*
vct
=
NULL
;
double
*
vct
=
NULL
;
double
*
single1
,
*
single2
;
double
*
ps_prog
=
NULL
,
*
full_press
=
NULL
,
*
dpress
=
NULL
;
double
*
hyb_press
=
NULL
;
int
Extrapolate
=
0
;
int
lhavevct
;
int
mono_level
;
LIST
*
flist
=
listNew
(
FLT_LIST
);
...
...
@@ -77,17 +106,13 @@ void *Vertintap(void *argument)
if
(
operatorID
==
AP2PL
||
operatorID
==
AP2PL_LP
)
{
char
*
envstr
;
envstr
=
getenv
(
"EXTRAPOLATE"
);
char
*
envstr
=
getenv
(
"EXTRAPOLATE"
);
if
(
envstr
)
if
(
envstr
&&
isdigit
((
int
)
envstr
[
0
])
)
{
if
(
isdigit
((
int
)
envstr
[
0
])
)
{
Extrapolate
=
atoi
(
envstr
);
if
(
Extrapolate
==
1
)
cdoPrint
(
"Extrapolation of missing values enabled!"
);
}
Extrapolate
=
atoi
(
envstr
);
if
(
Extrapolate
==
1
)
cdoPrint
(
"Extrapolation of missing values enabled!"
);
}
}
else
if
(
operatorID
==
AP2PLX
||
operatorID
==
AP2PLX_LP
)
...
...
@@ -97,8 +122,25 @@ void *Vertintap(void *argument)
operatorInputArg
(
cdoOperatorEnter
(
operatorID
));
nplev
=
args2fltlist
(
operatorArgc
(),
operatorArgv
(),
flist
);
plev
=
(
double
*
)
listArrayPtr
(
flist
);
int
nplev
=
0
;
double
*
plev
=
NULL
;
if
(
operatorArgc
()
==
1
&&
strcmp
(
operatorArgv
()[
0
],
"default"
)
==
0
)
{
/*
double stdlev[] = {100000, 92500, 85000, 77500, 70000, 60000, 50000, 40000, 30000, 25000, 20000,
15000, 10000, 7000, 5000, 3000, 2000, 1000, 700, 500, 300, 200, 100, 50, 20, 10};
*/
double
stdlev
[]
=
{
100000
,
92500
,
85000
,
70000
,
60000
,
50000
,
40000
,
30000
,
25000
,
20000
,
15000
,
10000
,
7000
,
5000
,
3000
,
2000
,
1000
};
nplev
=
sizeof
(
stdlev
)
/
sizeof
(
*
stdlev
);
plev
=
(
double
*
)
malloc
(
nplev
*
sizeof
(
double
));
for
(
i
=
0
;
i
<
nplev
;
++
i
)
plev
[
i
]
=
stdlev
[
i
];
}
else
{
nplev
=
args2fltlist
(
operatorArgc
(),
operatorArgv
(),
flist
);
plev
=
(
double
*
)
listArrayPtr
(
flist
);
}
int
streamID1
=
streamOpenRead
(
cdoStreamName
(
0
));
...
...
@@ -118,7 +160,42 @@ void *Vertintap(void *argument)
zaxisDefLevels
(
zaxisIDp
,
plev
);
nzaxis
=
vlistNzaxis
(
vlistID1
);
lhavevct
=
FALSE
;
int
lheight
=
FALSE
;
for
(
i
=
0
;
i
<
nzaxis
;
i
++
)
{
mono_level
=
TRUE
;
zaxisID
=
vlistZaxis
(
vlistID1
,
i
);
nlevel
=
zaxisInqSize
(
zaxisID
);
if
(
is_height_axis
(
zaxisID
,
nlevel
)
)
{
double
*
level
=
(
double
*
)
malloc
(
nlevel
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID
,
level
);
int
l
;
for
(
l
=
0
;
l
<
nlevel
;
l
++
)
{
if
(
(
l
+
1
)
!=
(
int
)
(
level
[
l
]
+
0
.
5
)
)
break
;
}
if
(
l
==
nlevel
)
mono_level
=
TRUE
;
free
(
level
);
}
if
(
is_height_axis
(
zaxisID
,
nlevel
)
&&
mono_level
)
{
lheight
=
TRUE
;
zaxisIDh
=
zaxisID
;
nhlev
=
nlevel
;
nhlevf
=
nhlev
;
nhlevh
=
nhlevf
+
1
;
vlistChangeZaxisIndex
(
vlistID2
,
i
,
zaxisIDp
);
break
;
}
}
if
(
!
lheight
)
{
// old version, not needed anymore!!
int
lhavevct
=
FALSE
;
for
(
i
=
0
;
i
<
nzaxis
;
i
++
)
{
/* mono_level = FALSE; */
...
...
@@ -126,13 +203,11 @@ void *Vertintap(void *argument)
zaxisID
=
vlistZaxis
(
vlistID1
,
i
);
nlevel
=
zaxisInqSize
(
zaxisID
);
if
(
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
||
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID_HALF
)
&&
nlevel
>
1
)
if
(
is_hybrid_axis
(
zaxisID
,
nlevel
)
)
{
double
*
level
;
int
l
;
level
=
(
double
*
)
malloc
(
nlevel
*
sizeof
(
double
));
double
*
level
=
(
double
*
)
malloc
(
nlevel
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID
,
level
);
int
l
;
for
(
l
=
0
;
l
<
nlevel
;
l
++
)
{
if
(
(
l
+
1
)
!=
(
int
)
(
level
[
l
]
+
0
.
5
)
)
break
;
...
...
@@ -141,8 +216,7 @@ void *Vertintap(void *argument)
free
(
level
);
}
if
(
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
||
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID_HALF
)
&&
nlevel
>
1
&&
mono_level
)
if
(
is_hybrid_axis
(
zaxisID
,
nlevel
)
&&
mono_level
)
{
nvct
=
zaxisInqVctSize
(
zaxisID
);
if
(
nlevel
==
(
nvct
/
2
-
1
)
)
...
...
@@ -189,7 +263,8 @@ void *Vertintap(void *argument)
}
}
}
}
int
nvars
=
vlistNvars
(
vlistID1
);
int
vars
[
nvars
];
...
...
@@ -198,16 +273,16 @@ void *Vertintap(void *argument)
int
*
varnmiss
[
nvars
];
int
varinterp
[
nvars
];
int
maxlev
=
nhlevh
>
nplev
?
nhlevh
:
nplev
;
int
maxlev
=
nhlevh
>
nplev
?
nhlevh
:
nplev
;
if
(
Extrapolate
==
0
)
pnmiss
=
(
int
*
)
malloc
(
nplev
*
sizeof
(
int
));
pnmiss
=
(
int
*
)
malloc
(
nplev
*
sizeof
(
int
));
// check levels
if
(
zaxisIDh
!=
-
1
)
{
int
nlev
=
zaxisInqSize
(
zaxisIDh
);
if
(
nlev
!=
nhlev
)
cdoAbort
(
"Internal error, wrong num
n
er of h
ybrid
level!"
);
if
(
nlev
!=
nhlev
)
cdoAbort
(
"Internal error, wrong num
b
er of h
eight
level!"
);
double
levels
[
nlev
];
zaxisInqLevels
(
zaxisIDh
,
levels
);
...
...
@@ -223,13 +298,13 @@ void *Vertintap(void *argument)
if
(
zaxisIDh
!=
-
1
&&
gridsize
>
0
)
{
vert_index
=
(
int
*
)
malloc
(
gridsize
*
nplev
*
sizeof
(
int
));
ps_prog
=
(
double
*
)
malloc
(
gridsize
*
sizeof
(
double
));
full_press
=
(
double
*
)
malloc
(
gridsize
*
nhlevf
*
sizeof
(
double
));
dpress
=
(
double
*
)
malloc
(
gridsize
*
nhlevf
*
sizeof
(
double
));
vert_index
=
(
int
*
)
malloc
(
gridsize
*
nplev
*
sizeof
(
int
));
ps_prog
=
(
double
*
)
malloc
(
gridsize
*
sizeof
(
double
));
full_press
=
(
double
*
)
malloc
(
gridsize
*
nhlevf
*
sizeof
(
double
));
dpress
=
(
double
*
)
malloc
(
gridsize
*
nhlevf
*
sizeof
(
double
));
}
else
cdoWarning
(
"No 3D variable with
hybrid sigma pressure coordinate
found!"
);
cdoWarning
(
"No 3D variable with
generalized height level
found!"
);
if
(
operfunc
==
func_hl
)
{
...
...
@@ -261,31 +336,23 @@ void *Vertintap(void *argument)
else
if
(
strcmp
(
stdname
,
var_stdname
(
pressure_thickness
))
==
0
)
dpressID
=
varID
;
else
if
(
strcmp
(
stdname
,
var_stdname
(
air_temperature
))
==
0
)
tempID
=
varID
;
if
(
gridInqType
(
gridID
)
==
GRID_SPECTRAL
&&
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
)
cdoAbort
(
"Spectral data on model level unsupported!"
);
if
(
gridInqType
(
gridID
)
==
GRID_SPECTRAL
)
cdoAbort
(
"Spectral data unsupported!"
);
vardata1
[
varID
]
=
(
double
*
)
malloc
(
gridsize
*
nlevel
*
sizeof
(
double
));
vardata1
[
varID
]
=
(
double
*
)
malloc
(
gridsize
*
nlevel
*
sizeof
(
double
));
if
(
zaxisID
==
zaxisIDh
||
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
&&
zaxisIDh
!=
-
1
&&
(
nlevel
==
nhlevh
||
nlevel
==
nhlevf
))
)
if
(
zaxisID
==
zaxisIDh
)
{
varinterp
[
varID
]
=
TRUE
;
vardata2
[
varID
]
=
(
double
*
)
malloc
(
gridsize
*
nplev
*
sizeof
(
double
));
varnmiss
[
varID
]
=
(
int
*
)
malloc
(
maxlev
*
sizeof
(
int
));
vardata2
[
varID
]
=
(
double
*
)
malloc
(
gridsize
*
nplev
*
sizeof
(
double
));
varnmiss
[
varID
]
=
(
int
*
)
malloc
(
maxlev
*
sizeof
(
int
));
memset
(
varnmiss
[
varID
],
0
,
maxlev
*
sizeof
(
int
));
}
else
{
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
&&
zaxisIDh
!=
-
1
&&
nlevel
>
1
)
cdoWarning
(
"Parameter %d has wrong number of levels, skipped! (param=%s nlevel=%d)"
,
varID
+
1
,
paramstr
,
nlevel
);
varinterp
[
varID
]
=
FALSE
;
vardata2
[
varID
]
=
vardata1
[
varID
];
varnmiss
[
varID
]
=
(
int
*
)
malloc
(
nlevel
*
sizeof
(
int
));
varnmiss
[
varID
]
=
(
int
*
)
malloc
(
nlevel
*
sizeof
(
int
));
}
}
...
...
@@ -297,7 +364,7 @@ void *Vertintap(void *argument)
if
(
tempID
!=
-
1
)
cdoPrint
(
" %s"
,
var_stdname
(
air_temperature
));
}
if
(
apressID
==
-
1
)
cdoAbort
(
"%s not found!"
,
var_stdname
(
air_pressure
));
if
(
apressID
==
-
1
)
cdoAbort
(
"%s not found!"
,
var_stdname
(
air_pressure
));
for
(
varID
=
0
;
varID
<
nvars
;
++
varID
)
{
...
...
@@ -312,9 +379,9 @@ void *Vertintap(void *argument)
int
tsID
=
0
;
while
(
(
nrecs
=
streamInqTimestep
(
streamID1
,
tsID
))
)
{
for
(
varID
=
0
;
varID
<
nvars
;
++
varID
)
vars
[
varID
]
=
FALSE
;
for
(
varID
=
0
;
varID
<
nvars
;
++
varID
)
{
vars
[
varID
]
=
FALSE
;
nlevel
=
zaxisInqSize
(
vlistInqVarZaxis
(
vlistID1
,
varID
));
for
(
levelID
=
0
;
levelID
<
nlevel
;
levelID
++
)
varnmiss
[
varID
][
levelID
]
=
0
;
...
...
@@ -402,7 +469,7 @@ void *Vertintap(void *argument)
{
param
=
vlistInqVarParam
(
vlistID1
,
varID
);
cdiParamToString
(
param
,
paramstr
,
sizeof
(
paramstr
));
cdoAbort
(
"Number of
hybrid
level differ from full/half level (param=%s)!"
,
paramstr
);
cdoAbort
(
"Number of
generalized height
level differ from full/half level (param=%s)!"
,
paramstr
);
}
for
(
levelID
=
0
;
levelID
<
nlevel
;
levelID
++
)
...
...
@@ -449,11 +516,10 @@ void *Vertintap(void *argument)
}
if
(
pnmiss
)
free
(
pnmiss
);
if
(
ps_prog
)
free
(
ps_prog
);
if
(
vert_index
)
free
(
vert_index
);
if
(
full_press
)
free
(
full_press
);
if
(
dpress
)
free
(
dpress
);
if
(
dpress
)
free
(
dpress
);
if
(
vct
)
free
(
vct
);
listDelete
(
flist
);
...
...
src/Vertintml.c
View file @
8c484501
...
...
@@ -41,7 +41,6 @@ void *Vertintml(void *argument)
enum
{
ECHAM_MODE
,
WMO_MODE
};
enum
{
func_pl
,
func_hl
};
enum
{
type_lin
,
type_log
};
int
gridsize
;
int
recID
,
nrecs
;
int
i
,
k
,
offset
;
int
tsID
,
varID
,
levelID
;
...
...
@@ -66,7 +65,6 @@ void *Vertintml(void *argument)
double
*
sgeopot
=
NULL
,
*
ps_prog
=
NULL
,
*
full_press
=
NULL
,
*
half_press
=
NULL
;
double
*
hyb_press
=
NULL
;
int
Extrapolate
=
0
;
int
lhavevct
;
int
mono_level
;
int
instNum
,
tableNum
;
int
useTable
;
...
...
@@ -90,17 +88,13 @@ void *Vertintml(void *argument)
if
(
operatorID
==
ML2PL
||
operatorID
==
ML2HL
||
operatorID
==
ML2PL_LP
||
operatorID
==
ML2HL_LP
)
{
char
*
envstr
;
envstr
=
getenv
(
"EXTRAPOLATE"
);
char
*
envstr
=
getenv
(
"EXTRAPOLATE"
);
if
(
envstr
)
if
(
envstr
&&
isdigit
((
int
)
envstr
[
0
])
)
{
if
(
isdigit
((
int
)
envstr
[
0
])
)
{
Extrapolate
=
atoi
(
envstr
);
if
(
Extrapolate
==
1
)
cdoPrint
(
"Extrapolation of missing values enabled!"
);
}
Extrapolate
=
atoi
(
envstr
);
if
(
Extrapolate
==
1
)
cdoPrint
(
"Extrapolation of missing values enabled!"
);
}
}
else
if
(
operatorID
==
ML2PLX
||
operatorID
==
ML2HLX
||
operatorID
==
ML2PLX_LP
||
operatorID
==
ML2HLX_LP
)
...
...
@@ -120,7 +114,7 @@ void *Vertintml(void *argument)
*/
double
stdlev
[]
=
{
100000
,
92500
,
85000
,
70000
,
60000
,
50000
,
40000
,
30000
,
25000
,
20000
,
15000
,
10000
,
7000
,
5000
,
3000
,
2000
,
1000
};
nplev
=
sizeof
(
stdlev
)
/
sizeof
(
*
stdlev
);
nplev
=
sizeof
(
stdlev
)
/
sizeof
(
*
stdlev
);
plev
=
(
double
*
)
malloc
(
nplev
*
sizeof
(
double
));
for
(
i
=
0
;
i
<
nplev
;
++
i
)
plev
[
i
]
=
stdlev
[
i
];
}
...
...
@@ -139,7 +133,7 @@ void *Vertintml(void *argument)
int
taxisID2
=
taxisDuplicate
(
taxisID1
);
vlistDefTaxis
(
vlistID2
,
taxisID2
);
gridsize
=
vlist_check_gridsize
(
vlistID1
);
int
gridsize
=
vlist_check_gridsize
(
vlistID1
);
if
(
operfunc
==
func_hl
)
zaxisIDp
=
zaxisCreate
(
ZAXIS_HEIGHT
,
nplev
);
...
...
@@ -148,7 +142,7 @@ void *Vertintml(void *argument)
zaxisDefLevels
(
zaxisIDp
,
plev
);
nzaxis
=
vlistNzaxis
(
vlistID1
);
lhavevct
=
FALSE
;
int
lhavevct
=
FALSE
;
for
(
i
=
0
;
i
<
nzaxis
;
i
++
)
{
/* mono_level = FALSE; */
...
...
@@ -159,10 +153,9 @@ void *Vertintml(void *argument)
if
(
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
||
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID_HALF
)
&&
nlevel
>
1
)
{
double
*
level
;
int
l
;
level
=
(
double
*
)
malloc
(
nlevel
*
sizeof
(
double
));
double
*
level
=
(
double
*
)
malloc
(
nlevel
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID
,
level
);
int
l
;
for
(
l
=
0
;
l
<
nlevel
;
l
++
)
{
if
(
(
l
+
1
)
!=
(
int
)
(
level
[
l
]
+
0
.
5
)
)
break
;
...
...
@@ -289,7 +282,7 @@ void *Vertintml(void *argument)
if
(
zaxisIDh
!=
-
1
)
{
int
nlev
=
zaxisInqSize
(
zaxisIDh
);
if
(
nlev
!=
nhlev
)
cdoAbort
(
"Internal error, wrong num
n
er of hybrid level!"
);
if
(
nlev
!=
nhlev
)
cdoAbort
(
"Internal error, wrong num
b
er of hybrid level!"
);
double
levels
[
nlev
];
zaxisInqLevels
(
zaxisIDh
,
levels
);
...
...
src/modules.c
View file @
8c484501
...
...
@@ -726,8 +726,8 @@ static modules_t Modules[] =
{
Vardup
,
NULL
,
VardupOperators
,
CDI_REAL
,
1
,
1
},
{
Vargen
,
VargenHelp
,
VargenOperators
,
CDI_REAL
,
0
,
1
},
{
Varrms
,
NULL
,
VarrmsOperators
,
CDI_REAL
,
2
,
1
},
{
Vertintml
,
Intvert
Help
,
VertintmlOperators
,
CDI_REAL
,
1
,
1
},
{
Vertintap
,
NULL
,
VertintapOperators
,
CDI_REAL
,
1
,
1
},
{
Vertintml
,
Vertintml
Help
,
VertintmlOperators
,
CDI_REAL
,
1
,
1
},
{
Vertintap
,
VertintapHelp
,
VertintapOperators
,
CDI_REAL
,
1
,
1
},
{
Vertstat
,
VertstatHelp
,
VertstatOperators
,
CDI_REAL
,
1
,
1
},
{
Vertcum
,
NULL
,
VertcumOperators
,
CDI_REAL
,
1
,
1
},
{
Vertwind
,
NULL
,
VertwindOperators
,
CDI_REAL
,
1
,
1
},
...
...
src/operator_help.h
View file @
8c484501
...
...
@@ -3618,7 +3618,7 @@ static char *RemapetaHelp[] = {
NULL
};
static
char
*
Intvert
Help
[]
=
{
static
char
*
Vertintml
Help
[]
=
{
"NAME"
,
" ml2pl, ml2hl - Vertical interpolation"
,
""
,
...
...
@@ -3627,7 +3627,7 @@ static char *IntvertHelp[] = {
" ml2hl,hlevels ifile ofile"
,
""
,
"DESCRIPTION"
,
" Interpolate 3D variables on hybrid
model
level
s
to pressure or height levels."
,
" Interpolate 3D variables on hybrid
sigma pressure
level to pressure or height levels."
,
" The input file should contain the log. surface pressure or the surface pressure."
,
" To interpolate the temperature, the surface geopotential is also needed."
,
" The pressure, temperature, and surface geopotential are identified by their GRIB1 code number"
,
...
...
@@ -3639,9 +3639,9 @@ static char *IntvertHelp[] = {
""
,
"OPERATORS"
,
" ml2pl Model to pressure level interpolation"
,
" Interpolates 3D variables on hybrid
model
level
s
to pressure level
s
."
,
" Interpolates 3D variables on hybrid
sigma pressure
level to pressure level."
,
" ml2hl Model to height level interpolation"
,
" Interpolates 3D variables on hybrid
model
level
s
to height level
s
."
,
" Interpolates 3D variables on hybrid
sigma pressure
level to height level."
,
" The procedure is the same as for the operator mh2pl except for"
,
" the pressure levels being calculated from the heights by:"
,
" plevel = 101325*exp(hlevel/-7000)"
,
...
...
@@ -3672,6 +3672,27 @@ static char *IntvertHelp[] = {
NULL
};
static
char
*
VertintapHelp
[]
=
{
"NAME"
,
" ap2pl - Vertical interpolation"
,
""
,
"SYNOPSIS"
,
" ap2pl,plevels ifile ofile"
,
""
,
"DESCRIPTION"
,
" Interpolate 3D variables on hybrid sigma height coordinates to pressure levels."
,
" The input file must contain the 3D air pressure. The air pressure is identified"
,
" by the netCDF CF standard name air_pressure."
,
" This operator requires all variables on the same horizontal grid."
,
""
,
"PARAMETER"
,
" plevels FLOAT Pressure levels in pascal"
,
""
,
"NOTE"
,
" This is a specific implememtation for netCDF files from the ICON model, it may not work with data from other sources."
,
NULL
};
static
char
*
IntlevelHelp
[]
=
{
"NAME"
,
" intlevel - Linear level interpolation"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment