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

user defined grid mapping #748

Open
larsbuntemeyer opened this issue Jul 3, 2024 · 0 comments
Open

user defined grid mapping #748

larsbuntemeyer opened this issue Jul 3, 2024 · 0 comments

Comments

@larsbuntemeyer
Copy link

larsbuntemeyer commented Jul 3, 2024

The documentation on set_grid_mapping says:

Additional mapping names and parameter names can be defined via the MIP table.

Could you give a quick example on how to do that? I found "sample_user_mapping" in CMIP6_grids.json but it's not clear, how i can use that or adapt it. For example, if i use:

cmor.set_grid_mapping(
        cmorGrid,
        "sample_user_mapping",
        ["parameter1", "parameter2"],
        [1., 2.],
        ["", ""],
)

i get

 Error: you defined your grid with 2 axes but grid_mapping 'sample_user_mapping' requires exactly 0 axes

What i would actually like to do is to define my own rotated_latitude_longitude grid mapping with a different out_name. From what i can see in

cmor/Src/cmor_grids.c

Lines 400 to 408 in d7346b8

} else if (strcmp(name, "rotated_latitude_longitude") == 0) {
*natt = 3;
strcpy(att[0], "grid_north_pole_latitude");
strcpy(att[1], "grid_north_pole_longitude");
strcpy(att[2], "north_pole_grid_longitude");
*ndims = 2;
strcpy(dims[0], "grid_latitude");
strcpy(dims[1], "grid_longitude");
} else if (strcmp(name, "stereographic") == 0) {

this is more or less hardcoded, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant