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
e4d52205
Commit
e4d52205
authored
Feb 13, 2018
by
LEFEBVREJP email
Browse files
Patching the radixio/hysplitcdump write routine to force a YY formatted year.
parent
dfafc980
Pipeline
#11992
failed with stages
in 3 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixio/hysplitcdump.i.hh
View file @
e4d52205
...
...
@@ -156,6 +156,13 @@ bool HysplitCDumpStream<data_type>::write_to(const std::string &file) const
record_length
=
id
.
size
()
+
sizeof
(
int
)
*
7
;
int
year
,
month
,
day
,
hour
,
forecastHour
,
minutes
,
numLocations
,
packing
=
1
;
mData
->
dateTime
(
year
,
month
,
day
,
hour
);
//
// Adjust the date from YYYY to YY format.
// HYSPLIT utils always assume YY format
if
(
year
>
99
)
{
year
=
year
%
100
;
}
forecastHour
=
mData
->
forecastHour
();
numLocations
=
mData
->
numLocations
();
...
...
@@ -170,7 +177,13 @@ bool HysplitCDumpStream<data_type>::write_to(const std::string &file) const
float
lat
,
lon
,
z
;
for
(
int
i
=
0
;
i
<
numLocations
;
++
i
)
{
mData
->
location
(
i
,
year
,
month
,
day
,
hour
,
lat
,
lon
,
z
,
minutes
);
mData
->
location
(
i
,
year
,
month
,
day
,
hour
,
lat
,
lon
,
z
,
minutes
);
//
// Adjust the date from YYYY to YY format.
// HYSPLIT utils always assume YY format
if
(
year
>
99
)
{
year
=
year
%
100
;
}
record_length
=
sizeof
(
int
)
*
5
+
sizeof
(
float
)
*
3
;
radix_tagged_line
(
"record_length="
<<
record_length
);
fstr
.
writeHeader
(
record_length
);
...
...
@@ -234,7 +247,14 @@ bool HysplitCDumpStream<data_type>::write_to(const std::string &file) const
"The number of start times did not match the number of end times."
);
for
(
int
timeIndex
=
0
;
timeIndex
<
numStartTimes
;
++
timeIndex
)
{
mData
->
startTime
(
timeIndex
,
year
,
month
,
day
,
hour
,
minutes
,
forecastHour
);
mData
->
startTime
(
timeIndex
,
year
,
month
,
day
,
hour
,
minutes
,
forecastHour
);
//
// Adjust the date from YYYY to YY format.
// HYSPLIT utils always assume YY format
if
(
year
>
99
)
{
year
=
year
%
100
;
}
record_length
=
sizeof
(
int
)
*
6
;
radix_tagged_line
(
"record_length="
<<
record_length
);
fstr
.
writeHeader
(
record_length
);
...
...
@@ -242,7 +262,14 @@ bool HysplitCDumpStream<data_type>::write_to(const std::string &file) const
radix_tagged_line
(
"bytes_written="
<<
fstr
.
bytesWritten
());
fstr
.
writeFooter
(
record_length
);
mData
->
endTime
(
timeIndex
,
year
,
month
,
day
,
hour
,
minutes
,
forecastHour
);
mData
->
endTime
(
timeIndex
,
year
,
month
,
day
,
hour
,
minutes
,
forecastHour
);
//
// Adjust the date from YYYY to YY format.
// HYSPLIT utils always assume YY format
if
(
year
>
99
)
{
year
=
year
%
100
;
}
record_length
=
sizeof
(
int
)
*
6
;
radix_tagged_line
(
"record_length="
<<
record_length
);
fstr
.
writeHeader
(
record_length
);
...
...
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