Skip to content

Commit

Permalink
Merge pull request #2483 from dtcenter/bugfix_2482_timeslicing_yyyymmdd
Browse files Browse the repository at this point in the history
Bugfix #2482 develop time slicing yyyymmdd
  • Loading branch information
hsoh-u authored Mar 9, 2023
2 parents 84eb17d + cfb68d1 commit 5c63627
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,13 @@ void VarInfoNcPinterp::set_magic(const ConcatString &nstr, const ConcatString &l
else {
int level = 0;
double level_value = bad_data_double;
if (is_number(ptr2)) {
if (is_datestring(ptr2)) {
unixtime unix_time = timestring_to_unix(ptr2);
level = vx_data2d_dim_by_value;
level_value = unix_time;
as_offset = false;
}
else if (is_number(ptr2)) {
if (as_offset) level = atoi(ptr2);
else {
level = vx_data2d_dim_by_value;
Expand Down
8 changes: 7 additions & 1 deletion src/libcode/vx_data2d_nccf/var_info_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,13 @@ void VarInfoNcCF::set_magic(const ConcatString &nstr, const ConcatString &lstr)
// Single level
int level = 0;
double level_value = bad_data_double;
if (is_number(ptr2)) {
if (is_datestring(ptr2)) {
unixtime unix_time = timestring_to_unix(ptr2);
level = vx_data2d_dim_by_value;
level_value = unix_time;
as_offset = false;
}
else if (is_number(ptr2)) {
if (as_offset) level = atoi(ptr2);
else {
level = vx_data2d_dim_by_value;
Expand Down

0 comments on commit 5c63627

Please sign in to comment.