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

Last change on this file since 3834 was 3834, checked in by Laurent Fairhead, 3 years ago

Renaming module files so that makelmdz and create_make_gcm finds them

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