1 | |
---|
2 | MODULE surf_land_bucket_mod |
---|
3 | |
---|
4 | ! Surface land bucket module |
---|
5 | |
---|
6 | ! This module is used when no external land model is choosen. |
---|
7 | |
---|
8 | IMPLICIT NONE |
---|
9 | |
---|
10 | CONTAINS |
---|
11 | |
---|
12 | SUBROUTINE surf_land_bucket(itime, jour, knon, knindex, debut, dtime,& |
---|
13 | tsurf, p1lay, tq_cdrag, precip_rain, precip_snow, temp_air, & |
---|
14 | spechum, petAcoef, peqAcoef, petBcoef, peqBcoef, pref, & |
---|
15 | u1, v1, gustiness, rugoro, swnet, lwnet, & |
---|
16 | snow, qsol, agesno, tsoil, & |
---|
17 | qsurf, z0_new, alb1_new, alb2_new, evap, & |
---|
18 | fluxsens, fluxlat, tsurf_new, dflux_s, dflux_l & |
---|
19 | #ifdef ISO |
---|
20 | ,xtprecip_rain, xtprecip_snow,xtspechum, & |
---|
21 | xtsnow, xtsol,xtevap,h1, & |
---|
22 | runoff_diag,xtrunoff_diag,Rland_ice & |
---|
23 | #endif |
---|
24 | ) |
---|
25 | |
---|
26 | USE limit_read_mod |
---|
27 | USE surface_data |
---|
28 | USE fonte_neige_mod |
---|
29 | USE calcul_fluxs_mod |
---|
30 | USE cpl_mod |
---|
31 | USE dimphy |
---|
32 | USE lmdz_geometry, ONLY: longitude,latitude |
---|
33 | USE lmdz_grid_phy |
---|
34 | USE lmdz_phys_para |
---|
35 | USE indice_sol_mod |
---|
36 | #ifdef ISO |
---|
37 | use infotrac_phy, ONLY: ntiso,niso |
---|
38 | USE isotopes_mod, ONLY: iso_eau, iso_HDO, iso_O18, iso_O17, & |
---|
39 | ridicule_qsol |
---|
40 | USE isotopes_routines_mod, ONLY: calcul_iso_surf_ter_vectall |
---|
41 | #ifdef ISOVERIF |
---|
42 | USE isotopes_verif_mod, ONLY: errmax,errmaxrel,iso_verif_noNaN, & |
---|
43 | iso_verif_aberrant_o17,iso_verif_egalite_choix,iso_verif_egalite |
---|
44 | #endif |
---|
45 | #endif |
---|
46 | !**************************************************************************************** |
---|
47 | ! Bucket calculations for surface. |
---|
48 | |
---|
49 | INCLUDE "clesphys.h" |
---|
50 | INCLUDE "dimsoil.h" |
---|
51 | INCLUDE "YOMCST.h" |
---|
52 | |
---|
53 | ! Input variables |
---|
54 | !**************************************************************************************** |
---|
55 | INTEGER, INTENT(IN) :: itime, jour, knon |
---|
56 | INTEGER, DIMENSION(klon), INTENT(IN) :: knindex |
---|
57 | LOGICAL, INTENT(IN) :: debut |
---|
58 | REAL, INTENT(IN) :: dtime |
---|
59 | REAL, DIMENSION(klon), INTENT(IN) :: tsurf |
---|
60 | REAL, DIMENSION(klon), INTENT(IN) :: p1lay |
---|
61 | REAL, DIMENSION(klon), INTENT(IN) :: tq_cdrag |
---|
62 | REAL, DIMENSION(klon), INTENT(IN) :: precip_rain, precip_snow |
---|
63 | REAL, DIMENSION(klon), INTENT(IN) :: temp_air, spechum |
---|
64 | REAL, DIMENSION(klon), INTENT(IN) :: petAcoef, peqAcoef |
---|
65 | REAL, DIMENSION(klon), INTENT(IN) :: petBcoef, peqBcoef |
---|
66 | REAL, DIMENSION(klon), INTENT(IN) :: pref |
---|
67 | REAL, DIMENSION(klon), INTENT(IN) :: u1, v1, gustiness |
---|
68 | REAL, DIMENSION(klon), INTENT(IN) :: rugoro |
---|
69 | REAL, DIMENSION(klon), INTENT(IN) :: swnet, lwnet |
---|
70 | #ifdef ISO |
---|
71 | REAL, DIMENSION(ntiso,klon), INTENT(IN) :: xtprecip_rain, xtprecip_snow |
---|
72 | REAL, DIMENSION(ntiso,klon), INTENT(IN) :: xtspechum |
---|
73 | #endif |
---|
74 | |
---|
75 | ! In/Output variables |
---|
76 | !**************************************************************************************** |
---|
77 | REAL, DIMENSION(klon), INTENT(INOUT) :: snow, qsol |
---|
78 | REAL, DIMENSION(klon), INTENT(INOUT) :: agesno |
---|
79 | REAL, DIMENSION(klon, nsoilmx), INTENT(INOUT) :: tsoil |
---|
80 | #ifdef ISO |
---|
81 | REAL, DIMENSION(niso,klon), INTENT(INOUT) :: xtsnow,xtsol |
---|
82 | #endif |
---|
83 | |
---|
84 | ! Output variables |
---|
85 | !**************************************************************************************** |
---|
86 | REAL, DIMENSION(klon), INTENT(OUT) :: qsurf |
---|
87 | REAL, DIMENSION(klon), INTENT(OUT) :: z0_new |
---|
88 | REAL, DIMENSION(klon), INTENT(OUT) :: alb1_new, alb2_new |
---|
89 | REAL, DIMENSION(klon), INTENT(OUT) :: evap, fluxsens, fluxlat |
---|
90 | REAL, DIMENSION(klon), INTENT(OUT) :: tsurf_new |
---|
91 | REAL, DIMENSION(klon), INTENT(OUT) :: dflux_s, dflux_l |
---|
92 | #ifdef ISO |
---|
93 | REAL, DIMENSION(ntiso,klon), INTENT(OUT) :: xtevap |
---|
94 | REAL, DIMENSION(klon), INTENT(OUT) :: h1 |
---|
95 | REAL, DIMENSION(niso,klon), INTENT(OUT) :: xtrunoff_diag |
---|
96 | REAL, DIMENSION(klon), INTENT(OUT) :: runoff_diag |
---|
97 | REAL, DIMENSION(niso,klon), INTENT(IN) :: Rland_ice |
---|
98 | #endif |
---|
99 | |
---|
100 | ! Local variables |
---|
101 | !**************************************************************************************** |
---|
102 | REAL, DIMENSION(klon) :: soilcap, soilflux |
---|
103 | REAL, DIMENSION(klon) :: cal, beta, dif_grnd, capsol |
---|
104 | REAL, DIMENSION(klon) :: alb_neig, alb_lim |
---|
105 | REAL, DIMENSION(klon) :: zfra |
---|
106 | REAL, DIMENSION(klon) :: radsol ! total net radiance at surface |
---|
107 | REAL, DIMENSION(klon) :: u0, v0, u1_lay, v1_lay |
---|
108 | REAL, DIMENSION(klon) :: dummy_riverflow,dummy_coastalflow |
---|
109 | INTEGER :: i |
---|
110 | #ifdef ISO |
---|
111 | INTEGER :: ixt |
---|
112 | REAL, DIMENSION(niso,klon) :: xtsnow_prec,xtsol_prec |
---|
113 | REAL, DIMENSION(klon) :: snow_prec,qsol_prec |
---|
114 | REAL, PARAMETER :: t_coup = 273.15 |
---|
115 | REAL, DIMENSION(klon) :: fq_fonte_diag |
---|
116 | REAL, DIMENSION(klon) :: fqfonte_diag |
---|
117 | REAL, DIMENSION(klon) :: snow_evap_diag |
---|
118 | REAL, DIMENSION(klon) :: fqcalving_diag |
---|
119 | REAL :: max_eau_sol_diag |
---|
120 | REAL, DIMENSION(klon) :: run_off_lic_diag |
---|
121 | REAL :: coeff_rel_diag |
---|
122 | #endif |
---|
123 | |
---|
124 | !**************************************************************************************** |
---|
125 | |
---|
126 | #ifdef ISO |
---|
127 | #ifdef ISOVERIF |
---|
128 | !write(*,*) 'surf_land_bucket 152' |
---|
129 | DO i=1,knon |
---|
130 | IF (iso_eau > 0) THEN |
---|
131 | CALL iso_verif_egalite_choix(precip_snow(i), & |
---|
132 | xtprecip_snow(iso_eau,i),'surf_land_bucket 131', & |
---|
133 | errmax,errmaxrel) |
---|
134 | CALL iso_verif_egalite_choix(qsol(i), & |
---|
135 | xtsol(iso_eau,i),'surf_land_bucket 134', & |
---|
136 | errmax,errmaxrel) |
---|
137 | ENDIF |
---|
138 | ENDDO |
---|
139 | #endif |
---|
140 | #ifdef ISOVERIF |
---|
141 | DO i=1,knon |
---|
142 | DO ixt=1,niso |
---|
143 | CALL iso_verif_noNaN(xtsol(ixt,i),'surf_land_mod_bucket 142') |
---|
144 | ENDDO !do ixt=1,niso |
---|
145 | ENDDO !do i=1,knon |
---|
146 | !write(*,*) 'surf_land_bucket 152' |
---|
147 | #endif |
---|
148 | #endif |
---|
149 | |
---|
150 | !* Read from limit.nc : albedo(alb_lim), length of rugosity(z0_new) |
---|
151 | |
---|
152 | CALL limit_read_rug_alb(itime, dtime, jour,& |
---|
153 | knon, knindex, & |
---|
154 | z0_new, alb_lim) |
---|
155 | |
---|
156 | !* Calcultaion of fluxes |
---|
157 | |
---|
158 | ! calculate total absorbed radiance at surface |
---|
159 | radsol(:) = 0.0 |
---|
160 | radsol(1:knon) = swnet(1:knon) + lwnet(1:knon) |
---|
161 | |
---|
162 | ! calculate constants |
---|
163 | CALL calbeta(dtime, is_ter, knon, snow, qsol, beta, capsol, dif_grnd) |
---|
164 | if (type_veget=='betaclim') then |
---|
165 | CALL calbeta_clim(knon,jour,latitude(knindex(1:knon)),beta) |
---|
166 | endif |
---|
167 | |
---|
168 | ! calculate temperature, heat capacity and conduction flux in soil |
---|
169 | IF (soil_model) THEN |
---|
170 | CALL soil(dtime, is_ter, knon, snow, tsurf, qsol, & |
---|
171 | longitude(knindex(1:knon)), latitude(knindex(1:knon)), tsoil, soilcap, soilflux) |
---|
172 | |
---|
173 | DO i=1, knon |
---|
174 | cal(i) = RCPD / soilcap(i) |
---|
175 | radsol(i) = radsol(i) + soilflux(i) |
---|
176 | END DO |
---|
177 | ELSE |
---|
178 | cal(:) = RCPD * capsol(:) |
---|
179 | IF (klon_glo == 1) THEN |
---|
180 | cal(:) = 0. |
---|
181 | ENDIF |
---|
182 | ENDIF |
---|
183 | |
---|
184 | ! Suppose zero surface speed |
---|
185 | u0(:)=0.0 |
---|
186 | v0(:)=0.0 |
---|
187 | u1_lay(:) = u1(:) - u0(:) |
---|
188 | v1_lay(:) = v1(:) - v0(:) |
---|
189 | |
---|
190 | CALL calcul_fluxs(knon, is_ter, dtime, & |
---|
191 | tsurf, p1lay, cal, beta, tq_cdrag, tq_cdrag, pref, & |
---|
192 | precip_rain, precip_snow, snow, qsurf, & |
---|
193 | radsol, dif_grnd, temp_air, spechum, u1_lay, v1_lay, gustiness, & |
---|
194 | 1.,petAcoef, peqAcoef, petBcoef, peqBcoef, & |
---|
195 | tsurf_new, evap, fluxlat, fluxsens, dflux_s, dflux_l) |
---|
196 | |
---|
197 | #ifdef ISO |
---|
198 | ! verif |
---|
199 | #ifdef ISOVERIF |
---|
200 | !write(*,*) 'surf_land_bucket 211' |
---|
201 | DO i=1,knon |
---|
202 | IF (iso_eau > 0) THEN |
---|
203 | CALL iso_verif_egalite_choix(xtsnow(iso_eau,i), & |
---|
204 | snow(i),'surf_land_bucket 522', & |
---|
205 | errmax,errmaxrel) |
---|
206 | ENDIF !IF (iso_eau > 0) then |
---|
207 | ENDDO !DO i=1,knon |
---|
208 | #endif |
---|
209 | ! end verif |
---|
210 | #endif |
---|
211 | #ifdef ISO |
---|
212 | DO i=1,knon |
---|
213 | snow_prec(i)=snow(i) |
---|
214 | qsol_prec(i)=qsol(i) |
---|
215 | DO ixt=1,niso |
---|
216 | xtsnow_prec(ixt,i)=xtsnow(ixt,i) |
---|
217 | xtsol_prec(ixt,i) =xtsol(ixt,i) |
---|
218 | ENDDO !DO ixt=1,niso |
---|
219 | ! initialisation: |
---|
220 | fqfonte_diag(i) =0.0 |
---|
221 | fq_fonte_diag(i) =0.0 |
---|
222 | snow_evap_diag(i)=0.0 |
---|
223 | ENDDO !DO i=1,knon |
---|
224 | #ifdef ISOVERIF |
---|
225 | ! write(*,*) 'surf_land_bucket 235' |
---|
226 | DO i=1,knon |
---|
227 | IF (iso_eau > 0) THEN |
---|
228 | CALL iso_verif_egalite(qsol_prec(i),xtsol_prec(iso_eau,i), & |
---|
229 | 'surf_land_bucket 141') |
---|
230 | ENDIF |
---|
231 | ENDDO !DO i=1,knon |
---|
232 | #endif |
---|
233 | #endif |
---|
234 | |
---|
235 | !* Calculate snow height, run_off, age of snow |
---|
236 | |
---|
237 | CALL fonte_neige( knon, is_ter, knindex, dtime, & |
---|
238 | tsurf, precip_rain, precip_snow, & |
---|
239 | snow, qsol, tsurf_new, evap & |
---|
240 | #ifdef ISO |
---|
241 | ,fq_fonte_diag,fqfonte_diag,snow_evap_diag,fqcalving_diag & |
---|
242 | ,max_eau_sol_diag,runoff_diag,run_off_lic_diag,coeff_rel_diag & |
---|
243 | #endif |
---|
244 | ) |
---|
245 | |
---|
246 | #ifdef ISO |
---|
247 | #ifdef ISOVERIF |
---|
248 | DO i=1,knon |
---|
249 | DO ixt=1,niso |
---|
250 | CALL iso_verif_noNaN(xtsol_prec(ixt,i),'surf_land_burcket 237') |
---|
251 | ENDDO |
---|
252 | ENDDO |
---|
253 | #endif |
---|
254 | #ifdef ISOVERIF |
---|
255 | !write(*,*) 'surf_land_bucket 235' |
---|
256 | DO i=1,knon |
---|
257 | IF (iso_eau > 0) THEN |
---|
258 | CALL iso_verif_egalite_choix(qsol_prec(i), & |
---|
259 | xtsol_prec(iso_eau,i),'surf_land_bucket 628', & |
---|
260 | errmax,errmaxrel) |
---|
261 | CALL iso_verif_egalite_choix(precip_snow(i), & |
---|
262 | xtprecip_snow(iso_eau,i),'surf_land_bucket 227', & |
---|
263 | errmax,errmaxrel) |
---|
264 | ! attention, dans fonte_neige, on modifie snow sans modifier |
---|
265 | ! xtsnow |
---|
266 | ! c'est fait plus tard dans gestion_neige |
---|
267 | ! write(*,*) 'surf_land_bucket 287: i=',i |
---|
268 | ! write(*,*) 'snow(i)=',snow(i) |
---|
269 | CALL iso_verif_egalite_choix(xtsnow(iso_eau,i), & |
---|
270 | snow_prec(i),'surf_land_bucket 245', & |
---|
271 | errmax,errmaxrel) |
---|
272 | ENDIF |
---|
273 | IF ((iso_O17 > 0).AND.(iso_O18 > 0)) THEN |
---|
274 | IF (qsol_prec(i) > ridicule_qsol) THEN |
---|
275 | CALL iso_verif_aberrant_o17(xtsol_prec(iso_O17,i)/qsol_prec(i) & |
---|
276 | ,xtsol_prec(iso_O18,i)/qsol_prec(i) & |
---|
277 | ,'surf_land_bucket 642') |
---|
278 | ENDIF !IF ((qsol_prec(i) > ridicule_qsol) & |
---|
279 | ENDIF !IF ((iso_O17 > 0).AND.(iso_O18 > 0)) THEN |
---|
280 | ENDDO !DO i=1,knon |
---|
281 | !write(*,*) 'surf_land_mod 291' |
---|
282 | !write(*,*) 'snow_evap_diag(1)=',snow_evap_diag(1) |
---|
283 | #endif |
---|
284 | CALL calcul_iso_surf_ter_vectall(klon,knon, & |
---|
285 | evap,snow_evap_diag,snow, & |
---|
286 | fq_fonte_diag,fqfonte_diag,dtime,precip_rain,xtprecip_rain, & |
---|
287 | precip_snow,xtprecip_snow, snow_prec,xtsnow_prec, & |
---|
288 | tsurf_new,xtspechum,pref,spechum,t_coup,u1_lay,v1_lay,p1lay, & |
---|
289 | qsol,xtsol,qsol_prec,xtsol_prec, & |
---|
290 | max_eau_sol_diag, & |
---|
291 | xtevap,xtsnow,h1,runoff_diag,xtrunoff_diag,fqcalving_diag, & |
---|
292 | knindex,is_ter,run_off_lic_diag,coeff_rel_diag,Rland_ice & |
---|
293 | ) |
---|
294 | !#ifdef ISOVERIF |
---|
295 | ! write(*,*) 'surf_land_bucket 303' |
---|
296 | !#endif |
---|
297 | #endif |
---|
298 | |
---|
299 | !* Calculate the age of snow |
---|
300 | |
---|
301 | CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:)) |
---|
302 | |
---|
303 | WHERE (snow(1 : knon) < 0.0001) agesno(1 : knon) = 0. |
---|
304 | |
---|
305 | DO i=1, knon |
---|
306 | zfra(i) = MAX(0.0,MIN(1.0, snow(i)/(snow(i)+10.0))) |
---|
307 | alb_lim(i) = alb_neig(i) *zfra(i) + alb_lim(i)*(1.0-zfra(i)) |
---|
308 | END DO |
---|
309 | |
---|
310 | !* Return albedo : |
---|
311 | ! alb1_new and alb2_new are here given the same values |
---|
312 | |
---|
313 | alb1_new(:) = 0.0 |
---|
314 | alb2_new(:) = 0.0 |
---|
315 | alb1_new(1:knon) = alb_lim(1:knon) |
---|
316 | alb2_new(1:knon) = alb_lim(1:knon) |
---|
317 | |
---|
318 | !* Calculate the rugosity |
---|
319 | |
---|
320 | DO i = 1, knon |
---|
321 | z0_new(i) = MAX(1.5e-05,SQRT(z0_new(i)**2 + rugoro(i)**2)) |
---|
322 | END DO |
---|
323 | |
---|
324 | !* Send to coupler |
---|
325 | ! The run-off from river and coast are not calculated in the bucket modele. |
---|
326 | ! For testing purpose of the coupled modele we put the run-off to zero. |
---|
327 | IF (type_ocean=='couple') THEN |
---|
328 | dummy_riverflow(:) = 0.0 |
---|
329 | dummy_coastalflow(:) = 0.0 |
---|
330 | CALL cpl_send_land_fields(itime, knon, knindex, & |
---|
331 | dummy_riverflow, dummy_coastalflow) |
---|
332 | ENDIF |
---|
333 | |
---|
334 | !* End |
---|
335 | |
---|
336 | END SUBROUTINE surf_land_bucket |
---|
337 | |
---|
338 | !**************************************************************************************** |
---|
339 | |
---|
340 | END MODULE surf_land_bucket_mod |
---|