Skip to content

Commit

Permalink
Fixes output of x_period and y_period
Browse files Browse the repository at this point in the history
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
vanroekel committed Jan 22, 2020
1 parent e91c7ca commit 926a936
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 926a936

Please sign in to comment.