Revision 106538f5c3e5805d574d526226ce853b217e8702 authored by Bill Sacks on 24 May 2021, 19:56:23 UTC, committed by Bill Sacks on 24 May 2021, 20:23:59 UTC
This is intended to support the GLC component having multiple
grids (e.g., Greenland & Antarctica), but the implementation handles any
component having multiple grids.

At a high level: If a component's grid is a colon-delimited string, then
it is assumed to specify multiple grids, separated by the colons. Then,
anywhere where we use the component's grid to create derived
variables (domain name, mapping file names, etc.), I have introduced a
loop over the list of grids for each component. For a component with
multiple grids, the derived variables then also end up as
colon-delimited strings, with one colon-delimited element per grid.

To avoid adding more complexity and deep nesting to the Grids class, I
have refactored it significantly in a few places. Main goals of the
refactoring were (1) extracting some logic into a helper class,
_ComponentGrids; among other things, this replaces various lookups that
were being done using tuples and dicts; and (2) extracting the bodies of
nested loops into new methods to avoid super-deep nesting.

I have also added unit tests of grids.py. The high-level tests of the
Grids class work by constructing little fake xml files on the fly. There
are also some tests of the lower-level helper functions. These unit
tests don't cover all of the logic in grids.py, but they do cover a lot
of the logic, with a particular focus on any parts of the code that I
had to change significantly for this work.

Resolves ESMCI/cime#3962
1 parent acd4cd8
History
File Mode Size
.github
config
doc
scripts
src
tools
utils
.gitignore -rw-r--r-- 460 bytes
.nojekyll -rw-r--r-- 0 bytes
CMakeLists.txt -rw-r--r-- 3.9 KB
CONTRIBUTING.md -rw-r--r-- 4.6 KB
ChangeLog -rw-r--r-- 874.6 KB
ChangeLog_template -rw-r--r-- 420 bytes
LICENSE.TXT -rw-r--r-- 2.4 KB
README.md -rw-r--r-- 1.8 KB
index.html -rw-r--r-- 444 bytes

README.md

back to top