Skip to content

Commit 3a8f805

Browse files
Add Bnds array
1 parent 77e1f98 commit 3a8f805

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

landice/mesh_tools_li/interpolate_mpasOcean_to_mali.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ def __init__(self):
4141
-570, -630, -690, -750, -810, -870, -930, -990, -1050, -1110, -1170,\
4242
-1230, -1290, -1350, -1410, -1470, -1530, -1590, -1650, -1710, -1770), dtype='float64')
4343

44+
# create bnds array
45+
self.ismip6shelfMelt_zBndsOcean = np.zeros((2, len(self.ismip6shelfMelt_zOcean)))
46+
self.ismip6shelfMelt_zBndsOcean[0, 0] = 0.0
47+
for z in range(1, len(self.ismip6shelfMelt_zOcean)):
48+
self.ismip6shelfMelt_zBndsOcean[0, z] = 0.5 * (self.ismip6shelfMelt_zOcean[z - 1] +
49+
self.ismip6shelfMelt_zOcean[z])
50+
for z in range(0, len(self.ismip6shelfMelt_zOcean) - 1):
51+
self.ismip6shelfMelt_zBndsOcean[1, z] = 0.5 * (self.ismip6shelfMelt_zOcean[z] +
52+
self.ismip6shelfMelt_zOcean[z + 1])
53+
self.ismip6shelfMelt_zBndsOcean[1, -1] = self.ismip6shelfMelt_zOcean[-1] + \
54+
(self.ismip6shelfMelt_zOcean[-1] - self.ismip6shelfMelt_zBndsOcean[0, -1])
55+
4456
def prepare_mpaso_mesh_data(self):
4557

4658
#open mpas ocean mesh
@@ -335,6 +347,7 @@ def remap_mpas_to_mali(self, year):
335347
ds_remapped = xr.open_dataset(tmp_maliDestFile, decode_times=False, decode_cf=False)
336348
ds_out = xr.Dataset(data_vars={'ismip6shelfMelt_3dThermalForcing': ds_remapped['ismip6shelfMelt_3dThermalForcing']})
337349
ds_out['ismip6shelfMelt_zOcean'] = xr.DataArray(self.ismip6shelfMelt_zOcean, dims=("nISMIP6OceanLayers"))
350+
ds_out['ismip6shelfMelt_zBndsOcean'] = xr.DataArray(self.ismip6shelfMelt_zBndsOcean, dims=("TWO", "nISMIP6OceanLayers"))
338351
if self.have_landIceFreshwaterFlux:
339352
ds_out['floatingBasalMassBal'] = ds_remapped['floatingBasalMassBal']
340353

0 commit comments

Comments
 (0)