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
7356dda7
Commit
7356dda7
authored
Mar 27, 2018
by
LEFEBVREJP email
Browse files
Exposing the gfsfile surface height as a member.
parent
afac5360
Pipeline
#12757
passed with stages
in 8 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/gfsfile.cc
View file @
7356dda7
...
...
@@ -585,6 +585,9 @@ const std::vector<std::string> &GFSFile::profileTimes() const
{
return
mProfiles
;
}
float
GFSFile
::
surfaceHeight
()
const
{
return
mSurfaceHeight
;
}
std
::
vector
<
std
::
vector
<
float
>>
GFSFile
::
query
(
float
lat
,
float
lon
,
int
month
,
int
day
,
int
year
,
int
hour
,
std
::
vector
<
std
::
string
>
columns
)
...
...
@@ -716,13 +719,12 @@ std::vector<std::vector<float>> GFSFile::query(float lat, float lon, int month,
delete
rstream
;
// SOUND section of Fortran
float
tpot
=
0.0
f
;
float
temp
=
288.15
f
;
// default to surface temperature
float
relHum
=
0.0
f
;
bool
sfcwnd
=
false
;
float
offset
=
0.0
f
;
float
plevel
=
0.0
f
;
double
surfaceAltitude
=
0
;
float
tpot
=
0.0
f
;
float
temp
=
288.15
f
;
// default to surface temperature
float
relHum
=
0.0
f
;
bool
sfcwnd
=
false
;
float
offset
=
0.0
f
;
float
plevel
=
0.0
f
;
std
::
vector
<
std
::
vector
<
float
>>
results
(
mHeader
.
nz
);
for
(
int
ll
=
0
;
ll
<
mHeader
.
nz
;
++
ll
)
...
...
@@ -804,7 +806,7 @@ std::vector<std::vector<float>> GFSFile::query(float lat, float lon, int month,
if
(
hIt
!=
columns
.
end
())
{
results
[
ll
][
hIt
-
columns
.
begin
()]
=
hypsometric
(
msle
,
plevel
,
temp
)
-
s
urface
Altitude
;
hypsometric
(
msle
,
plevel
,
temp
)
-
mS
urface
Height
;
}
// check for time
...
...
@@ -846,7 +848,12 @@ std::vector<std::vector<float>> GFSFile::query(float lat, float lon, int month,
if
(
varb
.
compare
(
"SPH2"
)
==
0
)
varb
=
"SPHU"
;
if
(
varb
.
compare
(
"PRSS"
)
==
0
)
{
surfaceAltitude
=
hypsometric
(
msle
,
vdata
[
kk
][
ll
],
temp
);
mSurfaceHeight
=
hypsometric
(
msle
,
vdata
[
kk
][
ll
],
temp
);
}
if
(
varb
.
compare
(
"SHGT"
)
==
0
)
{
// geopotential surface height
mSurfaceHeight
=
vdata
[
kk
][
ll
];
}
// check whether relative humidity has been requested, and convert
// specific humidity if this is present instead
...
...
radixio/gfsfile.hh
View file @
7356dda7
...
...
@@ -183,6 +183,7 @@ class RADIX_PUBLIC GFSFile
Label
mLabel
;
Header
mHeader
;
float
mSurfaceHeight
;
/**
* \brief gbl2xy converts global lat&lon to xy coordinates for grid lookup
*/
...
...
@@ -282,6 +283,12 @@ class RADIX_PUBLIC GFSFile
* @return std::vector<std::string>
*/
const
std
::
vector
<
std
::
string
>
&
profileTimes
()
const
;
/**
* @brief surfaceHeight Get the geopotential height 'SHGT' in meters
* @return
*/
float
surfaceHeight
()
const
;
};
// class GFSFile
}
// namespace radix
#endif
/** RADIXIO_GFSFILE_HH_ */
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