Skip to content

Commit

Permalink
Fix utest errors: various and one still remains
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Apr 18, 2024
1 parent ba0a3c2 commit f38a5d6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/ctsm/test/test_unit_singlept_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class TestSinglePointCase(unittest.TestCase):
evenly_split_cropland = False
pct_pft = None
num_pft = 16
cth = [0.9]
cbh = [0.1]
cth = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9]
cbh = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
include_nonveg = False
uni_snow = True
cap_saturation = True
Expand Down
48 changes: 44 additions & 4 deletions python/ctsm/test/test_unit_singlept_data_surfdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class TestSinglePointCaseSurfaceNoCrop(unittest.TestCase):
evenly_split_cropland = False
pct_pft = None
num_pft = 16
cth = [0.9]
cbh = [0.1]
cth = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9]
cbh = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
include_nonveg = False
uni_snow = True
cap_saturation = True
Expand All @@ -58,6 +58,8 @@ class TestSinglePointCaseSurfaceNoCrop(unittest.TestCase):
# -- dimensions of xarray dataset
lsmlat = [plat]
lsmlon = [plon]
months = np.arange(1, 13, 1, dtype=int)
lsmpft = np.arange(0, 79, 1, dtype=int)
natpft = np.arange(0, 15, 1, dtype=int)
cft = np.arange(15, 17, 1, dtype=int)
numurbl = np.arange(0, 3, 1, dtype=int)
Expand Down Expand Up @@ -139,6 +141,24 @@ class TestSinglePointCaseSurfaceNoCrop(unittest.TestCase):
"units": "unitless",
},
),
"MONTHLY_HEIGHT_TOP": xr.DataArray(
data=np.random.rand(1, 1, months[-1], lsmpft[-1] + 1),
dims=["lsmlat", "lsmlon", "time", "lsmpft"],
coords={"lsmlat": lsmlat, "lsmlon": lsmlon, "time": months, "lsmpft": lsmpft},
attrs={
"long_name": "monthly height top by pft and month",
"units": "m",
},
),
"MONTHLY_HEIGHT_BOT": xr.DataArray(
data=np.random.rand(1, 1, months[-1], lsmpft[-1] + 1),
dims=["lsmlat", "lsmlon", "time", "lsmpft"],
coords={"lsmlat": lsmlat, "lsmlon": lsmlon, "time": months, "lsmpft": lsmpft},
attrs={
"long_name": "monthly height bottom by pft and month",
"units": "m",
},
),
},
attrs={"Conventions": "test data only"},
)
Expand Down Expand Up @@ -642,8 +662,8 @@ class TestSinglePointCaseSurfaceCrop(unittest.TestCase):
evenly_split_cropland = False
pct_pft = None
num_pft = 78
cth = [0.9]
cbh = [0.1]
cth = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9]
cbh = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
include_nonveg = False
uni_snow = False
cap_saturation = False
Expand All @@ -653,6 +673,8 @@ class TestSinglePointCaseSurfaceCrop(unittest.TestCase):
# -- dimensions of xarray dataset
lsmlat = [plat]
lsmlon = [plon]
months = np.arange(1, 12, 1, dtype=int)
lsmpft = np.arange(0, 79, 1, dtype=int)
natpft = np.arange(0, 15, 1, dtype=int)
cft = np.arange(15, 79, 1, dtype=int)
numurbl = np.arange(0, 3, 1, dtype=int)
Expand Down Expand Up @@ -734,6 +756,24 @@ class TestSinglePointCaseSurfaceCrop(unittest.TestCase):
"units": "unitless",
},
),
"MONTHLY_HEIGHT_TOP": xr.DataArray(
data=np.random.rand(1, 1, months[-1], lsmpft[-1] + 1),
dims=["lsmlat", "lsmlon", "time", "lsmpft"],
coords={"lsmlat": lsmlat, "lsmlon": lsmlon, "time": months, "lsmpft": lsmpft},
attrs={
"long_name": "monthly height top by pft and month",
"units": "m",
},
),
"MONTHLY_HEIGHT_BOT": xr.DataArray(
data=np.random.rand(1, 1, months[-1], lsmpft[-1] + 1),
dims=["lsmlat", "lsmlon", "time", "lsmpft"],
coords={"lsmlat": lsmlat, "lsmlon": lsmlon, "time": months, "lsmpft": lsmpft},
attrs={
"long_name": "monthly height bottom by pft and month",
"units": "m",
},
),
},
attrs={"Conventions": "test data only"},
)
Expand Down

0 comments on commit f38a5d6

Please sign in to comment.