You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interp routine currently makes use of a lot of repeated, nearly-identical blocks of code: FieldRegrid+FieldGet and FieldGather+search+FieldScatter. Making use of pointer arrays, we can significantly pare down the length of this subroutine but utilizing a regrid_many and a search_many subroutine that loops over the fields to be regridded/searched for each masked area (e.g., sea ice, water, land ice, etc.). I've already verified that this approach works for part of this subroutine, and the code passes the old "regression" (system) tests. I'll need to extend this to the rest of the masked regridding sections. Testing for regrid_many will probably need to involve generation of a simple, very small test case since the routine makes use of multiple ESMF calls. Testing search_many should look very much like the test for search, but with 2 fields (and associated other variables) passed at once.
The text was updated successfully, but these errors were encountered:
@kgerheiser That's a fantastic idea! I knew FieldBundles were used in the weather model code, but didn't make the connection here. Yes, the FieldBundle would be much more elegant than the array of pointers for the ESMF Fields. I still think I'll need to pass through an array of pointers for one of the elements (the pointer names to assign in FieldGet), but the other two pointer arrays can be substituted with FieldBundles.
Also a bonus: the ESMF documentation for 8.1.1 says they're working on adding features for packed FieldBundles that would allow regridding of an entire bundle in a single call. This is essentially what regrid_many is doing, so we'll be able to utilize that sort of functionality (and get rid of regrid_many) when it's added to ESMF.
The interp routine currently makes use of a lot of repeated, nearly-identical blocks of code: FieldRegrid+FieldGet and FieldGather+search+FieldScatter. Making use of pointer arrays, we can significantly pare down the length of this subroutine but utilizing a regrid_many and a search_many subroutine that loops over the fields to be regridded/searched for each masked area (e.g., sea ice, water, land ice, etc.). I've already verified that this approach works for part of this subroutine, and the code passes the old "regression" (system) tests. I'll need to extend this to the rest of the masked regridding sections. Testing for regrid_many will probably need to involve generation of a simple, very small test case since the routine makes use of multiple ESMF calls. Testing search_many should look very much like the test for search, but with 2 fields (and associated other variables) passed at once.
The text was updated successfully, but these errors were encountered: