Skip to content
GitLab
Menu
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
396adbf2
Commit
396adbf2
authored
Mar 23, 2015
by
Uwe Schulzweida
Browse files
vertint: skip vars on surface level
parent
13b8c309
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Vertstat.c
View file @
396adbf2
...
...
@@ -84,13 +84,7 @@ int getLayerThickness(int genbounds, int index, int zaxisID, int nlev, double *w
double
*
thickness
=
(
double
*
)
malloc
(
nlev
*
sizeof
(
double
));
zaxisInqLevels
(
zaxisID
,
levels
);
if
(
zaxisInqLbounds
(
zaxisID
,
NULL
)
&&
zaxisInqUbounds
(
zaxisID
,
NULL
)
)
{
status
=
1
;
zaxisInqLbounds
(
zaxisID
,
lbounds
);
zaxisInqUbounds
(
zaxisID
,
ubounds
);
}
else
if
(
genbounds
)
if
(
genbounds
)
{
status
=
2
;
lbounds
[
0
]
=
levels
[
0
];
...
...
@@ -102,6 +96,12 @@ int getLayerThickness(int genbounds, int index, int zaxisID, int nlev, double *w
ubounds
[
i
]
=
bound
;
}
}
else
if
(
zaxisInqLbounds
(
zaxisID
,
NULL
)
&&
zaxisInqUbounds
(
zaxisID
,
NULL
)
)
{
status
=
1
;
zaxisInqLbounds
(
zaxisID
,
lbounds
);
zaxisInqUbounds
(
zaxisID
,
ubounds
);
}
else
{
for
(
i
=
0
;
i
<
nlev
;
++
i
)
...
...
@@ -287,20 +287,21 @@ void *Vertstat(void *argument)
zaxisID
=
vars1
[
varID
].
zaxis
;
double
vweight
=
1
.
0
;
// if ( operatorID == VERTINT && !IS_SURFACE_LEVEL(zaxisID) )
if
(
operatorID
==
VERTINT
)
if
(
operatorID
==
VERTINT
&&
!
IS_SURFACE_LEVEL
(
zaxisID
)
)
{
for
(
int
index
=
0
;
index
<
nzaxis
;
++
index
)
if
(
vert
[
index
].
zaxisID
==
zaxisID
)
{
vweight
=
vert
[
index
].
weights
[
levelID
];
{
if
(
vert
[
index
].
status
==
0
&&
tsID
==
0
&&
levelID
==
0
)
{
char
varname
[
CDI_MAX_NAME
];
vlistInqVarName
(
vlistID1
,
varID
,
varname
);
cdoWarning
(
"Using constant vertical weights for variable %s!"
,
varname
);
}
else
{
vweight
=
vert
[
index
].
weights
[
levelID
];
}
break
;
}
...
...
@@ -334,7 +335,7 @@ void *Vertstat(void *argument)
field
.
grid
=
vars1
[
varID
].
grid
;
field
.
missval
=
vars1
[
varID
].
missval
;
if
(
vweight
<
1.
e3
0
)
farcmul
(
&
field
,
vweight
);
if
(
operatorID
==
VERTINT
&&
IS_NOT_EQUAL
(
vweight
,
1
.
0
)
)
farcmul
(
&
field
,
vweight
);
if
(
field
.
nmiss
>
0
||
samp1
[
varID
].
ptr
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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