GCC Code Coverage Report


Directory: ./
File: Ocean_skin/sens_heat_rain_m.f90
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 10 10 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 module sens_heat_rain_m
2
3 implicit none
4
5 contains
6
7 467812 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 use esat_m, only: esat
18
19 include "YOMCST.h"
20 ! for eps_w
21
22 real, intent(in):: rain ! rain mass flux, in kg m-2 s-1
23 real, intent(in):: t ! air temperature at 10 m, in K
24 real, intent(in):: q ! specific humidity at 10 m
25 real, intent(in):: rhoa ! density of moist air (kg / m3)
26 real, intent(in):: xlv ! latent heat of evaporation (J / kg)
27 real, intent(in):: t_int ! interface temperature, in K
28 real, intent(in):: p ! surface pressure, in Pa
29
30 ! Local:
31
32 real es ! saturation pressure of wator vapor, in Pa
33 real alfac ! wet bulb factor
34 real dwat ! water vapour diffusivity
35 real dtmp ! heat diffusivity
36 real q_int ! specific (saturation) humidity at ocean interface
37 real t_celsius ! air temperature at 10 m, in Celsius degrees
38
39 real wetc
40 ! derivative of saturated mass fraction of water vapor with
41 ! respect to temperature, at constant total pressure
42
43 !---------------------------------------------------------------------
44
45 467812 es = esat(t_int, p) * 0.98 ! reduced for salinity, Kraus 1972 page 46
46 467812 q_int = eps_w * (es / (p - (1. - eps_w) * es))
47 467812 wetc = eps_w * xlv * q_int / (rgas * t_int**2)
48 467812 dwat = 2.11e-5 * (t / 273.15)**1.94
49 467812 t_celsius = t - 273.15
50 dtmp = (1. + 3.309e-3 * t_celsius - 1.44e-6 * t_celsius**2) * 0.02411 &
51 467812 / (rhoa * cpa)
52
53 ! Gosnell 1995 k0991, equation (11):
54 467812 alfac = 1. / (1. + (wetc * xlv * dwat) / (cpa * dtmp))
55
56 ! Gosnell 1995 k0991, equation (12):
57 467812 sens_heat_rain = rain * alfac * cpw * (t_int - t + (q_int - q) * xlv / cpa)
58
59 467812 end function sens_heat_rain
60
61 end module sens_heat_rain_m
62