|
9 | 9 | from polaris.ocean.ice_shelf import ( |
10 | 10 | compute_freezing_temperature, |
11 | 11 | compute_land_ice_draft_from_pressure, |
12 | | - compute_land_ice_pressure_from_draft, |
13 | 12 | ) |
14 | 13 | from polaris.ocean.vertical import init_vertical_coord |
15 | 14 | from polaris.ocean.viz import compute_transect, plot_transect |
@@ -109,7 +108,14 @@ def _compute_init_topo(self): |
109 | 108 | section = config['isomip_plus_init'] |
110 | 109 | min_levels = section.getint('minimum_levels') |
111 | 110 | min_layer_thickness = section.getfloat('min_layer_thickness') |
112 | | - min_column_thickness = section.getfloat('min_column_thickness') |
| 111 | + if thin_film: |
| 112 | + min_column_thickness = section.getfloat( |
| 113 | + 'min_column_thickness_thin_film' |
| 114 | + ) |
| 115 | + else: |
| 116 | + min_column_thickness = section.getfloat( |
| 117 | + 'min_column_thickness_no_thin_film' |
| 118 | + ) |
113 | 119 | min_land_ice_fraction = section.getfloat('min_land_ice_fraction') |
114 | 120 |
|
115 | 121 | ds_topo = xr.open_dataset('topo.nc') |
@@ -143,31 +149,17 @@ def _compute_init_topo(self): |
143 | 149 |
|
144 | 150 | ds_init['landIceGroundedFraction'] = ds_topo['landIceGroundedFraction'] |
145 | 151 |
|
146 | | - if thin_film: |
147 | | - # start from landIcePressure and compute landIceDraft |
148 | | - ds_init['landIcePressure'] = ds_topo['landIcePressure'] |
149 | | - |
150 | | - land_ice_draft = compute_land_ice_draft_from_pressure( |
151 | | - land_ice_pressure=ds_topo.landIcePressure, |
152 | | - modify_mask=ds_topo.landIcePressure > 0.0, |
153 | | - ) |
154 | | - |
155 | | - land_ice_draft = np.maximum( |
156 | | - ds_topo.bedrockTopography, land_ice_draft |
157 | | - ) |
158 | | - |
159 | | - ds_init['landIceDraft'] = land_ice_draft |
| 152 | + # start from landIcePressure and compute landIceDraft |
| 153 | + ds_init['landIcePressure'] = ds_topo['landIcePressure'] |
160 | 154 |
|
161 | | - else: |
162 | | - # start form landIceDraft and compute landIcePressure |
163 | | - ds_init['landIceDraft'] = ds_topo['landIceDraft'] |
| 155 | + land_ice_draft = compute_land_ice_draft_from_pressure( |
| 156 | + land_ice_pressure=ds_topo.landIcePressure, |
| 157 | + modify_mask=ds_topo.landIcePressure > 0.0, |
| 158 | + ) |
164 | 159 |
|
165 | | - land_ice_pressure = compute_land_ice_pressure_from_draft( |
166 | | - land_ice_draft=ds_topo.landIceDraft, |
167 | | - modify_mask=ds_topo.landIceDraft < 0.0, |
168 | | - ) |
| 160 | + land_ice_draft = np.maximum(ds_topo.bedrockTopography, land_ice_draft) |
169 | 161 |
|
170 | | - ds_init['landIcePressure'] = land_ice_pressure |
| 162 | + ds_init['landIceDraft'] = land_ice_draft |
171 | 163 |
|
172 | 164 | ds_init['ssh'] = ds_init.landIceDraft |
173 | 165 |
|
@@ -303,7 +295,15 @@ def _plot(self): |
303 | 295 | Plot several fields from the initial condition |
304 | 296 | """ |
305 | 297 | section = self.config['isomip_plus_init'] |
306 | | - min_column_thickness = section.getfloat('min_column_thickness') |
| 298 | + thin_film = self.thin_film |
| 299 | + if thin_film: |
| 300 | + min_column_thickness = section.getfloat( |
| 301 | + 'min_column_thickness_thin_film' |
| 302 | + ) |
| 303 | + else: |
| 304 | + min_column_thickness = section.getfloat( |
| 305 | + 'min_column_thickness_no_thin_film' |
| 306 | + ) |
307 | 307 | min_layer_thickness = section.getfloat('min_layer_thickness') |
308 | 308 |
|
309 | 309 | tol = 1e-10 |
|
0 commit comments