Skip to content

Commit

Permalink
Merge pull request #2484 from dtcenter/bugfix_2482_timeslicing_yyyymm…
Browse files Browse the repository at this point in the history
…dd_main_v11.0

Bugfix #2482 main_v11.0 time slicing yyyymmdd
  • Loading branch information
hsoh-u authored Mar 9, 2023
2 parents 36cf66d + 16e0e3c commit c200ee2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/libcode/vx_data2d_nc_pinterp/var_info_nc_pinterp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,19 @@ 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;
level_value = atof(ptr2);
}
}
else 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 {
mlog << Error << "\n" << method_name
<< "trouble parsing NetCDF dimension value \""
Expand Down
14 changes: 7 additions & 7 deletions src/libcode/vx_data2d_nccf/var_info_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,19 @@ 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;
level_value = atof(ptr2);
}
}
else 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 {
mlog << Error << "\n" << method_name
<< "trouble parsing NetCDF dimension value \""
Expand Down

0 comments on commit c200ee2

Please sign in to comment.