1 | ! |
---|
2 | MODULE ocean_forced_mod |
---|
3 | ! |
---|
4 | ! This module is used for both the sub-surfaces ocean and sea-ice for the case of a |
---|
5 | ! forced ocean, "ocean=force". |
---|
6 | ! |
---|
7 | IMPLICIT NONE |
---|
8 | |
---|
9 | CONTAINS |
---|
10 | ! |
---|
11 | !**************************************************************************************** |
---|
12 | ! |
---|
13 | SUBROUTINE ocean_forced_noice( & |
---|
14 | itime, dtime, jour, knon, knindex, & |
---|
15 | p1lay, cdragh, cdragm, precip_rain, precip_snow, & |
---|
16 | temp_air, spechum, & |
---|
17 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
18 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
19 | ps, u1, v1, & |
---|
20 | radsol, snow, agesno, & |
---|
21 | qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, & |
---|
22 | tsurf_new, dflux_s, dflux_l) |
---|
23 | ! |
---|
24 | ! This subroutine treats the "open ocean", all grid points that are not entierly covered |
---|
25 | ! by ice. |
---|
26 | ! The routine receives data from climatologie file limit.nc and does some calculations at the |
---|
27 | ! surface. |
---|
28 | ! |
---|
29 | USE dimphy |
---|
30 | USE calcul_fluxs_mod |
---|
31 | USE limit_read_mod |
---|
32 | USE indice_sol_mod |
---|
33 | |
---|
34 | !L. Fita, LMD. November, 2013 |
---|
35 | USE NOread_limit_sub_variables |
---|
36 | |
---|
37 | INCLUDE "YOMCST.h" |
---|
38 | |
---|
39 | ! Input arguments |
---|
40 | !**************************************************************************************** |
---|
41 | INTEGER, INTENT(IN) :: itime, jour, knon |
---|
42 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
43 | REAL, INTENT(IN) :: dtime |
---|
44 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
45 | REAL, DIMENSION(klon), INTENT(IN) :: cdragh, cdragm |
---|
46 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
47 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
48 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefH, AcoefQ, BcoefH, BcoefQ |
---|
49 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefU, AcoefV, BcoefU, BcoefV |
---|
50 | REAL, DIMENSION(klon), INTENT(IN) :: ps |
---|
51 | REAL, DIMENSION(klon), INTENT(IN) :: u1, v1 |
---|
52 | |
---|
53 | ! In/Output arguments |
---|
54 | !**************************************************************************************** |
---|
55 | REAL, DIMENSION(klon), INTENT(INOUT) :: radsol |
---|
56 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow |
---|
57 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno !? put to 0 in ocean |
---|
58 | |
---|
59 | ! Output arguments |
---|
60 | !**************************************************************************************** |
---|
61 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
62 | REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat |
---|
63 | REAL, DIMENSION(klon), INTENT(OUT) :: flux_u1, flux_v1 |
---|
64 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new |
---|
65 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
66 | |
---|
67 | ! Local variables |
---|
68 | !**************************************************************************************** |
---|
69 | INTEGER :: i |
---|
70 | REAL, DIMENSION(klon) :: cal, beta, dif_grnd |
---|
71 | REAL, DIMENSION(klon) :: alb_neig, tsurf_lim, zx_sl |
---|
72 | REAL, DIMENSION(klon) :: u0, v0 |
---|
73 | REAL, DIMENSION(klon) :: u1_lay, v1_lay |
---|
74 | LOGICAL :: check=.FALSE. |
---|
75 | ! Lluis |
---|
76 | INTEGER :: lp, lpt |
---|
77 | |
---|
78 | lp = 885 |
---|
79 | lpt = 765 |
---|
80 | |
---|
81 | !**************************************************************************************** |
---|
82 | ! Start calculation |
---|
83 | !**************************************************************************************** |
---|
84 | IF (check) WRITE(*,*)' Entering ocean_forced_noice' |
---|
85 | |
---|
86 | !**************************************************************************************** |
---|
87 | ! 1) |
---|
88 | ! Read sea-surface temperature from file limit.nc |
---|
89 | ! |
---|
90 | !**************************************************************************************** |
---|
91 | ! L. Fita, LMD. November 2013 |
---|
92 | ! Not needed! Using wrfinput, wrfbdy and wrflowinput instead |
---|
93 | ! ALLOCATE(tsurf_lim(klon)) |
---|
94 | ! CALL limit_read_sst(knon,knindex,tsurf_lim) |
---|
95 | ! tsurf_lim = sst(knindex(1:knon)) |
---|
96 | ! tsurf_lim = 283.15 |
---|
97 | |
---|
98 | DO i=1,knon |
---|
99 | tsurf_lim(i) = tsurf_limit(knindex(i)) |
---|
100 | END DO |
---|
101 | |
---|
102 | !**************************************************************************************** |
---|
103 | ! 2) |
---|
104 | ! Flux calculation |
---|
105 | ! |
---|
106 | !**************************************************************************************** |
---|
107 | ! Set some variables for calcul_fluxs |
---|
108 | cal = 0. |
---|
109 | beta = 1. |
---|
110 | dif_grnd = 0. |
---|
111 | alb_neig(:) = 0. |
---|
112 | agesno(:) = 0. |
---|
113 | ! Suppose zero surface speed |
---|
114 | u0(:)=0.0 |
---|
115 | v0(:)=0.0 |
---|
116 | u1_lay(:) = u1(:) - u0(:) |
---|
117 | v1_lay(:) = v1(:) - v0(:) |
---|
118 | |
---|
119 | ! Calcul de tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l and qsurf |
---|
120 | CALL calcul_fluxs(knon, is_oce, dtime, & |
---|
121 | tsurf_lim, p1lay, cal, beta, cdragh, ps, & |
---|
122 | precip_rain, precip_snow, snow, qsurf, & |
---|
123 | radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
---|
124 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
125 | tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
---|
126 | |
---|
127 | ! - Flux calculation at first modele level for U and V |
---|
128 | CALL calcul_flux_wind(knon, dtime, & |
---|
129 | u0, v0, u1, v1, cdragm, & |
---|
130 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
131 | p1lay, temp_air, & |
---|
132 | flux_u1, flux_v1) |
---|
133 | |
---|
134 | END SUBROUTINE ocean_forced_noice |
---|
135 | ! |
---|
136 | !*************************************************************************************** |
---|
137 | ! |
---|
138 | SUBROUTINE ocean_forced_ice( & |
---|
139 | itime, dtime, jour, knon, knindex, & |
---|
140 | tsurf_in, p1lay, cdragh, cdragm, precip_rain, precip_snow, temp_air, spechum, & |
---|
141 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
142 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
143 | ps, u1, v1, & |
---|
144 | radsol, snow, qsol, agesno, tsoil, & |
---|
145 | qsurf, alb1_new, alb2_new, evap, fluxsens, fluxlat, flux_u1, flux_v1, & |
---|
146 | tsurf_new, dflux_s, dflux_l) |
---|
147 | ! |
---|
148 | ! This subroutine treats the ocean where there is ice. |
---|
149 | ! The routine reads data from climatologie file and does flux calculations at the |
---|
150 | ! surface. |
---|
151 | ! |
---|
152 | USE dimphy |
---|
153 | USE calcul_fluxs_mod |
---|
154 | USE surface_data, ONLY : calice, calsno, tau_gl |
---|
155 | USE limit_read_mod |
---|
156 | USE fonte_neige_mod, ONLY : fonte_neige |
---|
157 | USE indice_sol_mod |
---|
158 | |
---|
159 | INCLUDE "dimsoil.h" |
---|
160 | INCLUDE "YOMCST.h" |
---|
161 | INCLUDE "clesphys.h" |
---|
162 | |
---|
163 | ! Input arguments |
---|
164 | !**************************************************************************************** |
---|
165 | INTEGER, INTENT(IN) :: itime, jour, knon |
---|
166 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
167 | REAL, INTENT(IN) :: dtime |
---|
168 | REAL, DIMENSION(klon), INTENT(IN) :: tsurf_in |
---|
169 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
170 | REAL, DIMENSION(klon), INTENT(IN) :: cdragh, cdragm |
---|
171 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
172 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
173 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefH, AcoefQ, BcoefH, BcoefQ |
---|
174 | REAL, DIMENSION(klon), INTENT(IN) :: AcoefU, AcoefV, BcoefU, BcoefV |
---|
175 | REAL, DIMENSION(klon), INTENT(IN) :: ps |
---|
176 | REAL, DIMENSION(klon), INTENT(IN) :: u1, v1 |
---|
177 | |
---|
178 | ! In/Output arguments |
---|
179 | !**************************************************************************************** |
---|
180 | REAL, DIMENSION(klon), INTENT(INOUT) :: radsol |
---|
181 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow, qsol |
---|
182 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno |
---|
183 | REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil |
---|
184 | |
---|
185 | ! Output arguments |
---|
186 | !**************************************************************************************** |
---|
187 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
188 | REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new ! new albedo in visible SW interval |
---|
189 | REAL, DIMENSION(klon), INTENT(OUT) :: alb2_new ! new albedo in near IR interval |
---|
190 | REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat |
---|
191 | REAL, DIMENSION(klon), INTENT(OUT) :: flux_u1, flux_v1 |
---|
192 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new |
---|
193 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
194 | |
---|
195 | ! Local variables |
---|
196 | !**************************************************************************************** |
---|
197 | LOGICAL :: check=.FALSE. |
---|
198 | INTEGER :: i |
---|
199 | REAL :: zfra |
---|
200 | REAL, PARAMETER :: t_grnd=271.35 |
---|
201 | REAL, DIMENSION(klon) :: cal, beta, dif_grnd, capsol |
---|
202 | REAL, DIMENSION(klon) :: alb_neig, tsurf_tmp |
---|
203 | REAL, DIMENSION(klon) :: soilcap, soilflux |
---|
204 | REAL, DIMENSION(klon) :: u0, v0 |
---|
205 | REAL, DIMENSION(klon) :: u1_lay, v1_lay |
---|
206 | |
---|
207 | !**************************************************************************************** |
---|
208 | ! Start calculation |
---|
209 | !**************************************************************************************** |
---|
210 | IF (check) WRITE(*,*)'Entering surface_seaice, knon=',knon |
---|
211 | |
---|
212 | !**************************************************************************************** |
---|
213 | ! 1) |
---|
214 | ! Flux calculation : tsurf_new, evap, fluxlat, fluxsens, flux_u1, flux_v1 |
---|
215 | ! dflux_s, dflux_l and qsurf |
---|
216 | !**************************************************************************************** |
---|
217 | tsurf_tmp(:) = tsurf_in(:) |
---|
218 | |
---|
219 | ! calculate the parameters cal, beta, capsol and dif_grnd |
---|
220 | CALL calbeta(dtime, is_sic, knon, snow, qsol, beta, capsol, dif_grnd) |
---|
221 | |
---|
222 | |
---|
223 | IF (soil_model) THEN |
---|
224 | ! update tsoil and calculate soilcap and soilflux |
---|
225 | CALL soil(dtime, is_sic, knon, snow, tsurf_tmp, tsoil,soilcap, soilflux) |
---|
226 | cal(1:knon) = RCPD / soilcap(1:knon) |
---|
227 | radsol(1:knon) = radsol(1:knon) + soilflux(1:knon) |
---|
228 | dif_grnd = 1.0 / tau_gl |
---|
229 | ELSE |
---|
230 | dif_grnd = 1.0 / tau_gl |
---|
231 | cal = RCPD * calice |
---|
232 | WHERE (snow > 0.0) cal = RCPD * calsno |
---|
233 | ENDIF |
---|
234 | |
---|
235 | beta = 1.0 |
---|
236 | ! Suppose zero surface speed |
---|
237 | u0(:)=0.0 |
---|
238 | v0(:)=0.0 |
---|
239 | u1_lay(:) = u1(:) - u0(:) |
---|
240 | v1_lay(:) = v1(:) - v0(:) |
---|
241 | CALL calcul_fluxs(knon, is_sic, dtime, & |
---|
242 | tsurf_tmp, p1lay, cal, beta, cdragh, ps, & |
---|
243 | precip_rain, precip_snow, snow, qsurf, & |
---|
244 | radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, & |
---|
245 | AcoefH, AcoefQ, BcoefH, BcoefQ, & |
---|
246 | tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
---|
247 | |
---|
248 | ! - Flux calculation at first modele level for U and V |
---|
249 | CALL calcul_flux_wind(knon, dtime, & |
---|
250 | u0, v0, u1, v1, cdragm, & |
---|
251 | AcoefU, AcoefV, BcoefU, BcoefV, & |
---|
252 | p1lay, temp_air, & |
---|
253 | flux_u1, flux_v1) |
---|
254 | |
---|
255 | !**************************************************************************************** |
---|
256 | ! 2) |
---|
257 | ! Calculations due to snow and runoff |
---|
258 | ! |
---|
259 | !**************************************************************************************** |
---|
260 | CALL fonte_neige( knon, is_sic, knindex, dtime, & |
---|
261 | tsurf_tmp, precip_rain, precip_snow, & |
---|
262 | snow, qsol, tsurf_new, evap) |
---|
263 | |
---|
264 | ! Calculation of albedo at snow (alb_neig) and update the age of snow (agesno) |
---|
265 | ! |
---|
266 | CALL albsno(klon, knon, dtime, agesno(:), alb_neig(:), precip_snow(:)) |
---|
267 | |
---|
268 | WHERE (snow(1:knon) .LT. 0.0001) agesno(1:knon) = 0. |
---|
269 | |
---|
270 | alb1_new(:) = 0.0 |
---|
271 | DO i=1, knon |
---|
272 | zfra = MAX(0.0,MIN(1.0,snow(i)/(snow(i)+10.0))) |
---|
273 | alb1_new(i) = alb_neig(i) * zfra + 0.6 * (1.0-zfra) |
---|
274 | ENDDO |
---|
275 | |
---|
276 | alb2_new(:) = alb1_new(:) |
---|
277 | |
---|
278 | END SUBROUTINE ocean_forced_ice |
---|
279 | ! |
---|
280 | !**************************************************************************************** |
---|
281 | ! |
---|
282 | END MODULE ocean_forced_mod |
---|
283 | |
---|
284 | |
---|
285 | |
---|
286 | |
---|
287 | |
---|
288 | |
---|