SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_thermo_lead_r.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !GLT_LIC The GELATO model is a seaice model used in stand-alone or embedded mode.
6 !GLT_LIC It has been developed by Meteo-France. The holder of GELATO is Meteo-France.
7 !GLT_LIC
8 !GLT_LIC This software is governed by the CeCILL-C license under French law and biding
9 !GLT_LIC by the rules of distribution of free software. See the CeCILL-C_V1-en.txt
10 !GLT_LIC (English) and CeCILL-C_V1-fr.txt (French) for details. The CeCILL is a free
11 !GLT_LIC software license, explicitly compatible with the GNU GPL
12 !GLT_LIC (see http://www.gnu.org/licenses/license-list.en.html#CeCILL)
13 !GLT_LIC
14 !GLT_LIC The CeCILL-C licence agreement grants users the right to modify and re-use the
15 !GLT_LIC software governed by this free software license. The exercising of this right
16 !GLT_LIC is conditional upon the obligation to make available to the community the
17 !GLT_LIC modifications made to the source code of the software so as to contribute to
18 !GLT_LIC its evolution.
19 !GLT_LIC
20 !GLT_LIC In consideration of access to the source code and the rights to copy, modify
21 !GLT_LIC and redistribute granted by the license, users are provided only with a limited
22 !GLT_LIC warranty and the software's author, the holder of the economic rights, and the
23 !GLT_LIC successive licensors only have limited liability. In this respect, the risks
24 !GLT_LIC associated with loading, using, modifying and/or developing or reproducing the
25 !GLT_LIC software by the user are brought to the user's attention, given its Free
26 !GLT_LIC Software status, which may make it complicated to use, with the result that its
27 !GLT_LIC use is reserved for developers and experienced professionals having in-depth
28 !GLT_LIC computer knowledge. Users are therefore encouraged to load and test the
29 !GLT_LIC suitability of the software as regards their requirements in conditions enabling
30 !GLT_LIC the security of their systems and/or data to be ensured and, more generally, to
31 !GLT_LIC use and operate it in the same conditions of security.
32 !GLT_LIC
33 !GLT_LIC The GELATO sofware is cureently distibuted with the SURFEX software, available at
34 !GLT_LIC http://www.cnrm.meteo.fr/surfex. The fact that you download the software deemed that
35 !GLT_LIC you had knowledge of the CeCILL-C license and that you accept its terms.
36 !GLT_LIC Attempts to use this software in a way not complying with CeCILL-C license
37 !GLT_LIC may lead to prosecution.
38 !GLT_LIC
39 ! =======================================================================
40 ! ======================= MODULE modi_glt_thermo_lead_r =====================
41 ! =======================================================================
42 !
43 !
44 ! * Do the thermodynamics for the lead covered fraction of the grid
45 ! cell.
46 !
47 ! Modified: 2007/11 (D. Salas y Melia)
48 ! thick(jh) < Hsi < thick(jh+1) is not correct: misses cases
49 ! like Hsi = thick(jh)
50 ! corrected to: thick(jh) < Hsi <= thick(jh+1)
51 ! Modified: 2009/06 (D. Salas y Melia) reduced grid
52 ! Modified: 2011/12 (A. Voldoire) modified diagnostics and ice/water
53 ! fluxes interface CALL
54 ! Modified: 2012/07 (D. Salas y Melia) suppress tpopw variable
55 !
56 ! ------------------- BEGIN MODULE modi_glt_thermo_lead_r -------------------
57 !
58 !THXS_SFX!MODULE modi_glt_thermo_lead_r
59 !THXS_SFX!INTERFACE
60 !THXS_SFX!!
61 !THXS_SFX!SUBROUTINE glt_thermo_lead_r &
62 !THXS_SFX! (tpdom,pustar,tpmxl,tpatm,tpblkw, &
63 !THXS_SFX! tpdia,tptfl,tpsit,tpsil, &
64 !THXS_SFX! tpldsit,tpldsil)
65 !THXS_SFX!!
66 !THXS_SFX! USE modd_types_glt
67 !THXS_SFX! USE modd_glt_param
68 !THXS_SFX!!
69 !THXS_SFX! TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
70 !THXS_SFX! tpdom
71 !THXS_SFX! REAL, DIMENSION(np), INTENT(in) :: &
72 !THXS_SFX! pustar
73 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
74 !THXS_SFX! tpmxl
75 !THXS_SFX! TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
76 !THXS_SFX! tpatm
77 !THXS_SFX!!
78 !THXS_SFX! TYPE(t_blk), DIMENSION(np), INTENT(inout) :: &
79 !THXS_SFX! tpblkw
80 !THXS_SFX! TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
81 !THXS_SFX! tpdia
82 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
83 !THXS_SFX! tptfl
84 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
85 !THXS_SFX! tpsit
86 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
87 !THXS_SFX! tpsil
88 !THXS_SFX!!
89 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(out) :: &
90 !THXS_SFX! tpldsit
91 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(out) :: &
92 !THXS_SFX! tpldsil
93 !THXS_SFX!END SUBROUTINE glt_thermo_lead_r
94 !THXS_SFX!!
95 !THXS_SFX!END INTERFACE
96 !THXS_SFX!END MODULE modi_glt_thermo_lead_r
97 !
98 ! -------------------- END MODULE modi_glt_thermo_lead_r --------------------
99 !
100 !
101 ! -----------------------------------------------------------------------
102 ! --------------------- SUBROUTINE glt_thermo_lead_r ------------------------
103 !
104 SUBROUTINE glt_thermo_lead_r &
105  (tpdom,pustar,tpmxl,tpatm,tpblkw, &
106  tpdia,tptfl,tpsit,tpsil, &
107  tpldsit,tpldsil)
108 !
109 !
110 !
111 ! 1. Declarations
112 ! ===============
113 !
114 ! 1.1. Module declarations
115 ! ------------------------
116 !
117  USE modd_types_glt
118  USE modd_glt_param
120  USE mode_glt_info_r
121  USE modi_gltools_chkglo_r
122  USE modi_glt_saltrap_r
123  USE modi_glt_updtfl_r
124  USE modi_glt_oceflx_r
125  USE mode_glt_stats_r
126 !
127  IMPLICIT NONE
128 !
129 !
130 ! 1.2. Dummy arguments declarations
131 ! ---------------------------------
132 !
133 ! .. INTENT(in) arguments.
134 !
135  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
136  tpdom
137  REAL, DIMENSION(np), INTENT(in) :: &
138  pustar
139  TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
140  tpmxl
141  TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
142  tpatm
143 !
144 ! .. INTENT(inout) arguments.
145 !
146  TYPE(t_blk), DIMENSION(np), INTENT(inout) :: &
147  tpblkw
148  TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
149  tpdia
150  TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
151  tptfl
152  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
153  tpsit
154  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
155  tpsil
156 !
157 ! .. INTENT(out) arguments.
158 !
159  TYPE(t_sit), DIMENSION(nt,np), INTENT(out) :: &
160  tpldsit
161  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(out) :: &
162  tpldsil
163 !
164 !
165 ! 1.3. Local variables declarations
166 ! ---------------------------------
167 !
168  INTEGER :: &
169  jk,jp,jt
170  LOGICAL, DIMENSION(np) :: &
171  yfreeze
172  REAL :: &
173  zibflx0,zlat0,zsst0,zfac0
174  REAL, DIMENSION(np) :: &
175  zfld,zfldsi,zhldsi,ztldsi,zdhldsi,za,zdtml,zhef,zsnflx, &
176  zdmsi,zfsit,zent0,zsalt0,ztem0
177  REAL, DIMENSION(nt,np) :: &
178  zdmsi2,zent,zsalt
179 !
180 !
181 ! 1.4. Array initializations
182 ! -------------------------
183 !
184  zfldsi(:) = 0.
185  zhldsi(:) = 0.
186  ztldsi(:) = 0.
187  za(:) = 0.
188  zdtml(:) = 0.
189  zhef(:) = 0.
190  zsnflx(:) = 0.
191  zdmsi(:) = 0.
192  zfsit(:) = 0.
193  zdmsi2(:,:) = 0.
194 ! print*,'(1) gltools_enthalpy =',tptfl%tlo
195 !
196 !
197 ! 1.5. Compute the ocean-ice heat flux (if requested)
198 ! ----------------------------------------------------
199 !
200 ! .. We update the ocean-ice heat flux (if not provided by the ocean model)
201 !
202  IF ( nextqoc==0 ) THEN
203  CALL glt_oceflx_r( tpdom,pustar,tpmxl )
204  ENDIF
205 !
206 !
207 ! 1.6. Define lead freezing boolean
208 ! ---------------------------------
209 !
210  yfreeze(:) = .false.
211  WHERE ( tpdom(:)%tmk==1 .AND. tpmxl(:)%tml<=tpmxl(:)%mlf+0.1 )
212  yfreeze(:) = .true.
213  ENDWHERE
214 !
215 !
216 ! 1.7. Welcome message
217 ! --------------------
218 !
219  IF (lp1) THEN
220  WRITE(noutlu,*) ' '
221  WRITE(noutlu,*) '**** LEVEL 4 - SUBROUTINE THERMO_LEAD_R'
222  WRITE(noutlu,*) ' '
223  ENDIF
224 !
225 !
226 ! 1.8. Check in
227 ! -------------
228 !
229  CALL gltools_chkglo_r( 'BEFORE THERMO_LEAD_R',tpdom,tpsit )
230 !
231 !
232 !
233 ! 2. Leads thermodynamics
234 ! =======================
235 !
236 ! 2.1. Compute new lead features
237 ! ------------------------------
238 !
239 ! 2.1.1. Lead fraction variation due to lateral sea ice melting
240 ! .............................................................
241 !
242 ! .. In thermo_ice, the concentration of sea ice changed, due to lateral
243 ! melting. So here, the concentration of leads should be changed
244 ! accordingly. Note these changes in concentration will cause a lack of
245 ! energy concentration, as the global flux sent by atmosphere to the
246 ! sea ice/open water ensemble won't be conserved.
247 !
248 ! .. Compute total sea ice concentration
249 !
250  zfsit(:) = sum(tpsit(:,:)%fsi,dim=1)
251 !
252 ! .. Concentration of leads. Note that here, to ensure accuracy of energy
253 ! conservation, it is not directly taken from the restart lead variable.
254 !
255  zfld(:) = 1.-zfsit(:)
256 !
257 !
258 ! 2.1.2. Compute P-E sent to the ocean through the leads
259 ! ......................................................
260 !
261 ! .. Note : evaporation and precipitations on leads (water in m.s-1).
262 !
263  tptfl(:)%wlo = tptfl(:)%wlo + &
264  zfld(:)*( tpatm(:)%lip + tpatm(:)%sop + tpblkw(:)%eva )
265  tpdia(:)%l_pr = zfld(:) * tpatm(:)%lip
266  tpdia(:)%l_prsn = zfld(:) * tpatm(:)%sop
267  tpdia(:)%sul = zfld(:) * tpblkw(:)%eva
268 !
269 !
270 !
271 ! 2.1.3. Parameterization of slush sea ice
272 ! .........................................
273 !
274 ! .. Compute energy transfer due to snow going to leads (per m2)
275 !
276  IF ( nsnwrad==1 ) THEN
277  zsnflx(:) = -xmhofusn0*tpatm(:)%sop
278  ELSE
279  zsnflx(:) = 0.
280  ENDIF
281 !
282 !
283 ! 2.1.5. Compute solar flux absorbed by the ocean through the leads
284 ! .................................................................
285 !
286 ! .. Solar flux (totally transmitted to the ocean in all cases)
287 !
288  tptfl(:)%llo = tptfl(:)%llo + zfld(:)*tpblkw(:)%swa
289 !
290 !
291 ! 2.1.6. Compute total non-solar heat flux on leads
292 ! .................................................
293 !
294 ! .. This is actually the sum of the non-solar flux sent by the atmosphere
295 ! model and of the flux qml sent by the ocean.
296 !
297  zhef(:) = tpmxl(:)%qml + tpblkw(:)%nsf + zsnflx(:)
298 !
299 ! .. Taking into account the ocean-ice heat flux
300 ! - If the ocean-ice flux is larger than the non-solar flux, no sea
301 ! ice will be formed; we assume that the oce-ice heat flux exactly compensates
302 ! the non-solar heat flux
303 !
304 ! A PRECISER
305  WHERE( yfreeze(:) )
306  WHERE( zhef(:)>0. )
307  yfreeze = .false.
308  ELSEWHERE
309  WHERE ( zhef(:) + tpmxl(:)%qoc > 0. )
310  yfreeze = .false.
311  ELSEWHERE
312  zhef(:) = zhef(:) + tpmxl(:)%qoc
313  ENDWHERE
314  ENDWHERE
315  ENDWHERE
316 !
317 !print*,glt_avg_r(tpdom,tptfl%tlo,0)
318  WHERE( .NOT. yfreeze(:) )
319  tptfl(:)%tlo = tptfl(:)%tlo + zfld(:) * zhef(:)
320  ELSEWHERE
321  tptfl(:)%tlo = tptfl(:)%tlo - zfld(:) * tpmxl(:)%qoc
322  tpdia(:)%qoi = tpdia(:)%qoi + zfld(:) * tpmxl(:)%qoc
323  ENDWHERE
324 !print*,glt_avg_r(tpdom,tptfl%tlo,0)
325 !
326 ! Ajouter les diags %qoi et modifier %tlo eventuellement
327 
328 ! WHERE( zhef(:)<0. .AND. tpmxl(:)%qoc > -zhef(:) )
329 ! yfreeze(:) = .FALSE.
330 !! tptfl%tlo is updated in 2.2.1.
331 ! tpdia(:)%qoi = tpdia(:)%qoi - zfld(:) * zhef(:)
332 ! ELSEWHERE
333 ! zhef(:) = zhef(:) + tpmxl(:)%qoc
334 ! ENDWHERE
335 ! print*,'(2) gltools_enthalpy =',tptfl%tlo
336 !
337 !
338 ! 2.2. Compute the characteristics of new sea ice formed in leads
339 ! ---------------------------------------------------------------
340 !
341 ! 2.2.1. No ice freezing in the lead
342 ! ....................................
343 !
344 ! .. In this case, no sea ice will be created in the lead; the solar and
345 ! non solar heat flux can be directly sent to the ocean surface.
346 !
347  WHERE ( .NOT.yfreeze(:) )
348  ztldsi(:) = tpmxl(:)%mlf
349  zhldsi(:) = 0.
350  ENDWHERE
351 !
352 ! REPRENDRE ICI
353 !
354 ! 2.2.2. Ice freezing in the lead
355 ! .................................
356 !
357 ! .. If the non-solar heat flux applied to leads is positive, no sea ice
358 ! is formed. The heat flux goes to the ocean.
359 !
360 !print*,yfreeze
361 !print*,zhef
362 ! WHERE ( yfreeze(:) .AND. zhef(:)>=0. )
363 ! tptfl(:)%tlo = zfld(:) * zhef(:)
364 ! ztldsi(:) = tpmxl(:)%mlf
365 ! zhldsi(:) = 0.
366 ! ENDWHERE
367 ! print*,'(4) gltools_enthalpy =',tptfl%tlo
368 !
369 !
370 ! 2.2.3. Third case: lead at freezing point and zhef<0
371 ! ....................................................
372 !
373 ! Q = tpmxl%qml + tpblkw%nsf is used to create new sea ice in the
374 ! lead. This negative flux will be used for three different things:
375 ! - build up ice of thickness hi : term Lf*hi
376 ! - if ice surface temperature is ts, cool down this new ice
377 ! and use : rhoi*cpi*hi*(Tf-ts)/2
378 ! - maintain flux balance at the surface : ki*dt*(Tf-ts)/hi
379 ! The sum of these three terms should be equal to : -Q*dt.
380 !
381 ! .. No non-solar heat flux is sent to the ocean
382 !
383 ! WHERE ( yfreeze(:) .AND. zhef(:)<0. )
384 ! tptfl(:)%tlo = 0.
385 ! ENDWHERE
386 !
387 ! .. We assume that lead sea ice is formed at -5 deg C
388 !
389  ztem0(:) = -5.
390 !
391 ! .. Get salinity, gltools_enthalpy and thickness of the new ice
392 !
393  CALL glt_saltrap_r( yfreeze,zhef,ztem0,tpmxl,zsalt0,zent0,zhldsi )
394 !
395 ! .. Compute surface temperature and thickness of new ice formed in leads
396 !
397  WHERE ( yfreeze(:) )
398  ztldsi(:) = tpmxl(:)%mlf
399  ENDWHERE
400 !
401 ! .. Corrections: depending on new ice computed thickness, compute new
402 ! ice fraction and if necessary update new ice thickness
403 !
404  WHERE ( yfreeze(:) )
405  WHERE ( zhldsi(:)<=xhsimin )
406  zfldsi(:) = zfld(:)*zhldsi(:)/xhsimin
407  zhldsi(:) = xhsimin
408  ELSEWHERE
409  zfldsi(:) = zfld(:)
410  ENDWHERE
411  ENDWHERE
412 !
413 !
414 ! 2.3. Define lead sea ice state variable
415 ! ---------------------------------------
416 !
417 ! .. Massic salt content of new sea ice (2d array)
418 !
419  zsalt(:,:) = spread( zsalt0(:),1,nt )
420 !
421 ! Compute all ice state variables for sea ice formed in the leads
422 !
423 ! ..Sea ice 3D variables.
424 !
425  tpldsit(:,:)%esi = .false.
426  tpldsit(:,:)%asn = albw
427  tpldsit(:,:)%fsi = 0.
428  tpldsit(:,:)%hsi = 0.
429  tpldsit(:,:)%hsn = 0.
430  tpldsit(:,:)%rsn = rhosnwmin
431  tpldsit(:,:)%tsf = spread( tpmxl(:)%mlf,1,nt )
432  tpldsit(:,:)%ssi = zsalt(:,:)
433  tpldsit(:,:)%age = 0.
434  tpldsit(:,:)%vmp = 0.
435 !
436  DO jk = 1,nt
437  WHERE ( thick(jk)<zhldsi(:) .AND. zhldsi(:)<=thick(jk+1) &
438  .AND. zhldsi(:)>0. )
439  tpldsit(jk,:)%esi = .true.
440 ! tpldsit(jk,:)%asn = &
441 ! albyngi*AMIN1( albi,xalf1*zhldsi(:)**xpow+albw ) + &
442 ! ( 1.-albyngi )*albi
443  tpldsit(jk,:)%asn = albi
444  tpldsit(jk,:)%fsi = zfldsi(:)
445  tpldsit(jk,:)%hsi = zhldsi(:)
446  tpldsit(jk,:)%tsf = ztldsi(:)
447  ENDWHERE
448  END DO
449 !
450 ! .. Sea ice 4D variables.
451 !
452  tpldsil(:,:,:)%ent = spread( spread( zent0(:),1,nt ),1,nl )
453 !
454 !
455 ! 2.4. Prepare lead sea ice diagnostics
456 ! --------------------------------------
457 !
458  tpdia(:)%lsi = zfldsi(:)*zhldsi(:)*rhoice/dtt
459 !
460 !
461 ! 2.5. Print out information about new sea ice
462 ! ---------------------------------------------
463 !
464  CALL glt_info_si_r( 'About lead sea ice', tpsit=tpldsit )
465 !
466 !
467 !
468 ! 3. Energy conservation
469 ! =======================
470 !
471 ! .. Compute consequences of new sea ice formation on the mixed layer.
472 !
473 ! 3.1. Compute mass of newly formed ice
474 ! --------------------------------------
475 !
476  WHERE ( yfreeze(:) )
477  zdmsi(:) = rhoice * zfldsi(:) * zhldsi(:)
478  ENDWHERE
479  zdmsi2(1,:) = zdmsi(:)
480 !
481 !
482 ! 3.3. Update water, heat and salt fluxes affecting the ocean
483 ! ------------------------------------------------------------
484 !
485  zent(:,:) = 0.
486  CALL glt_updtfl_r( 'I2O',tpmxl,tptfl,zdmsi2,pent=zent,psalt=zsalt )
487 !
488 ! print*,'(5) gltools_enthalpy =',tptfl%llo+tptfl%tlo
489 !
490 !
491 ! 4. Farewell message
492 ! ====================
493 !
494  IF (lp1) THEN
495  WRITE(noutlu,*) ' '
496  WRITE(noutlu,*) '**** LEVEL 4 - END SUBROUTINE THERMO_LEAD_R'
497  WRITE(noutlu,*) ' '
498  ENDIF
499 !
500 END SUBROUTINE glt_thermo_lead_r
501 !
502 ! ------------------- END SUBROUTINE glt_thermo_lead_r ----------------------
503 ! -----------------------------------------------------------------------
subroutine glt_saltrap_r(gfreeze, phef, ptem, tpmxl, psalt, pent, phsi)
subroutine glt_updtfl_r(hflag, tpmxl, tptfl, pdmass, pent, psalt)
subroutine glt_thermo_lead_r(tpdom, pustar, tpmxl, tpatm, tpblkw, tpdia, tptfl, tpsit, tpsil, tpldsit, tpldsil)
subroutine gltools_chkglo_r(omsg, tpdom, tpsit)
subroutine glt_oceflx_r(tpdom, pustar, tpmxl)