SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_gltools_updaponds_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_gltools_updaponds_r ======================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains a subroutine that is used to update the volume
46 ! and albedo of melt ponds. LEVITATING MELT PONDS!!!
47 !
48 !
49 ! Created : 2010/02 (M. Chevallier)
50 ! Modified: 2010/11 (M. Chevallier)
51 ! Called from updasn_r. Full computation of ponds thermodynamics
52 ! and ponds albedo.
53 ! Ponds albedo is used to correct sea-ice albedo. Fraction of the ice
54 ! surface that is not covered by ponds consists in melting bare ice.
55 !
56 ! ------------------ BEGIN MODULE modi_gltools_updaponds_r -------------------
57 !
58 !THXS_SFX!MODULE modi_gltools_updaponds_r
59 !THXS_SFX!INTERFACE
60 !THXS_SFX!!
61 !THXS_SFX!SUBROUTINE gltools_updaponds_r (omelt,tpatm,tpblki,tpdia,tpsit,pasi )
62 !THXS_SFX! USE modd_types_glt
63 !THXS_SFX! USE modd_glt_param
64 !THXS_SFX! LOGICAL, DIMENSION(nt,np), INTENT(in) :: &
65 !THXS_SFX! omelt
66 !THXS_SFX! TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
67 !THXS_SFX! tpatm
68 !THXS_SFX! TYPE(t_blk), DIMENSION(nt,np), INTENT(in) :: &
69 !THXS_SFX! tpblki
70 !THXS_SFX! TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
71 !THXS_SFX! tpdia
72 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
73 !THXS_SFX! tpsit
74 !THXS_SFX! REAL, DIMENSION(nt,np), INTENT(inout) :: &
75 !THXS_SFX! pasi
76 !THXS_SFX!END SUBROUTINE gltools_updaponds_r
77 !THXS_SFX!!
78 !THXS_SFX!END INTERFACE
79 !THXS_SFX!END MODULE modi_gltools_updaponds_r
80 !
81 ! ------------------- END MODULE modi_gltools_updaponds_r --------------------
82 !
83 !
84 !
85 ! -----------------------------------------------------------------------
86 ! ------------------------- SUBROUTINE gltools_updaponds_r -------------------------
87 !
88 ! * Subroutine used to update melt ponds volume and albedo (takes into account rain, snow, or thermodynamic surface melting).
89 ! * (APONDS = Albedo of PONDS)
90 !
91 SUBROUTINE gltools_updaponds_r ( omelt,tpatm,tpblki,tpdia,tpsit,pasi )
92 !
94  USE modd_types_glt
95  USE modd_glt_param
96 !
97  IMPLICIT NONE
98 !
99  LOGICAL, DIMENSION(nt,np), INTENT(in) :: &
100  omelt
101  TYPE(t_atm), DIMENSION(np), INTENT(in) :: &
102  tpatm
103  TYPE(t_blk), DIMENSION(nt,np), INTENT(in) :: &
104  tpblki
105  TYPE(t_dia), DIMENSION(np), INTENT(inout) :: &
106  tpdia
107  TYPE(t_sit), DIMENSION(nt,np), INTENT(inout) :: &
108  tpsit
109  REAL, DIMENSION(nt,np), INTENT(inout) :: &
110  pasi
111 !
112  LOGICAL, DIMENSION(nt,np) :: &
113  gsipond, gsnpond
114  INTEGER :: &
115  jp,jt
116  REAL :: &
117  zrhwinv, zdelta
118  REAL, DIMENSION(np) :: &
119  zwork1, zwork2
120  REAL, DIMENSION(nt,np) :: &
121  zvmp, zpcpr, ztsf,zmeltt, zmelts, &
122  zfmp, zdmp, zamp, zdiftp, zfblki
123 !
124 !
125 ! 1. Initializations
126 ! ==================
127 !
128 ! Volume (fraction * depth) of melt ponds covering the fractional cell
129  zvmp(:,:) = tpsit(:,:)%vmp
130 !
131  ztsf(:,:) = tpsit(:,:)%tsf
132 !
133 ! print*, 'tsf = ', MAXVAL(SUM(tpsit(:,:)%fsi * tpsit(:,:)%tsf,DIM=1))
134 ! print*, 'vmp = ', MAXVAL(SUM(tpsit(:,:)%fsi * tpsit(:,:)%vmp,DIM=1))
135 !
136 ! .. Compute the rate of liquid precipitation
137 !
138  zpcpr(:,:) = spread( tpatm(:)%lip,1,nt)
139 !
140 ! .. Melting ice with snow, ice thickness> hice_mp
141 !
142  gsnpond = .false.
143  WHERE ( tpsit(:,:)%hsi>= hsi_mp .AND. tpsit(:,:)%hsn >= hsn_mp .AND. omelt(:,:) )
144  gsnpond(:,:) = .true.
145  ENDWHERE
146 !
147 ! .. Melting ice without snow, ice thickness> hice_mp
148 !
149  gsipond = .false.
150  WHERE ( tpsit(:,:)%hsi>= hsi_mp .AND. tpsit(:,:)%hsn < hsn_mp .AND. omelt(:,:) )
151  gsipond(:,:) = .true.
152  ENDWHERE
153 !
154 ! .. Sea ice top ablation
155 !
156 ! zwork1(:) = MAX(tpdia(:)%mrt, 0.)
157 !
158 ! .. Snow ablation (positive values)
159 !
160  zwork2(:) = ( sum( tpsit(:,:)%rsn*tpsit(:,:)%fsi*tpsit(:,:)%hsn, dim=1 )- &
161  tpdia(:)%dsn )/ dtt
162 ! .. Only consider melting snow: dhsn<0 i.e. -zworks2(:)>0.
163  zwork2(:) = max( -zwork2(:),0. )
164 !
165 ! .. Assuming uniform distribution of melt rates over all categories...
166 ! zmeltt(:,:) = SPREAD( zwork1(:), 1, nt)
167  zmeltt(:,:) = spread( -tpdia(:)%mrt, 1, nt )
168  zmelts(:,:) = spread( -zwork2(:), 1, nt)
169 !
170 ! print*, 'melti = ', MAXVAL(SUM(tpsit(:,:)%fsi * zmeltt(:,:), DIM=1))
171 ! print*, 'melts = ', MAXVAL(SUM(tpsit(:,:)%fsi * zmelts(:,:), DIM=1))
172 !
173  zdiftp = 0.
174  WHERE ( ( tp - ztsf(:,:) ) >= epsil5 )
175  zdiftp(:,:) = ( tp - ztsf(:,:) ) / tp
176  ELSEWHERE
177  zdiftp(:,:) = 0.
178  ENDWHERE
179 !
180 ! .. Incoming fluxes over sea-ice (approximation)
181 !
182  zfblki(:,:) = tpblki(:,:)%nsf + tpblki(:,:)%swa
183 !
184  zrhwinv = dtt / rhofw ! in s*m3/kg
185 !
186 ! 2. Compute the characteristics of melt ponds
187 ! ============================================
188 !
189 ! 2.0. Dry ice or thin ice
190 ! ------------------------
191 !
192 ! .. No melt or ice too thin!
193 !
194 ! zvmp(:,:) = 0.
195  zfmp(:,:) = 0.
196  zdmp(:,:) = 0.
197 !
198 !
199  DO jp=1,np
200 ! print*, 'jp= ', jp
201  DO jt=1,nt
202 ! print*, 'jt= ', jt
203 !
204 ! WHERE ( gsnpond(:,:) )
205 !IF ( tpsit(jt,jp)%hsi>=hsi_mp .AND. &
206  ! tpsit(jt,jp)%hsn>= epsil1 .AND. &
207  ! omelt(jt,jp)=.TRUE. ) THEN
208 ! print*, 'gsnpond(jt,jp) = ',gsnpond(jt,jp)
209 ! print*, 'gsipond(jt,jp) = ',gsipond(jt,jp)
210  IF ( gsnpond(jt,jp) ) THEN
211 !
212 ! 2.1. Melting ice with snow
213 ! --------------------------
214 !
215 ! .. Melting ice, but too much snow.
216 ! .. Only increase the total melt water volume
217 ! at the sea ice surface.
218 ! .. No ponds.
219 !
220  zvmp(jt,jp) = zvmp(jt,jp) + &
221  zrhwinv * ( zmeltt(jt,jp) + zmelts(jt,jp) + zpcpr(jt,jp) )
222  zfmp(jt,jp) = 0.
223  zdmp(jt,jp) = 0.
224 !
225 ! ENDWHERE
226 !
227 !
228 ! WHERE ( gsipond(:,:) )
229 !
230 ! IF ( tpsit(jt,jp)%hsi>=hsi_mp .AND. &
231  ! tpsit(jt,jp)%hsn< epsil1 .AND. &
232  ! omelt(jt,jp)=.TRUE. ) THEN
233  ELSE IF ( gsipond(jt,jp) ) THEN
234 ! print*, 'tp - tsf = ' , zdiftp(jt,jp)
235 ! print*, 'NSF + SWA = ', zfblki(jt,jp)
236 ! print*, 'DVPI = ', zrhwinv * hofusni0 * rhoice0 * zfblki(jt,jp)
237 !
238 ! 2.2. Melting ice without snow cover
239 ! -----------------------------------
240 !
241 ! .. Melting ice and no more snow.
242 ! .. Only a fraction of surface melt water is
243 ! used to form the melt ponds.
244 !
245 ! 2.2.1. Update melt pond volume
246 ! ------------------------------
247 !
248  zvmp(jt,jp) = zvmp(jt,jp) + xr1 * &
249  zrhwinv * ( zmeltt(jt,jp) + zmelts(jt,jp) + zpcpr(jt,jp) )
250 !
251 ! zvmp(:,:) = zvmp(:,:) - drainrate * dtt / xday2sec !(MAYBE NOT)!
252 !
253 ! .. During autumn freezing, pond volume decays exponentially. Residual volume
254 ! could be used to form pond ice (incorporated in sea ice: not done!).
255 !
256 ! zvmp(jt,jp) = zvmp(jt,jp)*exp(xr2 * zdiftp(jt,jp))
257 !
258  zvmp(jt,jp) = zvmp(jt,jp) + &
259  amin1( zrhwinv * hofusni0 * rhoice0 * zfblki(jt,jp), 0.)
260 !
261 ! 2.2.2 Compute melt pond fraction and depth
262 ! ------------------------------------------
263 ! .. Melt pond depth and fraction: simple linear relation.
264 ! (dmp = 0.8*fmp, vmp = fmp * dmp )
265 !
266  zdelta = amax1( dptfr2 * dptfr2 + 4.*dptfr1*zvmp(jt,jp),0. )
267 ! .. Only one physical root...
268  zfmp(jt,jp) = 0.5*(- dptfr2 + sqrt(zdelta) ) / dptfr1
269  zfmp(jt,jp) = amin1( zfmp(jt,jp),1. )
270  zdmp(jt,jp) = amax1( dptfr1 * zfmp(jt,jp) + dptfr2, 0. )
271 !
272 ! 2.2.3. Limit pond depth to 90% of ice thickness
273 ! -----------------------------------------------
274 !
275  zdmp(jt,jp) = amin1( zdmp(jt,jp), dpthhi * tpsit(jt,jp)%hsi )
276 !
277 ! .. When limit depth reached, pond volume is corrected with respect to hpond
278 ! equal to limit depth.
279 !
280  zvmp(jt,jp) = zfmp(jt,jp) * zdmp(jt,jp)
281 !
282 ! print*, 'fmp: ', zfmp(jt,jp)
283 ! print*, 'dmp: ', zdmp(jt,jp)
284 ! print*, 'vmp: ', zvmp(jt,jp)
285 !
286 ! ENDWHERE
287  ELSE
288  !zvmp(jt,jp) = zvmp(jt,jp)*EXP(xr2 * zdiftp(jt,jp))
289 ! print*, 'DVPI = ', zrhwinv * hofusni0 * rhoice0 * zfblki(jt,jp)
290  zvmp(jt,jp) = zvmp(jt,jp) + &
291  amin1( zrhwinv * hofusni0 * rhoice0 * zfblki(jt,jp), 0.)
292 ! zfmp(jt,jp) = 0.
293 ! zdmp(jt,jp) = 0.
294 !
295 ! .. NEW: 13/12/10. Computation of fmp and dmp is done even when melt flag is
296 ! false. Snow depth is the ultimate limitation of the pond formation.
297 !
298  zdelta = amax1( dptfr2 * dptfr2 + 4.*dptfr1*zvmp(jt,jp), 0. )
299  zfmp(jt,jp) = 0.5*(- dptfr2 + sqrt(zdelta) ) / dptfr1
300  zfmp(jt,jp) = amin1( zfmp(jt,jp),1. )
301  zdmp(jt,jp) = amax1( dptfr1 * zfmp(jt,jp) + dptfr2, 0. )
302  ENDIF
303 !
304 ! .. Negative volume means all melt ponds have disappeared.
305 !
306  zvmp(jt,jp) = amax1(zvmp(jt,jp),0.)
307  END DO
308  END DO
309 !
310 ! .. Cutoff to avoid vmp>0 during the winter.
311 !
312  WHERE (zvmp(:,:)<1e-8)
313  zvmp(:,:) = 0.
314  zfmp(:,:) = 0.
315  zdmp(:,:) = 0.
316  ENDWHERE
317 !
318 ! .. Cutoff to avoid fmp>0 when dmp=0.
319 !
320  WHERE (zdmp(:,:)<epsil5)
321  zfmp(:,:) = 0.
322  ENDWHERE
323 !
324 !
325 ! print*, 'MAX vmp: ', MAXVAL(SUM(tpsit(:,:)%fsi * zvmp(:,:),DIM=1))
326 ! print*, 'MAX fmp: ', MAXVAL(SUM(tpsit(:,:)%fsi * zfmp(:,:),DIM=1))
327 ! print*, 'MAX dmp: ', MAXVAL(SUM(tpsit(:,:)%fsi * zdmp(:,:),DIM=1))
328 ! print*, 'MAX hsi: ', MAXVAL(SUM(tpsit(:,:)%fsi * tpsit(:,:)%hsi,DIM=1))
329 !
330 ! 2.3. Update glt_output fields
331 ! -------------------------
332 !
333 ! .. Melt pond volume:
334 !
335  tpsit(:,:)%vmp = zvmp(:,:)
336 !
337 !
338 ! 3. Compute the albedo of melt ponds
339 ! ===================================
340 !
341 ! 3.1. Compute albedo of melt ponds (function of pond depth)
342 ! ----------------------------------------------------------
343 !
344  zamp(:,:) = xwmp1 * (xamp1 + exp(-xbmp1*zdmp(:,:)-xcmp1))
345  zamp(:,:) = zamp(:,:) + xwmp2 * (xamp2 + exp(-xbmp2*zdmp(:,:)-xcmp2))
346  zamp(:,:) = zamp(:,:) + xwmp3 * (xamp3 + exp(-xbmp3*zdmp(:,:)-xcmp3))
347  zamp(:,:) = zamp(:,:) + xwmp4 * xamp4
348 !
349 ! 3.2. Update sea-ice albedo
350 ! --------------------------
351 !
352  pasi(:,:) = (1.-zfmp(:,:)) * pasi(:,:) + zfmp(:,:) * zamp(:,:)
353 !
354 !
355  tpdia(:)%amp = sum( tpsit(:,:)%fsi * pasi(:,:), dim=1 )
356 !
357 !
358 !
359 END SUBROUTINE gltools_updaponds_r
360 !
361 ! ---------------------- END SUBROUTINE gltools_updaponds_r ------------------------
362 ! -----------------------------------------------------------------------
363 
364 
subroutine gltools_updaponds_r(omelt, tpatm, tpblki, tpdia, tpsit, pasi)