MPAS-Dev / MPAS-Limited-Area

Python tool to create a regional subset of a global MPAS Mesh
http://mpas-dev.github.io/
21 stars 10 forks source link

Subset fields dimensioned by time #33

Closed MiCurry closed 4 years ago

MiCurry commented 4 years ago

This commit adds changes to successfully subset fields that are dimensioned by Time. Before, if a field was dimensioned by Time an error would occur because the region masks (either glbBdyCellIDs, glbBdyVertexIDs or glbBdyEdgeIDs) would be subsetting the Time dimensioned and not the nCells, nVertices or nEdges dimension.

This commit fixes the above by checking to see if the time dimension is in the new variable we are copying and using the region masks to subset the second nCells, nVertices or nEdges dimension.

MiCurry commented 4 years ago

This change was easier then I had anticipated. With these changes I created a region from an MPAS initialization data and was able to run a simulation on the outputted region!

@mgduda, as well as giving this PR a look over, would you like to give this a test or two as well?

At the time being, I've pointed this PR at Master, but I'd like to point this to a yet-to-be-made 2.0 release branch, which I'd like to make after fixing the method for specifying the radius of the circle-method (hotfix-v1.1). While we get testing this branch I'll work on creating the release branch and merging the hotfix-v1.1 changes to master and hopefully we'll have this change released in less than a week.

MiCurry commented 4 years ago

Sounds great, thanks for giving it a test. Also, I believe this issue will also resolve issue #28.