Skip to content

Commit

Permalink
Merge pull request #279 from vanroekel/x_y_period_in_mesh_converter
Browse files Browse the repository at this point in the history
Fixes output of x_period and y_period

For periodic grids, x and y_period where being read in as character
strings and then converted to doubles for output in the mesh. The read
in as a string caused only the first two decimals to be read of y_period
and x_period, which breaks periodicity in MPAS.

This commit reads in x_period and y_period as doubles and skips the
conversions.
  • Loading branch information
xylar authored Jan 23, 2020
2 parents e91c7ca + 926a936 commit b496152
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mesh_tools/mesh_conversion_tools/netcdf_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,8 @@ double netcdf_mpas_read_yperiod(string filename){/*{{{*/
vals = att_id -> values();

for(int i = 0; i < vals -> num(); i++){
tmp_name = vals -> as_string(i);

return atof(vals -> as_string(i));
return vals -> as_double(i);
}
} else {
return -1.0;
Expand Down

0 comments on commit b496152

Please sign in to comment.