From 3ddbaa1a4f4462fa8dc303c4a7040e6dceb541cd Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Wed, 28 Aug 2024 12:09:04 -0500 Subject: [PATCH] Fix ice thickness and pressure where above flotation We don't want ice thickness and pressure to exceed their flotation values. Previously, we were only making sure that ice draft did not exceed its flotation value (i.e. the draft was above the bed). --- compass/ocean/mesh/remap_topography.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compass/ocean/mesh/remap_topography.py b/compass/ocean/mesh/remap_topography.py index 0e03562203..788561fc38 100644 --- a/compass/ocean/mesh/remap_topography.py +++ b/compass/ocean/mesh/remap_topography.py @@ -158,16 +158,18 @@ def run(self): ds_out[var] = xr.where(valid, ds_out[var] / norm, 0.) thickness = ds_out.landIceThkObserved + bed = ds_out.bed_elevation + flotation_thickness = - (ocean_density / ice_density) * bed + # not allowed to be thicker than the flotation thickness + thickness = np.minimum(thickness, flotation_thickness) + ds_out['landIceThkObserved'] = thickness + ds_out['landIcePressureObserved'] = ice_density * g * thickness # compute the ice draft to be consistent with the land ice pressure # and using E3SM's density of seawater - draft = - (ice_density / ocean_density) * thickness - bed = ds_out.bed_elevation - - # can't be deeper than the bed - draft = xr.where(draft >= bed, draft, bed) - ds_out['landIceDraftObserved'] = draft + ds_out['landIceDraftObserved'] = \ + - (ice_density / ocean_density) * thickness write_netcdf(ds_out, 'topography_remapped.nc')