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
c522cb6a
Commit
c522cb6a
authored
Aug 17, 2015
by
Uwe Schulzweida
Browse files
vertintml: use psname if available
parent
2453fb4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Select.c
View file @
c522cb6a
...
...
@@ -464,7 +464,7 @@ void par_check_word_flag(int npar, char **parlist, int *flaglist, const char *tx
}
int
vlist_get_psvarid
(
int
nvars
,
int
vlistID
,
int
zaxisID
)
int
vlist_get_psvarid
(
int
vlistID
,
int
zaxisID
)
{
int
psvarid
=
-
1
;
char
name
[
CDI_MAX_NAME
];
...
...
@@ -474,6 +474,7 @@ int vlist_get_psvarid(int nvars, int vlistID, int zaxisID)
if
(
psname
[
0
]
)
{
int
nvars
=
vlistNvars
(
vlistID
);
for
(
int
varID
=
0
;
varID
<
nvars
;
++
varID
)
{
vlistInqVarName
(
vlistID
,
varID
,
name
);
...
...
@@ -483,6 +484,8 @@ int vlist_get_psvarid(int nvars, int vlistID, int zaxisID)
break
;
}
}
if
(
cdoVerbose
&&
psvarid
==
-
1
)
cdoWarning
(
"Surface pressure variable not found - %s"
,
psname
);
}
return
psvarid
;
...
...
@@ -718,7 +721,7 @@ void *Select(void *argument)
zaxisID
=
vlistInqVarZaxis
(
vlistID1
,
varID
);
if
(
zaxisInqType
(
zaxisID
)
==
ZAXIS_HYBRID
)
{
int
psvarid
=
vlist_get_psvarid
(
nvars
,
vlistID1
,
zaxisID
);
int
psvarid
=
vlist_get_psvarid
(
vlistID1
,
zaxisID
);
if
(
psvarid
!=
-
1
&&
!
vars
[
psvarid
]
)
vars
[
psvarid
]
=
TRUE
;
}
}
...
...
src/Vertintml.c
View file @
c522cb6a
...
...
@@ -70,8 +70,6 @@ void *Vertintml(void *argument)
int
useTable
;
gribcode_t
gribcodes
=
{
0
};
LIST
*
flist
=
listNew
(
FLT_LIST
);
char
psname
[
CDI_MAX_NAME
];
psname
[
0
]
=
0
;
cdoInitialize
(
argument
);
...
...
@@ -266,10 +264,11 @@ void *Vertintml(void *argument)
}
}
int
psvarID
=
-
1
;
int
linvertvct
=
FALSE
;
if
(
lhavevct
&&
nvct
&&
nvct
%
2
==
0
)
{
zaxisInqPsName
(
zaxisID
,
psname
);
psvarID
=
vlist_get_psvarid
(
vlistID1
,
zaxisIDh
);
for
(
i
=
nvct
/
2
+
1
;
i
<
nvct
;
i
++
)
if
(
vct
[
i
]
>
vct
[
i
-
1
]
)
break
;
...
...
@@ -278,7 +277,6 @@ void *Vertintml(void *argument)
}
if
(
cdoVerbose
)
cdoPrint
(
"linvertvct = %d"
,
linvertvct
);
if
(
cdoVerbose
)
cdoPrint
(
"psname = %s"
,
psname
);
if
(
linvertvct
)
{
...
...
@@ -501,7 +499,9 @@ void *Vertintml(void *argument)
cdoAbort
(
"Temperature not found, needed for vertical interpolation of geopotheight!"
);
presID
=
lnpsID
;
if
(
zaxisIDh
!=
-
1
&&
lnpsID
==
-
1
)
if
(
psvarID
!=
-
1
)
presID
=
psvarID
;
if
(
zaxisIDh
!=
-
1
&&
presID
==
-
1
)
{
if
(
psID
==
-
1
)
cdoAbort
(
"%s not found!"
,
var_stdname
(
surface_air_pressure
));
...
...
@@ -511,10 +511,11 @@ void *Vertintml(void *argument)
if
(
cdoVerbose
)
{
vlistInqVarName
(
vlistID1
,
presID
,
varname
);
if
(
presID
==
lnpsID
)
cdoPrint
(
"using LOG(%s)"
,
var_stdname
(
surface_air_pressure
)
);
cdoPrint
(
"using LOG(%s)
from %s
"
,
var_stdname
(
surface_air_pressure
)
,
varname
);
else
cdoPrint
(
"using %s"
,
var_stdname
(
surface_air_pressure
));
cdoPrint
(
"using
%s from
%s"
,
var_stdname
(
surface_air_pressure
)
,
varname
);
}
// check VCT
...
...
@@ -585,10 +586,10 @@ void *Vertintml(void *argument)
}
}
if
(
lnp
sID
!
=
-
1
)
if
(
pre
sID
=
=
lnpsID
)
for
(
i
=
0
;
i
<
gridsize
;
i
++
)
ps_prog
[
i
]
=
exp
(
vardata1
[
lnpsID
][
i
]);
else
if
(
psID
!=
-
1
)
memcpy
(
ps_prog
,
vardata1
[
psID
],
gridsize
*
sizeof
(
double
));
else
if
(
p
re
sID
!=
-
1
)
memcpy
(
ps_prog
,
vardata1
[
p
re
sID
],
gridsize
*
sizeof
(
double
));
/* check range of ps_prog */
minmaxval
(
gridsize
,
ps_prog
,
NULL
,
&
minval
,
&
maxval
);
...
...
src/cdo_int.h
View file @
c522cb6a
...
...
@@ -150,5 +150,4 @@ double parameter2double(const char *string);
int
parameter2int
(
const
char
*
string
);
int
parameter2intlist
(
const
char
*
string
);
#endif
/* _CDO_INT_H */
src/util.h
View file @
c522cb6a
...
...
@@ -187,7 +187,7 @@ int cdoDefineZaxis(const char *zaxisfile);
int
vlistInqNWPV
(
int
vlistID
,
int
varID
);
int
vlistIsSzipped
(
int
vlistID
);
int
vlist_check_gridsize
(
int
vlistID
);
int
vlist_get_psvarid
(
int
vlistID
,
int
zaxisID
);
void
cdoGenFileSuffix
(
char
*
filesuffix
,
size_t
maxlen
,
int
filetype
,
int
vlistID
,
const
char
*
refname
);
...
...
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