Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
1419ebf3
Commit
1419ebf3
authored
Mar 28, 2018
by
LEFEBVREJP email
Browse files
Updating gfsfile to save the surface pressure height as a HGTS.
parent
b32855dd
Pipeline
#12762
passed with stages
in 9 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/gfsfile.cc
View file @
1419ebf3
...
...
@@ -801,14 +801,6 @@ std::vector<std::vector<float>> GFSFile::query(float lat, float lon, int month,
// initialize space for results vector
results
[
ll
]
=
std
::
vector
<
float
>
(
columns
.
size
(),
0.0
f
);
// if "HGTS" has been requested add level as the default HGTS
auto
hIt
=
std
::
find
(
columns
.
begin
(),
columns
.
end
(),
"HGTS"
);
if
(
hIt
!=
columns
.
end
())
{
results
[
ll
][
hIt
-
columns
.
begin
()]
=
hypsometric
(
msle
,
plevel
,
temp
)
-
mSurfaceHeight
;
}
// check for time
auto
timeIt
=
std
::
find
(
columns
.
begin
(),
columns
.
end
(),
"TIME"
);
if
(
timeIt
!=
columns
.
end
())
...
...
@@ -846,14 +838,21 @@ std::vector<std::vector<float>> GFSFile::query(float lat, float lon, int month,
// convert surface specific humidity to specific humidity for relhum
// conversion
if
(
varb
.
compare
(
"SPH2"
)
==
0
)
varb
=
"SPHU"
;
if
(
varb
.
compare
(
"PRSS"
)
==
0
)
// only calculate surface height from surface pressure if geopotential
// height was already used
if
(
varb
.
compare
(
"PRSS"
)
==
0
&&
mSurfaceHeight
==
0.
f
)
{
mSurfaceHeight
=
hypsometric
(
msle
,
vdata
[
kk
][
ll
],
temp
);
varb
=
"HGTS"
;
vdata
[
kk
][
ll
]
=
mSurfaceHeight
;
}
if
(
varb
.
compare
(
"SHGT"
)
==
0
)
{
// update varb to indicate a height for saving
varb
=
"HGTS"
;
// geopotential surface height
mSurfaceHeight
=
vdata
[
kk
][
ll
];
radix_line
(
"Geopotential height("
<<
mSurfaceHeight
<<
")"
);
}
// check whether relative humidity has been requested, and convert
// specific humidity if this is present instead
...
...
radixio/gfsfile.hh
View file @
1419ebf3
...
...
@@ -183,7 +183,7 @@ class RADIX_PUBLIC GFSFile
Label
mLabel
;
Header
mHeader
;
float
mSurfaceHeight
;
float
mSurfaceHeight
=
0.
f
;
/**
* \brief gbl2xy converts global lat&lon to xy coordinates for grid lookup
*/
...
...
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