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

Add option to mesh_modifer tool to output mask as either ocean-mask (as is now) or as a land-mask #2152

Open
ekluzek opened this issue Sep 12, 2023 · 5 comments
Labels
enhancement new capability or improved behavior of existing capability

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Sep 12, 2023

It's useful for the mesh_modifier tool to output the mask as either an ocean-mask (so 1 means ocean, and 0 means land) or as a land-mask (so 1 means land, and 0 means ocean). A simple command line option can easily be added to trigger between these two options.

@ekluzek ekluzek added the enhancement new capability or improved behavior of existing capability label Sep 12, 2023
@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 12, 2023

The part that converts to the ocean mask is this in modify_mesh_mask.py:

                # Reshape landmask into the
                # elementCount dimension of the mesh file.
                # In the process overwrite self.file[var].
                ocnmask = np.logical_not(int(landmask[row, col]))
                self.file[var][ncount] = ocnmask

So an argument just needs to be set in the option parser and then passed down to set_mesh_mask.

@slevis-lmwg

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 12, 2023

In talking with @slevis-lmwg he explained to me why you only change the MASK_MESH, and hence need the ocean grid for the mesh file.

What I will do is to check if this is needed for the SPARSE grid. It might not be, so we might not need this for that case, and hence, this will just lower the priority for this.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 12, 2023

Another way to do this would be to output both a land mesh AND an ocean mesh file. That might be the best way for the most flexibility for the user, and without having to understand the options.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Oct 4, 2023

In talking with @mvertens we think this issue is of more relevance because her suggestion is that you set ATM_DOMAIN_MESH, LND_DOMAIN_MESH, and MASK_MESH all to the same mesh file for the sparse grid case. See #1731

@slevis-lmwg
Copy link
Contributor

Agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new capability or improved behavior of existing capability
Projects
None yet
Development

No branches or pull requests

2 participants