1 | module Near_Surface_m |
---|
2 | |
---|
3 | Implicit none |
---|
4 | |
---|
5 | REAL, parameter:: depth = 3. |
---|
6 | ! diurnal warm layer and fresh water lens depth, in m (Zeng and Beljaars 2005) |
---|
7 | |
---|
8 | CONTAINS |
---|
9 | |
---|
10 | SUBROUTINE near_surface(al, t_subskin, s_subskin, ds_ns, dt_ns, tau, taur, & |
---|
11 | hlb, rhoa, xlv, dtime, t_ocean_1, s1, rain, q_pwp) |
---|
12 | |
---|
13 | ! Hugo Bellenger, 2016 |
---|
14 | |
---|
15 | USE config_ocean_skin_m, ONLY: depth_1 |
---|
16 | USE const, ONLY: beta, cpw, grav, rhow, von |
---|
17 | USE Phiw_m, ONLY: Phiw |
---|
18 | USE therm_expans_m, ONLY: therm_expans |
---|
19 | |
---|
20 | REAL, INTENT(OUT):: al(:) ! water thermal expansion coefficient (in K-1) |
---|
21 | REAL, INTENT(OUT):: t_subskin(:) ! subskin temperature, in K |
---|
22 | REAL, INTENT(OUT):: s_subskin(:) ! subskin salinity, in ppt |
---|
23 | |
---|
24 | REAL, INTENT(INOUT):: ds_ns(:) |
---|
25 | ! "delta salinity near surface". Salinity variation in the |
---|
26 | ! near-surface turbulent layer. That is subskin salinity minus |
---|
27 | ! foundation salinity. In ppt. |
---|
28 | |
---|
29 | REAL, INTENT(INOUT):: dt_ns(:) |
---|
30 | ! "delta temperature near surface". Temperature variation in the |
---|
31 | ! near-surface turbulent layer. That is subskin temperature minus |
---|
32 | ! foundation temperature. (Can be negative.) In K. |
---|
33 | |
---|
34 | REAL, INTENT(IN):: tau(:) |
---|
35 | ! wind stress at the surface, turbulent part only, in Pa |
---|
36 | |
---|
37 | REAL, INTENT(IN):: taur(:) ! momentum flux due to rainfall, in Pa |
---|
38 | REAL, INTENT(IN):: hlb(:) ! latent heat flux, turbulent part only, in W / m2 |
---|
39 | REAL, INTENT(IN):: rhoa(:) ! density of moist air (kg / m3) |
---|
40 | REAL, INTENT(IN):: xlv(:) ! latent heat of evaporation (J/kg) |
---|
41 | REAL, INTENT(IN):: dtime ! time step (s) |
---|
42 | REAL, INTENT(IN):: t_ocean_1(:) ! input sea temperature, at depth_1, in K |
---|
43 | REAL, INTENT(IN):: S1(:) ! salinity at depth_1, in ppt |
---|
44 | REAL, INTENT(IN):: rain(:) ! rain mass flux, in kg m-2 s-1 |
---|
45 | |
---|
46 | REAL, INTENT(IN):: q_pwp(:) |
---|
47 | ! net flux absorbed by the warm layer (part of the solar flux |
---|
48 | ! absorbed at "depth"), minus surface fluxes, in W m-2 |
---|
49 | |
---|
50 | ! Local: |
---|
51 | |
---|
52 | REAL, parameter:: khor = 1. / 1.5e4 |
---|
53 | ! Parameter for the lens spread, in m-1. Inverse of the size of |
---|
54 | ! the lens. |
---|
55 | |
---|
56 | REAL, parameter:: umax = 15. |
---|
57 | REAL, parameter:: fact = 1. |
---|
58 | REAL buoyf(size(t_ocean_1)) ! buoyancy flux |
---|
59 | REAL usrc(size(t_ocean_1)) |
---|
60 | REAL drho(size(t_ocean_1)) ! rho(- delta) - rho(- d) |
---|
61 | REAL Lmo(size(t_ocean_1)) ! Monin-Obukhov length |
---|
62 | |
---|
63 | REAL u(size(t_ocean_1)) |
---|
64 | ! Wind speed at 15 m relative to the sea surface, i. e. taking |
---|
65 | ! current vector into account. In m s-1. |
---|
66 | |
---|
67 | REAL, DIMENSION(size(t_ocean_1)):: At, Bt, As, Bs, correction |
---|
68 | |
---|
69 | REAL eta(size(t_ocean_1)) |
---|
70 | ! exponent in the function giving T(z) and S(z), equation (11) in |
---|
71 | ! Bellenger et al. 2017 JGR |
---|
72 | |
---|
73 | REAL t_fnd(size(t_ocean_1)) ! foundation temperature, in K |
---|
74 | REAL s_fnd(size(t_ocean_1)) ! foundation salinity, in ppt |
---|
75 | |
---|
76 | !---------------------------------------------------------------------- |
---|
77 | |
---|
78 | ! Temperature and salinity profiles change with wind: |
---|
79 | |
---|
80 | u = 28. * sqrt(tau / rhoa) |
---|
81 | |
---|
82 | where (dt_ns < 0.) |
---|
83 | where (u >= umax) |
---|
84 | eta = 1. / fact |
---|
85 | elsewhere (u <= 2.) |
---|
86 | eta = 2. / (fact * umax) |
---|
87 | elsewhere |
---|
88 | ! {u > 2. .AND. u < umax} |
---|
89 | eta = u / (fact * umax) |
---|
90 | end where |
---|
91 | elsewhere |
---|
92 | eta = 0.3 |
---|
93 | end where |
---|
94 | |
---|
95 | IF (depth_1 < depth) THEN |
---|
96 | correction = 1. - (depth_1 / depth)**eta |
---|
97 | ! (neglecting microlayer thickness compared to depth_1 and depth) |
---|
98 | |
---|
99 | t_fnd = t_ocean_1 - dt_ns * correction |
---|
100 | s_fnd = s1 - ds_ns * correction |
---|
101 | else |
---|
102 | t_fnd = t_ocean_1 |
---|
103 | s_fnd = s1 |
---|
104 | end if |
---|
105 | |
---|
106 | al = therm_expans(t_fnd) |
---|
107 | |
---|
108 | ! Bellenger 2017 k0976, equation (13): |
---|
109 | buoyf = Al * grav / (rhow * cpw) * q_pwp & |
---|
110 | - beta * S_FND * grav * (hlb / xlv - rain) / rhow |
---|
111 | |
---|
112 | usrc = sqrt((tau + taur) / rhow) |
---|
113 | drho = rhow * (- al * dt_ns + beta * ds_ns) |
---|
114 | |
---|
115 | ! Case of stable stratification and negative flux, Bellenger 2017 |
---|
116 | ! k0976, equation (15): |
---|
117 | where (buoyf < 0. .AND. drho < 0.) |
---|
118 | buoyf = sqrt(- eta * grav / (5. * depth * rhow) * drho) * usrc**2 |
---|
119 | elsewhere (buoyf == 0.) |
---|
120 | buoyf = tiny(0.) |
---|
121 | end where |
---|
122 | |
---|
123 | |
---|
124 | Lmo = usrc**3 / (von * buoyf) |
---|
125 | |
---|
126 | ! Equation (14) for temperature. Implicit scheme for time integration: |
---|
127 | ! \Delta T_{i + 1} - \Delta T_i = \delta t (Bt + At \Delta T_{i + 1}) |
---|
128 | At = - (eta + 1.) * von * usrc / (depth * Phiw(depth / Lmo)) |
---|
129 | |
---|
130 | ! Lens horizontal spreading: |
---|
131 | where (drho < 0. .AND. ds_ns < 0.) At = At & |
---|
132 | - (eta + 1.) * khor * sqrt(depth * grav * abs(drho) / rhow) |
---|
133 | |
---|
134 | Bt = q_pwp / (depth * rhow * cpw * eta / (eta + 1.)) |
---|
135 | dt_ns = (dtime * Bt + dt_ns) / (1 - dtime * At) |
---|
136 | |
---|
137 | ! Equation (14) for salinity: |
---|
138 | ! \frac{\partial \Delta S}{\partial t} |
---|
139 | ! = (\Delta S + S_\mathrm{fnd}) B_S + A_S \Delta S |
---|
140 | As = - (eta + 1.) * von * usrc / (depth * Phiw(depth / Lmo)) |
---|
141 | |
---|
142 | ! Lens horizontal spreading: |
---|
143 | where (drho < 0. .AND. ds_ns < 0.) As = As & |
---|
144 | - (eta + 1.) * khor * sqrt(depth * grav * abs(drho) / rhow) |
---|
145 | |
---|
146 | Bs = (hlb / xlv - rain) * (eta + 1.) / (depth * rhow * eta) |
---|
147 | |
---|
148 | ! Implicit scheme for time integration: |
---|
149 | ds_ns = (dtime * Bs * S_fnd + ds_ns) / (1 - dtime * (As + bs)) |
---|
150 | |
---|
151 | t_subskin = t_fnd + dt_ns |
---|
152 | s_subskin = s_fnd + ds_ns |
---|
153 | |
---|
154 | END SUBROUTINE Near_Surface |
---|
155 | |
---|
156 | END MODULE Near_Surface_m |
---|