Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ice thickness and pressure where above flotation #855

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compass/ocean/mesh/remap_topography.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[remap_topography]

# the name of the topography file in the bathymetry database
topo_filename = BedMachineAntarctica_v3_and_GEBCO_2023_0.0125_degree_20240611.nc
topo_filename = BedMachineAntarctica_v3_and_GEBCO_2023_0.0125_degree_20240828.nc

# variable names in topo_filename
lon_var = lon
Expand Down
14 changes: 8 additions & 6 deletions compass/ocean/mesh/remap_topography.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
9 changes: 6 additions & 3 deletions compass/ocean/tests/utility/combine_topo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,17 @@ def _combine(self):
for field in ['bathymetry', 'ice_draft', 'thickness']:
combined[field].attrs['unit'] = 'meters'

for field in ['ice_mask', 'grounded_mask', 'ocean_mask']:
combined[field] = bedmachine[field]

combined['bathymetry_mask'] = bathy_mask

fill = {'ice_draft': 0., 'thickness': 0., 'ice_mask': 0.,
'grounded_mask': 0., 'ocean_mask': combined.bathymetry_mask}
'grounded_mask': 0., 'ocean_mask': bathy_mask}

for field, fill_val in fill.items():
valid = bedmachine[field].notnull()
combined[field] = bedmachine[field].where(valid, fill_val)
valid = combined[field].notnull()
combined[field] = combined[field].where(valid, fill_val)

combined['water_column'] = \
combined['ice_draft'] - combined['bathymetry']
Expand Down
2 changes: 1 addition & 1 deletion compass/ocean/tests/utility/combine_topo/combine_topo.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ antarctic_filename = BedMachineAntarctica-v3.nc
global_filename = GEBCO_2023.nc

# the name of the output topography file, to be copied to the bathymetry database
cobined_filename = BedMachineAntarctica_v3_and_GEBCO_2023_0.0125_degree_20240611.nc
cobined_filename = BedMachineAntarctica_v3_and_GEBCO_2023_0.0125_degree_20240828.nc

# the target and minimum number of MPI tasks to use in remapping
ntasks = 512
Expand Down
Loading