Skip to content

Commit

Permalink
Merge pull request #847 from xylar/fix-land-ice-pressure-in-critical-…
Browse files Browse the repository at this point in the history
…passages

Set more topographic variables in critical passages
  • Loading branch information
xylar authored Jul 26, 2024
2 parents f1fc25d + 27b5f58 commit 643ae69
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions compass/ocean/mesh/cull.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,15 +529,19 @@ def _add_land_ice_mask_and_mask_draft(ds_topo, ds_base_mesh,
ds_map_culled_to_base, ds_perserve,
logger, latitude_threshold, sweep_count):

land_ice_frac = ds_topo.landIceFracObserved
# we don't what land ice where we are preserving critical passages
for ds in ds_perserve:
not_preserve = ds.transectCellMasks.sum(dim='nTransects') == 0
land_ice_frac = land_ice_frac.where(not_preserve, 0.0)

land_ice_frac.to_netcdf('land_ice_frac_without_critical_passages.nc')
for var in ['landIceFracObserved', 'landIcePressureObserved',
'landIceDraftObserved', 'landIceGroundedFracObserved',
'landIceFloatingFracObserved', 'landIceThkObserved']:
ds_topo[var] = ds_topo[var].where(not_preserve, 0.0)

ds_topo['oceanFracObserved'] = \
ds_topo['oceanFracObserved'].where(not_preserve, 1.0)

ds_topo['landIceFracObserved'] = land_ice_frac
land_ice_frac = ds_topo.landIceFracObserved

# we want the mask to be 1 where there's at least half land-ice
land_ice_mask = xr.where(land_ice_frac > 0.5, 1, 0)
Expand Down

0 comments on commit 643ae69

Please sign in to comment.