-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #562 from matthewhoffman/landice/subdomain_extractor
Create test for extracting a MALI subdomain from a larger domain This merge adds a test case for a subdomain extractor. It allows a regional domain to be quickly created from an existing whole-ice-sheet domain using a mask. The regional mask can come from a region_mask MPAS netCDF file or a geojson file. Optionally, ancillary files (e.g. forcing or parameter files) can be remapped at the same time.
- Loading branch information
Showing
11 changed files
with
656 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from compass.landice.tests.mesh_modifications.subdomain_extractor import ( | ||
SubdomainExtractor, | ||
) | ||
from compass.testgroup import TestGroup | ||
|
||
|
||
class MeshModifications(TestGroup): | ||
""" | ||
A test group for automating modifications to existing meshes | ||
""" | ||
def __init__(self, mpas_core): | ||
""" | ||
mpas_core : compass.landice.Landice | ||
the MPAS core that this test group belongs to | ||
""" | ||
super().__init__(mpas_core=mpas_core, | ||
name='mesh_modifications') | ||
|
||
self.add_test_case(SubdomainExtractor(test_group=self)) |
36 changes: 36 additions & 0 deletions
36
compass/landice/tests/mesh_modifications/subdomain_extractor/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import sys | ||
from importlib import resources | ||
|
||
import numpy as np | ||
|
||
from compass.landice.tests.mesh_modifications.subdomain_extractor.extract_region import ( # noqa | ||
ExtractRegion, | ||
) | ||
from compass.testcase import TestCase | ||
|
||
|
||
class SubdomainExtractor(TestCase): | ||
""" | ||
A class for a test case that extracts a subdomain from a larger domain | ||
""" | ||
|
||
def __init__(self, test_group): | ||
""" | ||
Create the test case | ||
Parameters | ||
---------- | ||
test_group : compass.landice.tests.mesh_modifications.MeshModifications | ||
The test group that this test case belongs to | ||
""" | ||
name = 'subdomain_extractor' | ||
super().__init__(test_group=test_group, name=name) | ||
|
||
self.add_step(ExtractRegion(test_case=self)) | ||
|
||
# no configure() method is needed | ||
|
||
# no run() method is needed | ||
|
||
# no validate() method is needed |
Oops, something went wrong.