Skip to content

Commit

Permalink
Merge pull request #850 from xylar/fix-ssh-without-cavities
Browse files Browse the repository at this point in the history
Set ssh to land-ice draft only in meshes with cavities
  • Loading branch information
xylar authored Aug 26, 2024
2 parents 8fc9812 + e8df620 commit f7a7eb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions compass/ocean/mesh/cull.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ def _cull_topo(with_cavities, process_count, logger, latitude_threshold,
ds_map_culled_to_base, ds_preserve,
logger, latitude_threshold,
sweep_count)
ds_topo['ssh'] = ds_topo['landIceDraftObserved']

write_netcdf(ds_topo, 'topography_with_land_ice_mask.nc')

logger.info('Culling topography')
Expand Down Expand Up @@ -534,7 +536,7 @@ def _flood_fill_and_add_land_ice_mask(ds_topo, ds_base_mesh,
not_preserve = ds.transectCellMasks.sum(dim='nTransects') == 0

for var in ['landIceFracObserved', 'landIcePressureObserved',
'landIceDraftObserved', 'ssh',
'landIceDraftObserved',
'landIceGroundedFracObserved',
'landIceFloatingFracObserved', 'landIceThkObserved']:
ds_topo[var] = ds_topo[var].where(not_preserve, 0.0)
Expand Down Expand Up @@ -562,7 +564,7 @@ def _flood_fill_and_add_land_ice_mask(ds_topo, ds_base_mesh,

# update land-ice variables and ocean fraction accordingly
for var in ['landIceFracObserved', 'landIcePressureObserved',
'landIceDraftObserved', 'ssh', 'landIceGroundedFracObserved',
'landIceDraftObserved', 'landIceGroundedFracObserved',
'landIceFloatingFracObserved', 'landIceThkObserved']:
ds_topo[var] = ds_topo[var].where(land_ice_present, 0.0)

Expand Down
2 changes: 0 additions & 2 deletions compass/ocean/mesh/remap_topography.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,4 @@ def run(self):

ds_out['landIceDraftObserved'] = draft

ds_out['ssh'] = draft

write_netcdf(ds_out, 'topography_remapped.nc')

0 comments on commit f7a7eb5

Please sign in to comment.