SURFEX v8.1
General documentation of Surfex
mode_sfcflx.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 ! File %M% from Library %Q%
6 ! Version %I% from %G% extracted: %H%
7 !------------------------------------------------------------------------------
8 
9 MODULE mode_sfcflx
10 
11 !------------------------------------------------------------------------------
12 !
13 ! Description:
14 !
15 ! The main program unit of
16 ! the atmospheric surface-layer parameterization scheme "sfcflx".
17 ! "sfcflx" is used to compute fluxes
18 ! of momentum and of sensible and latent heat over lakes.
19 ! The surface-layer scheme developed by Mironov (1991) was used as the starting point.
20 ! It was modified and further developed to incorporate new results as to
21 ! the roughness lenghts for scalar quantities,
22 ! heat and mass transfer in free convection,
23 ! and the effect of limited fetch on the momentum transfer.
24 ! Apart from the momentum flux and sensible and latent heat fluxes,
25 ! the long-wave radiation flux from the water surface and
26 ! the long-wave radiation flux from the atmosphere can also be computed.
27 ! The atmospheric long-wave radiation flux is computed with simple empirical formulae,
28 ! where the atmospheric emissivity is taken to be dependent on
29 ! the water vapour pressure and cloud fraction.
30 !
31 ! A description of sfcflx is available from the author.
32 ! Dmitrii Mironov
33 ! German Weather Service, Kaiserleistr. 29/35, D-63067 Offenbach am Main, Germany.
34 ! dmitrii.mironov@dwd.de
35 !
36 ! Lines embraced with "!_tmp" contain temporary parts of the code.
37 ! Lines embraced/marked with "!_dev" may be replaced
38 ! as improved parameterizations are developed and tested.
39 ! Lines embraced/marked with "!_dm" are DM's comments
40 ! that may be helpful to a user.
41 ! Lines embraced/marked with "!_dbg" are used
42 ! for debugging purposes only.
43 !
44 !
45 ! Current Code Owner: DWD, Dmitrii Mironov
46 ! Phone: +49-69-8062 2705
47 ! Fax: +49-69-8062 3721
48 ! E-mail: dmitrii.mironov@dwd.de
49 !
50 ! History:
51 ! Version Date Name
52 ! ---------- ---------- ----
53 ! 1.00 2005/11/17 Dmitrii Mironov
54 ! Initial release
55 ! !VERSION! !DATE! <Your name>
56 ! <Modification comments>
57 !
58 ! Code Description:
59 ! Language: Fortran 90.
60 ! Software Standards: "European Standards for Writing and
61 ! Documenting Exchangeable Fortran 90 Code".
62 !==============================================================================
63 !
64 ! Declarations:
65 !
66 ! Modules used:
67 
68 !USE modd_data_parameters , ONLY : &
69 ! ireals , &! KIND-type parameter for real variables
70 ! iintegers ! KIND-type parameter for "normal" integer variables
71 
72 USE modd_flake_parameters , ONLY : &
73  tpl_grav , &! Acceleration due to gravity [m s^{-2}]
74  tpl_t_f , &! Fresh water freezing point [K]
75  tpl_rho_w_r , &! Maximum density of fresh water [kg m^{-3}]
76  tpl_c_w , &! Specific heat of water [J kg^{-1} K^{-1}]
77  tpl_l_f , &! Latent heat of fusion [J kg^{-1}]
78  h_ice_min_flk ! Minimum ice thickness [m]
79 
80 !==============================================================================
81 
82 !
83 USE yomhook ,ONLY : lhook, dr_hook
84 USE parkind1 ,ONLY : jprb
85 !
86 IMPLICIT NONE
87 
88 !==============================================================================
89 !
90 ! Declarations
91 
92 ! Dimensionless constants in the Monin-Obukhov surface-layer
93 ! similarity relations and in the expressions for the roughness lengths.
94 REAL , PARAMETER :: &
95  c_karman = 0.40 , &! The von Karman constant
96  pr_neutral = 1.0 , &! Turbulent Prandtl number at neutral static stability
97  sc_neutral = 1.0 , &! Turbulent Schmidt number at neutral static stability
98  c_mo_u_stab = 5.0 , &! Constant of the MO theory (wind, stable stratification)
99  c_mo_t_stab = 5.0 , &! Constant of the MO theory (temperature, stable stratification)
100  c_mo_q_stab = 5.0 , &! Constant of the MO theory (humidity, stable stratification)
101  c_mo_u_conv = 15.0 , &! Constant of the MO theory (wind, convection)
102  c_mo_t_conv = 15.0 , &! Constant of the MO theory (temperature, convection)
103  c_mo_q_conv = 15.0 , &! Constant of the MO theory (humidity, convection)
104  c_mo_u_exp = 0.25 , &! Constant of the MO theory (wind, exponent)
105  c_mo_t_exp = 0.5 , &! Constant of the MO theory (temperature, exponent)
106  c_mo_q_exp = 0.5 , &! Constant of the MO theory (humidity, exponent)
107  z0u_ice_rough = 1.0e-03 , &! Aerodynamic roughness of the ice surface [m] (rough flow)
108  c_z0u_smooth = 0.1 , &! Constant in the expression for z0u (smooth flow)
109  c_z0u_rough = 1.23e-02 , &! The Charnock constant in the expression for z0u (rough flow)
110  c_z0u_rough_l = 1.00e-01 , &! An increased Charnock constant (used as the upper limit)
111  c_z0u_ftch_f = 0.70 , &! Factor in the expression for fetch-dependent Charnock parameter
112  c_z0u_ftch_ex = 0.3333333 , &! Exponent in the expression for fetch-dependent Charnock parameter
113  c_z0t_rough_1 = 4.0 , &! Constant in the expression for z0t (factor)
114  c_z0t_rough_2 = 3.2 , &! Constant in the expression for z0t (factor)
115  c_z0t_rough_3 = 0.5 , &! Constant in the expression for z0t (exponent)
116  c_z0q_rough_1 = 4.0 , &! Constant in the expression for z0q (factor)
117  c_z0q_rough_2 = 4.2 , &! Constant in the expression for z0q (factor)
118  c_z0q_rough_3 = 0.5 , &! Constant in the expression for z0q (exponent)
119  c_z0t_ice_b0s = 1.250 , &! Constant in the expression for z0t over ice
120  c_z0t_ice_b0t = 0.149 , &! Constant in the expression for z0t over ice
121  c_z0t_ice_b1t = -0.550 , &! Constant in the expression for z0t over ice
122  c_z0t_ice_b0r = 0.317 , &! Constant in the expression for z0t over ice
123  c_z0t_ice_b1r = -0.565 , &! Constant in the expression for z0t over ice
124  c_z0t_ice_b2r = -0.183 , &! Constant in the expression for z0t over ice
125  c_z0q_ice_b0s = 1.610 , &! Constant in the expression for z0q over ice
126  c_z0q_ice_b0t = 0.351 , &! Constant in the expression for z0q over ice
127  c_z0q_ice_b1t = -0.628 , &! Constant in the expression for z0q over ice
128  c_z0q_ice_b0r = 0.396 , &! Constant in the expression for z0q over ice
129  c_z0q_ice_b1r = -0.512 , &! Constant in the expression for z0q over ice
130  c_z0q_ice_b2r = -0.180 , &! Constant in the expression for z0q over ice
131  re_z0s_ice_t = 2.5 , &! Threshold value of the surface Reynolds number
132  ! used to compute z0t and z0q over ice (Andreas 2002)
133  re_z0u_thresh = 0.1 ! Threshold value of the roughness Reynolds number
134  ! [value from Zilitinkevich, Grachev, and Fairall (200),
135  ! currently not used]
136 
137 ! Dimensionless constants
138 REAL , PARAMETER :: &
139  c_free_conv = 0.14 ! Constant in the expressions for fluxes in free convection
140 
141 ! Dimensionless constants
142 REAL , PARAMETER :: &
143  c_lwrad_emis = 0.99 ! Surface emissivity with respect to the long-wave radiation
144 
145 ! Thermodynamic parameters
146 REAL , PARAMETER :: &
147  tpsf_c_stefboltz = 5.67e-08 , &! The Stefan-Boltzmann constant [W m^{-2} K^{-4}]
148  tpsf_r_dryair = 2.8705e+02 , &! Gas constant for dry air [J kg^{-1} K^{-1}]
149  tpsf_r_watvap = 4.6151e+02 , &! Gas constant for water vapour [J kg^{-1} K^{-1}]
150  tpsf_c_a_p = 1.005e+03 , &! Specific heat of air at constant pressure [J kg^{-1} K^{-1}]
151  tpsf_l_evap = 2.501e+06 , &! Specific heat of evaporation [J kg^{-1}]
152  tpsf_nu_u_a = 1.50e-05 , &! Kinematic molecular viscosity of air [m^{2} s^{-1}]
153  tpsf_kappa_t_a = 2.20e-05 , &! Molecular temperature conductivity of air [m^{2} s^{-1}]
154  tpsf_kappa_q_a = 2.40e-05 ! Molecular diffusivity of air for water vapour [m^{2} s^{-1}]
155 
156 ! Derived thermodynamic parameters
157 REAL , PARAMETER :: &
158  tpsf_rd_o_rv = tpsf_r_dryair/tpsf_r_watvap , &! Ratio of gas constants (Rd/Rv)
159  tpsf_alpha_q = (1.-tpsf_rd_o_rv)/tpsf_rd_o_rv ! Diemsnionless ratio
160 
161 ! Thermodynamic parameters
162 REAL , PARAMETER :: &
163  p_a_ref = 1.0e+05 ! Reference pressure [N m^{-2} = kg m^{-1} s^{-2}]
164 
165 
166 ! The variables declared below
167 ! are accessible to all program units of the MODULE "sfcflx"
168 ! and to the driving routines that use "sfcflx".
169 ! These are basically the quantities computed by sfcflx.
170 ! Apart from these quantities, there a few local scalars
171 ! used by sfcflx routines mainly for security reasons.
172 ! All variables declared below have a suffix "sf".
173 
174 ! sfcflx variables of type REAL
175 
176 !RJ: provide default unreasonable value to init for 'ifort -fpic -openmp', to avoid ICE
177 REAL,PARAMETER,PRIVATE :: z_=-huge(0.0)
178 
179 ! Roughness lengths
180 REAL :: &
181  z0u_sf=z_ , &! Roughness length with respect to wind velocity [m]
182  z0t_sf=z_ , &! Roughness length with respect to potential temperature [m]
183  z0q_sf=z_ ! Roughness length with respect to specific humidity [m]
184 ! Security constants
185 REAL , PARAMETER :: &
186  u_wind_min_sf = 1.0e-02 , &! Minimum wind speed [m s^{-1}]
187  u_star_min_sf = 1.0e-04 , &! Minimum value of friction velocity [m s^{-1}]
188  z0t_min_sf = 1.0e-11 , &! Minimum value of thermal roughness length [m s^{-1}]
189  c_accur_sf = 1.0e-07 , &! A small number (accuracy)
190  c_small_sf = 1.0e-04 ! A small number (used to compute fluxes)
191 
192 ! Useful constants
193 REAL , PARAMETER :: &
194  num_1o3_sf = 1./3. ! 1/3
195 
196 !==============================================================================
197 ! Procedures
198 !==============================================================================
199 
200 CONTAINS
201 
202 !==============================================================================
203 ! The codes of the sfcflx procedures are stored in separate "*.incf" files
204 ! and are included below.
205 !------------------------------------------------------------------------------
206 
207 !==============================================================================
208 ! For SURFEX needs, separate *.incf files are explicitly expanded
209 !==============================================================================
210 !SURFEX include 'sfcflx_lwradatm.incf'
211 ! File %M% from Library %Q%
212 ! Version %I% from %G% extracted: %H%
213 !------------------------------------------------------------------------------
214 
215 !SURFEX REAL FUNCTION sfcflx_lwradatm (T_a, e_a, cl_tot, cl_low)
216 FUNCTION sfcflx_lwradatm (T_a, e_a, cl_tot, cl_low)
218 !------------------------------------------------------------------------------
219 !
220 ! Description:
221 !
222 ! Computes the long-wave radiation flux from the atmosphere
223 ! as function of air temperature, water vapour pressure and cloud fraction.
224 !
225 !
226 ! Current Code Owner: DWD, Dmitrii Mironov
227 ! Phone: +49-69-8062 2705
228 ! Fax: +49-69-8062 3721
229 ! E-mail: dmitrii.mironov@dwd.de
230 !
231 ! History:
232 ! Version Date Name
233 ! ---------- ---------- ----
234 ! 1.00 2005/11/17 Dmitrii Mironov
235 ! Initial release
236 ! !VERSION! !DATE! <Your name>
237 ! <Modification comments>
238 !
239 ! Code Description:
240 ! Language: Fortran 90.
241 ! Software Standards: "European Standards for Writing and
242 ! Documenting Exchangeable Fortran 90 Code".
243 !==============================================================================
244 !
245 ! Declarations:
246 !
247 ! Modules used:
248 
249 !_dm Parameters are USEd in module "sfcflx".
250 !_nu USE modd_data_parameters , ONLY : &
251 !_nu ireals, & ! KIND-type parameter for real variables
252 !_nu iintegers ! KIND-type parameter for "normal" integer variables
253 
254 !==============================================================================
255 
256 IMPLICIT NONE
257 
258 !==============================================================================
259 !
260 ! Declarations
261 
262 ! Input (function argument)
263 REAL , INTENT(IN) :: &
264  T_a , &! Air temperature [K]
265  e_a , &! Water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
266  cl_tot , &! Total cloud cover [0,1]
267  cl_low ! Lowe-level cloud cover [0,1]
268 
269 ! Output (function result)
270 REAL :: &
271  sfcflx_lwradatm ! Long-wave radiation flux [W m^{-2}]
272 
273 
274 ! Local parameters
275 
276 ! Coefficients in the empirical formulation
277 ! developed at the Main Geophysical Observatory (MGO), St. Petersburg, Russia.
278 REAL , PARAMETER :: &
279  c_lmMGO_1 = 43.057924 , &! Empirical coefficient
280  c_lmmgo_2 = 540.795 ! Empirical coefficient
281 ! Temperature-dependent cloud-correction coefficients in the MGO formula
282 INTEGER , PARAMETER :: &
283  nband_coef = 6 ! Number of temperature bands
284 REAL , PARAMETER, DIMENSION (nband_coef) :: &
285  corr_cl_tot = (/0.70, 0.45, 0.32, &
286  0.23, 0.18, 0.13/) , &! Total clouds
287  corr_cl_low = (/0.76, 0.49, 0.35, &
288  0.26, 0.20, 0.15/) , &! Low-level clouds
289  corr_cl_midhigh = (/0.46, 0.30, 0.21, &
290  0.15, 0.12, 0.09/) ! Mid- and high-level clouds
291 REAL , PARAMETER :: &
292  T_low = 253.15 , &! Low-limit temperature in the interpolation formula [K]
293  del_t = 10.0 ! Temperature step in the interpolation formula [K]
294 
295 ! Coefficients in the empirical water-vapour correction function
296 ! (see Fung et al. 1984, Zapadka and Wozniak 2000, Zapadka et al. 2001).
297 REAL , PARAMETER :: &
298  c_watvap_corr_min = 0.6100 , &! Empirical coefficient (minimum value of the correction function)
299  c_watvap_corr_max = 0.7320 , &! Empirical coefficient (maximum value of the correction function)
300  c_watvap_corr_e = 0.0050 ! Empirical coefficient [(N m^{-2})^{-1/2}]
301 
302 ! Local variables of type INTEGER
303 INTEGER :: &
304  i ! Loop index
305 
306 ! Local variables of type REAL
307 REAL :: &
308  c_cl_tot_corr , &! The MGO cloud correction coefficient, total clouds
309  c_cl_low_corr , &! The MGO cloud correction coefficient, low-level clouds
310  c_cl_midhigh_corr , &! The MGO cloud correction coefficient, mid- and high-level clouds
311  T_corr , &! Temperature used to compute the MGO cloud correction [K]
312  f_wvpres_corr , &! Correction function with respect to water vapour
313  f_cloud_corr ! Correction function with respect to cloudiness
314 REAL(KIND=JPRB) :: ZHOOK_HANDLE
315 
316 !==============================================================================
317 ! Start calculations
318 !------------------------------------------------------------------------------
319 
320 ! Water-vapour correction function
321  IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_LWRADATM',0,zhook_handle)
322  f_wvpres_corr = c_watvap_corr_min + c_watvap_corr_e*sqrt(e_a)
323  f_wvpres_corr = min(f_wvpres_corr, c_watvap_corr_max)
324 
325 ! Cloud-correction coefficients using the MGO formulation with linear interpolation
326 IF(t_a.LT.t_low) THEN
327  c_cl_tot_corr = corr_cl_tot(1)
328  c_cl_low_corr = corr_cl_low(1)
329  c_cl_midhigh_corr = corr_cl_midhigh(1)
330 ELSE IF(t_a.GE.t_low+(nband_coef-1)*del_t) THEN
331  c_cl_tot_corr = corr_cl_tot(nband_coef)
332  c_cl_low_corr = corr_cl_low(nband_coef)
333  c_cl_midhigh_corr = corr_cl_midhigh(nband_coef)
334 ELSE
335  t_corr = t_low
336  DO i=1, nband_coef-1
337  IF(t_a.GE.t_corr.AND.t_a.LT.t_corr+del_t) THEN
338  c_cl_tot_corr = (t_a-t_corr)/del_t
339  c_cl_low_corr = corr_cl_low(i) + (corr_cl_low(i+1)-corr_cl_low(i))*c_cl_tot_corr
340  c_cl_midhigh_corr = corr_cl_midhigh(i) + (corr_cl_midhigh(i+1)-corr_cl_midhigh(i))*c_cl_tot_corr
341  c_cl_tot_corr = corr_cl_tot(i) + (corr_cl_tot(i+1)-corr_cl_tot(i))*c_cl_tot_corr
342  END IF
343  t_corr = t_corr + del_t
344  END DO
345 END IF
346 ! Cloud correction function
347 IF(cl_low.LT.0.) THEN ! Total cloud cover only
348  f_cloud_corr = 1. + c_cl_tot_corr*cl_tot*cl_tot
349 ELSE ! Total and low-level cloud cover
350  f_cloud_corr = (1. + c_cl_low_corr*cl_low*cl_low) &
351  * (1. + c_cl_midhigh_corr*(cl_tot*cl_tot-cl_low*cl_low))
352 END IF
353 
354 ! Long-wave radiation flux [W m^{-2}]
355 
356 ! The MGO formulation
357 !_nu The MGO formulation
358 !_nu sfcflx_lwradatm = -sfcflx_lwradatm*c_lwrad_emis &
359 !_nu * (c_lmMGO_1*SQRT(tpsf_C_StefBoltz*T_a**4)-c_lmMGO_2)
360 !_nu
361 
362 ! "Conventional" formulation
363 ! (see Fung et al. 1984, Zapadka and Wozniak 2000, Zapadka et al. 2001)
364 sfcflx_lwradatm = -c_lwrad_emis*tpsf_c_stefboltz*t_a**4 &
365  * f_wvpres_corr*f_cloud_corr
366 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_LWRADATM',1,zhook_handle)
367 
368 !------------------------------------------------------------------------------
369 ! End calculations
370 !==============================================================================
371 
372 END FUNCTION sfcflx_lwradatm
373 
374 
375 !==============================================================================
376 !SURFEX include 'sfcflx_lwradwsfc.incf'
377 ! File %M% from Library %Q%
378 ! Version %I% from %G% extracted: %H%
379 !------------------------------------------------------------------------------
380 
381 !SURFEX REAL FUNCTION sfcflx_lwradwsfc (zts)
382 FUNCTION sfcflx_lwradwsfc (emis,pts)
384 !------------------------------------------------------------------------------
385 !
386 ! Description:
387 !
388 ! Computes the surface long-wave radiation flux
389 ! as function of temperature.
390 !
391 !
392 ! Current Code Owner: DWD, Dmitrii Mironov
393 ! Phone: +49-69-8062 2705
394 ! Fax: +49-69-8062 3721
395 ! E-mail: dmitrii.mironov@dwd.de
396 !
397 ! History:
398 ! Version Date Name
399 ! ---------- ---------- ----
400 ! 1.00 2005/11/17 Dmitrii Mironov
401 ! Initial release
402 ! !VERSION! !DATE! <Your name>
403 ! <Modification comments>
404 !
405 ! Code Description:
406 ! Language: Fortran 90.
407 ! Software Standards: "European Standards for Writing and
408 ! Documenting Exchangeable Fortran 90 Code".
409 !==============================================================================
410 !
411 ! Declarations:
412 !
413 ! Modules used:
414 
415 !_dm Parameters are USEd in module "sfcflx".
416 !_nu USE modd_data_parameters , ONLY : &
417 !_nu ireals, & ! KIND-type parameter for real variables
418 !_nu iintegers ! KIND-type parameter for "normal" integer variables
419 
420 !==============================================================================
421 
422 IMPLICIT NONE
423 
424 !==============================================================================
425 !
426 ! Declarations
427 
428 ! Input (function argument)
429 REAL , INTENT(IN) :: &
430  emis , & ! Emissivity
431  pts ! Temperature [K]
432 
433 ! Output (function result)
434 REAL :: &
435  sfcflx_lwradwsfc ! Long-wave radiation flux [W m^{-2}]
436 REAL(KIND=JPRB) :: ZHOOK_HANDLE
437 
438 !==============================================================================
439 ! Start calculations
440 !------------------------------------------------------------------------------
441 
442 ! Long-wave radiation flux [W m^{-2}]
443 
444 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_LWRADWSFC',0,zhook_handle)
445 sfcflx_lwradwsfc = emis*tpsf_c_stefboltz*pts**4
446 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_LWRADWSFC',1,zhook_handle)
447 
448 !------------------------------------------------------------------------------
449 ! End calculations
450 !==============================================================================
451 
452 END FUNCTION sfcflx_lwradwsfc
453 
454 
455 !==============================================================================
456 !SURFEX include 'sfcflx_momsenlat.incf'
457 ! File %M% from Library %Q%
458 ! Version %I% from %G% extracted: %H%
459 !------------------------------------------------------------------------------
460 
461 SUBROUTINE sfcflx_momsenlat ( height_u, height_tq, fetch, &
462  U_a, T_a, q_a, T_s, P_a, h_ice, &
463  Q_momentum, Q_sensible, Q_latent, Q_watvap,&
464  Ri, z0u_ini, z0t_ini, Qsat_out, &
465  Q_latenti, Q_sublim )
467 !------------------------------------------------------------------------------
468 !
469 ! Description:
470 !
471 ! The sfcflx routine
472 ! where fluxes of momentum and of sensible and latent heat
473 ! at the air-water or air-ice (air-snow) interface are computed.
474 !
475 ! Lines embraced with "!_tmp" contain temporary parts of the code.
476 ! Lines embraced/marked with "!_dev" may be replaced
477 ! as improved parameterizations are developed and tested.
478 ! Lines embraced/marked with "!_dm" are DM's comments
479 ! that may be helpful to a user.
480 ! Lines embraced/marked with "!_dbg" are used
481 ! for debugging purposes only.
482 !
483 !
484 ! Current Code Owner: DWD, Dmitrii Mironov
485 ! Phone: +49-69-8062 2705
486 ! Fax: +49-69-8062 3721
487 ! E-mail: dmitrii.mironov@dwd.de
488 !
489 ! History:
490 ! Version Date Name
491 ! ---------- ---------- ----
492 ! 1.00 2005/11/17 Dmitrii Mironov
493 ! Initial release
494 ! !VERSION! !DATE! <Your name>
495 ! <Modification comments>
496 !
497 ! Code Description:
498 ! Language: Fortran 90.
499 ! Software Standards: "European Standards for Writing and
500 ! Documenting Exchangeable Fortran 90 Code".
501 !==============================================================================
502 !
503 ! Declarations:
504 !
505 ! Modules used:
506 
507 !_dm Parameters are USEd in module "sfcflx".
508 !_nu USE modd_data_parameters , ONLY : &
509 !_nu ireals, & ! KIND-type parameter for real variables
510 !_nu iintegers ! KIND-type parameter for "normal" integer variables
511 
512 !==============================================================================
513 
514 USE mode_thermos
515 USE modd_surf_atm, ONLY : xrimax
516 
517 IMPLICIT NONE
518 
519 !==============================================================================
520 !
521 ! Declarations
522 
523 ! Input (procedure arguments)
524 
525 REAL , INTENT(IN) :: &
526  height_u , &! Height where wind is measured [m]
527  height_tq , &! Height where temperature and humidity are measured [m]
528  fetch , &! Typical wind fetch [m]
529  U_a , &! Wind speed [m s^{-1}]
530  T_a , &! Air temperature [K]
531  q_a , &! Air specific humidity [-]
532  T_s , &! Surface temperature (water, ice or snow) [K]
533  P_a , &! Surface air pressure [N m^{-2} = kg m^{-1} s^{-2}]
534  h_ice , &! Ice thickness [m]
535  !
536  !plm add z0u_ini and z0t_ini as input to fill z0u_sf and z0t_sf used in
537  ! flake interface for roughness length
538  z0u_ini , &! Initial roughness for momentum
539  z0t_ini ! Initial roughness for heat
540 
541 ! Output (procedure arguments)
542 
543 REAL , INTENT(INOUT) :: &
544  Q_momentum ! Momentum flux [N m^{-2}]
545 REAL , INTENT(OUT) :: &
546  Q_sensible , &! Sensible heat flux [W m^{-2}]
547  Q_latent , &! Laten heat flux [W m^{-2}]
548  Q_latenti , &! Sublimation Latent heat flux [W m^{-2}]
549  Q_watvap , &! Flux of water vapout [kg m^{-2} s^{-1}]
550  Q_sublim , &! Flux of sublimation [kg m^{-2} s^{-1}]
551  Ri , &! Gradient Richardson number
552  Qsat_out ! specific humidity at saturation [kg.kg-1]
553 
554 
555 ! Local parameters of type INTEGER
556 INTEGER , PARAMETER :: &
557  n_iter_max = 5 ! Maximum number of iterations
558 
559 ! Local variables of type LOGICAL
560 LOGICAL :: &
561  l_conv_visc , &! Switch, TRUE = viscous free convection, the Nu=C Ra^(1/3) law is used
562  l_conv_cbl ! Switch, TRUE = CBL scale convective structures define surface fluxes
563 
564 ! Local variables of type INTEGER
565 INTEGER :: &
566  i , &! Loop index
567  n_iter ! Number of iterations performed
568 
569 ! Local variables of type REAL
570 REAL :: &
571  rho_a , &! Air density [kg m^{-3}]
572  wvpres_s , &! Saturation water vapour pressure at T=T_s [N m^{-2}]
573  q_s ! Saturation specific humidity at T=T_s [-]
574 
575 ! Local variables of type REAL
576 REAL :: &
577  Q_mom_tur , &! Turbulent momentum flux [N m^{-2}]
578  Q_sen_tur , &! Turbulent sensible heat flux [W m^{-2}]
579  Q_lat_tur , &! Turbulent laten heat flux [W m^{-2}]
580  Q_mom_mol , &! Molecular momentum flux [N m^{-2}]
581  Q_sen_mol , &! Molecular sensible heat flux [W m^{-2}]
582  Q_lat_mol , &! Molecular laten heat flux [W m^{-2}]
583  Q_mom_con , &! Momentum flux in free convection [N m^{-2}]
584  Q_sen_con , &! Sensible heat flux in free convection [W m^{-2}]
585  Q_lat_con ! Laten heat flux in free convection [W m^{-2}]
586 
587 ! Local variables of type REAL
588 REAL :: &
589  par_conv_visc , &! Viscous convection stability parameter
590  par_conv_cbl , &! CBL convection stability parameter
591  c_z0u_fetch , &! Fetch-dependent Charnock parameter
592  U_a_thresh , &! Threshld value of the wind speed [m s^{-1}]
593  u_star_thresh , &! Threshld value of friction velocity [m s^{-1}]
594  u_star_previter , &! Friction velocity from previous iteration [m s^{-1}]
595  u_star_n , &! Friction velocity at neutral stratification [m s^{-1}]
596  u_star_st , &! Friction velocity with due regard for stratification [m s^{-1}]
597  ZoL , &! The z/L ratio, z=height_u
598  !salgado: Ri is passed as an argument (OUT) in order to be available in flake_interface
599  !Ri , & ! Gradient Richardson number
600  ri_cr , &! Critical value of Ri
601  r_z , &! Ratio of "height_tq" to "height_u"
602  fun , &! A function of generic variable "x"
603  fun_prime , &! Derivative of "Fun" with respect to "x"
604  delta , &! Relative error
605  psi_u , &! The MO stability function for wind profile
606  psi_t , &! The MO stability function for temperature profile
607  psi_q ! The MO stability function for specific humidity profile
608 REAL(KIND=JPRB) :: ZHOOK_HANDLE
609 
610 
611 !==============================================================================
612 ! Start calculations
613 !------------------------------------------------------------------------------
614 
615 !_dm All fluxes are positive when directed upwards.
616 
617 !------------------------------------------------------------------------------
618 ! Compute saturation specific humidity and the air density at T=T_s
619 !------------------------------------------------------------------------------
620 
621 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_MOMSENLAT',0,zhook_handle)
622 q_s = qsat(t_s,p_a)
623 rho_a = sfcflx_rhoair(t_s, q_s, p_a) ! Air density at T_s and q_s (surface values)
624 !------------------------------------------------------------------------------
625 ! Compute molecular fluxes of momentum and of sensible and latent heat
626 !------------------------------------------------------------------------------
627 
628 !_dm The fluxes are in kinematic units
629 q_mom_mol = -tpsf_nu_u_a*u_a/height_u
630 q_sen_mol = -tpsf_kappa_t_a*(t_a-t_s)/height_tq
631 q_lat_mol = -tpsf_kappa_q_a*(q_a-q_s)/height_tq
632 
633 !------------------------------------------------------------------------------
634 ! Compute fluxes in free convection
635 !------------------------------------------------------------------------------
636 
637 par_conv_visc = (t_s-t_a)/t_s*sqrt(tpsf_kappa_t_a) + (q_s-q_a)*tpsf_alpha_q*sqrt(tpsf_kappa_q_a)
638 IF(par_conv_visc.GT.0.) THEN ! Viscous convection takes place
639  l_conv_visc = .true.
640  par_conv_visc = (par_conv_visc*tpl_grav/tpsf_nu_u_a)**num_1o3_sf
641  q_sen_con = c_free_conv*sqrt(tpsf_kappa_t_a)*par_conv_visc
642  q_sen_con = q_sen_con*(t_s-t_a)
643  q_lat_con = c_free_conv*sqrt(tpsf_kappa_q_a)*par_conv_visc
644  q_lat_con = q_lat_con*(q_s-q_a)
645 ELSE ! No viscous convection, set fluxes to zero
646  l_conv_visc = .false.
647  q_sen_con = 0.
648  q_lat_con = 0.
649 END IF
650 q_mom_con = 0. ! Momentum flux in free (viscous or CBL-scale) convection is zero
651 
652 !------------------------------------------------------------------------------
653 ! Compute turbulent fluxes
654 !------------------------------------------------------------------------------
655 
656 r_z = height_tq/height_u ! Ratio of "height_tq" to "height_u"
657 ri_cr = c_mo_t_stab/c_mo_u_stab**2*r_z ! Critical Ri
658 ri = tpl_grav*((t_a-t_s)/t_s+tpsf_alpha_q*(q_a-q_s))/max(u_a,u_wind_min_sf)**2
659 ri = min(xrimax,ri*height_u/pr_neutral) ! Gradient Richardson number
660 
661 turb_fluxes: IF(u_a.LT.u_wind_min_sf.OR.ri.GT.ri_cr-c_small_sf) THEN ! Low wind or Ri>Ri_cr
662 
663 u_star_st = 0. ! Set turbulent fluxes to zero
664 q_mom_tur = 0.
665 q_sen_tur = 0.
666 q_lat_tur = 0.
667 z0u_sf = z0u_ini
668 z0t_sf = z0t_ini
669 
670 ELSE turb_fluxes ! Compute turbulent fluxes using MO similarity
671 
672 ! Compute z/L, where z=height_u
673 IF(ri.GE.0.) THEN ! Stable stratification
674  zol = sqrt(1.-4.*(c_mo_u_stab-r_z*c_mo_t_stab)*ri)
675  zol = zol - 1. + 2.*c_mo_u_stab*ri
676  zol = zol/2./c_mo_u_stab/c_mo_u_stab/(ri_cr-ri)
677 ELSE ! Convection
678  n_iter = 0
679  delta = 1. ! Set initial error to a large value (as compared to the accuracy)
680  u_star_previter = ri*max(1., sqrt(r_z*c_mo_t_conv/c_mo_u_conv)) ! Initial guess for ZoL
681  DO WHILE (delta.GT.c_accur_sf.AND.n_iter.LT.n_iter_max)
682  fun = u_star_previter**2*(c_mo_u_conv*u_star_previter-1.) &
683  + ri**2*(1.-r_z*c_mo_t_conv*u_star_previter)
684  fun_prime = 3.*c_mo_u_conv*u_star_previter**2 &
685  - 2.*u_star_previter - r_z*c_mo_t_conv*ri**2
686  zol = u_star_previter - fun/fun_prime
687  delta = abs(zol-u_star_previter)/max(c_accur_sf, abs(zol+u_star_previter))
688  u_star_previter = zol
689  n_iter = n_iter + 1
690  END DO
691 !_dbg
692 ! IF(n_iter.GE.n_iter_max-1) &
693 ! WRITE(*,*) 'ZoL: Max No. iters. exceeded (n_iter = ', n_iter, ')!'
694 !_dbg
695 END IF
696 
697 ! Compute fetch-dependent Charnock parameter, use "u_star_min_sf"
698  CALL sfcflx_roughness (fetch, u_a, u_star_min_sf, h_ice, c_z0u_fetch, u_star_thresh, z0u_sf, z0t_sf, z0q_sf)
699 
700 ! Threshold value of wind speed
701 u_star_st = u_star_thresh
702  CALL sfcflx_roughness (fetch, u_a, u_star_st, h_ice, c_z0u_fetch, u_star_thresh, z0u_sf, z0t_sf, z0q_sf)
703 IF(zol.GT.0.) THEN ! MO function in stable stratification
704  psi_u = c_mo_u_stab*zol*(1.-min(z0u_sf/height_u, 1.))
705 ELSE ! MO function in convection
706  psi_t = (1.-c_mo_u_conv*zol)**c_mo_u_exp
707  psi_q = (1.-c_mo_u_conv*zol*min(z0u_sf/height_u, 1.))**c_mo_u_exp
708  psi_u = 2.*(atan(psi_t)-atan(psi_q)) &
709  + 2.*log((1.+psi_q)/(1.+psi_t)) &
710  + log((1.+psi_q*psi_q)/(1.+psi_t*psi_t))
711 END IF
712 u_a_thresh = u_star_thresh/c_karman*(log(height_u/z0u_sf)+psi_u)
713 
714 ! Compute friction velocity
715 n_iter = 0
716 delta = 1. ! Set initial error to a large value (as compared to the accuracy)
717 !u_star_previter = u_star_thresh ! Initial guess for friction velocity
718 !* modif. V. Masson (Meteo-France) : uses previous time-step momentum flux for ustar guess
719 u_star_previter = max( sqrt( - q_momentum / rho_a ) , u_star_thresh )
720 !
721 
722 IF(u_a.LE.u_a_thresh) THEN ! Smooth surface
723  DO WHILE (delta.GT.c_accur_sf.AND.n_iter.LT.n_iter_max)
724  CALL sfcflx_roughness (fetch, u_a, min(u_star_thresh, u_star_previter), h_ice, &
725  c_z0u_fetch, u_star_thresh, z0u_sf, z0t_sf, z0q_sf)
726  IF(zol.GE.0.) THEN ! Stable stratification
727  psi_u = c_mo_u_stab*zol*(1.-min(z0u_sf/height_u, 1.))
728  fun = log(height_u/z0u_sf) + psi_u
729  fun_prime = (fun + 1. + c_mo_u_stab*zol*min(z0u_sf/height_u, 1.))/c_karman
730  fun = fun*u_star_previter/c_karman - u_a
731  ELSE ! Convection
732  psi_t = (1.-c_mo_u_conv*zol)**c_mo_u_exp
733  psi_q = (1.-c_mo_u_conv*zol*min(z0u_sf/height_u, 1.))**c_mo_u_exp
734  psi_u = 2.*(atan(psi_t)-atan(psi_q)) &
735  + 2.*log((1.+psi_q)/(1.+psi_t)) &
736  + log((1.+psi_q*psi_q)/(1.+psi_t*psi_t))
737  fun = log(height_u/z0u_sf) + psi_u
738  fun_prime = (fun + 1./psi_q)/c_karman
739  fun = fun*u_star_previter/c_karman - u_a
740  END IF
741  u_star_st = u_star_previter - fun/fun_prime
742  delta = abs((u_star_st-u_star_previter)/(u_star_st+u_star_previter))
743  u_star_previter = u_star_st
744  n_iter = n_iter + 1
745  END DO
746 ELSE ! Rough surface
747  DO WHILE (delta.GT.c_accur_sf.AND.n_iter.LT.n_iter_max.AND.z0t_sf>z0t_min_sf)
748  CALL sfcflx_roughness (fetch, u_a, max(u_star_thresh, u_star_previter), h_ice, &
749  c_z0u_fetch, u_star_thresh, z0u_sf, z0t_sf, z0q_sf)
750  IF(zol.GE.0.) THEN ! Stable stratification
751  psi_u = c_mo_u_stab*zol*(1.-min(z0u_sf/height_u, 1.))
752  fun = log(height_u/z0u_sf) + psi_u
753  fun_prime = (fun - 2. - 2.*c_mo_u_stab*zol*min(z0u_sf/height_u, 1.))/c_karman
754  fun = fun*u_star_previter/c_karman - u_a
755  ELSE ! Convection
756  psi_t = (1.-c_mo_u_conv*zol)**c_mo_u_exp
757  psi_q = (1.-c_mo_u_conv*zol*min(z0u_sf/height_u, 1.))**c_mo_u_exp
758  psi_u = 2.*(atan(psi_t)-atan(psi_q)) &
759  + 2.*log((1.+psi_q)/(1.+psi_t)) &
760  + log((1.+psi_q*psi_q)/(1.+psi_t*psi_t))
761  fun = log(height_u/z0u_sf) + psi_u
762  fun_prime = (fun - 2./psi_q)/c_karman
763  fun = fun*u_star_previter/c_karman - u_a
764  END IF
765  IF(h_ice.GE.h_ice_min_flk) THEN ! No iteration is required for rough flow over ice
766  u_star_st = c_karman*u_a/max(c_small_sf, log(height_u/z0u_sf)+psi_u)
767  u_star_previter = u_star_st
768  ELSE ! Iterate in case of open water
769  u_star_st = u_star_previter - fun/fun_prime
770  END IF
771  delta = abs((u_star_st-u_star_previter)/(u_star_st+u_star_previter))
772  u_star_previter = u_star_st
773  n_iter = n_iter + 1
774  END DO
775 END IF
776 !
777 !* Modification: V. Masson (Meteo-France)
778 !* in case convergence did not occur :
779 ! - one keeps the values of the previous time-step for momentum roughness length
780 ! - one recomputes the thermal and water vapor roughness lengthes
781 ! - one estimates the momentum flux using neutral law
782 IF (n_iter == n_iter_max .OR. z0t_sf<=z0t_min_sf) THEN
783  u_star_st = max( sqrt( - q_momentum / rho_a ) , u_star_min_sf )
784  CALL sfcflx_roughness (fetch, u_a, u_star_st, h_ice, &
785  c_z0u_fetch, u_star_previter, z0u_sf, z0t_sf, z0q_sf)
786  z0u_sf = z0u_ini
787  u_star_st = c_karman*u_a/max(c_small_sf, log(height_u/z0u_sf))
788 END IF
789 
790 !_dbg
791 ! WRITE(*,*) 'MO stab. func. psi_u = ', psi_u, ' n_iter = ', n_iter
792 ! WRITE(*,*) ' Wind speed = ', U_a, ' u_* = ', u_star_st
793 ! WRITE(*,*) ' Fun = ', Fun
794 !_dbg
795 
796 !_dbg
797 ! IF(n_iter.GE.n_iter_max-1) &
798 ! WRITE(*,*) 'u_*: Max No. iters. exceeded (n_iter = ', n_iter, ')!'
799 !_dbg
800 
801 ! Momentum flux
802 q_mom_tur = -u_star_st*u_star_st
803 
804 ! Temperature and specific humidity fluxes
805  CALL sfcflx_roughness (fetch, u_a, u_star_st, h_ice, c_z0u_fetch, u_star_thresh, z0u_sf, z0t_sf, z0q_sf)
806 !
807 IF(zol.GE.0.) THEN ! Stable stratification
808  psi_t = c_mo_t_stab*r_z*zol*(1.-min(z0t_sf/height_tq, 1.))
809  psi_q = c_mo_q_stab*r_z*zol*(1.-min(z0q_sf/height_tq, 1.))
810 !_dbg
811 ! WRITE(*,*) 'STAB: psi_t = ', psi_t, ' psi_q = ', psi_q
812 !_dbg
813 ELSE ! Convection
814  psi_u = (1.-c_mo_t_conv*r_z*zol)**c_mo_t_exp
815  psi_t = (1.-c_mo_t_conv*r_z*zol*min(z0t_sf/height_tq, 1.))**c_mo_t_exp
816  psi_t = 2.*log((1.+psi_t)/(1.+psi_u))
817  psi_u = (1.-c_mo_q_conv*r_z*zol)**c_mo_q_exp
818  psi_q = (1.-c_mo_q_conv*r_z*zol*min(z0q_sf/height_tq, 1.))**c_mo_q_exp
819  psi_q = 2.*log((1.+psi_q)/(1.+psi_u))
820 !_dbg
821 ! WRITE(*,*) 'CONV: psi_t = ', psi_t, ' psi_q = ', psi_q
822 !_dbg
823 END IF
824 
825 q_sen_tur = -(t_a-t_s)*u_star_st*c_karman/pr_neutral &
826  / max(c_small_sf, log(height_tq/z0t_sf)+psi_t)
827 q_lat_tur = -(q_a-q_s)*u_star_st*c_karman/sc_neutral &
828  / max(c_small_sf, log(height_tq/z0q_sf)+psi_q)
829 
830 END IF turb_fluxes
831 
832 !------------------------------------------------------------------------------
833 ! Decide between turbulent, molecular, and convective fluxes
834 !------------------------------------------------------------------------------
835 
836 q_momentum = min(q_mom_tur, q_mom_mol, q_mom_con) ! Momentum flux is negative
837 IF(l_conv_visc) THEN ! Convection, take fluxes that are maximal in magnitude
838  IF(abs(q_sen_tur).GE.abs(q_sen_con)) THEN
839  q_sensible = q_sen_tur
840  ELSE
841  q_sensible = q_sen_con
842  END IF
843  IF(abs(q_sensible).LT.abs(q_sen_mol)) THEN
844  q_sensible = q_sen_mol
845  END IF
846  IF(abs(q_lat_tur).GE.abs(q_lat_con)) THEN
847  q_latent = q_lat_tur
848  ELSE
849  q_latent = q_lat_con
850  END IF
851  IF(abs(q_latent).LT.abs(q_lat_mol)) THEN
852  q_latent = q_lat_mol
853  END IF
854 ELSE ! Stable or neutral stratification, chose fluxes that are maximal in magnitude
855  IF(abs(q_sen_tur).GE.abs(q_sen_mol)) THEN
856  q_sensible = q_sen_tur
857  ELSE
858  q_sensible = q_sen_mol
859  END IF
860  IF(abs(q_lat_tur).GE.abs(q_lat_mol)) THEN
861  q_latent = q_lat_tur
862  ELSE
863  q_latent = q_lat_mol
864  END IF
865 END IF
866 
867 !------------------------------------------------------------------------------
868 ! Set output (notice that fluxes are no longer in kinematic units)
869 !------------------------------------------------------------------------------
870 !
871 q_momentum = q_momentum*rho_a
872 q_sensible = q_sensible*rho_a*tpsf_c_a_p
873 q_watvap = q_latent*rho_a
874 !
875 IF(h_ice.GE.h_ice_min_flk)THEN
876  q_latent = q_watvap * (tpsf_l_evap + tpl_l_f) ! Add latent heat of fusion over ice
877  q_latenti = q_watvap * (tpsf_l_evap + tpl_l_f)
878  q_sublim = q_watvap
879 ELSE
880  q_latent = q_watvap * tpsf_l_evap
881  q_latenti = 0.0
882  q_sublim = 0.0
883 ENDIF
884 !
885 qsat_out = q_s
886 !
887 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_MOMSENLAT',1,zhook_handle)
888 
889 !------------------------------------------------------------------------------
890 ! End calculations
891 !==============================================================================
892 
893 END SUBROUTINE sfcflx_momsenlat
894 
895 
896 !==============================================================================
897 
898 !==============================================================================
899 !SURFEX include 'sfcflx_rhoair.incf'
900 ! File %M% from Library %Q%
901 ! Version %I% from %G% extracted: %H%
902 !------------------------------------------------------------------------------
903 
904 !SURFEX REAL FUNCTION sfcflx_rhoair (T, q, P)
905 FUNCTION sfcflx_rhoair (T, q, P)
907 !------------------------------------------------------------------------------
908 !
909 ! Description:
910 !
911 ! Computes the air density as function
912 ! of temperature, specific humidity and pressure.
913 !
914 !
915 ! Current Code Owner: DWD, Dmitrii Mironov
916 ! Phone: +49-69-8062 2705
917 ! Fax: +49-69-8062 3721
918 ! E-mail: dmitrii.mironov@dwd.de
919 !
920 ! History:
921 ! Version Date Name
922 ! ---------- ---------- ----
923 ! 1.00 2005/11/17 Dmitrii Mironov
924 ! Initial release
925 ! !VERSION! !DATE! <Your name>
926 ! <Modification comments>
927 !
928 ! Code Description:
929 ! Language: Fortran 90.
930 ! Software Standards: "European Standards for Writing and
931 ! Documenting Exchangeable Fortran 90 Code".
932 !==============================================================================
933 !
934 ! Declarations:
935 !
936 ! Modules used:
937 
938 !_dm Parameters are USEd in module "sfcflx".
939 !_nu USE modd_data_parameters , ONLY : &
940 !_nu ireals, & ! KIND-type parameter for real variables
941 !_nu iintegers ! KIND-type parameter for "normal" integer variables
942 
943 !==============================================================================
944 
945 IMPLICIT NONE
946 
947 !==============================================================================
948 !
949 ! Declarations
950 
951 ! Input (function argument)
952 REAL , INTENT(IN) :: &
953  T , &! Temperature [K]
954  q , &! Specific humidity
955  P ! Pressure [N m^{-2} = kg m^{-1} s^{-2}]
956 
957 ! Output (function result)
958 REAL :: &
959  sfcflx_rhoair ! Air density [kg m^{-3}]
960 REAL(KIND=JPRB) :: ZHOOK_HANDLE
961 
962 !==============================================================================
963 ! Start calculations
964 !------------------------------------------------------------------------------
965 
966 ! Air density [kg m^{-3}]
967 
968 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_RHOAIR',0,zhook_handle)
969 sfcflx_rhoair = p/tpsf_r_dryair/t/(1.+(1./tpsf_rd_o_rv-1.)*q)
970 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_RHOAIR',1,zhook_handle)
971 
972 !------------------------------------------------------------------------------
973 ! End calculations
974 !==============================================================================
975 
976 END FUNCTION sfcflx_rhoair
977 
978 
979 !==============================================================================
980 !SURFEX include 'sfcflx_roughness.incf'
981 ! File %M% from Library %Q%
982 ! Version %I% from %G% extracted: %H%
983 !------------------------------------------------------------------------------
984 
985 SUBROUTINE sfcflx_roughness (fetch, U_a, u_star, h_ice, &
986  c_z0u_fetch, u_star_thresh, z0u, z0t, z0q)
988 !------------------------------------------------------------------------------
989 !
990 ! Description:
991 !
992 ! Computes the water-surface or the ice-surface roughness lengths
993 ! with respect to wind velocity, potential temperature and specific humidity.
994 !
995 ! The water-surface roughness lengths with respect to wind velocity is computed
996 ! from the Charnock formula when the surface is aerodynamically rough.
997 ! A simple empirical formulation is used to account for the dependence
998 ! of the Charnock parameter on the wind fetch.
999 ! When the flow is aerodynamically smooth, the roughness length with respect to
1000 ! wind velocity is proportional to the depth of the viscous sub-layer.
1001 ! The water-surface roughness lengths for scalars are computed using the power-law
1002 ! formulations in terms of the roughness Reynolds number (Zilitinkevich et al. 2001).
1003 ! The ice-surface aerodynamic roughness is taken to be constant.
1004 ! The ice-surface roughness lengths for scalars
1005 ! are computed through the power-law formulations
1006 ! in terms of the roughness Reynolds number (Andreas 2002).
1007 !
1008 !
1009 ! Current Code Owner: DWD, Dmitrii Mironov
1010 ! Phone: +49-69-8062 2705
1011 ! Fax: +49-69-8062 3721
1012 ! E-mail: dmitrii.mironov@dwd.de
1013 !
1014 ! History:
1015 ! Version Date Name
1016 ! ---------- ---------- ----
1017 ! 1.00 2005/11/17 Dmitrii Mironov
1018 ! Initial release
1019 ! !VERSION! !DATE! <Your name>
1020 ! <Modification comments>
1021 !
1022 ! Code Description:
1023 ! Language: Fortran 90.
1024 ! Software Standards: "European Standards for Writing and
1025 ! Documenting Exchangeable Fortran 90 Code".
1026 !==============================================================================
1027 !
1028 ! Declarations:
1029 !
1030 ! Modules used:
1031 
1032 !_dm Parameters are USEd in module "sfcflx".
1033 !_nu USE modd_data_parameters , ONLY : &
1034 !_nu ireals , & ! KIND-type parameter for real variables
1035 !_nu iintegers ! KIND-type parameter for "normal" integer variables
1036 
1037 !==============================================================================
1038 
1039 IMPLICIT NONE
1040 
1041 !==============================================================================
1042 !
1043 ! Declarations
1044 
1045 ! Input (procedure arguments)
1046 REAL , INTENT(IN) :: &
1047  fetch , &! Typical wind fetch [m]
1048  U_a , &! Wind speed [m s^{-1}]
1049  u_star , &! Friction velocity in the surface air layer [m s^{-1}]
1050  h_ice ! Ice thickness [m]
1051 
1052 ! Output (procedure arguments)
1053 REAL , INTENT(OUT) :: &
1054  c_z0u_fetch , &! Fetch-dependent Charnock parameter
1055  u_star_thresh , &! Threshold value of friction velocity [m s^{-1}]
1056  z0u , &! Roughness length with respect to wind velocity [m]
1057  z0t , &! Roughness length with respect to potential temperature [m]
1058  z0q ! Roughness length with respect to specific humidity [m]
1059 
1060 ! Local variables of type REAL
1061 REAL :: &
1062  Re_s , &! Surface Reynolds number
1063  Re_s_thresh ! Threshold value of Re_s
1064 REAL(KIND=JPRB) :: ZHOOK_HANDLE
1065 
1066 !==============================================================================
1067 ! Start calculations
1068 !------------------------------------------------------------------------------
1069 
1070 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_ROUGHNESS',0,zhook_handle)
1071 water_or_ice: IF(h_ice.LT.h_ice_min_flk) THEN ! Water surface
1072 
1073 ! The Charnock parameter as dependent on dimensionless fetch
1074  c_z0u_fetch = max(u_a, u_wind_min_sf)**2/tpl_grav/fetch ! Inverse dimensionless fetch
1075  c_z0u_fetch = c_z0u_rough + c_z0u_ftch_f*c_z0u_fetch**c_z0u_ftch_ex
1076  c_z0u_fetch = min(c_z0u_fetch, c_z0u_rough_l) ! Limit Charnock parameter
1077 
1078 ! Threshold value of friction velocity
1079  u_star_thresh = (c_z0u_smooth/c_z0u_fetch*tpl_grav*tpsf_nu_u_a)**num_1o3_sf
1080 
1081 ! Surface Reynolds number and its threshold value
1082  re_s = u_star**3/tpsf_nu_u_a/tpl_grav
1083  re_s_thresh = c_z0u_smooth/c_z0u_fetch
1084 
1085 ! Aerodynamic roughness
1086  IF(re_s.LE.re_s_thresh) THEN
1087  z0u = c_z0u_smooth*tpsf_nu_u_a/u_star ! Smooth flow
1088  ELSE
1089  z0u = c_z0u_fetch*u_star*u_star/tpl_grav ! Rough flow
1090  END IF
1091 ! Roughness for scalars
1092  z0q = c_z0u_fetch*max(re_s, re_s_thresh)
1095  z0t = z0u*exp(-c_karman/pr_neutral*z0t)
1096  z0q = z0u*exp(-c_karman/sc_neutral*z0q)
1097 
1098 ELSE water_or_ice ! Ice surface
1099 
1100 ! The Charnock parameter is not used over ice, formally set "c_z0u_fetch" to its minimum value
1101  c_z0u_fetch = c_z0u_rough
1102 
1103 ! Threshold value of friction velocity
1104  u_star_thresh = c_z0u_smooth*tpsf_nu_u_a/z0u_ice_rough
1105 
1106 ! Aerodynamic roughness
1107  z0u = max(z0u_ice_rough, c_z0u_smooth*tpsf_nu_u_a/u_star)
1108 
1109 ! Roughness Reynolds number
1110  re_s = max(u_star*z0u/tpsf_nu_u_a, c_accur_sf)
1111 
1112 ! Roughness for scalars
1113  IF(re_s.LE.re_z0s_ice_t) THEN
1114  z0t = c_z0t_ice_b0t + c_z0t_ice_b1t*log(re_s)
1115  z0t = min(z0t, c_z0t_ice_b0s)
1116  z0q = c_z0q_ice_b0t + c_z0q_ice_b1t*log(re_s)
1117  z0q = min(z0q, c_z0q_ice_b0s)
1118  ELSE
1119  z0t = c_z0t_ice_b0r + c_z0t_ice_b1r*log(re_s) + c_z0t_ice_b2r*log(re_s)**2
1120  z0q = c_z0q_ice_b0r + c_z0q_ice_b1r*log(re_s) + c_z0q_ice_b2r*log(re_s)**2
1121  END IF
1122  z0t = z0u*exp(z0t)
1123  z0q = z0u*exp(z0q)
1124 
1125 END IF water_or_ice
1126 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_ROUGHNESS',1,zhook_handle)
1127 
1128 !------------------------------------------------------------------------------
1129 ! End calculations
1130 !==============================================================================
1131 
1132 END SUBROUTINE sfcflx_roughness
1133 
1134 !==============================================================================
1135 !SURFEX include 'sfcflx_satwvpres.incf'
1136 ! File %M% from Library %Q%
1137 ! Version %I% from %G% extracted: %H%
1138 !------------------------------------------------------------------------------
1139 
1140 !SURFEX REAL FUNCTION sfcflx_satwvpres (T, h_ice)
1141 FUNCTION sfcflx_satwvpres (T, h_ice)
1143 !------------------------------------------------------------------------------
1144 !
1145 ! Description:
1146 !
1147 ! Computes saturation water vapour pressure
1148 ! over the water surface or over the ice surface
1149 ! as function of temperature.
1150 !
1151 !
1152 ! Current Code Owner: DWD, Dmitrii Mironov
1153 ! Phone: +49-69-8062 2705
1154 ! Fax: +49-69-8062 3721
1155 ! E-mail: dmitrii.mironov@dwd.de
1156 !
1157 ! History:
1158 ! Version Date Name
1159 ! ---------- ---------- ----
1160 ! 1.00 2005/11/17 Dmitrii Mironov
1161 ! Initial release
1162 ! !VERSION! !DATE! <Your name>
1163 ! <Modification comments>
1164 !
1165 ! Code Description:
1166 ! Language: Fortran 90.
1167 ! Software Standards: "European Standards for Writing and
1168 ! Documenting Exchangeable Fortran 90 Code".
1169 !==============================================================================
1170 !
1171 ! Declarations:
1172 !
1173 ! Modules used:
1174 
1175 !_dm Parameters are USEd in module "sfcflx".
1176 !_nu USE modd_data_parameters , ONLY : &
1177 !_nu ireals, & ! KIND-type parameter for real variables
1178 !_nu iintegers ! KIND-type parameter for "normal" integer variables
1179 
1180 !_dm The variable is USEd in module "sfcflx".
1181 !_nu USE flake_parameters , ONLY : &
1182 !_nu h_Ice_min_flk ! Minimum ice thickness [m]
1183 
1184 !==============================================================================
1185 
1186 IMPLICIT NONE
1187 
1188 !==============================================================================
1189 !
1190 ! Declarations
1191 
1192 ! Input (function argument)
1193 REAL , INTENT(IN) :: &
1194  T , &! Temperature [K]
1195  h_ice ! Ice thickness [m]
1196 
1197 ! Output (function result)
1198 REAL :: &
1199  sfcflx_satwvpres ! Saturation water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
1200 
1201 ! Local parameters
1202 REAL , PARAMETER :: &
1203  b1_vap = 610.78 , &! Coefficient [N m^{-2} = kg m^{-1} s^{-2}]
1204  b3_vap = 273.16 , &! Triple point [K]
1205  b2w_vap = 17.2693882 , &! Coefficient (water)
1206  b2i_vap = 21.8745584 , &! Coefficient (ice)
1207  b4w_vap = 35.86 , &! Coefficient (temperature) [K]
1208  b4i_vap = 7.66 ! Coefficient (temperature) [K]
1209 REAL(KIND=JPRB) :: ZHOOK_HANDLE
1210 
1211 !==============================================================================
1212 ! Start calculations
1213 !------------------------------------------------------------------------------
1214 
1215 ! Saturation water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
1216 
1217 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_SATWVPRES',0,zhook_handle)
1218 IF(h_ice.LT.h_ice_min_flk) THEN ! Water surface
1219  sfcflx_satwvpres = b1_vap*exp(b2w_vap*(t-b3_vap)/(t-b4w_vap))
1220 ELSE ! Ice surface
1221  sfcflx_satwvpres = b1_vap*exp(b2i_vap*(t-b3_vap)/(t-b4i_vap))
1222 END IF
1223 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_SATWVPRES',1,zhook_handle)
1224 
1225 !------------------------------------------------------------------------------
1226 ! End calculations
1227 !==============================================================================
1228 
1229 END FUNCTION sfcflx_satwvpres
1230 
1231 
1232 !==============================================================================
1233 !SURFEX include 'sfcflx_spechum.incf'
1234 ! File %M% from Library %Q%
1235 ! Version %I% from %G% extracted: %H%
1236 !------------------------------------------------------------------------------
1237 
1238 !SURFEX REAL FUNCTION sfcflx_spechum (wvpres, P)
1239 FUNCTION sfcflx_spechum (wvpres, P)
1241 !------------------------------------------------------------------------------
1242 !
1243 ! Description:
1244 !
1245 ! Computes specific humidity as function
1246 ! of water vapour pressure and air pressure.
1247 !
1248 !
1249 ! Current Code Owner: DWD, Dmitrii Mironov
1250 ! Phone: +49-69-8062 2705
1251 ! Fax: +49-69-8062 3721
1252 ! E-mail: dmitrii.mironov@dwd.de
1253 !
1254 ! History:
1255 ! Version Date Name
1256 ! ---------- ---------- ----
1257 ! 1.00 2005/11/17 Dmitrii Mironov
1258 ! Initial release
1259 ! !VERSION! !DATE! <Your name>
1260 ! <Modification comments>
1261 !
1262 ! Code Description:
1263 ! Language: Fortran 90.
1264 ! Software Standards: "European Standards for Writing and
1265 ! Documenting Exchangeable Fortran 90 Code".
1266 !==============================================================================
1267 !
1268 ! Declarations:
1269 !
1270 ! Modules used:
1271 
1272 !_dm Parameters are USEd in module "sfcflx".
1273 !_nu USE modd_data_parameters , ONLY : &
1274 !_nu ireals, & ! KIND-type parameter for real variables
1275 !_nu iintegers ! KIND-type parameter for "normal" integer variables
1276 
1277 !==============================================================================
1278 
1279 IMPLICIT NONE
1280 
1281 !==============================================================================
1282 !
1283 ! Declarations
1284 
1285 ! Input (function argument)
1286 REAL , INTENT(IN) :: &
1287  wvpres , &! Water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
1288  P ! Air pressure [N m^{-2} = kg m^{-1} s^{-2}]
1289 
1290 ! Output (function result)
1291 REAL :: &
1292  sfcflx_spechum ! Specific humidity
1293 REAL(KIND=JPRB) :: ZHOOK_HANDLE
1294 
1295 !==============================================================================
1296 ! Start calculations
1297 !------------------------------------------------------------------------------
1298 
1299 ! Specific humidity
1300 
1301 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_SPECHUM',0,zhook_handle)
1302 sfcflx_spechum = tpsf_rd_o_rv*wvpres/(p-(1.-tpsf_rd_o_rv)*wvpres)
1303 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_SPECHUM',1,zhook_handle)
1304 
1305 !------------------------------------------------------------------------------
1306 ! End calculations
1307 !==============================================================================
1308 
1309 END FUNCTION sfcflx_spechum
1310 
1311 
1312 !==============================================================================
1313 !SURFEX include 'sfcflx_wvpreswetbulb.incf'
1314 ! File %M% from Library %Q%
1315 ! Version %I% from %G% extracted: %H%
1316 !------------------------------------------------------------------------------
1317 
1318 !SURFEX REAL FUNCTION sfcflx_wvpreswetbulb (T_dry, T_wetbulb, satwvpres_bulb, P)
1319 FUNCTION sfcflx_wvpreswetbulb (T_dry, T_wetbulb, satwvpres_bulb, P)
1321 !------------------------------------------------------------------------------
1322 !
1323 ! Description:
1324 !
1325 ! Computes water vapour pressure as function of air temperature,
1326 ! wet bulb temperature, satururation vapour pressure at wet-bulb temperature,
1327 ! and air pressure.
1328 !
1329 !
1330 ! Current Code Owner: DWD, Dmitrii Mironov
1331 ! Phone: +49-69-8062 2705
1332 ! Fax: +49-69-8062 3721
1333 ! E-mail: dmitrii.mironov@dwd.de
1334 !
1335 ! History:
1336 ! Version Date Name
1337 ! ---------- ---------- ----
1338 ! 1.00 2005/11/17 Dmitrii Mironov
1339 ! Initial release
1340 ! !VERSION! !DATE! <Your name>
1341 ! <Modification comments>
1342 !
1343 ! Code Description:
1344 ! Language: Fortran 90.
1345 ! Software Standards: "European Standards for Writing and
1346 ! Documenting Exchangeable Fortran 90 Code".
1347 !==============================================================================
1348 !
1349 ! Declarations:
1350 !
1351 ! Modules used:
1352 
1353 !_dm Parameters are USEd in module "sfcflx".
1354 !_nu USE modd_data_parameters , ONLY : &
1355 !_nu ireals, & ! KIND-type parameter for real variables
1356 !_nu iintegers ! KIND-type parameter for "normal" integer variables
1357 
1358 !==============================================================================
1359 
1360 IMPLICIT NONE
1361 
1362 !==============================================================================
1363 !
1364 ! Declarations
1365 
1366 ! Input (function argument)
1367 REAL , INTENT(IN) :: &
1368  T_dry , &! Dry air temperature [K]
1369  T_wetbulb , &! Wet bulb temperature [K]
1370  satwvpres_bulb , &! Satururation vapour pressure at wet-bulb temperature [N m^{-2}]
1371  P ! Atmospheric pressure [N m^{-2}]
1372 
1373 ! Output (function result)
1374 REAL :: &
1375  sfcflx_wvpreswetbulb ! Water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
1376 REAL(KIND=JPRB) :: ZHOOK_HANDLE
1377 
1378 !==============================================================================
1379 ! Start calculations
1380 !------------------------------------------------------------------------------
1381 
1382 ! Water vapour pressure [N m^{-2} = kg m^{-1} s^{-2}]
1383 
1384 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_WVPRESWETBULB',0,zhook_handle)
1385 sfcflx_wvpreswetbulb = satwvpres_bulb &
1386  - tpsf_c_a_p*p/tpsf_l_evap/tpsf_rd_o_rv*(t_dry-t_wetbulb)
1387 IF (lhook) CALL dr_hook('SFCFLX:SFCFLX_WVPRESWETBULB',1,zhook_handle)
1388 
1389 
1390 !------------------------------------------------------------------------------
1391 ! End calculations
1392 !==============================================================================
1393 
1394 END FUNCTION sfcflx_wvpreswetbulb
1395 
1396 
1397 END MODULE mode_sfcflx
1398 
real, parameter c_z0q_rough_2
Definition: mode_sfcflx.F90:94
real, parameter c_karman
Definition: mode_sfcflx.F90:94
real, parameter c_mo_t_stab
Definition: mode_sfcflx.F90:94
real, parameter c_mo_q_exp
Definition: mode_sfcflx.F90:94
real, parameter tpsf_rd_o_rv
real, parameter z0u_ice_rough
Definition: mode_sfcflx.F90:94
real, parameter tpsf_alpha_q
real, parameter tpsf_r_watvap
real, parameter num_1o3_sf
real, parameter c_mo_u_conv
Definition: mode_sfcflx.F90:94
real, parameter c_z0u_rough
Definition: mode_sfcflx.F90:94
real, parameter c_z0u_smooth
Definition: mode_sfcflx.F90:94
real, parameter tpsf_nu_u_a
real, parameter c_z0q_ice_b0r
Definition: mode_sfcflx.F90:94
real, parameter c_z0q_rough_1
Definition: mode_sfcflx.F90:94
real, parameter c_z0u_rough_l
Definition: mode_sfcflx.F90:94
subroutine sfcflx_roughness(fetch, U_a, u_star, h_ice, c_z0u_fetch, u_star_thresh, z0u, z0t, z0q)
real function sfcflx_lwradatm(T_a, e_a, cl_tot, cl_low)
real, parameter c_z0t_rough_1
Definition: mode_sfcflx.F90:94
real, parameter sc_neutral
Definition: mode_sfcflx.F90:94
real, parameter u_star_min_sf
real, parameter c_z0u_ftch_ex
Definition: mode_sfcflx.F90:94
real, parameter pr_neutral
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_ice_b1t
Definition: mode_sfcflx.F90:94
real function sfcflx_satwvpres(T, h_ice)
real, parameter c_mo_u_stab
Definition: mode_sfcflx.F90:94
real, parameter c_z0q_ice_b0s
Definition: mode_sfcflx.F90:94
real, parameter c_z0q_rough_3
Definition: mode_sfcflx.F90:94
integer, parameter jprb
Definition: parkind1.F90:32
real, parameter tpsf_c_a_p
real, parameter c_lwrad_emis
real, parameter c_mo_t_exp
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_ice_b0r
Definition: mode_sfcflx.F90:94
real, parameter c_z0u_ftch_f
Definition: mode_sfcflx.F90:94
real, parameter c_z0q_ice_b2r
Definition: mode_sfcflx.F90:94
real, parameter re_z0u_thresh
Definition: mode_sfcflx.F90:94
real, parameter c_accur_sf
real, parameter c_free_conv
real, parameter c_z0q_ice_b1t
Definition: mode_sfcflx.F90:94
real function sfcflx_lwradwsfc(emis, pts)
real, parameter c_z0t_ice_b0t
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_rough_2
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_ice_b0s
Definition: mode_sfcflx.F90:94
real, parameter c_z0q_ice_b0t
Definition: mode_sfcflx.F90:94
real, parameter tpsf_c_stefboltz
logical lhook
Definition: yomhook.F90:15
real function sfcflx_spechum(wvpres, P)
real, parameter z0t_min_sf
real, parameter u_wind_min_sf
real, parameter c_mo_u_exp
Definition: mode_sfcflx.F90:94
real, parameter tpsf_r_dryair
real, parameter c_mo_q_stab
Definition: mode_sfcflx.F90:94
real, parameter c_mo_q_conv
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_rough_3
Definition: mode_sfcflx.F90:94
real, parameter c_mo_t_conv
Definition: mode_sfcflx.F90:94
real function sfcflx_rhoair(T, q, P)
real, parameter tpsf_kappa_t_a
real, parameter c_z0t_ice_b1r
Definition: mode_sfcflx.F90:94
real, parameter re_z0s_ice_t
Definition: mode_sfcflx.F90:94
real, parameter c_z0t_ice_b2r
Definition: mode_sfcflx.F90:94
real, parameter c_small_sf
real, parameter c_z0q_ice_b1r
Definition: mode_sfcflx.F90:94
real, parameter tpsf_l_evap
real, parameter tpsf_kappa_q_a
real function sfcflx_wvpreswetbulb(T_dry, T_wetbulb, satwvpres_bulb, P)
real, parameter, private z_
real, parameter p_a_ref
subroutine sfcflx_momsenlat(height_u, height_tq, fetch, U_a, T_a, q_a, T_s, P_a, h_ice, Q_momentum, Q_sensible, Q_latent, Q_watvap, Ri, z0u_ini, z0t_ini, Qsat_out, Q_latenti, Q_sublim)