SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_thermo_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_r ======================
41 ! =======================================================================
42 !
43 !
44 ! Goal:
45 ! -----
46 ! Computation of the thermodynamic forcing over open water, sea ice
47 ! and snow-covered sea ice. Version with thickness within each box
48 ! which is constant, compensated with variable fractional ice
49 ! covers.
50 !
51 ! Created : 1996/03 (D. Salas y Melia)
52 ! Modified: 1996/09 (D. Salas y Melia)
53 ! Include lead scheme, snow scheme, heat diffusion scheme.
54 ! Modified: 1997/12 (D. Salas y Melia)
55 ! Suppress all loops, split to thermo_init, thermo_ice,
56 ! thermo_lead, thermo_end routines
57 ! Modified: 1998/06 (D. Salas y Melia)
58 ! Introduction of optional arguments so that the routine
59 ! should be able to accept different sets of arguments,
60 ! depending on run options
61 ! Modified: 2001/07 (D. Salas y Melia)
62 ! Suppress optional arguments as the possibility that the
63 ! model should compute its own fluxes is no longer offered.
64 ! Modified: 2001/09 (D. Salas y Melia)
65 ! Suppress the CALL to thermo_init routine. Move its two
66 ! functionalities to thermo_ice and gelato.
67 ! Modified: 2009/06 (D. Salas y Melia)
68 ! Reduced grid version
69 ! Modified: 2015/06 (D. Salas y Melia)
70 ! The constrain of sea ice with a climatology is now applied
71 ! after the thermodynamics (and outside the present routine).
72 ! If Gelato is activated in ARPEGE/Surfex, the atmospheric code
73 ! will therefore "see" surface conditions closer to the used
74 ! climatology.
75 !
76 ! ------------------- BEGIN MODULE modi_glt_thermo_r ------------------------
77 
78 !THXS_SFX!MODULE modi_glt_thermo_r
79 !THXS_SFX!INTERFACE
80 !THXS_SFX!
81 !THXS_SFX!SUBROUTINE glt_thermo_r &
82 !THXS_SFX! ( tpdom,pustar,tpmxl,tpatm, &
83 !THXS_SFX! tpblkw,tpblki,tpbud,tpdia,tptfl,tpsit,tpsil,tpsit_d )
84 !THXS_SFX! USE modd_types_glt
85 !THXS_SFX! USE modd_glt_param
86 !THXS_SFX! TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
87 !THXS_SFX! tpdom
88 !THXS_SFX! REAL, DIMENSION(np), INTENT(in) :: &
89 !THXS_SFX! pustar
90 !THXS_SFX! TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
91 !THXS_SFX! tpmxl
92 !THXS_SFX! TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
93 !THXS_SFX! tpatm
94 !THXS_SFX! TYPE(t_blk), DIMENSION(np), INTENT(inout) :: &
95 !THXS_SFX! tpblkw
96 !THXS_SFX! TYPE(t_blk), DIMENSION(nt,np), INTENT(in) :: &
97 !THXS_SFX! tpblki
98 !THXS_SFX! TYPE(t_bud), DIMENSION(np), INTENT(inout) :: &
99 !THXS_SFX! tpbud
100 !THXS_SFX! TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
101 !THXS_SFX! tpdia
102 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
103 !THXS_SFX! tptfl
104 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
105 !THXS_SFX! tpsit
106 !THXS_SFX! TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
107 !THXS_SFX! tpsil
108 !THXS_SFX! TYPE(t_sit), DIMENSION(ntd,np), OPTIONAL, INTENT(in) :: &
109 !THXS_SFX! tpsit_d
110 !THXS_SFX!END SUBROUTINE glt_thermo_r
111 !THXS_SFX!
112 !THXS_SFX!END INTERFACE
113 !THXS_SFX!END MODULE modi_glt_thermo_r
114 
115 ! --------------------- END MODULE modi_glt_thermo_r ------------------------
116 
117 
118 
119 ! -----------------------------------------------------------------------
120 ! ---------------------- SUBROUTINE glt_thermo_r ----------------------------
121 !
122 SUBROUTINE glt_thermo_r &
123  ( tpdom,pustar,tpmxl,tpatm, &
124  tpblkw,tpblki,tpbud,tpdia,tptfl,tpsit,tpsil )
125 !
126 !
127 ! 1. DECLARATIONS
128 ! ===============
129 !
130 ! 1.1. Module declarations
131 ! ------------------------
132 !
134  USE modd_types_glt
135  USE modd_glt_param
136  USE mode_glt_info_r
137  USE modi_glt_updbud_r
138  USE mode_glt_stats_r
140  USE modi_glt_constrain_r
141  USE modi_glt_thermo_ice_r
142  USE modi_glt_thermo_lead_r
143  USE modi_glt_thermo_end_r
144  USE modi_glt_updice_r
145 !
146  IMPLICIT none
147 !
148 !
149 ! 1.2. Dummy arguments declarations
150 ! ---------------------------------
151 !
152  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
153  tpdom
154  REAL, DIMENSION(np), INTENT(in) :: &
155  pustar
156  TYPE(t_mxl), DIMENSION(np), INTENT(inout) :: &
157  tpmxl
158  TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
159  tpatm
160  TYPE(t_blk), DIMENSION(np), INTENT(inout) :: &
161  tpblkw
162  TYPE(t_blk), DIMENSION(nt,np), INTENT(in) :: &
163  tpblki
164  TYPE(t_bud), DIMENSION(np), INTENT(inout) :: &
165  tpbud
166  TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
167  tpdia
168  TYPE(t_tfl), DIMENSION(np), INTENT(inout) :: &
169  tptfl
170  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
171  tpsit
172  TYPE(t_vtp), DIMENSION(nl,nt,np), INTENT(inout) :: &
173  tpsil
174 !
175 !
176 ! 1.3. Local variables declarations
177 ! ---------------------------------
178 !
179  TYPE(t_sit), DIMENSION(nt,np) :: &
180  tzldsit
181  TYPE(t_vtp), DIMENSION(nl,nt,np) :: &
182  tzldsil
183  REAL :: &
184  zice_a, zemps_a, zsalt_a, zsalf_a, zsalt_a_0, zsalf_a_0
185 !
186 !
187 ! 1.4. Welcome message
188 ! --------------------
189 !
190  IF (lp1) THEN
191  WRITE(noutlu,*) ' '
192  WRITE(noutlu,*) ' *** LEVEL 3 - SUBROUTINE THERMO_R'
193  WRITE(noutlu,*) ' '
194  ENDIF
195 !
196 !
197 ! 1.5. Initialize arrays
198 ! ----------------------
199 !
200 ! .. Types
201 !
202  tzldsit(:,:)%esi = .false.
203  tzldsit(:,:)%asn = albw
204  tzldsit(:,:)%fsi = 0.
205  tzldsit(:,:)%hsi = 0.
206  tzldsit(:,:)%hsn = 0.
207  tzldsit(:,:)%rsn = rhosnwmax
208  tzldsit(:,:)%tsf = spread(tpmxl(:)%tml,1,nt)
209  tzldsit(:,:)%age = 0.
210  tzldsit(:,:)%ssi = spread(tpmxl(:)%sml,1,nt)
211  tzldsit(:,:)%vmp = 0.
212  tzldsil(:,:,:)%ent = 0.
213 !
214 ! .. To know how much sea ice was thermodynamically created, record
215 ! initial average sea ice thickness field
216 !
217  tpdia(:)%dsi = rhoice*sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi, dim=1 )
218 !
219 ! .. Idem for sea ice fresh water content
220 !
221  tpdia(:)%dwi = rhoice*sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi* &
222  ( 1.-1.e-3*tpsit(:,:)%ssi ), dim=1 )
223 !
224 ! .. Idem for snow mass variations
225 !
226  tpdia(:)%dsn = sum( tpsit(:,:)%fsi*tpsit(:,:)%rsn*tpsit(:,:)%hsn, dim=1 )
227 !
228 ! .. Idem for salt mass variations
229 !
230  tpdia(:)%dsa = sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi*tpsit(:,:)%ssi, dim=1 )
231 !
232 !
233 !
234 ! 2. LEADS THERMODYNAMICS
235 ! =======================
236 !
237 ! * Do the thermodynamics for the lead covered fraction of the grid
238 ! cell.
239 ! A lead is now physically defined in depth as the depth reached by
240 ! its associated sea ice element on the grid cell. Underneath lies the
241 ! mixed layer, whose velocity is different from that of the ensemble
242 ! ice/leads, making lead further downward spreading virtually
243 ! impossible.
244 !
245  IF ( nupdbud==1 ) THEN
246  CALL glt_updbud_r( 1,'Before THERMO_LEAD_R:', &
247  tpdom,tpmxl,tptfl,tpatm,tpblkw,tpblki,tpsit,tpsil,tpbud )
248  CALL glt_updice_r(0,' BEFORE glt_thermo_lead_r ', &
249  tpdom, tpsit, zsalt_a, zice_a, tptfl, zemps_a, zsalf_a)
250  zsalt_a_0 = zsalt_a
251  zsalf_a_0 = zsalf_a
252  ENDIF
253 !
254  CALL glt_thermo_lead_r &
255  (tpdom,pustar,tpmxl,tpatm,tpblkw, &
256  tpdia,tptfl,tpsit,tpsil, &
257  tzldsit,tzldsil)
258 !
259 !
260 !
261 ! 3. SEA ICE THERMODYNAMICS
262 ! =========================
263 !
264 ! * Do the thermodynamics for the ice covered fraction of the grid cell
265 ! (considering several ice types_glt, defined according to their
266 ! thicknesses).
267 ! The main involved processes in this part are :
268 ! - the impact of precipitations on sea ice / snow build up,
269 ! - effect of ocean and atmospheric heat fluxes on sea ice
270 ! thickness changes (heat conduction in the ice / snow slab).
271 ! N.B. : Heat fluxes are considered at the top and at the bottom of
272 ! the ice (W / m^2). Positive q-fluxes denote melting.
273 !
274 !
275 ! 3.1. Check
276 ! ----------
277 !
278 ! .. Check sea ice model thermodynamics energy balance : compute the
279 ! total enthalpy, latent heat and stored heat of sea ice.
280 !
281  IF ( nupdbud==1 ) THEN
282  CALL glt_updbud_r( 0,'After glt_thermo_lead_r / Before THERMO_ICE_R:', &
283  tpdom,tpmxl,tptfl,tpatm,tpblkw,tpblki,tpsit,tpsil,tpbud )
284  CALL glt_updice_r(1, ' AFTER THERMO_LEAD_R', &
285  tpdom, tpsit, zsalt_a, zice_a, tptfl, zemps_a, zsalf_a)
286  ENDIF
287 !
288 !
289 ! 3.2. Run sea ice and snow thermodynamics
290 ! ----------------------------------------
291 !
292  CALL glt_thermo_ice_r &
293  ( tpdom,tpmxl,tpatm,tpblki,tpbud,tpdia,tptfl,tpsit,tpsil )
294 !
295 !
296 !
297 ! 4. FINAL THERMODYNAMIC COMPUTATIONS
298 ! ===================================
299 !
300 ! * Previous calls to other thermodynamic subroutines may have led to
301 ! disruptions in ice types_glt classification, for several reasons :
302 ! - an ice type has grown in thickness, moving to the next class.
303 ! - an ice type has disappeared totally because of lateral or
304 ! (and) vertical melting.
305 ! - sea ice may has grown on an open water surface.
306 !
307 ! * The goal of thermo_end subroutine is to assess which ice type(s) are
308 ! now in the different classes. If necessary, merge them, as well as
309 ! associated leads.
310 !
311 !
312 ! 4.1. Check in
313 ! -------------
314 !
315  IF ( nupdbud==1 ) THEN
316  CALL glt_updbud_r( 0,'After glt_thermo_ice_r / Before THERMO_END_R:', &
317  tpdom,tpmxl,tptfl,tpatm,tpblkw,tpblki,tpsit,tpsil,tpbud )
318  CALL glt_updice_r(1, ' AFTER glt_thermo_ice_r ', &
319  tpdom, tpsit, zsalt_a, zice_a, tptfl, zemps_a, zsalf_a)
320  ENDIF
321 !
322 !
323 ! 4.2. Final operations
324 ! ---------------------
325 !
326  CALL glt_thermo_end_r( tpdom,tpmxl,tzldsit,tzldsil,tpsit,tpsil )
327 !
328 !
329 ! 4.3. Compute some diagnostics
330 ! ------------------------------
331 !
332 ! This is done even if updbud flag is off, to allow the computation
333 ! of certain diagnostics if wished by the user.
334 !
335  CALL glt_updbud_r( 0,'After THERMO_END_R:', &
336  tpdom,tpmxl,tptfl,tpatm,tpblkw,tpblki,tpsit,tpsil,tpbud )
337 !
338 ! Compute change in stored latent heat and enthalpy in sea ice/snow
339 ! due to thermodynamic processes
340 !
341  tpdia(:)%the = ( tpbud(:)%enn - tpbud(:)%eni ) / dtt
342 !
343 ! Compute net sea ice production field
344 !
345  tpdia(:)%dsi = &
346  ( rhoice * sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi, dim=1 )- &
347  tpdia(:)%dsi ) / dtt
348 !
349 ! Compute net sea ice fresh water content change field
350 !
351  tpdia(:)%dwi = &
352  ( rhoice * sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi* &
353  ( 1.-1.e-3*tpsit(:,:)%ssi ), dim=1 )- &
354  tpdia(:)%dwi ) / dtt
355 !
356 ! Compute net snow mass change field
357 !
358  tpdia(:)%dsn = &
359  ( sum( tpsit(:,:)%rsn*tpsit(:,:)%fsi*tpsit(:,:)%hsn, dim=1 )- &
360  tpdia(:)%dsn ) / dtt
361 !
362 ! Compute net salt mass change field
363 !
364  tpdia(:)%dsa = rhoice*1.e-3* &
365  ( sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi*tpsit(:,:)%ssi, dim=1 )- &
366  tpdia(:)%dsa ) / dtt
367 !
368 ! Compute sea ice and snow heat content
369 !
370  CALL glt_aventh( tpsit,tpsil,tpdia%sie,tpdia%sne )
371 !
372 !
373 !
374 ! 6. FAREWELL MESSAGE
375 ! ====================
376 !
377  IF (lp1) THEN
378  WRITE(noutlu,*) ' '
379  WRITE(noutlu,*) ' *** LEVEL 3 - END SUBROUTINE THERMO_R'
380  WRITE(noutlu,*) ' '
381  ENDIF
382  IF ( nupdbud==1 ) THEN
383  CALL glt_updice_r(1, ' SALT BUDGET OVER ENTIRE glt_thermo_r ', &
384  tpdom, tpsit, zsalt_a_0, zice_a, tptfl, zemps_a, zsalf_a_0)
385  ENDIF
386 !
387 END SUBROUTINE glt_thermo_r
388 
389 ! --------------------- END SUBROUTINE glt_thermo_r ---------------------
390 ! -----------------------------------------------------------------------
subroutine glt_thermo_ice_r(tpdom, tpmxl, tpatm, tpblki, tpbud, tpdia, tptfl, tpsit, tpsil)
subroutine glt_updice_r(kinit, omsg, tpdom, tpsit, psalt_a, pice_a, tptfl, pemps_a, psalf_a)
subroutine glt_thermo_lead_r(tpdom, pustar, tpmxl, tpatm, tpblkw, tpdia, tptfl, tpsit, tpsil, tpldsit, tpldsil)
subroutine glt_thermo_end_r(tpdom, tpml, tpldsit, tpldsil, tpsit, tpsil)
subroutine glt_thermo_r(tpdom, pustar, tpmxl, tpatm, tpblkw, tpblki, tpbud, tpdia, tptfl, tpsit, tpsil)
subroutine glt_updbud_r(kinit, omsg, tpdom, tpmxl, tptfl, tpatm, tpblkw, tpblki, tpsit, tpsil, tpbud)