Skip to content

Fix reading of sphere_radius, x_period and mesh_spec - #296

Merged
xylar merged 2 commits into
MPAS-Dev:masterfrom
xylar:fix_sphere_radius_cell_culler
Mar 5, 2020
Merged

xylar merged 2 commits into
MPAS-Dev:masterfrom
xylar:fix_sphere_radius_cell_culler

Conversation

@xylar

@xylar xylar commented Mar 5, 2020

Copy link
Copy Markdown
Collaborator

#279 fixed y_period but other attributes were still being read as strings and converted to doubles (even though they are stored in the NetCDF file as doubles). The remaining variables need to be fixed in the same way.

MPAS-Dev#279 fixed y_period
but other attributes were still being read as strings and converted
to doubles (even though they are stored in the NetCDF file as
doubles).  The remaining variables need to be fixed in the same
way.
@xylar xylar added the bug label Mar 5, 2020
@xylar
xylar requested review from jonbob and vanroekel March 5, 2020 19:51
@xylar xylar self-assigned this Mar 5, 2020
@xylar

xylar commented Mar 5, 2020

Copy link
Copy Markdown
Collaborator Author

Testing

I build the conda package with this source. With the new build, I ran:

$ MpasCellCuller.x ocean.QU.480km.151209.nc test.nc
$ ncdump -h test.nc
...
// global attributes:
		:on_a_sphere = "YES" ;
		:sphere_radius = 6371229. ;

This is the expected value.

Thanks for the help identifying the problem @jonbob!

@xylar

xylar commented Mar 5, 2020

Copy link
Copy Markdown
Collaborator Author

@vanroekel and @jonbob, if you could glance at the changes and make sure:

  1. you're okay with the 3 places I removed atof() calls
  2. you don't see any that I missed this time
    that would be great!

There are also some white-space changes that happen automatically in my editor, so don't worry about those.

I also updated the version number because this fix is worthy of a release.

@jonbob jonbob left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, by visual inspection -- and @xylar 's testing

@vanroekel vanroekel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good. Thanks @xylar

@xylar
xylar merged commit 51ec7be into MPAS-Dev:master Mar 5, 2020
@xylar
xylar deleted the fix_sphere_radius_cell_culler branch March 5, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants