1 | SUBROUTINE ice_phy_remap(nlay_s,nlay_i,kideb,kiut) |
---|
2 | |
---|
3 | !!----------------------------------------------------------------------------- |
---|
4 | !! ** Purpose : |
---|
5 | !! This routine redistributes heat content and salt mass |
---|
6 | !! on the new grid |
---|
7 | !! |
---|
8 | !! |
---|
9 | !! ** Method : Linear redistribution |
---|
10 | !! |
---|
11 | !! ** Steps : switches, snow, ice heat content, ice salt content |
---|
12 | !! |
---|
13 | !! ** Arguments |
---|
14 | !! |
---|
15 | !! ** Inputs / Outputs |
---|
16 | !! |
---|
17 | !! ** External |
---|
18 | !! |
---|
19 | !! ** References |
---|
20 | !! |
---|
21 | !! ** History : (05-2003) Martin Vancoppenolle, LIM1D |
---|
22 | !! (05-2008) Martin Vancoppenolle, LLN, revision BIOLIM |
---|
23 | !! (09-2009) Martin Vancoppenolle, LLN, restructuration BIOLIM |
---|
24 | !!----------------------------------------------------------------------------- |
---|
25 | |
---|
26 | USE lib_fortran |
---|
27 | |
---|
28 | INCLUDE 'type.com' |
---|
29 | INCLUDE 'para.com' |
---|
30 | INCLUDE 'const.com' |
---|
31 | INCLUDE 'ice.com' |
---|
32 | INCLUDE 'thermo.com' |
---|
33 | INCLUDE 'bio.com' |
---|
34 | |
---|
35 | ! Local Variables |
---|
36 | REAL(8), DIMENSION (maxnlay) :: |
---|
37 | & zsh_i0 , !: old ice salt content (ppt.m-2) |
---|
38 | & zsh_i1 !: new ice salt content (ppt.m-2) |
---|
39 | |
---|
40 | REAL(8), DIMENSION (maxnlay) :: |
---|
41 | & zqh_i0 , !: old ice heat content (J.m-2) |
---|
42 | & zqh_i1 !: new ice heat content (J.m-2) |
---|
43 | |
---|
44 | REAL(8), DIMENSION (maxnlay) :: |
---|
45 | & zqh_s0 , !: old snow heat content (J.m-2) |
---|
46 | & zqh_s1 !: new snow heat content (J.m-2) |
---|
47 | |
---|
48 | REAL(8), DIMENSION( maxnlay ) :: |
---|
49 | & zthick1 !: thickness of physical layers |
---|
50 | |
---|
51 | REAL(8), DIMENSION (maxnlay+2) :: |
---|
52 | & zthick0 !: thickness of old layers |
---|
53 | LOGICAL :: |
---|
54 | & ln_write, ln_con |
---|
55 | |
---|
56 | ! Local Constants |
---|
57 | zeps = 1.0e-20 |
---|
58 | |
---|
59 | ln_write = .TRUE. |
---|
60 | ln_con = .TRUE. |
---|
61 | |
---|
62 | s_i_b(1,:) = sn_i_b(:) ! update salinity |
---|
63 | |
---|
64 | IF ( ln_write ) THEN |
---|
65 | WRITE(numout,*) ' ** ice_phy_remap : ' |
---|
66 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~ ' |
---|
67 | WRITE(numout,*) |
---|
68 | ENDIF |
---|
69 | ! |
---|
70 | !------------------------------------------------------------------------------| |
---|
71 | ! CONSERVATION CHECKS | |
---|
72 | !------------------------------------------------------------------------------| |
---|
73 | ! |
---|
74 | |
---|
75 | ji = 1 |
---|
76 | IF ( ln_con ) THEN |
---|
77 | CALL ice_sal_column(kideb,kiut,z_ms_i_ini,s_i_b(1,1:nlay_i), |
---|
78 | & deltaz_i_phy, nlay_i, .FALSE. ) |
---|
79 | ! salt content loss due to ice melt |
---|
80 | zfmelt = ( s_i_b(ji,1) * dh_i_surf(ji) + s_i_b(ji,nlay_i) * |
---|
81 | & MIN(dh_i_bott(ji),0.0) ) / ddtb |
---|
82 | ENDIF |
---|
83 | |
---|
84 | zqt_s_ini = 0.0 ! total heat content in snow (initial value) |
---|
85 | zqt_i_ini = 0.0 ! total heat content in ice (initial value) |
---|
86 | zqt_s_fin = 0.0 ! total heat content in snow (final value) |
---|
87 | zqt_i_fin = 0.0 ! total heat content in ice (final value) |
---|
88 | zqt_ini = 0.0 ! total heat content snow + ice (initial value) |
---|
89 | zqt_fin = 0.0 ! total heat content snow + ice (final value) |
---|
90 | |
---|
91 | DO 10 ji = kideb, kiut |
---|
92 | ! |
---|
93 | !------------------------------------------------------------------------------| |
---|
94 | ! SWITCHES | |
---|
95 | !------------------------------------------------------------------------------| |
---|
96 | ! |
---|
97 | ! snow surface behaviour : calcul de snind-snswi |
---|
98 | ! snind : index tel que sa valeur est 0 si la neige s'accrète |
---|
99 | ! 1 si la 1ere couche est entamée par la fonte |
---|
100 | ! 2 si la 2eme .... |
---|
101 | ! etc ... |
---|
102 | snind = 0 |
---|
103 | deltah = 0.0 |
---|
104 | DO layer = 1, nlay_s |
---|
105 | IF ( - dh_s_tot(ji) .GT. deltah ) THEN |
---|
106 | snind = layer |
---|
107 | ENDIF |
---|
108 | deltah = deltah + deltaz_s_phy(layer) |
---|
109 | END DO |
---|
110 | |
---|
111 | ! snswi : switch which value equals 1 if snow melts |
---|
112 | ! 0 if not |
---|
113 | snswi = MAX(0,INT(-dh_s_tot(ji)/MAX(zeps,ABS(dh_s_tot(ji))))) |
---|
114 | |
---|
115 | ! ice surface behaviour : computation of icsuind-icsuswi |
---|
116 | ! icsuind : index which values equals 0 if there is nothing |
---|
117 | ! 1 if first layer has started to melt |
---|
118 | ! 2 if first and second layer have started ... |
---|
119 | ! etc ... |
---|
120 | icsuind = 0 |
---|
121 | deltah = 0.0 |
---|
122 | DO layer = 1, nlay_i |
---|
123 | IF ( -dh_i_surf(ji).GT.deltah) THEN |
---|
124 | icsuind = layer |
---|
125 | ENDIF |
---|
126 | deltah = deltah + deltaz_i_phy(layer) |
---|
127 | END DO |
---|
128 | |
---|
129 | ! icsuswi : switch which value equals 1 if ice melts at the surface |
---|
130 | ! 0 if not |
---|
131 | icsuswi = max(0,int(-dh_i_surf(ji) |
---|
132 | & /max(zeps,abs(dh_i_surf(ji))))) |
---|
133 | |
---|
134 | ! ice bottom behaviour : computation of icboind-icboswi |
---|
135 | ! icboind : index which values equals 0 if accretion is on the way |
---|
136 | ! 1 if last layer has started to melt |
---|
137 | ! 2 if penultiem layer has started ... |
---|
138 | ! etc ... |
---|
139 | icboind = 0 |
---|
140 | deltah = 0.0 |
---|
141 | DO layer = nlay_i, 1, -1 |
---|
142 | IF (-dh_i_bott(ji) .GT. deltah) THEN |
---|
143 | icboind = nlay_i+1-layer |
---|
144 | ENDIF |
---|
145 | deltah = deltah + deltaz_i_phy(layer) |
---|
146 | END DO |
---|
147 | |
---|
148 | ! icboswi : switch which value equals 1 if accretion of ice is on the way |
---|
149 | ! 0 if ablation is on the way |
---|
150 | icboswi = max(0,int(dh_i_bott(ji) |
---|
151 | & /max(zeps,abs(dh_i_bott(ji))))) |
---|
152 | |
---|
153 | ! snow-ice formation : calcul de snicind-snicswi |
---|
154 | ! snicind : index which values equals 0 if no snow-ice forms |
---|
155 | ! 1 if last layer of snow has started to melt |
---|
156 | ! 2 if penultiem layer ... |
---|
157 | snicind = 0 |
---|
158 | deltah = 0.0 |
---|
159 | DO layer = nlay_s, 1, -1 |
---|
160 | IF ( dh_snowice(ji) .GT. deltah ) THEN |
---|
161 | snicind = nlay_s+1-layer |
---|
162 | ENDIF |
---|
163 | deltah = deltah + deltaz_s_phy(layer) |
---|
164 | END DO |
---|
165 | |
---|
166 | ! snicswi : switch which value equals 1 if snow-ice forms |
---|
167 | ! 0 if not |
---|
168 | snicswi = max(0,int(dh_snowice(ji)/ |
---|
169 | & max(zeps,abs(dh_snowice(ji))))) |
---|
170 | |
---|
171 | IF ( ln_write ) THEN |
---|
172 | WRITE(numout,*) ' - Switches ... ' |
---|
173 | WRITE(numout,*) ' snind : ', snind |
---|
174 | WRITE(numout,*) ' snswi : ', snswi |
---|
175 | WRITE(numout,*) ' icsuind : ', icsuind |
---|
176 | WRITE(numout,*) ' icsuswi : ', icsuswi |
---|
177 | WRITE(numout,*) ' icboind : ', icboind |
---|
178 | WRITE(numout,*) ' icboswi : ', icboswi |
---|
179 | WRITE(numout,*) ' snicind : ', snicind |
---|
180 | WRITE(numout,*) ' snicswi : ', snicswi |
---|
181 | WRITE(numout,*) |
---|
182 | ENDIF |
---|
183 | |
---|
184 | !------------------------------------------------------------------------------! |
---|
185 | |
---|
186 | !------------------------------! |
---|
187 | ! ! |
---|
188 | ! SNOW redistribution ! |
---|
189 | ! ! |
---|
190 | !------------------------------! |
---|
191 | |
---|
192 | ! |
---|
193 | !------------------------------------------------------------------------------| |
---|
194 | ! S-1) 'Old' snow cotes |
---|
195 | !------------------------------------------------------------------------------| |
---|
196 | ! |
---|
197 | ! |
---|
198 | ! by 'old', I mean that layers coming from accretion are included, and |
---|
199 | ! that surface layers which were partly melted are reduced ... |
---|
200 | |
---|
201 | ! indexes of the vectors |
---|
202 | ntop0 = 1 |
---|
203 | nbot0 = nlay_s+1-snind+(1-snicind)*snicswi |
---|
204 | |
---|
205 | ! cotes of the top of the layers |
---|
206 | zm0(0) = 0.0 |
---|
207 | DO layer = 1, nbot0-1 |
---|
208 | limsum = snswi*(layer+snind-1) + (1-snswi)*(layer-1) |
---|
209 | limsum = MIN( limsum , nlay_s ) |
---|
210 | zm0(layer) = dh_s_tot(ji) |
---|
211 | DO layer_a = 1, limsum |
---|
212 | zm0(layer) = zm0(layer) + deltaz_s_phy(layer_a) |
---|
213 | END DO |
---|
214 | END DO |
---|
215 | |
---|
216 | zm0(nbot0) = dh_s_tot(ji) - snicswi*dh_snowice(ji) |
---|
217 | DO layer = 1, nlay_s |
---|
218 | zm0(nbot0) = zm0(nbot0) + deltaz_s_phy(layer) |
---|
219 | END DO |
---|
220 | zm0(1) = dh_s_tot(ji)*(1-snswi) + snswi*zm0(1) |
---|
221 | |
---|
222 | ! thicknesses |
---|
223 | DO layer = ntop0, nbot0 |
---|
224 | zthick0(layer) = zm0(layer) - zm0(layer-1) |
---|
225 | END DO |
---|
226 | ! |
---|
227 | !------------------------------------------------------------------------------| |
---|
228 | ! S-2) 'Old' enthalpies |
---|
229 | !------------------------------------------------------------------------------| |
---|
230 | ! |
---|
231 | ! enthalpies |
---|
232 | zqh_s0(1) = rhon * ( cpg * ( tpw - (1 - snswi) * tabqb(ji) - ! fallen snow |
---|
233 | & snswi * t_s_b(ji,1) ) + lfus )* zthick0(1) |
---|
234 | zqt_s_ini = zqt_s_ini + zqh_s0(1) |
---|
235 | |
---|
236 | DO layer = 2, nbot0 ! remaining snow |
---|
237 | limsum = (1-snswi)*(layer-1) + snswi*(layer+snind-1) |
---|
238 | limsum = MIN( limsum, nlay_s ) |
---|
239 | zqh_s0(layer) = rhon*( cpg*(tpw - t_s_b(ji,limsum)) + lfus) |
---|
240 | & *zthick0(layer) |
---|
241 | zswitch = 1.0 - MAX (0.0, SIGN ( 1.0d0, zeps - ht_s_b(ji) ) ) |
---|
242 | zqt_s_ini = zqt_s_ini + ( 1 - snswi ) * zqh_s0(layer) * zswitch |
---|
243 | WRITE(numout,*) 'limsum : ', limsum |
---|
244 | END DO |
---|
245 | zqt_ini = zqt_s_ini |
---|
246 | |
---|
247 | IF ( ln_write ) THEN |
---|
248 | WRITE(numout,*) ' - Snow redistribution ... ' |
---|
249 | WRITE(numout,*) ' ntop0 : ', ntop0 |
---|
250 | WRITE(numout,*) ' nbot0 : ', nbot0 |
---|
251 | WRITE(numout,*) ' zm0 : ', ( zm0(layer), layer = 0, nbot0) |
---|
252 | WRITE(numout,*) ' zqh_s0: ', ( zqh_s0(layer), layer = 1, nbot0) |
---|
253 | WRITE(numout,*) ' q_s_b1: ', q_s_b(ji,1) |
---|
254 | WRITE(numout,*) |
---|
255 | ENDIF |
---|
256 | |
---|
257 | !----------------------------------------- |
---|
258 | ! snow enthalpy lost in sea ice formation |
---|
259 | !----------------------------------------- |
---|
260 | zqsnow = 0.0 |
---|
261 | zdeltah = 0.0 |
---|
262 | |
---|
263 | DO layer = nlay_s, 1, -1 |
---|
264 | zhsnow = MAX(0.0,dh_snowice(ji)-zdeltah) |
---|
265 | zqsnow = zqsnow + q_s_b(ji,layer) * zhsnow |
---|
266 | END DO |
---|
267 | |
---|
268 | ! |
---|
269 | !------------------------------------------------------------------------------| |
---|
270 | ! S-3) New snow grid |
---|
271 | !------------------------------------------------------------------------------| |
---|
272 | ! |
---|
273 | ! indexes of the vectors |
---|
274 | ntop1 = 1 |
---|
275 | nbot1 = nlay_s |
---|
276 | |
---|
277 | ! cotes and thicknesses |
---|
278 | CALL ice_phy_grid( kideb , kiut , nlay_s , ht_s_b(ji), .FALSE., |
---|
279 | & "sno" ) |
---|
280 | ! |
---|
281 | !------------------------------------------------------------------------------| |
---|
282 | ! S-4) New snow enthalpy |
---|
283 | !------------------------------------------------------------------------------| |
---|
284 | ! |
---|
285 | CALL ice_phy_relay( nbot0 , nbot1 , ntop0 , ntop1 , |
---|
286 | & zthick0, deltaz_s_phy, zqh_s0 , zqh_s1 ) |
---|
287 | |
---|
288 | zqt_s_fin = 0.0 ! total heat content |
---|
289 | ! |
---|
290 | !------------------------------------------------------------------------------| |
---|
291 | ! S-5) Recover snow temperature |
---|
292 | !------------------------------------------------------------------------------| |
---|
293 | ! |
---|
294 | WRITE(numout,*) ' Recover snow temperature ' |
---|
295 | WRITE(numout,*) ' nlay_s : ', nlay_s |
---|
296 | WRITE(numout,*) ' ji : ', ji |
---|
297 | WRITE(numout,*) ' ht_s_b : ', ht_s_b(ji) |
---|
298 | WRITE(numout,*) ' tpw : ', tpw |
---|
299 | WRITE(numout,*) ' rhon : ', rhon |
---|
300 | DO layer = 1, nlay_s |
---|
301 | isnow = INT( 1.0 - MAX( 0.0 , SIGN( 1.0d0, - ht_s_b(ji) ) )) |
---|
302 | WRITE(numout,*) ' isnow : ', isnow |
---|
303 | t_s_b(ji,layer) = isnow * ( tpw - ( zqh_s1(layer) / rhon / |
---|
304 | & MAX( deltaz_s_phy(layer) , zeps ) - lfus ) |
---|
305 | & / cpg ) + |
---|
306 | & ( 1.0 - isnow ) * tpw |
---|
307 | WRITE(numout,*) ' zqh_s1: ', zqh_s1(layer) |
---|
308 | WRITE(numout,*) ' deltaz_s_phy : ', deltaz_s_phy(layer) |
---|
309 | WRITE(numout,*) ' zeps : ', zeps |
---|
310 | WRITE(numout,*) ' lfus : ', lfus |
---|
311 | WRITE(numout,*) ' cpg : ', cpg |
---|
312 | WRITE(numout,*) ' t_s_b : ', t_s_b(ji,layer) |
---|
313 | zqt_s_fin = zqt_s_fin + zqh_s1(layer) |
---|
314 | q_s_b(ji,layer) = isnow * zqh_s1(layer) / |
---|
315 | & MAX( deltaz_s_phy(layer) , zeps ) |
---|
316 | END DO |
---|
317 | WRITE(numout,*) ' t_s_b : ', t_s_b(ji,1) |
---|
318 | zqt_fin = zqt_s_fin |
---|
319 | |
---|
320 | IF ( ln_write ) THEN |
---|
321 | WRITE(numout,*) ' - Heat conservation, ice_th_remap , snow ' |
---|
322 | WRITE(numout,*) ' zqt_s_fin : ', zqt_s_fin |
---|
323 | WRITE(numout,*) ' zqt_s_ini : ', zqt_s_ini |
---|
324 | WRITE(numout,*) ' TS1. zqt_s_fin - zqt_s_ini : ', |
---|
325 | & zqt_s_fin - zqt_s_ini |
---|
326 | WRITE(numout,*) |
---|
327 | ENDIF |
---|
328 | |
---|
329 | !------------------------------------------------------------------------------! |
---|
330 | |
---|
331 | !------------------------------! |
---|
332 | ! ! |
---|
333 | ! ICE redistribution ! |
---|
334 | ! ! |
---|
335 | !------------------------------! |
---|
336 | |
---|
337 | !------------------------------------------------------------------------------! |
---|
338 | |
---|
339 | ! |
---|
340 | !------------------------------------------------------------------------------! |
---|
341 | ! I-1) Old ice grid ! |
---|
342 | !------------------------------------------------------------------------------! |
---|
343 | ! |
---|
344 | ! indexes of the vectors |
---|
345 | ntop0 = 1 |
---|
346 | nbot0 = MAX(1, MIN( nlay_i + 1 - icboind + (1-icsuind)*icsuswi |
---|
347 | & + snicswi, nlay_i + 2 ) ) |
---|
348 | |
---|
349 | ! cotes of the top of the layers |
---|
350 | zm0(0) = 0.0 |
---|
351 | DO layer = 1, nbot0-1 |
---|
352 | limsum = ((icsuswi*(icsuind+layer-1) + (1-icsuswi)*layer))* |
---|
353 | & (1-snicswi) + (layer-1)*snicswi |
---|
354 | zm0(layer)= icsuswi*dh_i_surf(ji) + snicswi*dh_snowice(ji) |
---|
355 | DO layer_a = 1, limsum |
---|
356 | zm0(layer) = zm0(layer) + deltaz_i_phy(layer_a) |
---|
357 | END DO |
---|
358 | END DO |
---|
359 | |
---|
360 | zm0(nbot0) = icsuswi*dh_i_surf(ji) + snicswi*dh_snowice(ji) + |
---|
361 | & dh_i_bott(ji) |
---|
362 | DO layer = 1, nlay_i |
---|
363 | zm0(nbot0) = zm0(nbot0) + deltaz_i_phy(layer) |
---|
364 | END DO |
---|
365 | zm0(1) = snicswi*dh_snowice(ji) + (1-snicswi)*zm0(1) |
---|
366 | |
---|
367 | ! thicknesses |
---|
368 | DO layer = ntop0, nbot0 |
---|
369 | zthick0(layer) = zm0(layer) - zm0(layer-1) |
---|
370 | END DO |
---|
371 | |
---|
372 | IF ( ln_write ) THEN |
---|
373 | WRITE(numout,*) ' - Ice redistribution ... ' |
---|
374 | WRITE(numout,*) ' ntop0 : ', ntop0 |
---|
375 | WRITE(numout,*) ' nbot0 : ', nbot0 |
---|
376 | WRITE(numout,*) ' zm0 : ', ( zm0(layer), layer = 0, nbot0) |
---|
377 | WRITE(numout,*) ' zthick0: ', ( zthick0(layer), layer = ntop0, |
---|
378 | & nbot0) |
---|
379 | ENDIF |
---|
380 | ! |
---|
381 | !------------------------------------------------------------------------------| |
---|
382 | ! I-2) Old ice heat content | |
---|
383 | !------------------------------------------------------------------------------| |
---|
384 | ! |
---|
385 | !------------------------- |
---|
386 | ! sources of heat content |
---|
387 | !------------------------- |
---|
388 | !- new ice |
---|
389 | tmelts = - tmut * s_i_new + tpw |
---|
390 | zqh_i_new = rhog * ( cpg * ( tmelts - t_bo_b(ji) ) |
---|
391 | & + lfus * ( 1.0 - ( tmelts - tpw ) / |
---|
392 | & ( t_bo_b(ji) - tpw ) ) - cpw * ( tmelts - tpw ) ) |
---|
393 | & * zthick0(nbot0) |
---|
394 | |
---|
395 | !- snow ice |
---|
396 | zqh_i_sni = rho0 * cpw * ( tpw - t_bo_b(ji) ) * dh_snowice(ji) * |
---|
397 | & ( rhog - rhon ) / rhog * snicswi ! generally positive |
---|
398 | fsnic = - zqh_i_sni / ddtb |
---|
399 | zqh_i_sni = zqsnow + zqh_i_sni |
---|
400 | |
---|
401 | !---------------------- |
---|
402 | ! sea ice heat content |
---|
403 | !---------------------- |
---|
404 | zqh_i0(:) = 0.0 |
---|
405 | !- internal ice layers |
---|
406 | DO layer = ntop0, nbot0 |
---|
407 | limsum = MAX( 1 , MIN( snicswi*(layer-1) |
---|
408 | & + icsuswi * ( layer - 1 + icsuind ) |
---|
409 | & + ( 1 - icsuswi ) * ( 1 - snicswi ) * layer, nlay_i ) ) |
---|
410 | zqh_i0(layer) = q_i_b(ji,limsum) * zthick0(layer) |
---|
411 | WRITE(numout,*) ' limsum : ', limsum, ' layer : ', layer |
---|
412 | END DO |
---|
413 | |
---|
414 | !- boundary values |
---|
415 | zqh_i0(1) = snicswi * zqh_i_sni + ( 1 - snicswi ) * zqh_i0(1) |
---|
416 | zqh_i0(nbot0) = ( 1 - icboswi ) * zqh_i0(nbot0) + |
---|
417 | & icboswi * zqh_i_new |
---|
418 | |
---|
419 | IF ( ln_write ) THEN |
---|
420 | WRITE(numout,*) ' zqh_i_new: ', zqh_i_new |
---|
421 | WRITE(numout,*) ' zqh_i_sni: ', zqh_i_sni |
---|
422 | WRITE(numout,*) ' zqh_i0: ', ( zqh_i0(layer), layer = ntop0, |
---|
423 | & nbot0) |
---|
424 | ENDIF |
---|
425 | |
---|
426 | DO layer = ntop0, nbot0 |
---|
427 | zqt_i_ini = zqt_i_ini + zqh_i0(layer) |
---|
428 | END DO |
---|
429 | |
---|
430 | zqt_ini = zqt_ini + zqt_i_ini ! includes zqsnic and zqsnow |
---|
431 | |
---|
432 | ! |
---|
433 | !------------------------------------------------------------------------------| |
---|
434 | ! I-3) Old ice salt content | |
---|
435 | !------------------------------------------------------------------------------| |
---|
436 | ! |
---|
437 | ! basal new ice salt content |
---|
438 | zsh_i_new = e_skel * oce_sal * MAX ( dh_i_bott(ji), 0.0 ) |
---|
439 | ! snow ice salt content |
---|
440 | s_i_snic = ( rhog - rhon ) / rhog * oce_sal * |
---|
441 | & frtr_si_phy ! snow ice salinity |
---|
442 | zsh_i_sni = s_i_snic * dh_snowice(ji) |
---|
443 | |
---|
444 | IF ( ln_write ) THEN |
---|
445 | WRITE(numout,*) ' Salt sources : ' |
---|
446 | WRITE(numout,*) ' ~~~~~~~~~~~~~~ ' |
---|
447 | WRITE(numout,*) ' zsh_i_new : ', zsh_i_new |
---|
448 | WRITE(numout,*) ' zsh_i_sni : ', zsh_i_sni |
---|
449 | ENDIF |
---|
450 | |
---|
451 | zsh_i0(:) = 0.0 |
---|
452 | |
---|
453 | DO layer = ntop0, nbot0 |
---|
454 | limsum = snicswi*(layer-1) + icsuswi*(layer-1+icsuind) |
---|
455 | & + (1-icsuswi)*(1-snicswi)*layer |
---|
456 | limsum = MAX(1,MIN(snicswi*(layer-1) + icsuswi*(layer-1 |
---|
457 | & + icsuind) |
---|
458 | & + (1-icsuswi)*(1-snicswi)*layer, nlay_i)) |
---|
459 | zsh_i0(layer) = s_i_b(ji,limsum)*zthick0(layer) |
---|
460 | END DO |
---|
461 | |
---|
462 | zsh_i0(nbot0) = (1-icboswi)* zsh_i0(nbot0) + icboswi * zsh_i_new |
---|
463 | zsh_i0(1) = snicswi * zsh_i_sni + ( 1 - snicswi ) * zsh_i0(1) |
---|
464 | |
---|
465 | ! z_ms_i_ini = 0.0 |
---|
466 | ! DO layer = ntop0, nbot0 |
---|
467 | ! z_ms_i_ini = z_ms_i_ini + zsh_i0(layer) |
---|
468 | ! END DO |
---|
469 | |
---|
470 | IF ( ln_write ) THEN |
---|
471 | WRITE(numout,*) ' frtr_si_phy:', frtr_si_phy |
---|
472 | WRITE(numout,*) ' oce_sal : ', oce_sal |
---|
473 | WRITE(numout,*) ' s_i_snic : ', s_i_snic |
---|
474 | WRITE(numout,*) ' zsh_i0 : ', zsh_i0(ntop0:nbot0) |
---|
475 | WRITE(numout,*) |
---|
476 | ENDIF |
---|
477 | ! |
---|
478 | !------------------------------------------------------------------------------| |
---|
479 | ! I-4) New ice profile | |
---|
480 | !------------------------------------------------------------------------------| |
---|
481 | ! |
---|
482 | ! indexes of the vectors |
---|
483 | ntop1 = 1 |
---|
484 | nbot1 = nlay_i |
---|
485 | |
---|
486 | ! cotes and thicknesses |
---|
487 | CALL ice_phy_grid( kideb , kiut , nlay_i , ht_i_b(ji), .FALSE., |
---|
488 | & "ice" ) |
---|
489 | |
---|
490 | IF ( ln_write ) THEN |
---|
491 | WRITE(numout,*) ' z_i_phy : ', ( z_i_phy(layer), |
---|
492 | & layer = ntop1, nbot1 ) |
---|
493 | WRITE(numout,*) ' deltaz_i_phy : ', ( deltaz_i_phy(layer), |
---|
494 | & layer = ntop1, nbot1 ) |
---|
495 | ENDIF |
---|
496 | ! |
---|
497 | !------------------------------------------------------------------------------| |
---|
498 | ! I-5) Redistribute ice heat content | |
---|
499 | !------------------------------------------------------------------------------| |
---|
500 | ! |
---|
501 | ! Remapping ice enthalpy |
---|
502 | CALL ice_phy_relay( nbot0 , nbot1 , ntop0 , ntop1 , |
---|
503 | & zthick0, deltaz_i_phy, zqh_i0 , zqh_i1 ) |
---|
504 | |
---|
505 | IF ( ln_write ) THEN |
---|
506 | WRITE(numout,*) ' zqh_i1 : ',( zqh_i1(layer), layer = ntop1, |
---|
507 | & nbot1) |
---|
508 | WRITE(numout,*) |
---|
509 | ENDIF |
---|
510 | |
---|
511 | DO layer = ntop1, nbot1 |
---|
512 | zqt_i_fin = zqt_i_fin + zqh_i1(layer) |
---|
513 | END DO |
---|
514 | |
---|
515 | zqt_fin = zqt_fin + zqt_i_fin ! includes zqsnic and zqsnow |
---|
516 | ! |
---|
517 | !------------------------------------------------------------------------------| |
---|
518 | ! I-6) Redistribute ice salt content | |
---|
519 | !------------------------------------------------------------------------------| |
---|
520 | ! |
---|
521 | CALL ice_phy_relay( nbot0 , nbot1 , ntop0 , ntop1 , |
---|
522 | & zthick0, deltaz_i_phy, zsh_i0 , zsh_i1 ) |
---|
523 | IF ( ln_write ) THEN |
---|
524 | WRITE(numout,*) ' zsh_i1 : ', zsh_i1(ntop0:nbot0) |
---|
525 | WRITE(numout,*) |
---|
526 | ENDIF |
---|
527 | |
---|
528 | ! |
---|
529 | !------------------------------------------------------------------------------| |
---|
530 | ! I-7) Heat conservation test | |
---|
531 | !------------------------------------------------------------------------------| |
---|
532 | ! |
---|
533 | IF ( ln_write ) THEN |
---|
534 | WRITE(numout,*) ' - Heat conservation, ice_th_remap , |
---|
535 | & sea ice... ' |
---|
536 | WRITE(numout,*) ' zqt_i_fin : ', zqt_i_fin |
---|
537 | WRITE(numout,*) ' zqt_i_ini : ', zqt_i_ini |
---|
538 | WRITE(numout,*) ' TI1. zqt_i_fin - zqt_i_ini : ', |
---|
539 | & zqt_i_fin - zqt_i_ini |
---|
540 | WRITE(numout,*) |
---|
541 | WRITE(numout,*) ' - Heat conservation, total ... ' |
---|
542 | WRITE(numout,*) ' zqt_ini : ', zqt_ini |
---|
543 | WRITE(numout,*) ' zqt_fin : ', zqt_fin |
---|
544 | WRITE(numout,*) ' zqt_fin-zqt_ini : ', zqt_fin-zqt_ini |
---|
545 | ENDIF |
---|
546 | ! |
---|
547 | !------------------------------------------------------------------------------| |
---|
548 | ! I-8) Recover energy of melting, salinity and temperature | |
---|
549 | !------------------------------------------------------------------------------| |
---|
550 | ! |
---|
551 | DO layer = 1, nlay_i |
---|
552 | q_i_b(ji,layer) = zqh_i1(layer) / |
---|
553 | & MAX( deltaz_i_phy(layer) , zeps ) |
---|
554 | END DO |
---|
555 | |
---|
556 | DO layer = 1, nlay_i |
---|
557 | s_i_b(ji,layer) = zsh_i1(layer) / MAX( deltaz_i_phy(layer) , |
---|
558 | & zeps ) |
---|
559 | END DO |
---|
560 | |
---|
561 | DO layer = 1, nlay_i |
---|
562 | tmelts = -tmut*s_i_b(ji,layer) + tpw |
---|
563 | aaa = cpg |
---|
564 | bbb = (cpw-cpg)*(tmelts-tpw) + q_i_b(ji,layer)/ rhog |
---|
565 | & - lfus |
---|
566 | ccc = lfus * (tmelts-tpw) |
---|
567 | discrim = SQRT( bbb*bbb - 4.0*aaa*ccc ) |
---|
568 | t_i_b(ji,layer) = tpw + (- bbb - discrim) / ( 2.0*aaa ) |
---|
569 | END DO |
---|
570 | ! |
---|
571 | !------------------------------------------------------------------------------| |
---|
572 | ! I-9) Salt conservation test | |
---|
573 | !------------------------------------------------------------------------------| |
---|
574 | ! |
---|
575 | CALL ice_sal_column(kideb,kiut,z_ms_i_fin,s_i_b(ji,1:nlay_i), |
---|
576 | & deltaz_i_phy, nlay_i, .FALSE.) |
---|
577 | IF ( ln_write ) WRITE(numout,*) ' z_ms_i_fin : ', |
---|
578 | & z_ms_i_fin |
---|
579 | |
---|
580 | ! Flux due to bottom and snow ice formation |
---|
581 | zfgrml = zsh_i_new / ddtb |
---|
582 | zfsigr = zsh_i_sni / ddtb |
---|
583 | |
---|
584 | zfgrml = zfgrml + zfmelt |
---|
585 | IF ( ln_write ) THEN |
---|
586 | WRITE(numout,*) ' zfgrml : ', zfgrml |
---|
587 | WRITE(numout,*) ' zfsigr : ', zfsigr |
---|
588 | ENDIF |
---|
589 | |
---|
590 | zerror = 1.0e-9 |
---|
591 | CALL ice_sal_conserv(kideb,kiut,'ice_phy_remap: ',zerror, |
---|
592 | & z_ms_i_ini,z_ms_i_fin, |
---|
593 | & zfgrml, zfsigr, ddtb) |
---|
594 | |
---|
595 | 10 CONTINUE |
---|
596 | |
---|
597 | RETURN |
---|
598 | |
---|
599 | !------------------------------------------------------------------------------- |
---|
600 | ! Fin de la routine ice_th_remap |
---|
601 | END |
---|