Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-&-paste error in error message on false_northing and projection_y_coordinate in cmor_grids.c #547

Closed
neumannd opened this issue Oct 2, 2019 · 3 comments
Projects

Comments

@neumannd
Copy link

neumannd commented Oct 2, 2019

Starting in line 215 in file cmor_grids.c

The attribute false_northing (of grid projection/mapping variable) and the standard name projection_y_coordinate (of a coordinate) are checked. The user output mentions false_easting and projection_y_coordinate. It is a copy-&-paste error from the previous check a few lines above.

Instead of

    } else if (strcmp(name, "false_northing") == 0) {
        j = -1;
        for (i = 0; i < cmor_grids[grid_id].ndims; i++) {
            cmor_get_axis_attribute(cmor_grids[grid_id].axes_ids[i],
                                    "standard_name", 'c', &ctmp[0]);
            if (strcmp(ctmp, "projection_y_coordinate") == 0)
                j = i;
        }
        if (j == -1) {
            snprintf(ctmp, CMOR_MAX_STRING,
                     "grid mapping attribute: 'false easting' must be set in conjunction with a 'projection_x_coordinate' axis, I could not find such an axis on your grid, we will not set this attribute");
            cmor_handle_error(ctmp, CMOR_NORMAL);
            cmor_pop_traceback();
            return (1);
        }
        cmor_get_axis_attribute(cmor_grids[grid_id].axes_ids[j], "units",
                                'c', &ctmp[0]);
        cmor_convert_value(units, ctmp, &tmp);
    }

it should be

    } else if (strcmp(name, "false_northing") == 0) {
        j = -1;
        for (i = 0; i < cmor_grids[grid_id].ndims; i++) {
            cmor_get_axis_attribute(cmor_grids[grid_id].axes_ids[i],
                                    "standard_name", 'c', &ctmp[0]);
            if (strcmp(ctmp, "projection_y_coordinate") == 0)
                j = i;
        }
        if (j == -1) {
            snprintf(ctmp, CMOR_MAX_STRING,
                     "grid mapping attribute: 'false northing' must be set in conjunction with a 'projection_y_coordinate' axis, I could not find such an axis on your grid, we will not set this attribute");
            cmor_handle_error(ctmp, CMOR_NORMAL);
            cmor_pop_traceback();
            return (1);
        }
        cmor_get_axis_attribute(cmor_grids[grid_id].axes_ids[j], "units",
                                'c', &ctmp[0]);
        cmor_convert_value(units, ctmp, &tmp);
    }

A pull request is on the way.

@neumannd
Copy link
Author

neumannd commented Oct 7, 2019

pull request #548 superseded by #550; forgot to include "fixes #547" in the commit message of #550

@mauzey1
Copy link
Collaborator

mauzey1 commented Oct 7, 2019

@neumannd I will merge #550 as soon as all the tests succeed. I will also close #548.

@mauzey1
Copy link
Collaborator

mauzey1 commented Oct 7, 2019

I have merged #550 so I am closing this issue.

@mauzey1 mauzey1 closed this as completed Oct 7, 2019
@mauzey1 mauzey1 added this to To do in 3.6.0 via automation Oct 8, 2019
@mauzey1 mauzey1 moved this from To do to Done in 3.6.0 Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
3.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants