Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
638ea2ac
Commit
638ea2ac
authored
Jun 28, 2019
by
LEFEBVREJP email
Browse files
Merge branch 'snd2arl' into 'master'
Snd2arl See merge request
!77
parents
8f918616
ada3950f
Pipeline
#61491
passed with stages
in 14 minutes and 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/examples/radixsnd2arl.cc
View file @
638ea2ac
...
...
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
// Work out which fields are which data points - should be 2nd line (1)
std
::
cout
<<
"Finding data fields..."
<<
std
::
endl
;
for
(
in
t
entry
=
0
;
entry
<
inputData
[
1
].
size
();
++
entry
)
for
(
size_
t
entry
=
0
;
entry
<
inputData
[
1
].
size
();
++
entry
)
{
if
(
inputData
[
1
][
entry
]
==
pressureString
)
{
...
...
@@ -250,7 +250,7 @@ int main(int argc, char **argv)
inputWDirs
,
inputWSpds
,
inputHeights
;
std
::
cout
<<
"Data fields found - reading data..."
<<
std
::
endl
;
float
missingValue
=
-
9999.
f
;
for
(
in
t
row
=
4
;
row
<
inputData
.
size
();
++
row
)
for
(
size_
t
row
=
4
;
row
<
inputData
.
size
();
++
row
)
{
if
(
inputData
[
row
].
size
()
<
inputData
[
1
].
size
())
{
...
...
@@ -262,7 +262,7 @@ int main(int argc, char **argv)
bool
foundPressure
=
false
,
foundTemp
=
false
,
foundRelHum
=
false
,
foundDewPt
=
false
,
foundWDir
=
false
,
foundWSpd
=
false
,
foundHeight
=
false
;
for
(
in
t
entry
=
0
;
entry
<
inputData
[
row
].
size
();
++
entry
)
for
(
size_
t
entry
=
0
;
entry
<
inputData
[
row
].
size
();
++
entry
)
{
float
thisValue
=
from_string
(
inputData
[
row
][
entry
],
missingValue
);
...
...
@@ -475,6 +475,11 @@ int main(int argc, char **argv)
std
::
cout
<<
" Height:"
<<
std
::
endl
;
inputHeights
=
interpolateValues
(
inputPressures
,
inputHeights
,
true
);
}
// First convert temperature from Celsius to Kelvin
std
::
cout
<<
"Converting Temperature from C to Kelvin."
<<
std
::
endl
;
std
::
transform
(
inputTemps
.
begin
(),
inputTemps
.
end
(),
inputTemps
.
begin
(),
[](
double
v
)
{
return
v
-
ABS_ZERO_CELSIUS
;
});
std
::
cout
<<
" Interpolation complete."
<<
std
::
endl
;
// Check if the grid is of appropriate size - with too small grid/too many
...
...
@@ -538,7 +543,7 @@ int main(int argc, char **argv)
thisIndexHeader
.
dummy
=
0.
f
;
thisIndexHeader
.
nx
=
numberGridCells
;
thisIndexHeader
.
ny
=
numberGridCells
;
thisIndexHeader
.
nz
=
inputPressures
.
size
();
thisIndexHeader
.
nz
=
int
(
inputPressures
.
size
()
)
;
thisIndexHeader
.
z_flag
=
2
;
thisIndexHeader
.
lenh
=
numberGridCells
*
numberGridCells
;
thisIndexHeader
.
levels
=
inputPressures
;
...
...
@@ -604,8 +609,6 @@ int main(int argc, char **argv)
}
// Write temperature levels
// First convert temperature from Celsius to Kelvin
inputTemps
[
level
]
=
inputTemps
[
level
]
-
ABS_ZERO_CELSIUS
;
{
thisRecordHeader
.
kvar
=
"TEMP"
;
thisRecordHeader
.
var1
=
inputTemps
[
level
];
...
...
@@ -682,6 +685,8 @@ int main(int argc, char **argv)
metTime
.
tm_year
=
metTime
.
tm_year
+
400
;
#endif // _WIN32
addHour
(
&
metTime
,
1
);
printf
(
"%d%02d%02d:%02d
\n
"
,
metTime
.
tm_year
,
(
metTime
.
tm_mon
+
1
),
metTime
.
tm_mday
,
metTime
.
tm_hour
);
#ifdef _WIN32
metTime
.
tm_year
=
metTime
.
tm_year
-
400
;
#endif
...
...
Write
Preview
Markdown
is supported
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