SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
mode_glt_stats_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 mode_glt_stats_r ==========================
41 ! =======================================================================
42 !
43 !
44 ! This module contains some subroutines that help the icestate user or
45 ! developper to have better control on model outputs, while it is
46 ! running.
47 ! Note: this is the reduced grid version.
48 !
49 ! Created : 2009/06
50 !
51 ! -------------------- BEGIN MODULE mode_glt_stats_r ------------------------
52 
54 INTERFACE
55 
56 FUNCTION glt_iceconcm_r(tpsit)
57  USE modd_types_glt
58  USE modd_glt_param
59  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
60  tpsit
61  REAL, DIMENSION(np) :: &
63 END FUNCTION glt_iceconcm_r
64 
65 FUNCTION glt_thinice_concm_r(tpsit)
66  USE modd_types_glt
67  USE modd_glt_param
68  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
69  tpsit
70  REAL, DIMENSION(np) :: &
72 END FUNCTION glt_thinice_concm_r
73 
74 FUNCTION glt_thickice_concm_r(tpsit)
75  USE modd_types_glt
76  USE modd_glt_param
77  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
78  tpsit
79  REAL, DIMENSION(np) :: &
81 END FUNCTION glt_thickice_concm_r
82 
83 FUNCTION glt_icesurfg_r(tpdom,tpsit)
84  USE modd_types_glt
85  USE modd_glt_param
86  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
87  tpdom
88  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
89  tpsit
90  REAL :: &
92 END FUNCTION glt_icesurfg_r
93 
94 FUNCTION glt_avg_r(tpdom,pfield,ktot)
95  USE modd_types_glt
96  USE modd_glt_param
97  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
98  tpdom
99  REAL, DIMENSION(np), INTENT(in) :: &
100  pfield
101  INTEGER, INTENT(in) :: &
102  ktot
103  REAL :: &
104  glt_avg_r
105 END FUNCTION glt_avg_r
106 
107 FUNCTION glt_avhicem_r(tpsit)
108  USE modd_types_glt
109  USE modd_glt_param
110  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
111  tpsit
112  REAL, DIMENSION(np) :: &
114 END FUNCTION glt_avhicem_r
115 
116 FUNCTION glt_avhsnwm_r(tpsit)
117  USE modd_types_glt
118  USE modd_glt_param
119  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
120  tpsit
121  REAL, DIMENSION(np) :: &
123 END FUNCTION glt_avhsnwm_r
124 
125 FUNCTION glt_avmsnwm_r(tpsit)
126  USE modd_types_glt
127  USE modd_glt_param
128  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
129  tpsit
130  REAL, DIMENSION(np) :: &
132 END FUNCTION glt_avmsnwm_r
133 
134 FUNCTION glt_avhiceg_r(tpdom,tpsit)
135  USE modd_types_glt
136  USE modd_glt_param
137  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
138  tpdom
139  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
140  tpsit
141  REAL :: &
143 END FUNCTION glt_avhiceg_r
144 
145 FUNCTION glt_voliceg_r(tpdom,tpsit)
146  USE modd_types_glt
147  USE modd_glt_param
148  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
149  tpdom
150  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
151  tpsit
152  REAL :: &
154 END FUNCTION glt_voliceg_r
155 
156 END INTERFACE
157 END MODULE mode_glt_stats_r
158 
159 ! --------------------- END MODULE mode_glt_stats_r -------------------------
160 
161 
162 ! -----------------------------------------------------------------------
163 ! ------------------------ FUNCTION glt_iceconcm_r --------------------------
164 
165 ! Returns the array of fractional ice coverage on all the cells of
166 ! the domain.
167 
168 FUNCTION glt_iceconcm_r(tpsit)
169 !
170  USE modd_types_glt
171  USE modd_glt_param
172 !
173  IMPLICIT NONE
174 
175  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
176  tpsit
177  REAL, DIMENSION(np) :: &
179 
180 ! * Compute total sea ice concentration.
181  glt_iceconcm_r(:) = sum( tpsit(:,:)%fsi,dim=1 )
182 !
183 END FUNCTION glt_iceconcm_r
184 
185 ! ----------------------- END FUNCTION glt_iceconcm_r -----------------------
186 ! -----------------------------------------------------------------------
187 
188 
189 ! -----------------------------------------------------------------------
190 ! ---------------------- FUNCTION glt_thinice_concm_r -----------------------
191 
192 ! Returns the array of fractional ice coverage on all the cells of
193 ! the domain (ONLY thin ice, thinner than a threshold thickness that
194 ! is given as a namelist parameter).
195 
196 FUNCTION glt_thinice_concm_r(tpsit)
197 !
198  USE modd_types_glt
199  USE modd_glt_param
200 !
201  IMPLICIT NONE
202 
203  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
204  tpsit
205  REAL, DIMENSION(np) :: &
207 
208  glt_thinice_concm_r(:) = &
209  sum(tpsit(:,:)%fsi,mask=(tpsit(:,:)%hsi<xicethcr),dim=1)
210 !
211 END FUNCTION glt_thinice_concm_r
212 
213 ! -------------------- END FUNCTION glt_thinice_concm_r ---------------------
214 ! -----------------------------------------------------------------------
215 
216 
217 ! -----------------------------------------------------------------------
218 ! ---------------------- FUNCTION glt_thickice_concm_r ----------------------
219 
220 ! Returns the array of fractional ice coverage on all the cells of
221 ! the domain (ONLY thick ice, thicker than a threshold thickness that
222 ! is given as a namelist parameter : xicethcr).
223 
224 FUNCTION glt_thickice_concm_r(tpsit)
225 !
226  USE modd_types_glt
227  USE modd_glt_param
228 !
229  IMPLICIT NONE
230 
231  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
232  tpsit
233  REAL, DIMENSION(np) :: &
235 
236  glt_thickice_concm_r(:) = &
237  sum(tpsit(:,:)%fsi,mask=(tpsit(:,:)%hsi>xicethcr),dim=1)
238 !
239 END FUNCTION glt_thickice_concm_r
240 
241 ! ------------------- END FUNCTION glt_thickice_concm_r ---------------------
242 ! -----------------------------------------------------------------------
243 
244 
245 ! -----------------------------------------------------------------------
246 ! ------------------------- FUNCTION glt_icesurfg_r -------------------------
247 
248 ! Returns the total surface of the ice cover in a given region (sq. m)
249 
250 FUNCTION glt_icesurfg_r(tpdom,tpsit)
251 !
252  USE modd_types_glt
253  USE modd_glt_param
254 !
255  IMPLICIT NONE
256 
257  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
258  tpdom
259  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
260  tpsit
261  REAL :: &
263  REAL, DIMENSION(np) :: &
264  z2_sumfsi
265 
266  z2_sumfsi(:) = sum( tpsit(:,:)%fsi,dim=1 )
267  glt_icesurfg_r = sum( z2_sumfsi(:)*tpdom(:)%srf )
268 !
269 END FUNCTION glt_icesurfg_r
270 
271 ! ----------------------- END FUNCTION glt_icesurfg_r -----------------------
272 ! -----------------------------------------------------------------------
273 
274 
275 ! -----------------------------------------------------------------------
276 ! -------------------------- FUNCTION glt_avg_r -----------------------------
277 
278 ! Returns the global average of a 2D array over the entire domain
279 ! ktot=1 : integral
280 ! ktot=0 : average
281 
282 FUNCTION glt_avg_r(tpdom,pfield,ktot)
283 !
284  USE modd_types_glt
285  USE modd_glt_param
287 !
288  IMPLICIT NONE
289 !
290  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
291  tpdom
292  REAL, DIMENSION(np), INTENT(in) :: &
293  pfield
294  INTEGER, INTENT(in) :: &
295  ktot
296  REAL :: &
297  glt_avg_r
298 !
299  glt_avg_r = sum( pfield(:)*tpdom(:)%srf )
300 !
301  IF ( ktot==0 ) THEN
302  glt_avg_r = glt_avg_r / amax1(xdomsrf_r,epsil2)
303  ENDIF
304 !
305 END FUNCTION glt_avg_r
306 
307 ! ------------------------ END FUNCTION glt_avg_r ---------------------------
308 ! -----------------------------------------------------------------------
309 
310 
311 ! -----------------------------------------------------------------------
312 ! ------------------------ FUNCTION glt_avhicem_r ---------------------------
313 
314 ! Returns the array of average ice thickness on all the cells of
315 ! the domain.
316 
317 FUNCTION glt_avhicem_r(tpsit)
318 !
319  USE modd_types_glt
320  USE modd_glt_param
321 !
322  IMPLICIT NONE
323 
324  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
325  tpsit
326  REAL, DIMENSION(np) :: &
328 
329  glt_avhicem_r(:) = sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi,dim=1 )
330 !
331 END FUNCTION glt_avhicem_r
332 
333 ! ----------------------- END FUNCTION glt_avhicem_r ------------------------
334 ! -----------------------------------------------------------------------
335 
336 
337 ! -----------------------------------------------------------------------
338 ! ------------------------- FUNCTION glt_avhsnwm_r --------------------------
339 
340 ! Returns the array of average snow thickness on all the cells of
341 ! the domain.
342 
343 FUNCTION glt_avhsnwm_r(tpsit)
344  USE modd_types_glt
345  USE modd_glt_param
346 !
347  IMPLICIT NONE
348 
349  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
350  tpsit
351  REAL, DIMENSION(np) :: &
353 
354  glt_avhsnwm_r(:) = sum(tpsit(:,:)%fsi*tpsit(:,:)%hsn,dim=1)
355 !
356 END FUNCTION glt_avhsnwm_r
357 
358 ! ----------------------- END FUNCTION glt_avhsnwm_r ------------------------
359 ! -----------------------------------------------------------------------
360 
361 
362 ! -----------------------------------------------------------------------
363 ! ------------------------- FUNCTION glt_avmsnwm_r --------------------------
364 
365 ! Returns the array of average snow mass on all the cells of
366 ! the domain (kg/m2)
367 
368 FUNCTION glt_avmsnwm_r(tpsit)
369  USE modd_types_glt
370  USE modd_glt_param
372 !
373  IMPLICIT NONE
374 
375  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
376  tpsit
377  REAL, DIMENSION(np) :: &
379 
380  glt_avmsnwm_r(:) = sum( &
381  tpsit(:,:)%fsi*tpsit(:,:)%rsn*tpsit(:,:)%hsn, dim=1 )
382 !
383 END FUNCTION glt_avmsnwm_r
384 
385 ! ----------------------- END FUNCTION glt_avmsnwm_r ------------------------
386 ! -----------------------------------------------------------------------
387 
388 
389 ! -----------------------------------------------------------------------
390 ! ------------------------- FUNCTION glt_avhiceg_r --------------------------
391 
392 ! Returns the average ice thickness on the whole domain
393 
394 FUNCTION glt_avhiceg_r(tpdom,tpsit)
395 !
396  USE modd_types_glt
397  USE modd_glt_param
398 !
399  IMPLICIT NONE
400 
401  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
402  tpdom
403  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
404  tpsit
405  REAL :: &
407  REAL, DIMENSION(np) :: &
408  z2_avhsi
409 
410  z2_avhsi(:) = &
411  sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi,dim=1 )
412  glt_avhiceg_r = sum( z2_avhsi(:)*tpdom(:)%srf ) / xdomsrf
413 !
414 END FUNCTION glt_avhiceg_r
415 
416 ! ----------------------- END FUNCTION glt_avhiceg_r ------------------------
417 ! -----------------------------------------------------------------------
418 
419 
420 ! -----------------------------------------------------------------------
421 ! ------------------------- FUNCTION glt_voliceg_r --------------------------
422 
423 ! Returns the total volume of ice on the whole region of study, in
424 ! cubic m.
425 
426 FUNCTION glt_voliceg_r(tpdom,tpsit)
427 !
428  USE modd_types_glt
429  USE modd_glt_param
430 !
431  IMPLICIT NONE
432 
433  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
434  tpdom
435  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
436  tpsit
437  REAL :: &
439  REAL, DIMENSION(np) :: &
440  z2_avhsi
441 
442  z2_avhsi(:) = sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi,dim=1 )
443  glt_voliceg_r = sum( z2_avhsi(:)*tpdom(:)%srf )
444 !
445 END FUNCTION glt_voliceg_r
446 
447 ! ----------------------- END FUNCTION glt_voliceg_r ------------------------
448 ! -----------------------------------------------------------------------
real function glt_avhiceg_r(tpdom, tpsit)
real function, dimension(np) glt_thickice_concm_r(tpsit)
real function, dimension(np) glt_avhsnwm_r(tpsit)
real function glt_icesurfg_r(tpdom, tpsit)
real function, dimension(np) glt_iceconcm_r(tpsit)
real function, dimension(np) glt_avmsnwm_r(tpsit)
real function, dimension(np) glt_thinice_concm_r(tpsit)
real function glt_avg_r(tpdom, pfield, ktot)
real function, dimension(np) glt_avhicem_r(tpsit)
real function glt_voliceg_r(tpdom, tpsit)