Skip to content

Commit d325a48

Browse files
committed
Remove ice density calculation
1 parent 3cd7fd4 commit d325a48

File tree

3 files changed

+13
-42
lines changed

3 files changed

+13
-42
lines changed

compass/ocean/iceshelf.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,6 @@ def compute_land_ice_pressure_from_thickness(land_ice_thickness, modify_mask,
4040
return land_ice_pressure
4141

4242

43-
def compute_land_ice_density_from_draft(land_ice_draft, land_ice_thickness,
44-
floating_mask, ref_density=None):
45-
"""
46-
Compute the spatially-averaged ice density needed to match the ice draft
47-
48-
Parameters
49-
----------
50-
land_ice_draft : xarray.DataArray
51-
The ice draft (sea surface height)
52-
53-
land_ice_thickness: xarray.DataArray
54-
The ice thickness
55-
56-
floating_mask : xarray.DataArray
57-
A mask that is 1 where the ice is assumed in hydrostatic equilibrium
58-
59-
ref_density : float, optional
60-
A reference density for seawater displaced by the ice shelf
61-
62-
Returns
63-
-------
64-
land_ice_density: float
65-
The ice density
66-
"""
67-
if ref_density is None:
68-
ref_density = constants['SHR_CONST_RHOSW']
69-
land_ice_draft = numpy.where(floating_mask, land_ice_draft, numpy.nan)
70-
land_ice_thickness = numpy.where(floating_mask, land_ice_thickness,
71-
numpy.nan)
72-
land_ice_density = \
73-
numpy.nanmean(-ref_density * land_ice_draft / land_ice_thickness)
74-
return land_ice_density
75-
76-
7743
def compute_land_ice_pressure_from_draft(land_ice_draft, modify_mask,
7844
ref_density=None):
7945
"""

compass/ocean/tests/isomip_plus/initial_state.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mpas_tools.io import write_netcdf
99

1010
from compass.ocean.iceshelf import (
11-
compute_land_ice_density_from_draft,
11+
compute_land_ice_draft_from_pressure,
1212
compute_land_ice_pressure_from_draft,
1313
compute_land_ice_pressure_from_thickness,
1414
)
@@ -101,13 +101,16 @@ def _compute_initial_condition(self):
101101
section = config['isomip_plus']
102102
min_land_ice_fraction = section.getfloat('min_land_ice_fraction')
103103
min_ocean_fraction = section.getfloat('min_ocean_fraction')
104+
ice_density = section.getfloat('ice_density')
104105

105106
ds_geom = xr.open_dataset('input_geometry_processed.nc')
106107
ds_mesh = xr.open_dataset('culled_mesh.nc')
107108

108109
ds = interpolate_geom(ds_mesh, ds_geom, min_ocean_fraction,
109110
thin_film_present)
110111

112+
ds['bottomDepth'] = -ds.bottomDepthObserved
113+
111114
ds['landIceFraction'] = \
112115
ds['landIceFraction'].expand_dims(dim='Time', axis=0)
113116
ds['landIceFloatingFraction'] = \
@@ -129,16 +132,17 @@ def _compute_initial_condition(self):
129132

130133
ds['landIceFraction'] = xr.where(mask, ds.landIceFraction, 0.)
131134

132-
land_ice_draft = ds.ssh
133135
if thin_film_present:
134136
land_ice_thickness = ds.landIceThickness
135-
land_ice_density = compute_land_ice_density_from_draft(
136-
land_ice_draft, land_ice_thickness,
137-
floating_mask=ds.landIceFloatingMask)
138137
land_ice_pressure = compute_land_ice_pressure_from_thickness(
139138
land_ice_thickness=land_ice_thickness, modify_mask=ds.ssh < 0.,
140-
land_ice_density=land_ice_density)
139+
land_ice_density=ice_density)
140+
land_ice_draft = compute_land_ice_draft_from_pressure(
141+
land_ice_pressure=land_ice_pressure,
142+
modify_mask=ds.bottomDepth > 0.)
143+
ds['ssh'] = np.maximum(land_ice_draft, -ds.bottomDepth)
141144
else:
145+
land_ice_draft = ds.ssh
142146
land_ice_pressure = compute_land_ice_pressure_from_draft(
143147
land_ice_draft=land_ice_draft, modify_mask=land_ice_draft < 0.)
144148

@@ -147,8 +151,6 @@ def _compute_initial_condition(self):
147151
if self.time_varying_forcing:
148152
self._write_time_varying_forcing(ds_init=ds)
149153

150-
ds['bottomDepth'] = -ds.bottomDepthObserved
151-
152154
section = config['isomip_plus']
153155

154156
# Deepen the bottom depth to maintain the minimum water-column

compass/ocean/tests/isomip_plus/isomip_plus.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ min_smoothed_draft_mask = 0.01
7878
# considered a land-ice cell by MPAS-Ocean (landIceMask == 1).
7979
min_land_ice_fraction = 0.5
8080

81+
# the density of ice prescribed in ISOMIP+
82+
ice_density = 918
83+
8184
# the initial temperature at the sea surface
8285
init_top_temp = -1.9
8386
# the initial temperature at the sea floor

0 commit comments

Comments
 (0)