Skip to content

Commit 2d041e8

Browse files
Cleanup
1 parent dd14cd3 commit 2d041e8

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

compass/landice/tests/mismipplus/albany_input_debrisfriction.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ ANONYMOUS:
66
SDBC on NS dirichlet for DOF U1 prescribe Field: dirichlet_field
77
LandIce BCs:
88
BC 0:
9-
Cubature Degree: 4
109
Basal Friction Coefficient:
1110
Type: Debris Friction
1211
Power Exponent: 0.3333333333

compass/landice/tests/mismipplus/run_model.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,21 @@ def run(self):
240240
streams='streams.{}'.format(suffix))
241241

242242
def _update_mesh_for_debris_friction(self):
243-
with xr.open_dataset(self.mesh_file) as ds_mesh:
243+
mesh_filename = os.path.join(self.work_dir, self.mesh_file)
244+
245+
with xr.open_dataset(mesh_filename) as ds_mesh:
244246
ds_mesh['muFriction'].loc[:] = 0.4
245247
ds_mesh['bedRoughnessBC'] = xr.full_like(ds_mesh['muFriction'],
246248
6000.0)
247249
ds_mesh['basalDebrisFactor'] = xr.where(
248250
ds_mesh['xCell'] < 200000.0, 3.2e-2, 0.0)
249-
ds_mesh.to_netcdf(self.mesh_file, mode='a')
251+
ds_mesh.to_netcdf(mesh_filename, mode='a')
250252

251253
def _update_mesh_for_regularized_coulomb(self):
252-
with xr.open_dataset(self.mesh_file) as ds_mesh:
254+
mesh_filename = os.path.join(self.work_dir, self.mesh_file)
255+
256+
with xr.open_dataset(mesh_filename) as ds_mesh:
253257
ds_mesh['muFriction'].loc[:] = 0.4
254-
ds_mesh['bedRoughnessBC'].loc[:] = 1.25e-4
255-
ds_mesh.to_netcdf(self.mesh_file, mode='a')
258+
ds_mesh['bedRoughnessBC'] = xr.full_like(ds_mesh['muFriction'],
259+
1.25e-4)
260+
ds_mesh.to_netcdf(mesh_filename, mode='a')

compass/landice/tests/mismipplus/smoke_test/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def __init__(self, test_group, resolution, basal_friction='weertman'):
5555
step_name = 'run_model'
5656
step = RunModel(test_case=self, name=step_name,
5757
resolution=resolution,
58-
basal_friction=basal_friction,
59-
update_mesh_for_basal_friction=True)
58+
basal_friction=basal_friction,
59+
update_mesh_for_basal_friction=True)
6060

6161
# download and link the mesh, eventually this will need to be
6262
# resolution aware. ``configure`` method is probably a better place

0 commit comments

Comments
 (0)