source: LMDZ6/trunk/libf/phylmd/Ocean_skin/sens_heat_rain_m.F90 @ 5440

Last change on this file since 5440 was 5274, checked in by abarral, 2 months ago

Replace yomcst.h by existing module

File size: 2.1 KB
Line 
1module sens_heat_rain_m
2
3  implicit none
4
5contains
6
7#ifdef IN_LMDZ
8  real function sens_heat_rain(rain, t, q, rhoa, xlv, t_int, p)
9#else
10  elemental real function sens_heat_rain(rain, t, q, rhoa, xlv, t_int, p)
11#endif
12
13    ! Computes heat flux due to rainfall, in W m-2, positive
14    ! upward.
15
16    ! If in LMDZ, do not declare this function as elemental because
17    ! YOMCST.h contains an OpenMP directive, and that only works in
18    ! OpenMP 5.0.
19
20    use const, only: cpa, cpw, rgas
21#ifndef IN_LMDZ
22    use const, only: eps_w
23#endif
24    use esat_m, only: esat
25
26#ifdef IN_LMDZ
27     USE yomcst_mod_h, ONLY: eps_w
28#endif
29
30    real, intent(in):: rain ! rain mass flux, in kg m-2 s-1
31    real, intent(in):: t ! air temperature at 10 m, in K
32    real, intent(in):: q ! specific humidity at 10 m
33    real, intent(in):: rhoa ! density of moist air  (kg / m3)
34    real, intent(in):: xlv ! latent heat of evaporation (J / kg)
35    real, intent(in):: t_int ! interface temperature, in K
36    real, intent(in):: p ! surface pressure, in Pa
37
38    ! Local:
39   
40    real es ! saturation pressure of wator vapor, in Pa
41    real alfac ! wet bulb factor
42    real dwat ! water vapour diffusivity
43    real dtmp ! heat diffusivity
44    real q_int ! specific (saturation) humidity at ocean interface
45    real t_celsius ! air temperature at 10 m, in Celsius degrees
46
47    real wetc
48    ! derivative of saturated mass fraction of water vapor with
49    ! respect to temperature, at constant total pressure
50
51    !---------------------------------------------------------------------
52
53    es = esat(t_int, p) * 0.98 ! reduced for salinity, Kraus 1972 page 46
54    q_int = eps_w * (es / (p - (1. - eps_w) * es))
55    wetc = eps_w * xlv * q_int / (rgas * t_int**2)
56    dwat = 2.11e-5 * (t / 273.15)**1.94
57    t_celsius = t - 273.15
58    dtmp = (1. + 3.309e-3 * t_celsius - 1.44e-6 * t_celsius**2) * 0.02411 &
59         / (rhoa * cpa)
60
61    ! Gosnell 1995 k0991, equation (11):
62    alfac =  1. / (1. + (wetc * xlv * dwat) / (cpa * dtmp))
63
64    ! Gosnell 1995 k0991, equation (12):
65    sens_heat_rain =  rain * alfac * cpw * (t_int - t + (q_int - q) * xlv / cpa)
66
67  end function sens_heat_rain
68 
69end module sens_heat_rain_m
Note: See TracBrowser for help on using the repository browser.