88from mpas_tools .io import write_netcdf
99
1010from 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
0 commit comments