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

Arithmetic expression parser in MAPL needs to become GEOM/rank agnostic #2149

Closed
bena-nasa opened this issue May 23, 2023 · 0 comments
Closed
Assignees
Labels
🎁 New Feature This is a new feature

Comments

@bena-nasa
Copy link
Collaborator

bena-nasa commented May 23, 2023

The current MAPL arithmetic parser can perform element-wise operations on any combination of supported fields on the obviously same grid ( including layout, otherwise this wouldn't make sense!) given character expression involving the names of the fields.

Right now this is limited to 2D or 3D 32 bit fields on ESMF_Grids with the ability to broadcast (to borrow from numpy) 2D fields into 3D fields when doing an operation involving a pair of fields that have the same grid but one is 2D, other 3D with a single ungridded dimension.

Assuming the that +-/*^ are overloaded for fields on any GEOM/rank/type, as well as current supported Fortran intrinsic or single argument functions I see no reason why this should not be very easy to generalize the code to work on fields regardless of rank like @darianboggs has been going for other things.

Besides History, the arithmetic expression parser is an integral part of my ExtData/History testing framework to fill fields from a "menu" of available fields to the user. Indeed, without it my testing framework would not work. I was updating ExtDataDriver.x to be able to run on a "tile" grid to use as a tester when I update ExtData to handle tiled fields, but the one stumbling block is that it will fall flat when using the expression parser since the fields on tiles are 1D (but still on a grid remember, NOT a locstream), with some number of undistributed dimensions

I've just made a PR that should allow me to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 New Feature This is a new feature
Projects
None yet
Development

No branches or pull requests

3 participants