|
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 |
@@ -98,7 +97,12 @@ def _compute_init_topo(self): |
98 | 97 | section = config['isomip_plus_init'] |
99 | 98 | min_levels = section.getint('minimum_levels') |
100 | 99 | min_layer_thickness = section.getfloat('min_layer_thickness') |
101 | | - min_column_thickness = section.getfloat('min_column_thickness') |
| 100 | + if thin_film: |
| 101 | + min_column_thickness = ( |
| 102 | + section.getfloat('min_column_thickness_thin_film')) |
| 103 | + else: |
| 104 | + min_column_thickness = ( |
| 105 | + section.getfloat('min_column_thickness_no_thin_film')) |
102 | 106 | min_land_ice_fraction = section.getfloat('min_land_ice_fraction') |
103 | 107 |
|
104 | 108 | ds_topo = xr.open_dataset('topo.nc') |
@@ -130,28 +134,17 @@ def _compute_init_topo(self): |
130 | 134 |
|
131 | 135 | ds_init['landIceGroundedFraction'] = ds_topo['landIceGroundedFraction'] |
132 | 136 |
|
133 | | - if thin_film: |
134 | | - # start from landIcePressure and compute landIceDraft |
135 | | - ds_init['landIcePressure'] = ds_topo['landIcePressure'] |
136 | | - |
137 | | - land_ice_draft = compute_land_ice_draft_from_pressure( |
138 | | - land_ice_pressure=ds_topo.landIcePressure, |
139 | | - modify_mask=ds_topo.landIcePressure > 0.) |
140 | | - |
141 | | - land_ice_draft = np.maximum(ds_topo.bedrockTopography, |
142 | | - land_ice_draft) |
| 137 | + # start from landIcePressure and compute landIceDraft |
| 138 | + ds_init['landIcePressure'] = ds_topo['landIcePressure'] |
143 | 139 |
|
144 | | - ds_init['landIceDraft'] = land_ice_draft |
| 140 | + land_ice_draft = compute_land_ice_draft_from_pressure( |
| 141 | + land_ice_pressure=ds_topo.landIcePressure, |
| 142 | + modify_mask=ds_topo.landIcePressure > 0.) |
145 | 143 |
|
146 | | - else: |
147 | | - # start form landIceDraft and compute landIcePressure |
148 | | - ds_init['landIceDraft'] = ds_topo['landIceDraft'] |
149 | | - |
150 | | - land_ice_pressure = compute_land_ice_pressure_from_draft( |
151 | | - land_ice_draft=ds_topo.landIceDraft, |
152 | | - modify_mask=ds_topo.landIceDraft < 0.) |
| 144 | + land_ice_draft = np.maximum(ds_topo.bedrockTopography, |
| 145 | + land_ice_draft) |
153 | 146 |
|
154 | | - ds_init['landIcePressure'] = land_ice_pressure |
| 147 | + ds_init['landIceDraft'] = land_ice_draft |
155 | 148 |
|
156 | 149 | ds_init['ssh'] = ds_init.landIceDraft |
157 | 150 |
|
@@ -274,7 +267,13 @@ def _plot(self): |
274 | 267 | Plot several fields from the initial condition |
275 | 268 | """ |
276 | 269 | section = self.config['isomip_plus_init'] |
277 | | - min_column_thickness = section.getfloat('min_column_thickness') |
| 270 | + thin_film = self.thin_film |
| 271 | + if thin_film: |
| 272 | + min_column_thickness = ( |
| 273 | + section.getfloat('min_column_thickness_thin_film')) |
| 274 | + else: |
| 275 | + min_column_thickness = ( |
| 276 | + section.getfloat('min_column_thickness_no_thin_film')) |
278 | 277 | min_layer_thickness = section.getfloat('min_layer_thickness') |
279 | 278 |
|
280 | 279 | tol = 1e-10 |
|
0 commit comments