GCC Code Coverage Report


Directory: ./
File: phys/pbl_surface_mod.f90
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 842 1465 57.5%
Branches: 1227 1781 68.9%

Line Branch Exec Source
1 !
2 ! $Id: pbl_surface_mod.F90 3956 2021-07-06 07:16:14Z jyg $
3 !
4 MODULE pbl_surface_mod
5 !
6 ! Planetary Boundary Layer and Surface module
7 !
8 ! This module manages the calculation of turbulent diffusion in the boundary layer
9 ! and all interactions towards the differents sub-surfaces.
10 !
11 !
12 USE dimphy
13 USE mod_phys_lmdz_para, ONLY : mpi_size
14 USE mod_grid_phy_lmdz, ONLY : klon_glo
15 USE ioipsl
16 USE surface_data, ONLY : type_ocean, ok_veget
17 USE surf_land_mod, ONLY : surf_land
18 USE surf_landice_mod, ONLY : surf_landice
19 USE surf_ocean_mod, ONLY : surf_ocean
20 USE surf_seaice_mod, ONLY : surf_seaice
21 USE cpl_mod, ONLY : gath2cpl
22 USE climb_hq_mod, ONLY : climb_hq_down, climb_hq_up
23 USE climb_wind_mod, ONLY : climb_wind_down, climb_wind_up
24 USE coef_diff_turb_mod, ONLY : coef_diff_turb
25 USE ioipsl_getin_p_mod, ONLY : getin_p
26 USE cdrag_mod
27 USE stdlevvar_mod
28 USE wx_pbl_var_mod, ONLY : wx_pbl_init, wx_pbl_final, &
29 wx_pbl_prelim_0, wx_pbl_prelim_beta
30 USE wx_pbl_mod, ONLY : wx_pbl0_merge, wx_pbl_split, wx_pbl_dts_merge, &
31 wx_pbl_check, wx_pbl_dts_check, wx_evappot
32 use config_ocean_skin_m, only: activate_ocean_skin
33
34 IMPLICIT NONE
35
36 ! Declaration of variables saved in restart file
37 REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE :: fder ! flux drift
38 !$OMP THREADPRIVATE(fder)
39 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC, SAVE :: snow ! snow at surface
40 !$OMP THREADPRIVATE(snow)
41 REAL, ALLOCATABLE, DIMENSION(:,:), PRIVATE, SAVE :: qsurf ! humidity at surface
42 !$OMP THREADPRIVATE(qsurf)
43 REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: ftsoil ! soil temperature
44 !$OMP THREADPRIVATE(ftsoil)
45 REAL, ALLOCATABLE, DIMENSION(:), SAVE :: ydTs0, ydqs0
46 ! nul forced temperature and humidity differences
47 !$OMP THREADPRIVATE(ydTs0, ydqs0)
48
49 INTEGER, SAVE :: iflag_pbl_surface_t2m_bug
50 !$OMP THREADPRIVATE(iflag_pbl_surface_t2m_bug)
51 INTEGER, SAVE :: iflag_new_t2mq2m
52 !$OMP THREADPRIVATE(iflag_new_t2mq2m)
53
54 !FC
55 ! integer, save :: iflag_frein
56 ! !$OMP THREADPRIVATE(iflag_frein)
57
58 CONTAINS
59 !
60 !****************************************************************************************
61 !
62 16 SUBROUTINE pbl_surface_init(fder_rst, snow_rst, qsurf_rst, ftsoil_rst)
63
64 ! This routine should be called after the restart file has been read.
65 ! This routine initialize the restart variables and does some validation tests
66 ! for the index of the different surfaces and tests the choice of type of ocean.
67
68 USE indice_sol_mod
69 USE print_control_mod, ONLY: lunout
70 USE ioipsl_getin_p_mod, ONLY : getin_p
71 IMPLICIT NONE
72
73 INCLUDE "dimsoil.h"
74
75 ! Input variables
76 !****************************************************************************************
77 REAL, DIMENSION(klon), INTENT(IN) :: fder_rst
78 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: snow_rst
79 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: qsurf_rst
80 REAL, DIMENSION(klon, nsoilmx, nbsrf), INTENT(IN) :: ftsoil_rst
81
82 ! Local variables
83 !****************************************************************************************
84 INTEGER :: ierr
85 CHARACTER(len=80) :: abort_message
86 CHARACTER(len = 20) :: modname = 'pbl_surface_init'
87
88 !****************************************************************************************
89 ! Allocate and initialize module variables with fields read from restart file.
90 !
91 !****************************************************************************************
92
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(fder(klon), stat=ierr)
93
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
94
95
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(snow(klon,nbsrf), stat=ierr)
96
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
97
98
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(qsurf(klon,nbsrf), stat=ierr)
99
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
100
101
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(ftsoil(klon,nsoilmx,nbsrf), stat=ierr)
102
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
103
104
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(ydTs0(klon), stat=ierr)
105
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
106
107
4/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 ALLOCATE(ydqs0(klon), stat=ierr)
108
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1)
109
110
2/2
✓ Branch 0 taken 994 times.
✓ Branch 1 taken 1 times.
995 fder(:) = fder_rst(:)
111
4/4
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3976 times.
✓ Branch 3 taken 4 times.
3981 snow(:,:) = snow_rst(:,:)
112
4/4
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3976 times.
✓ Branch 3 taken 4 times.
3981 qsurf(:,:) = qsurf_rst(:,:)
113
6/6
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 44 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 43736 times.
✓ Branch 5 taken 44 times.
43785 ftsoil(:,:,:) = ftsoil_rst(:,:,:)
114
2/2
✓ Branch 0 taken 994 times.
✓ Branch 1 taken 1 times.
995 ydTs0(:) = 0.
115
2/2
✓ Branch 0 taken 994 times.
✓ Branch 1 taken 1 times.
995 ydqs0(:) = 0.
116
117 !****************************************************************************************
118 ! Test for sub-surface indices
119 !
120 !****************************************************************************************
121 IF (is_ter /= 1) THEN
122 WRITE(lunout,*)" *** Warning ***"
123 WRITE(lunout,*)" is_ter n'est pas le premier surface, is_ter = ",is_ter
124 WRITE(lunout,*)"or on doit commencer par les surfaces continentales"
125 abort_message="voir ci-dessus"
126 CALL abort_physic(modname,abort_message,1)
127 ENDIF
128
129 IF ( is_oce > is_sic ) THEN
130 WRITE(lunout,*)' *** Warning ***'
131 WRITE(lunout,*)' Pour des raisons de sequencement dans le code'
132 WRITE(lunout,*)' l''ocean doit etre traite avant la banquise'
133 WRITE(lunout,*)' or is_oce = ',is_oce, '> is_sic = ',is_sic
134 abort_message='voir ci-dessus'
135 CALL abort_physic(modname,abort_message,1)
136 ENDIF
137
138 IF ( is_lic > is_sic ) THEN
139 WRITE(lunout,*)' *** Warning ***'
140 WRITE(lunout,*)' Pour des raisons de sequencement dans le code'
141 WRITE(lunout,*)' la glace contineltalle doit etre traite avant la glace de mer'
142 WRITE(lunout,*)' or is_lic = ',is_lic, '> is_sic = ',is_sic
143 abort_message='voir ci-dessus'
144 CALL abort_physic(modname,abort_message,1)
145 ENDIF
146
147 !****************************************************************************************
148 ! Validation of ocean mode
149 !
150 !****************************************************************************************
151
152
2/6
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
1 IF (type_ocean /= 'slab ' .AND. type_ocean /= 'force ' .AND. type_ocean /= 'couple') THEN
153 WRITE(lunout,*)' *** Warning ***'
154 WRITE(lunout,*)'Option couplage pour l''ocean = ', type_ocean
155 abort_message='option pour l''ocean non valable'
156 CALL abort_physic(modname,abort_message,1)
157 ENDIF
158
159 1 iflag_pbl_surface_t2m_bug=0
160 1 CALL getin_p('iflag_pbl_surface_t2m_bug',iflag_pbl_surface_t2m_bug)
161 1 WRITE(lunout,*) 'iflag_pbl_surface_t2m_bug=',iflag_pbl_surface_t2m_bug
162 !FC
163 ! iflag_frein = 0
164 ! CALL getin_p('iflag_frein',iflag_frein)
165 !
166 !jyg<
167 !****************************************************************************************
168 ! Allocate variables for pbl splitting
169 !
170 !****************************************************************************************
171
172 1 CALL wx_pbl_init
173 !>jyg
174
175 1 END SUBROUTINE pbl_surface_init
176 !
177 !****************************************************************************************
178 !
179
180 480 SUBROUTINE pbl_surface( &
181 dtime, date0, itap, jour, &
182 debut, lafin, &
183 480 rlon, rlat, rugoro, rmu0, &
184 lwdown_m, cldt, &
185 rain_f, snow_f, solsw_m, solswfdiff_m, sollw_m, &
186 gustiness, &
187 t, q, u, v, &
188 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
189 !! t_x, q_x, t_w, q_w, &
190 wake_dlt, wake_dlq, &
191 wake_cstar, wake_s, &
192 !!!
193 480 pplay, paprs, pctsrf, &
194 480 ts,SFRWL, alb_dir, alb_dif,ustar, u10m, v10m,wstar, &
195 cdragh, cdragm, zu1, zv1, &
196 !jyg< (26/09/2019)
197 beta, &
198 !>jyg
199 480 alb_dir_m, alb_dif_m, zxsens, zxevap, &
200 alb3_lic, runoff, snowhgt, qsnow, to_ice, sissnow, &
201 zxtsol, zxfluxlat, zt2m, qsat2m, zn2mout, &
202 d_t, d_q, d_u, d_v, d_t_diss, &
203 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
204 480 d_t_w, d_q_w, &
205 d_t_x, d_q_x, &
206 !! d_wake_dlt,d_wake_dlq, &
207 zxsens_x, zxfluxlat_x,zxsens_w,zxfluxlat_w, &
208 !!!
209 !!! nrlmd le 13/06/2011
210 delta_tsurf,wake_dens,cdragh_x,cdragh_w, &
211 cdragm_x,cdragm_w,kh,kh_x,kh_w, &
212 !!!
213
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 480 times.
480 zcoefh, zcoefm, slab_wfbils, &
214 qsol, zq2m, s_pblh, s_plcl, &
215 !!!
216 !!! jyg le 08/02/2012
217 s_pblh_x, s_plcl_x, s_pblh_w, s_plcl_w, &
218 !!!
219 s_capCL, s_oliqCL, s_cteiCL, s_pblT, &
220 s_therm, s_trmb1, s_trmb2, s_trmb3, &
221 zustar,zu10m, zv10m, fder_print, &
222 zxqsurf, delta_qsurf, &
223 rh2m, zxfluxu, zxfluxv, &
224 480 z0m, z0h, agesno, sollw, solsw, &
225 d_ts, evap, fluxlat, t2m, &
226 wfbils, wfbilo, wfevap, wfrain, wfsnow, &
227 480 flux_t, flux_u, flux_v, &
228 dflux_t, dflux_q, zxsnow, &
229 !jyg<
230 !! zxfluxt, zxfluxq, q2m, flux_q, tke, &
231 480 zxfluxt, zxfluxq, q2m, flux_q, tke_x, &
232 !>jyg
233 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
234 !! tke_x, tke_w &
235 wake_dltke, &
236 treedrg &
237 !FC
238 !!!
239 )
240 !****************************************************************************************
241 ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
242 ! Objet: interface de "couche limite" (diffusion verticale)
243 !
244 !AA REM:
245 !AA-----
246 !AA Tout ce qui a trait au traceurs est dans phytrac maintenant
247 !AA pour l'instant le calcul de la couche limite pour les traceurs
248 !AA se fait avec cltrac et ne tient pas compte de la differentiation
249 !AA des sous-fraction de sol.
250 !AA REM bis :
251 !AA----------
252 !AA Pour pouvoir extraire les coefficient d'echanges et le vent
253 !AA dans la premiere couche, 3 champs supplementaires ont ete crees
254 !AA zcoefh, zu1 et zv1. Pour l'instant nous avons moyenne les valeurs
255 !AA de ces trois champs sur les 4 subsurfaces du modele. Dans l'avenir
256 !AA si les informations des subsurfaces doivent etre prises en compte
257 !AA il faudra sortir ces memes champs en leur ajoutant une dimension,
258 !AA c'est a dire nbsrf (nbre de subsurface).
259 !
260 ! Arguments:
261 !
262 ! dtime----input-R- interval du temps (secondes)
263 ! itap-----input-I- numero du pas de temps
264 ! date0----input-R- jour initial
265 ! t--------input-R- temperature (K)
266 ! q--------input-R- vapeur d'eau (kg/kg)
267 ! u--------input-R- vitesse u
268 ! v--------input-R- vitesse v
269 ! wake_dlt-input-R- temperatre difference between (w) and (x) (K)
270 ! wake_dlq-input-R- humidity difference between (w) and (x) (kg/kg)
271 !wake_cstar-input-R- wake gust front speed (m/s)
272 ! wake_s---input-R- wake fractionnal area
273 ! ts-------input-R- temperature du sol (en Kelvin)
274 ! paprs----input-R- pression a intercouche (Pa)
275 ! pplay----input-R- pression au milieu de couche (Pa)
276 ! rlat-----input-R- latitude en degree
277 ! z0m, z0h ----input-R- longeur de rugosite (en m)
278 ! Martin
279 ! cldt-----input-R- total cloud fraction
280 ! Martin
281 !
282 ! d_t------output-R- le changement pour "t"
283 ! d_q------output-R- le changement pour "q"
284 ! d_u------output-R- le changement pour "u"
285 ! d_v------output-R- le changement pour "v"
286 ! d_ts-----output-R- le changement pour "ts"
287 ! flux_t---output-R- flux de chaleur sensible (CpT) J/m**2/s (W/m**2)
288 ! (orientation positive vers le bas)
289 ! tke_x---input/output-R- tke in the (x) region (kg/m**2/s)
290 ! wake_dltke-input/output-R- tke difference between (w) and (x) (kg/m**2/s)
291 ! flux_q---output-R- flux de vapeur d'eau (kg/m**2/s)
292 ! flux_u---output-R- tension du vent X: (kg m/s)/(m**2 s) ou Pascal
293 ! flux_v---output-R- tension du vent Y: (kg m/s)/(m**2 s) ou Pascal
294 ! dflux_t--output-R- derive du flux sensible
295 ! dflux_q--output-R- derive du flux latent
296 ! zu1------output-R- le vent dans la premiere couche
297 ! zv1------output-R- le vent dans la premiere couche
298 ! trmb1----output-R- deep_cape
299 ! trmb2----output-R- inhibition
300 ! trmb3----output-R- Point Omega
301 ! cteiCL---output-R- Critere d'instab d'entrainmt des nuages de CL
302 ! plcl-----output-R- Niveau de condensation
303 ! pblh-----output-R- HCL
304 ! pblT-----output-R- T au nveau HCL
305 ! treedrg--output-R- tree drag (m)
306 !
307 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, carbon_cycle_tr, level_coupling_esm
308 USE carbon_cycle_mod, ONLY : co2_send, nbcf_out, fields_out, yfields_out, cfname_out
309 use hbtm_mod, only: hbtm
310 USE indice_sol_mod
311 USE time_phylmdz_mod, ONLY : day_ini,annee_ref,itau_phy
312 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid1dto2d_glo
313 USE print_control_mod, ONLY : prt_level,lunout
314 USE ioipsl_getin_p_mod, ONLY : getin_p
315 use phys_state_var_mod, only: ds_ns, dt_ns, delta_sst, delta_sal, zsig, zmea
316 use phys_output_var_mod, only: dter, dser, tkt, tks, taur, sss
317 use netcdf, only: missing_val => nf90_fill_real
318
319
320
321
322 IMPLICIT NONE
323
324 INCLUDE "dimsoil.h"
325 INCLUDE "YOMCST.h"
326 INCLUDE "YOETHF.h"
327 INCLUDE "FCTTRE.h"
328 INCLUDE "clesphys.h"
329 INCLUDE "compbl.h"
330 INCLUDE "flux_arp.h"
331 !FC
332 INCLUDE "dimpft.h"
333
334 !****************************************************************************************
335 REAL, INTENT(IN) :: dtime ! time interval (s)
336 REAL, INTENT(IN) :: date0 ! initial day
337 INTEGER, INTENT(IN) :: itap ! time step
338 INTEGER, INTENT(IN) :: jour ! current day of the year
339 LOGICAL, INTENT(IN) :: debut ! true if first run step
340 LOGICAL, INTENT(IN) :: lafin ! true if last run step
341 REAL, DIMENSION(klon), INTENT(IN) :: rlon ! longitudes in degrees
342 REAL, DIMENSION(klon), INTENT(IN) :: rlat ! latitudes in degrees
343 REAL, DIMENSION(klon), INTENT(IN) :: rugoro ! rugosity length
344 REAL, DIMENSION(klon), INTENT(IN) :: rmu0 ! cosine of solar zenith angle
345 REAL, DIMENSION(klon), INTENT(IN) :: rain_f ! rain fall
346 REAL, DIMENSION(klon), INTENT(IN) :: snow_f ! snow fall
347 REAL, DIMENSION(klon), INTENT(IN) :: solsw_m ! net shortwave radiation at mean surface
348 REAL, DIMENSION(klon), INTENT(IN) :: solswfdiff_m ! diffuse fraction fordownward shortwave radiation at mean surface
349 REAL, DIMENSION(klon), INTENT(IN) :: sollw_m ! net longwave radiation at mean surface
350 REAL, DIMENSION(klon,klev), INTENT(IN) :: t ! temperature (K)
351 REAL, DIMENSION(klon,klev), INTENT(IN) :: q ! water vapour (kg/kg)
352 REAL, DIMENSION(klon,klev), INTENT(IN) :: u ! u speed
353 REAL, DIMENSION(klon,klev), INTENT(IN) :: v ! v speed
354 REAL, DIMENSION(klon,klev), INTENT(IN) :: pplay ! mid-layer pression (Pa)
355 REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs ! pression between layers (Pa)
356 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: pctsrf ! sub-surface fraction
357 ! Martin
358 REAL, DIMENSION(klon), INTENT(IN) :: lwdown_m ! downward longwave radiation at mean s
359 REAL, DIMENSION(klon), INTENT(IN) :: gustiness ! gustiness
360
361 REAL, DIMENSION(klon), INTENT(IN) :: cldt ! total cloud fraction
362
363 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
364 !! REAL, DIMENSION(klon,klev), INTENT(IN) :: t_x ! Temp\'erature hors poche froide
365 !! REAL, DIMENSION(klon,klev), INTENT(IN) :: t_w ! Temp\'erature dans la poches froide
366 !! REAL, DIMENSION(klon,klev), INTENT(IN) :: q_x !
367 !! REAL, DIMENSION(klon,klev), INTENT(IN) :: q_w ! Pareil pour l'humidit\'e
368 REAL, DIMENSION(klon,klev), INTENT(IN) :: wake_dlt !temperature difference between (w) and (x) (K)
369 REAL, DIMENSION(klon,klev), INTENT(IN) :: wake_dlq !humidity difference between (w) and (x) (K)
370 REAL, DIMENSION(klon), INTENT(IN) :: wake_s ! Fraction de poches froides
371 REAL, DIMENSION(klon), INTENT(IN) :: wake_cstar! Vitesse d'expansion des poches froides
372 REAL, DIMENSION(klon), INTENT(IN) :: wake_dens
373 !!!
374
375 ! Input/Output variables
376 !****************************************************************************************
377 !jyg<
378 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: beta ! Aridity factor
379 !>jyg
380 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: ts ! temperature at surface (K)
381 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: delta_tsurf !surface temperature difference between
382 !wake and off-wake regions
383 !albedo SB >>>
384 REAL, DIMENSIOn(6),intent(in) :: SFRWL
385 REAL, DIMENSION(klon, nsw, nbsrf), INTENT(INOUT) :: alb_dir,alb_dif
386 !albedo SB <<<
387 !jyg Pourquoi ustar et wstar sont-elles INOUT ?
388 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: ustar ! u* (m/s)
389 REAL, DIMENSION(klon, nbsrf+1), INTENT(INOUT) :: wstar ! w* (m/s)
390 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: u10m ! u speed at 10m
391 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: v10m ! v speed at 10m
392 !jyg<
393 !! REAL, DIMENSION(klon, klev+1, nbsrf+1), INTENT(INOUT) :: tke
394 REAL, DIMENSION(klon, klev+1, nbsrf+1), INTENT(INOUT) :: tke_x
395 !>jyg
396
397 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
398 REAL, DIMENSION(klon, klev+1, nbsrf+1), INTENT(INOUT) :: wake_dltke ! TKE_w - TKE_x
399 !!!
400
401 ! Output variables
402 !****************************************************************************************
403 REAL, DIMENSION(klon), INTENT(OUT) :: cdragh ! drag coefficient for T and Q
404 REAL, DIMENSION(klon), INTENT(OUT) :: cdragm ! drag coefficient for wind
405 REAL, DIMENSION(klon), INTENT(OUT) :: zu1 ! u wind speed in first layer
406 REAL, DIMENSION(klon), INTENT(OUT) :: zv1 ! v wind speed in first layer
407 !albedo SB >>>
408 REAL, DIMENSION(klon, nsw), INTENT(OUT) :: alb_dir_m,alb_dif_m
409 !albedo SB <<<
410 ! Martin
411 REAL, DIMENSION(klon), INTENT(OUT) :: alb3_lic
412 ! Martin
413 REAL, DIMENSION(klon), INTENT(OUT) :: zxsens ! sensible heat flux at surface with inversed sign
414 ! (=> positive sign upwards)
415 REAL, DIMENSION(klon), INTENT(OUT) :: zxevap ! water vapour flux at surface, positiv upwards
416 REAL, DIMENSION(klon), INTENT(OUT) :: zxtsol ! temperature at surface, mean for each grid point
417 !!! jyg le ???
418 REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_t_w ! !
419 REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_q_w ! ! Tendances dans les poches
420 REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_t_x ! !
421 REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_q_x ! ! Tendances hors des poches
422 !!! jyg
423 REAL, DIMENSION(klon), INTENT(OUT) :: zxfluxlat ! latent flux, mean for each grid point
424 REAL, DIMENSION(klon), INTENT(OUT) :: zt2m ! temperature at 2m, mean for each grid point
425 INTEGER, DIMENSION(klon, 6), INTENT(OUT) :: zn2mout ! number of times the 2m temperature is out of the [tsol,temp]
426 REAL, DIMENSION(klon), INTENT(OUT) :: qsat2m
427 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_t ! change in temperature
428 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_t_diss ! change in temperature
429 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_q ! change in water vapour
430 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_u ! change in u speed
431 REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_v ! change in v speed
432
433 REAL, INTENT(OUT):: zcoefh(:, :, :) ! (klon, klev, nbsrf + 1)
434 ! coef for turbulent diffusion of T and Q, mean for each grid point
435
436 REAL, INTENT(OUT):: zcoefm(:, :, :) ! (klon, klev, nbsrf + 1)
437 ! coef for turbulent diffusion of U and V (?), mean for each grid point
438
439 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
440 REAL, DIMENSION(klon), INTENT(OUT) :: zxsens_x ! Flux sensible hors poche
441 REAL, DIMENSION(klon), INTENT(OUT) :: zxsens_w ! Flux sensible dans la poche
442 REAL, DIMENSION(klon), INTENT(OUT) :: zxfluxlat_x! Flux latent hors poche
443 REAL, DIMENSION(klon), INTENT(OUT) :: zxfluxlat_w! Flux latent dans la poche
444 !! REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_wake_dlt
445 !! REAL, DIMENSION(klon,klev), INTENT(OUT) :: d_wake_dlq
446
447 ! Output only for diagnostics
448 REAL, DIMENSION(klon), INTENT(OUT) :: cdragh_x
449 REAL, DIMENSION(klon), INTENT(OUT) :: cdragh_w
450 REAL, DIMENSION(klon), INTENT(OUT) :: cdragm_x
451 REAL, DIMENSION(klon), INTENT(OUT) :: cdragm_w
452 REAL, DIMENSION(klon), INTENT(OUT) :: kh
453 REAL, DIMENSION(klon), INTENT(OUT) :: kh_x
454 REAL, DIMENSION(klon), INTENT(OUT) :: kh_w
455 !!!
456 REAL, DIMENSION(klon), INTENT(OUT) :: slab_wfbils! heat balance at surface only for slab at ocean points
457 REAL, DIMENSION(klon), INTENT(OUT) :: qsol ! water height in the soil (mm)
458 REAL, DIMENSION(klon), INTENT(OUT) :: zq2m ! water vapour at 2m, mean for each grid point
459 REAL, DIMENSION(klon), INTENT(OUT) :: s_pblh ! height of the planetary boundary layer(HPBL)
460 !!! jyg le 08/02/2012
461 REAL, DIMENSION(klon), INTENT(OUT) :: s_pblh_x ! height of the PBL in the off-wake region
462 REAL, DIMENSION(klon), INTENT(OUT) :: s_pblh_w ! height of the PBL in the wake region
463 !!!
464 REAL, DIMENSION(klon), INTENT(OUT) :: s_plcl ! condensation level
465 !!! jyg le 08/02/2012
466 REAL, DIMENSION(klon), INTENT(OUT) :: s_plcl_x ! condensation level in the off-wake region
467 REAL, DIMENSION(klon), INTENT(OUT) :: s_plcl_w ! condensation level in the wake region
468 !!!
469 REAL, DIMENSION(klon), INTENT(OUT) :: s_capCL ! CAPE of PBL
470 REAL, DIMENSION(klon), INTENT(OUT) :: s_oliqCL ! liquid water intergral of PBL
471 REAL, DIMENSION(klon), INTENT(OUT) :: s_cteiCL ! cloud top instab. crit. of PBL
472 REAL, DIMENSION(klon), INTENT(OUT) :: s_pblT ! temperature at PBLH
473 REAL, DIMENSION(klon), INTENT(OUT) :: s_therm ! thermal virtual temperature excess
474 REAL, DIMENSION(klon), INTENT(OUT) :: s_trmb1 ! deep cape, mean for each grid point
475 REAL, DIMENSION(klon), INTENT(OUT) :: s_trmb2 ! inhibition, mean for each grid point
476 REAL, DIMENSION(klon), INTENT(OUT) :: s_trmb3 ! point Omega, mean for each grid point
477 REAL, DIMENSION(klon), INTENT(OUT) :: zustar ! u*
478 REAL, DIMENSION(klon), INTENT(OUT) :: zu10m ! u speed at 10m, mean for each grid point
479 REAL, DIMENSION(klon), INTENT(OUT) :: zv10m ! v speed at 10m, mean for each grid point
480 REAL, DIMENSION(klon), INTENT(OUT) :: fder_print ! fder for printing (=fder(i) + dflux_t(i) + dflux_q(i))
481 REAL, DIMENSION(klon), INTENT(OUT) :: zxqsurf ! humidity at surface, mean for each grid point
482 REAL, DIMENSION(klon), INTENT(OUT) :: delta_qsurf! humidity difference at surface, mean for each grid point
483 REAL, DIMENSION(klon), INTENT(OUT) :: rh2m ! relative humidity at 2m
484 REAL, DIMENSION(klon, klev), INTENT(OUT) :: zxfluxu ! u wind tension, mean for each grid point
485 REAL, DIMENSION(klon, klev), INTENT(OUT) :: zxfluxv ! v wind tension, mean for each grid point
486 REAL, DIMENSION(klon, nbsrf+1), INTENT(INOUT) :: z0m,z0h ! rugosity length (m)
487 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: agesno ! age of snow at surface
488 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: solsw ! net shortwave radiation at surface
489 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: sollw ! net longwave radiation at surface
490 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: d_ts ! change in temperature at surface
491 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: evap ! evaporation at surface
492 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: fluxlat ! latent flux
493 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: t2m ! temperature at 2 meter height
494 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfbils ! heat balance at surface
495 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfbilo ! water balance at surface weighted by srf
496 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfevap ! water balance (evap) at surface weighted by srf
497 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfrain ! water balance (rain) at surface weighted by srf
498 REAL, DIMENSION(klon, nbsrf), INTENT(OUT) :: wfsnow ! water balance (snow) at surface weighted by srf
499 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_t ! sensible heat flux (CpT) J/m**2/s (W/m**2)
500 ! positve orientation downwards
501 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_u ! u wind tension (kg m/s)/(m**2 s) or Pascal
502 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_v ! v wind tension (kg m/s)/(m**2 s) or Pascal
503 !FC
504 REAL, DIMENSION(klon, klev, nbsrf), INTENT(INOUT) :: treedrg ! tree drag (m)
505
506
507 ! Output not needed
508 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_t ! change of sensible heat flux
509 REAL, DIMENSION(klon), INTENT(OUT) :: dflux_q ! change of water vapour flux
510 REAL, DIMENSION(klon), INTENT(OUT) :: zxsnow ! snow at surface, mean for each grid point
511 REAL, DIMENSION(klon, klev), INTENT(OUT) :: zxfluxt ! sensible heat flux, mean for each grid point
512 REAL, DIMENSION(klon, klev), INTENT(OUT) :: zxfluxq ! water vapour flux, mean for each grid point
513 REAL, DIMENSION(klon, nbsrf),INTENT(OUT) :: q2m ! water vapour at 2 meter height
514 REAL, DIMENSION(klon, klev, nbsrf), INTENT(OUT) :: flux_q ! water vapour flux(latent flux) (kg/m**2/s)
515
516 ! Martin
517 ! inlandsis
518 REAL, DIMENSION(klon), INTENT(OUT) :: qsnow ! snow water content
519 REAL, DIMENSION(klon), INTENT(OUT) :: snowhgt ! snow height
520 REAL, DIMENSION(klon), INTENT(OUT) :: to_ice ! snow passed to ice
521 REAL, DIMENSION(klon), INTENT(OUT) :: sissnow ! snow in snow model
522 REAL, DIMENSION(klon), INTENT(OUT) :: runoff ! runoff on land ice
523 ! Martin
524
525 ! Local variables with attribute SAVE
526 !****************************************************************************************
527 INTEGER, SAVE :: nhoridbg, nidbg ! variables for IOIPSL
528 !$OMP THREADPRIVATE(nhoridbg, nidbg)
529 LOGICAL, SAVE :: debugindex=.FALSE.
530 !$OMP THREADPRIVATE(debugindex)
531 LOGICAL, SAVE :: first_call=.TRUE.
532 !$OMP THREADPRIVATE(first_call)
533 CHARACTER(len=8), DIMENSION(nbsrf), SAVE :: cl_surf
534 !$OMP THREADPRIVATE(cl_surf)
535 REAL, SAVE :: beta_land ! beta for wx_dts
536 !$OMP THREADPRIVATE(beta_land)
537
538 ! Other local variables
539 !****************************************************************************************
540 ! >> PC
541 INTEGER :: ierr
542 INTEGER :: n
543 ! << PC
544 INTEGER :: iflag_split, iflag_split_ref
545 INTEGER :: i, k, nsrf
546 INTEGER :: knon, j
547 INTEGER :: idayref
548 960 INTEGER , DIMENSION(klon) :: ni
549 REAL :: yt1_new
550 REAL :: zx_alf1, zx_alf2 !valeur ambiante par extrapola
551 REAL :: amn, amx
552 REAL :: f1 ! fraction de longeurs visibles parmi tout SW intervalle
553 960 REAL, DIMENSION(klon) :: r_co2_ppm ! taux CO2 atmosphere
554 960 REAL, DIMENSION(klon) :: yts, yz0m, yz0h, ypct
555 960 REAL, DIMENSION(klon) :: yz0h_old
556 !albedo SB >>>
557 960 REAL, DIMENSION(klon) :: yalb,yalb_vis
558 !albedo SB <<<
559 960 REAL, DIMENSION(klon) :: yt1, yq1, yu1, yv1
560 960 REAL, DIMENSION(klon) :: yqa
561 960 REAL, DIMENSION(klon) :: ysnow, yqsurf, yagesno, yqsol
562 960 REAL, DIMENSION(klon) :: yrain_f, ysnow_f
563 960 REAL, DIMENSION(klon) :: ysolsw, ysollw
564 960 REAL, DIMENSION(klon) :: yfder
565 960 REAL, DIMENSION(klon) :: yrugoro
566 960 REAL, DIMENSION(klon) :: yfluxlat
567 960 REAL, DIMENSION(klon) :: y_d_ts
568 960 REAL, DIMENSION(klon) :: y_flux_t1, y_flux_q1
569 960 REAL, DIMENSION(klon) :: y_dflux_t, y_dflux_q
570 960 REAL, DIMENSION(klon) :: y_flux_u1, y_flux_v1
571 960 REAL, DIMENSION(klon) :: yt2m, yq2m, yu10m
572 960 INTEGER, DIMENSION(klon, nbsrf, 6) :: yn2mout, yn2mout_x, yn2mout_w
573 960 INTEGER, DIMENSION(klon, nbsrf, 6) :: n2mout, n2mout_x, n2mout_w
574 960 REAL, DIMENSION(klon) :: yustar
575 960 REAL, DIMENSION(klon) :: ywstar
576 960 REAL, DIMENSION(klon) :: ywindsp
577 960 REAL, DIMENSION(klon) :: yt10m, yq10m
578 960 REAL, DIMENSION(klon) :: ypblh
579 960 REAL, DIMENSION(klon) :: ylcl
580 960 REAL, DIMENSION(klon) :: ycapCL
581 960 REAL, DIMENSION(klon) :: yoliqCL
582 960 REAL, DIMENSION(klon) :: ycteiCL
583 960 REAL, DIMENSION(klon) :: ypblT
584 960 REAL, DIMENSION(klon) :: ytherm
585 960 REAL, DIMENSION(klon) :: ytrmb1
586 960 REAL, DIMENSION(klon) :: ytrmb2
587 960 REAL, DIMENSION(klon) :: ytrmb3
588 960 REAL, DIMENSION(klon) :: uzon, vmer
589 960 REAL, DIMENSION(klon) :: tair1, qair1, tairsol
590 960 REAL, DIMENSION(klon) :: psfce, patm
591 960 REAL, DIMENSION(klon) :: qairsol, zgeo1, speed, zri1, pref !speed, zri1, pref, added by Fuxing WANG, 04/03/2015
592 960 REAL, DIMENSION(klon) :: yz0h_oupas
593 960 REAL, DIMENSION(klon) :: yfluxsens
594 960 REAL, DIMENSION(klon) :: AcoefH_0, AcoefQ_0, BcoefH_0, BcoefQ_0
595 960 REAL, DIMENSION(klon) :: AcoefH, AcoefQ, BcoefH, BcoefQ
596 960 REAL, DIMENSION(klon) :: AcoefU, AcoefV, BcoefU, BcoefV
597 960 REAL, DIMENSION(klon) :: ypsref
598 960 REAL, DIMENSION(klon) :: yevap, yevap_pot, ytsurf_new, yalb3_new
599 !albedo SB >>>
600 960 REAL, DIMENSION(klon,nsw) :: yalb_dir_new, yalb_dif_new
601 !albedo SB <<<
602 960 REAL, DIMENSION(klon) :: ztsol
603 960 REAL, DIMENSION(klon) :: meansqT ! mean square deviation of subsurface temperatures
604 960 REAL, DIMENSION(klon) :: alb_m ! mean albedo for whole SW interval
605 960 REAL, DIMENSION(klon,klev) :: y_d_t, y_d_q, y_d_t_diss
606 960 REAL, DIMENSION(klon,klev) :: y_d_u, y_d_v
607 960 REAL, DIMENSION(klon,klev) :: y_flux_t, y_flux_q
608 960 REAL, DIMENSION(klon,klev) :: y_flux_u, y_flux_v
609 960 REAL, DIMENSION(klon,klev) :: ycoefh, ycoefm,ycoefq
610 960 REAL, DIMENSION(klon) :: ycdragh, ycdragq, ycdragm
611 960 REAL, DIMENSION(klon,klev) :: yu, yv
612 960 REAL, DIMENSION(klon,klev) :: yt, yq
613 960 REAL, DIMENSION(klon,klev) :: ypplay, ydelp
614 960 REAL, DIMENSION(klon,klev) :: delp
615 960 REAL, DIMENSION(klon,klev+1) :: ypaprs
616 960 REAL, DIMENSION(klon,klev+1) :: ytke
617 960 REAL, DIMENSION(klon,nsoilmx) :: ytsoil
618 !FC
619 960 REAL, DIMENSION(klon,nvm_lmdz) :: yveget
620 960 REAL, DIMENSION(klon,nvm_lmdz) :: ylai
621 960 REAL, DIMENSION(klon,nvm_lmdz) :: yheight
622 960 REAL, DIMENSION(klon,klev) :: y_d_u_frein
623 960 REAL, DIMENSION(klon,klev) :: y_d_v_frein
624 960 REAL, DIMENSION(klon,klev) :: y_treedrg
625 !FC
626
627 CHARACTER(len=80) :: abort_message
628 CHARACTER(len=20) :: modname = 'pbl_surface'
629 LOGICAL, PARAMETER :: zxli=.FALSE. ! utiliser un jeu de fonctions simples
630 LOGICAL, PARAMETER :: check=.FALSE.
631
632 !!! nrlmd le 02/05/2011
633 !!! jyg le 07/02/2012
634 960 REAL, DIMENSION(klon) :: ywake_s, ywake_cstar, ywake_dens
635 !!!
636 960 REAL, DIMENSION(klon,klev+1) :: ytke_x, ytke_w
637 960 REAL, DIMENSION(klon,klev+1) :: ywake_dltke
638 960 REAL, DIMENSION(klon,klev) :: yu_x, yv_x, yu_w, yv_w
639 960 REAL, DIMENSION(klon,klev) :: yt_x, yq_x, yt_w, yq_w
640 960 REAL, DIMENSION(klon,klev) :: ycoefh_x, ycoefm_x, ycoefh_w, ycoefm_w
641 960 REAL, DIMENSION(klon,klev) :: ycoefq_x, ycoefq_w
642 960 REAL, DIMENSION(klon) :: ycdragh_x, ycdragh_w, ycdragq_x, ycdragq_w
643 960 REAL, DIMENSION(klon) :: ycdragm_x, ycdragm_w
644 960 REAL, DIMENSION(klon) :: AcoefH_x, AcoefQ_x, BcoefH_x, BcoefQ_x
645 960 REAL, DIMENSION(klon) :: AcoefH_w, AcoefQ_w, BcoefH_w, BcoefQ_w
646 960 REAL, DIMENSION(klon) :: AcoefU_x, AcoefV_x, BcoefU_x, BcoefV_x
647 960 REAL, DIMENSION(klon) :: AcoefU_w, AcoefV_w, BcoefU_w, BcoefV_w
648 960 REAL, DIMENSION(klon) :: y_flux_t1_x, y_flux_q1_x, y_flux_t1_w, y_flux_q1_w
649 960 REAL, DIMENSION(klon) :: y_flux_u1_x, y_flux_v1_x, y_flux_u1_w, y_flux_v1_w
650 960 REAL, DIMENSION(klon,klev) :: y_flux_t_x, y_flux_q_x, y_flux_t_w, y_flux_q_w
651 960 REAL, DIMENSION(klon,klev) :: y_flux_u_x, y_flux_v_x, y_flux_u_w, y_flux_v_w
652 960 REAL, DIMENSION(klon) :: yfluxlat_x, yfluxlat_w
653 960 REAL, DIMENSION(klon,klev) :: y_d_t_x, y_d_q_x, y_d_t_w, y_d_q_w
654 960 REAL, DIMENSION(klon,klev) :: y_d_t_diss_x, y_d_t_diss_w
655 960 REAL, DIMENSION(klon,klev) :: d_t_diss_x, d_t_diss_w
656 960 REAL, DIMENSION(klon,klev) :: y_d_u_x, y_d_v_x, y_d_u_w, y_d_v_w
657 960 REAL, DIMENSION(klon, klev, nbsrf) :: flux_t_x, flux_q_x, flux_t_w, flux_q_w
658 960 REAL, DIMENSION(klon, klev, nbsrf) :: flux_u_x, flux_v_x, flux_u_w, flux_v_w
659 960 REAL, DIMENSION(klon, nbsrf) :: fluxlat_x, fluxlat_w
660 960 REAL, DIMENSION(klon, klev) :: zxfluxt_x, zxfluxq_x, zxfluxt_w, zxfluxq_w
661 960 REAL, DIMENSION(klon, klev) :: zxfluxu_x, zxfluxv_x, zxfluxu_w, zxfluxv_w
662 REAL :: zx_qs_surf, zcor_surf, zdelta_surf
663 !jyg<
664 960 REAL, DIMENSION(klon) :: ybeta
665 960 REAL, DIMENSION(klon) :: ybeta_prev
666 !>jyg
667 960 REAL, DIMENSION(klon, klev) :: d_u_x
668 960 REAL, DIMENSION(klon, klev) :: d_u_w
669 960 REAL, DIMENSION(klon, klev) :: d_v_x
670 960 REAL, DIMENSION(klon, klev) :: d_v_w
671
672 960 REAL, DIMENSION(klon,klev) :: CcoefH, CcoefQ, DcoefH, DcoefQ
673 960 REAL, DIMENSION(klon,klev) :: CcoefU, CcoefV, DcoefU, DcoefV
674 960 REAL, DIMENSION(klon,klev) :: CcoefH_x, CcoefQ_x, DcoefH_x, DcoefQ_x
675 960 REAL, DIMENSION(klon,klev) :: CcoefH_w, CcoefQ_w, DcoefH_w, DcoefQ_w
676 960 REAL, DIMENSION(klon,klev) :: CcoefU_x, CcoefV_x, DcoefU_x, DcoefV_x
677 960 REAL, DIMENSION(klon,klev) :: CcoefU_w, CcoefV_w, DcoefU_w, DcoefV_w
678 960 REAL, DIMENSION(klon,klev) :: Kcoef_hq, Kcoef_m, gama_h, gama_q
679 960 REAL, DIMENSION(klon,klev) :: Kcoef_hq_x, Kcoef_m_x, gama_h_x, gama_q_x
680 960 REAL, DIMENSION(klon,klev) :: Kcoef_hq_w, Kcoef_m_w, gama_h_w, gama_q_w
681 960 REAL, DIMENSION(klon) :: alf_1, alf_2, alf_1_x, alf_2_x, alf_1_w, alf_2_w
682 !!!
683 !!!jyg le 08/02/2012
684 960 REAL, DIMENSION(klon, nbsrf) :: windsp
685 !
686 960 REAL, DIMENSION(klon, nbsrf) :: t2m_x
687 960 REAL, DIMENSION(klon, nbsrf) :: q2m_x
688 960 REAL, DIMENSION(klon) :: rh2m_x
689 960 REAL, DIMENSION(klon) :: qsat2m_x
690 960 REAL, DIMENSION(klon, nbsrf) :: u10m_x
691 960 REAL, DIMENSION(klon, nbsrf) :: v10m_x
692 960 REAL, DIMENSION(klon, nbsrf) :: ustar_x
693 960 REAL, DIMENSION(klon, nbsrf) :: wstar_x
694 !
695 960 REAL, DIMENSION(klon, nbsrf) :: pblh_x
696 960 REAL, DIMENSION(klon, nbsrf) :: plcl_x
697 960 REAL, DIMENSION(klon, nbsrf) :: capCL_x
698 960 REAL, DIMENSION(klon, nbsrf) :: oliqCL_x
699 960 REAL, DIMENSION(klon, nbsrf) :: cteiCL_x
700 960 REAL, DIMENSION(klon, nbsrf) :: pblt_x
701 960 REAL, DIMENSION(klon, nbsrf) :: therm_x
702 960 REAL, DIMENSION(klon, nbsrf) :: trmb1_x
703 960 REAL, DIMENSION(klon, nbsrf) :: trmb2_x
704 960 REAL, DIMENSION(klon, nbsrf) :: trmb3_x
705 !
706 960 REAL, DIMENSION(klon, nbsrf) :: t2m_w
707 960 REAL, DIMENSION(klon, nbsrf) :: q2m_w
708 960 REAL, DIMENSION(klon) :: rh2m_w
709 960 REAL, DIMENSION(klon) :: qsat2m_w
710 960 REAL, DIMENSION(klon, nbsrf) :: u10m_w
711 960 REAL, DIMENSION(klon, nbsrf) :: v10m_w
712 960 REAL, DIMENSION(klon, nbsrf) :: ustar_w
713 960 REAL, DIMENSION(klon, nbsrf) :: wstar_w
714 !
715 960 REAL, DIMENSION(klon, nbsrf) :: pblh_w
716 960 REAL, DIMENSION(klon, nbsrf) :: plcl_w
717 960 REAL, DIMENSION(klon, nbsrf) :: capCL_w
718 960 REAL, DIMENSION(klon, nbsrf) :: oliqCL_w
719 960 REAL, DIMENSION(klon, nbsrf) :: cteiCL_w
720 960 REAL, DIMENSION(klon, nbsrf) :: pblt_w
721 960 REAL, DIMENSION(klon, nbsrf) :: therm_w
722 960 REAL, DIMENSION(klon, nbsrf) :: trmb1_w
723 960 REAL, DIMENSION(klon, nbsrf) :: trmb2_w
724 960 REAL, DIMENSION(klon, nbsrf) :: trmb3_w
725 !
726 960 REAL, DIMENSION(klon) :: yt2m_x
727 960 REAL, DIMENSION(klon) :: yq2m_x
728 960 REAL, DIMENSION(klon) :: yt10m_x
729 960 REAL, DIMENSION(klon) :: yq10m_x
730 960 REAL, DIMENSION(klon) :: yu10m_x
731 REAL, DIMENSION(klon) :: yv10m_x
732 960 REAL, DIMENSION(klon) :: yustar_x
733 960 REAL, DIMENSION(klon) :: ywstar_x
734 !
735 960 REAL, DIMENSION(klon) :: ypblh_x
736 960 REAL, DIMENSION(klon) :: ylcl_x
737 960 REAL, DIMENSION(klon) :: ycapCL_x
738 960 REAL, DIMENSION(klon) :: yoliqCL_x
739 960 REAL, DIMENSION(klon) :: ycteiCL_x
740 960 REAL, DIMENSION(klon) :: ypblt_x
741 960 REAL, DIMENSION(klon) :: ytherm_x
742 960 REAL, DIMENSION(klon) :: ytrmb1_x
743 960 REAL, DIMENSION(klon) :: ytrmb2_x
744 960 REAL, DIMENSION(klon) :: ytrmb3_x
745 !
746 960 REAL, DIMENSION(klon) :: yt2m_w
747 960 REAL, DIMENSION(klon) :: yq2m_w
748 960 REAL, DIMENSION(klon) :: yt10m_w
749 960 REAL, DIMENSION(klon) :: yq10m_w
750 960 REAL, DIMENSION(klon) :: yu10m_w
751 REAL, DIMENSION(klon) :: yv10m_w
752 960 REAL, DIMENSION(klon) :: yustar_w
753 960 REAL, DIMENSION(klon) :: ywstar_w
754 !
755 960 REAL, DIMENSION(klon) :: ypblh_w
756 960 REAL, DIMENSION(klon) :: ylcl_w
757 960 REAL, DIMENSION(klon) :: ycapCL_w
758 960 REAL, DIMENSION(klon) :: yoliqCL_w
759 960 REAL, DIMENSION(klon) :: ycteiCL_w
760 960 REAL, DIMENSION(klon) :: ypblt_w
761 960 REAL, DIMENSION(klon) :: ytherm_w
762 960 REAL, DIMENSION(klon) :: ytrmb1_w
763 960 REAL, DIMENSION(klon) :: ytrmb2_w
764 960 REAL, DIMENSION(klon) :: ytrmb3_w
765 !
766 960 REAL, DIMENSION(klon) :: uzon_x, vmer_x, speed_x, zri1_x, pref_x !speed_x, zri1_x, pref_x, added by Fuxing WANG, 04/03/2015
767 960 REAL, DIMENSION(klon) :: zgeo1_x, tair1_x, qair1_x, tairsol_x
768 !
769 960 REAL, DIMENSION(klon) :: uzon_w, vmer_w, speed_w, zri1_w, pref_w !speed_w, zri1_w, pref_w, added by Fuxing WANG, 04/03/2015
770 960 REAL, DIMENSION(klon) :: zgeo1_w, tair1_w, qair1_w, tairsol_w
771
772 !!! jyg le 25/03/2013
773 !! Variables intermediaires pour le raccord des deux colonnes \`a la surface
774 !jyg<
775 !! REAL :: dd_Ch
776 !! REAL :: dd_Cm
777 !! REAL :: dd_Kh
778 !! REAL :: dd_Km
779 !! REAL :: dd_u
780 !! REAL :: dd_v
781 !! REAL :: dd_t
782 !! REAL :: dd_q
783 !! REAL :: dd_AH
784 !! REAL :: dd_AQ
785 !! REAL :: dd_AU
786 !! REAL :: dd_AV
787 !! REAL :: dd_BH
788 !! REAL :: dd_BQ
789 !! REAL :: dd_BU
790 !! REAL :: dd_BV
791 !!
792 !! REAL :: dd_KHp
793 !! REAL :: dd_KQp
794 !! REAL :: dd_KUp
795 !! REAL :: dd_KVp
796 !>jyg
797
798 !!!
799 !!! nrlmd le 13/06/2011
800 960 REAL, DIMENSION(klon) :: y_delta_flux_t1, y_delta_flux_q1, y_delta_flux_u1, y_delta_flux_v1
801 960 REAL, DIMENSION(klon) :: y_delta_tsurf, y_delta_tsurf_new
802 960 REAL, DIMENSION(klon) :: delta_coef, tau_eq
803 960 REAL, DIMENSION(klon) :: HTphiT_b, dd_HTphiT, HTphiQ_b, dd_HTphiQ, HTRn_b, dd_HTRn
804 960 REAL, DIMENSION(klon) :: phiT0_b, dphiT0, phiQ0_b, dphiQ0, Rn0_b, dRn0
805 960 REAL, DIMENSION(klon) :: y_delta_qsurf
806 960 REAL, DIMENSION(klon) :: y_delta_qsats
807 960 REAL, DIMENSION(klon) :: yg_T, yg_Q
808 960 REAL, DIMENSION(klon) :: yGamma_dTs_phiT, yGamma_dQs_phiQ
809 960 REAL, DIMENSION(klon) :: ydTs_ins, ydqs_ins
810 !
811 REAL, PARAMETER :: facteur=2./sqrt(3.14)
812 REAL, PARAMETER :: inertia=2000.
813 960 REAL, DIMENSION(klon) :: ydtsurf_th
814 REAL :: zdelta_surf_x,zdelta_surf_w,zx_qs_surf_x,zx_qs_surf_w
815 REAL :: zcor_surf_x,zcor_surf_w
816 REAL :: mod_wind_x, mod_wind_w
817 REAL :: rho1
818 960 REAL, DIMENSION(klon) :: Kech_h ! Coefficient d'echange pour l'energie
819 960 REAL, DIMENSION(klon) :: Kech_h_x, Kech_h_w
820 REAL, DIMENSION(klon) :: Kech_m
821 REAL, DIMENSION(klon) :: Kech_m_x, Kech_m_w
822 960 REAL, DIMENSION(klon) :: yts_x, yts_w
823 REAL, DIMENSION(klon) :: yqsatsrf0_x, yqsatsrf0_w
824 960 REAL, DIMENSION(klon) :: yqsurf_x, yqsurf_w
825 !jyg<
826 !! REAL, DIMENSION(klon) :: Kech_Hp, Kech_H_xp, Kech_H_wp
827 !! REAL, DIMENSION(klon) :: Kech_Qp, Kech_Q_xp, Kech_Q_wp
828 !! REAL, DIMENSION(klon) :: Kech_Up, Kech_U_xp, Kech_U_wp
829 !! REAL, DIMENSION(klon) :: Kech_Vp, Kech_V_xp, Kech_V_wp
830 !>jyg
831
832 REAL :: fact_cdrag
833 REAL :: z1lay
834
835 REAL :: vent
836 !
837 ! For debugging with IOIPSL
838 960 INTEGER, DIMENSION(nbp_lon*nbp_lat) :: ndexbg
839 REAL :: zjulian
840 960 REAL, DIMENSION(klon) :: tabindx
841 960 REAL, DIMENSION(nbp_lon,nbp_lat) :: zx_lon, zx_lat
842 960 REAL, DIMENSION(nbp_lon,nbp_lat) :: debugtab
843
844
845 960 REAL, DIMENSION(klon,nbsrf) :: pblh ! height of the planetary boundary layer
846 960 REAL, DIMENSION(klon,nbsrf) :: plcl ! condensation level
847 960 REAL, DIMENSION(klon,nbsrf) :: capCL
848 960 REAL, DIMENSION(klon,nbsrf) :: oliqCL
849 960 REAL, DIMENSION(klon,nbsrf) :: cteiCL
850 960 REAL, DIMENSION(klon,nbsrf) :: pblT
851 960 REAL, DIMENSION(klon,nbsrf) :: therm
852 960 REAL, DIMENSION(klon,nbsrf) :: trmb1 ! deep cape
853 960 REAL, DIMENSION(klon,nbsrf) :: trmb2 ! inhibition
854 960 REAL, DIMENSION(klon,nbsrf) :: trmb3 ! point Omega
855 REAL, DIMENSION(klon,nbsrf) :: zx_rh2m, zx_qsat2m
856 REAL, DIMENSION(klon,nbsrf) :: zx_t1
857 960 REAL, DIMENSION(klon, nbsrf) :: alb ! mean albedo for whole SW interval
858 960 REAL, DIMENSION(klon) :: ylwdown ! jg : temporary (ysollwdown)
859 960 REAL, DIMENSION(klon) :: ygustiness ! jg : temporary (ysollwdown)
860
861 REAL :: zx_qs1, zcor1, zdelta1
862
863 ! Martin
864 REAL, DIMENSION(klon, nbsrf) :: sollwd ! net longwave radiation at surface
865 960 REAL, DIMENSION(klon) :: ytoice
866 960 REAL, DIMENSION(klon) :: ysnowhgt, yqsnow, ysissnow, yrunoff
867 960 REAL, DIMENSION(klon) :: yzmea
868 960 REAL, DIMENSION(klon) :: yzsig
869 960 REAL, DIMENSION(klon) :: ycldt
870 960 REAL, DIMENSION(klon) :: yrmu0
871 ! Martin
872
873 960 REAL, DIMENSION(klon):: ydelta_sst, ydelta_sal, yds_ns, ydt_ns, ydter, ydser, &
874 960 ytkt, ytks, ytaur, ysss
875 ! compression of delta_sst, delta_sal, ds_ns, dt_ns, dter, dser, tkt, tks,
876 ! taur, sss on ocean points
877
878 !****************************************************************************************
879 ! End of declarations
880 !****************************************************************************************
881
882 IF (prt_level >=10) print *,' -> pbl_surface, itap ',itap
883 !
884 !!jyg iflag_split = mod(iflag_pbl_split,2)
885 !!jyg iflag_split = mod(iflag_pbl_split,10)
886 !
887 ! Flags controlling the splitting of the turbulent boundary layer:
888 ! iflag_split_ref = 0 ==> no splitting
889 ! = 1 ==> splitting without coupling with surface temperature
890 ! = 2 ==> splitting with coupling with surface temperature over land
891 ! = 3 ==> splitting over ocean; no splitting over land
892 ! iflag_split: actual flag controlling the splitting.
893 ! iflag_split = iflag_split_ref outside the sub-surface loop
894 ! = iflag_split_ref if iflag_split_ref = 0, 1, or 2
895 ! = 0 over land if iflga_split_ref = 3
896 ! = 1 over ocean if iflga_split_ref = 3
897
898 480 iflag_split_ref = mod(iflag_pbl_split,10)
899 480 iflag_split = iflag_split_ref
900
901 !****************************************************************************************
902 ! 1) Initialisation and validation tests
903 ! Only done first time entering this subroutine
904 !
905 !****************************************************************************************
906
907 480 IF (first_call) THEN
908
909 1 iflag_new_t2mq2m=1
910 1 CALL getin_p('iflag_new_t2mq2m',iflag_new_t2mq2m)
911 1 WRITE(lunout,*) 'pbl_iflag_new_t2mq2m=',iflag_new_t2mq2m
912
913 1 print*,'PBL SURFACE AVEC GUSTINESS'
914 1 first_call=.FALSE.
915
916 ! Initialize ok_flux_surf (for 1D model)
917
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 IF (klon_glo>1) ok_flux_surf=.FALSE.
918
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 IF (klon_glo>1) ok_forc_tsurf=.FALSE.
919
920 ! intialize beta_land
921 1 beta_land = 0.5
922 1 call getin_p('beta_land', beta_land)
923
924 ! Initilize debug IO
925
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1 IF (debugindex .AND. mpi_size==1) THEN
926 ! initialize IOIPSL output
927 idayref = day_ini
928 CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
929 CALL grid1dTo2d_glo(rlon,zx_lon)
930 DO i = 1, nbp_lon
931 zx_lon(i,1) = rlon(i+1)
932 zx_lon(i,nbp_lat) = rlon(i+1)
933 ENDDO
934 CALL grid1dTo2d_glo(rlat,zx_lat)
935 CALL histbeg("sous_index",nbp_lon,zx_lon(:,1),nbp_lat,zx_lat(1,:), &
936 1,nbp_lon,1,nbp_lat, &
937 itau_phy,zjulian,dtime,nhoridbg,nidbg)
938 ! no vertical axis
939 cl_surf(1)='ter'
940 cl_surf(2)='lic'
941 cl_surf(3)='oce'
942 cl_surf(4)='sic'
943 DO nsrf=1,nbsrf
944 CALL histdef(nidbg, cl_surf(nsrf),cl_surf(nsrf), "-",nbp_lon, &
945 nbp_lat,nhoridbg, 1, 1, 1, -99, 32, "inst", dtime,dtime)
946 ENDDO
947
948 CALL histend(nidbg)
949 CALL histsync(nidbg)
950
951 ENDIF
952
953 ENDIF
954
955 !****************************************************************************************
956 ! Force soil water content to qsol0 if qsol0>0 and VEGET=F (use bucket
957 ! instead of ORCHIDEE)
958 480 IF (qsol0>=0.) THEN
959 PRINT*,'WARNING : On impose qsol=',qsol0
960 qsol(:)=qsol0
961 ENDIF
962 !****************************************************************************************
963
964 !****************************************************************************************
965 ! 2) Initialization to zero
966 !****************************************************************************************
967 !
968 ! 2a) Initialization of all argument variables with INTENT(OUT)
969 !****************************************************************************************
970
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 cdragh(:)=0. ; cdragm(:)=0.
971
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 zu1(:)=0. ; zv1(:)=0.
972 !albedo SB >>>
973
10/10
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2862720 times.
✓ Branch 3 taken 2880 times.
✓ Branch 4 taken 2880 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 2862720 times.
✓ Branch 7 taken 2880 times.
✓ Branch 8 taken 477120 times.
✓ Branch 9 taken 480 times.
6208800 alb_dir_m=0. ; alb_dif_m=0. ; alb3_lic(:)=0.
974 !albedo SB <<<
975
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 zxsens(:)=0. ; zxevap(:)=0. ; zxtsol(:)=0.
976
16/16
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
✓ Branch 8 taken 18720 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 18607680 times.
✓ Branch 11 taken 18720 times.
✓ Branch 12 taken 18720 times.
✓ Branch 13 taken 480 times.
✓ Branch 14 taken 18607680 times.
✓ Branch 15 taken 18720 times.
74506080 d_t_w(:,:)=0. ; d_q_w(:,:)=0. ; d_t_x(:,:)=0. ; d_q_x(:,:)=0.
977
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 zxfluxlat(:)=0.
978
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 zt2m(:)=0. ; zq2m(:)=0. ; qsat2m(:)=0. ; rh2m(:)=0.
979
4/4
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2862720 times.
✓ Branch 3 taken 2880 times.
2866080 zn2mout(:,:)=0 ;
980
20/20
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
✓ Branch 8 taken 18720 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 18607680 times.
✓ Branch 11 taken 18720 times.
✓ Branch 12 taken 18720 times.
✓ Branch 13 taken 480 times.
✓ Branch 14 taken 18607680 times.
✓ Branch 15 taken 18720 times.
✓ Branch 16 taken 18720 times.
✓ Branch 17 taken 480 times.
✓ Branch 18 taken 18607680 times.
✓ Branch 19 taken 18720 times.
93132480 d_t(:,:)=0. ; d_t_diss(:,:)=0. ; d_q(:,:)=0. ; d_u(:,:)=0. ; d_v(:,:)=0.
981
12/12
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 93600 times.
✓ Branch 3 taken 2400 times.
✓ Branch 4 taken 93038400 times.
✓ Branch 5 taken 93600 times.
✓ Branch 6 taken 2400 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 93600 times.
✓ Branch 9 taken 2400 times.
✓ Branch 10 taken 93038400 times.
✓ Branch 11 taken 93600 times.
186269280 zcoefh(:,:,:)=0. ; zcoefm(:,:,:)=0.
982
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 zxsens_x(:)=0. ; zxsens_w(:)=0. ; zxfluxlat_x(:)=0. ; zxfluxlat_w(:)=0.
983
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 cdragh_x(:)=0. ; cdragh_w(:)=0. ; cdragm_x(:)=0. ; cdragm_w(:)=0.
984
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 kh(:)=0. ; kh_x(:)=0. ; kh_w(:)=0.
985
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 slab_wfbils(:)=0.
986
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 s_pblh(:)=0. ; s_pblh_x(:)=0. ; s_pblh_w(:)=0.
987
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 s_plcl(:)=0. ; s_plcl_x(:)=0. ; s_plcl_w(:)=0.
988
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 s_capCL(:)=0. ; s_oliqCL(:)=0. ; s_cteiCL(:)=0. ; s_pblT(:)=0.
989
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 s_therm(:)=0.
990
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 s_trmb1(:)=0. ; s_trmb2(:)=0. ; s_trmb3(:)=0.
991
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 zustar(:)=0.
992
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 zu10m(:)=0. ; zv10m(:)=0.
993
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 fder_print(:)=0.
994
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 zxqsurf(:)=0.
995
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 delta_qsurf(:) = 0.
996
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
37253280 zxfluxu(:,:)=0. ; zxfluxv(:,:)=0.
997
8/8
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 1920 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 1908480 times.
✓ Branch 7 taken 1920 times.
3821280 solsw(:,:)=0. ; sollw(:,:)=0.
998
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 d_ts(:,:)=0.
999
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 evap(:,:)=0.
1000
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 fluxlat(:,:)=0.
1001
8/8
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 1920 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 1908480 times.
✓ Branch 7 taken 1920 times.
3821280 wfbils(:,:)=0. ; wfbilo(:,:)=0.
1002
12/12
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 1920 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 1908480 times.
✓ Branch 7 taken 1920 times.
✓ Branch 8 taken 1920 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 1908480 times.
✓ Branch 11 taken 1920 times.
5731680 wfevap(:,:)=0. ; wfrain(:,:)=0. ; wfsnow(:,:)=0.
1003
24/24
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 74880 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 74430720 times.
✓ Branch 5 taken 74880 times.
✓ Branch 6 taken 1920 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 74880 times.
✓ Branch 9 taken 1920 times.
✓ Branch 10 taken 74430720 times.
✓ Branch 11 taken 74880 times.
✓ Branch 12 taken 1920 times.
✓ Branch 13 taken 480 times.
✓ Branch 14 taken 74880 times.
✓ Branch 15 taken 1920 times.
✓ Branch 16 taken 74430720 times.
✓ Branch 17 taken 74880 times.
✓ Branch 18 taken 1920 times.
✓ Branch 19 taken 480 times.
✓ Branch 20 taken 74880 times.
✓ Branch 21 taken 1920 times.
✓ Branch 22 taken 74430720 times.
✓ Branch 23 taken 74880 times.
298030560 flux_t(:,:,:)=0. ; flux_q(:,:,:)=0. ; flux_u(:,:,:)=0. ; flux_v(:,:,:)=0.
1004
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 dflux_t(:)=0. ; dflux_q(:)=0.
1005
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 zxsnow(:)=0.
1006
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
37253280 zxfluxt(:,:)=0. ; zxfluxq(:,:)=0.
1007
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 qsnow(:)=0. ; snowhgt(:)=0. ; to_ice(:)=0. ; sissnow(:)=0.
1008
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 runoff(:)=0.
1009 480 IF (iflag_pbl<20.or.iflag_pbl>=30) THEN
1010
6/6
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 93600 times.
✓ Branch 3 taken 2400 times.
✓ Branch 4 taken 93038400 times.
✓ Branch 5 taken 93600 times.
93134880 zcoefh(:,:,:) = 0.0
1011
4/4
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2385600 times.
✓ Branch 3 taken 2400 times.
2388480 zcoefh(:,1,:) = 999999. ! zcoefh(:,k=1) should never be used
1012
6/6
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 93600 times.
✓ Branch 3 taken 2400 times.
✓ Branch 4 taken 93038400 times.
✓ Branch 5 taken 93600 times.
93134880 zcoefm(:,:,:) = 0.0
1013
4/4
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2385600 times.
✓ Branch 3 taken 2400 times.
2388480 zcoefm(:,1,:) = 999999. !
1014 ELSE
1015 zcoefm(:,:,is_ave)=0.
1016 zcoefh(:,:,is_ave)=0.
1017 ENDIF
1018 !!
1019 ! The components "is_ave" of tke_x and wake_deltke are "OUT" variables
1020 !jyg<
1021 !! tke(:,:,is_ave)=0.
1022
4/4
✓ Branch 0 taken 19200 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 19084800 times.
✓ Branch 3 taken 19200 times.
19104480 tke_x(:,:,is_ave)=0.
1023
1024
4/4
✓ Branch 0 taken 19200 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 19084800 times.
✓ Branch 3 taken 19200 times.
19104480 wake_dltke(:,:,is_ave)=0.
1025 !>jyg
1026 !!! jyg le 23/02/2013
1027
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 t2m(:,:) = 999999. ! t2m and q2m are meaningfull only over sub-surfaces
1028
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 q2m(:,:) = 999999. ! actually present in the grid cell.
1029 !!!
1030
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 rh2m(:) = 0. ; qsat2m(:) = 0.
1031 !!!
1032 !!! jyg le 10/02/2012
1033
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 rh2m_x(:) = 0. ; qsat2m_x(:) = 0. ; rh2m_w(:) = 0. ; qsat2m_w(:) = 0.
1034
1035 ! 2b) Initialization of all local variables that will be compressed later
1036 !****************************************************************************************
1037 !! cdragh = 0.0 ; cdragm = 0.0 ; dflux_t = 0.0 ; dflux_q = 0.0
1038
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 ypct = 0.0 ; yts = 0.0 ; ysnow = 0.0
1039 !! zv1 = 0.0 ; yqsurf = 0.0
1040 !albedo SB >>>
1041
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 yqsurf = 0.0 ; yalb = 0.0 ; yalb_vis = 0.0
1042 !albedo SB <<<
1043
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 yrain_f = 0.0 ; ysnow_f = 0.0 ; yfder = 0.0 ; ysolsw = 0.0
1044
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 ysollw = 0.0 ; yz0m = 0.0 ; yz0h = 0.0 ; yu1 = 0.0
1045
10/10
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 19200 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 19084800 times.
✓ Branch 5 taken 19200 times.
✓ Branch 6 taken 18720 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 18607680 times.
✓ Branch 9 taken 18720 times.
38208000 yv1 = 0.0 ; ypaprs = 0.0 ; ypplay = 0.0
1046
16/16
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
✓ Branch 8 taken 18720 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 18607680 times.
✓ Branch 11 taken 18720 times.
✓ Branch 12 taken 18720 times.
✓ Branch 13 taken 480 times.
✓ Branch 14 taken 18607680 times.
✓ Branch 15 taken 18720 times.
74506080 ydelp = 0.0 ; yu = 0.0 ; yv = 0.0 ; yt = 0.0
1047
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
19581120 yq = 0.0 ; y_dflux_t = 0.0 ; y_dflux_q = 0.0
1048
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yrugoro = 0.0 ; ywindsp = 0.0
1049 !! d_ts = 0.0 ; yfluxlat=0.0 ; flux_t = 0.0 ; flux_q = 0.0
1050
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 yfluxlat=0.0
1051 !! flux_u = 0.0 ; flux_v = 0.0 ; d_t = 0.0 ; d_q = 0.0
1052 !! d_t_diss= 0.0 ;d_u = 0.0 ; d_v = 0.0
1053
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 yqsol = 0.0
1054
1055
4/4
✓ Branch 0 taken 19200 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 19084800 times.
✓ Branch 3 taken 19200 times.
19104480 ytke=0.
1056 !FC
1057
4/4
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
18626880 y_treedrg=0.
1058
1059 ! Martin
1060
8/8
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 477120 times.
✓ Branch 7 taken 480 times.
1908960 ysnowhgt = 0.0; yqsnow = 0.0 ; yrunoff = 0.0 ; ytoice =0.0
1061
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yalb3_new = 0.0 ; ysissnow = 0.0
1062
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 ycldt = 0.0 ; yrmu0 = 0.0
1063 ! Martin
1064
1065 !!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
1066
12/12
✓ Branch 0 taken 19200 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 19084800 times.
✓ Branch 3 taken 19200 times.
✓ Branch 4 taken 19200 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 19084800 times.
✓ Branch 7 taken 19200 times.
✓ Branch 8 taken 19200 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 19084800 times.
✓ Branch 11 taken 19200 times.
57312480 ytke_x=0. ; ytke_w=0. ; ywake_dltke=0.
1067
16/16
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
✓ Branch 8 taken 18720 times.
✓ Branch 9 taken 480 times.
✓ Branch 10 taken 18607680 times.
✓ Branch 11 taken 18720 times.
✓ Branch 12 taken 18720 times.
✓ Branch 13 taken 480 times.
✓ Branch 14 taken 18607680 times.
✓ Branch 15 taken 18720 times.
74506080 y_d_t_x=0. ; y_d_t_w=0. ; y_d_q_x=0. ; y_d_q_w=0.
1068 !! d_t_w=0. ; d_q_w=0.
1069 !! d_t_x=0. ; d_q_x=0.
1070 !! d_wake_dlt=0. ; d_wake_dlq=0.
1071
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yfluxlat_x=0. ; yfluxlat_w=0.
1072
6/6
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
✓ Branch 4 taken 477120 times.
✓ Branch 5 taken 480 times.
1431840 ywake_s=0. ; ywake_cstar=0. ;ywake_dens=0.
1073 !!!
1074 !!! nrlmd le 13/06/2011
1075
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 tau_eq=0. ; delta_coef=0.
1076
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 y_delta_flux_t1=0.
1077
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 ydtsurf_th=0.
1078
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yts_x(:)=0. ; yts_w(:)=0.
1079
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 y_delta_tsurf(:)=0. ; y_delta_qsurf(:)=0.
1080
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yqsurf_x(:)=0. ; yqsurf_w(:)=0.
1081
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yg_T(:) = 0. ; yg_Q(:) = 0.
1082
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 yGamma_dTs_phiT(:) = 0. ; yGamma_dQs_phiQ(:) = 0.
1083
4/4
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 477120 times.
✓ Branch 3 taken 480 times.
954720 ydTs_ins(:) = 0. ; ydqs_ins(:) = 0.
1084
1085 !!!
1086
4/4
✓ Branch 0 taken 5280 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 5248320 times.
✓ Branch 3 taken 5280 times.
5254080 ytsoil = 999999.
1087 !FC
1088
4/4
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
18626880 y_d_u_frein(:,:)=0.
1089
4/4
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
18626880 y_d_v_frein(:,:)=0.
1090 !FC
1091
1092 ! >> PC
1093 !the yfields_out variable is defined in (klon,nbcf_out) even if it is used on
1094 !the ORCHIDEE grid and as such should be defined in yfields_out(knon,nbcf_out) but
1095 !the knon variable is not known at that level of pbl_surface_mod
1096
1097 !the yfields_in variable is defined in (klon,nbcf_in) even if it is used on the
1098 !ORCHIDEE grid and as such should be defined in yfields_in(knon,nbcf_in) but the
1099 !knon variable is not known at that level of pbl_surface_mod
1100
1101
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 480 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
480 yfields_out(:,:) = 0.
1102 ! << PC
1103
1104
1105 ! 2c) Initialization of all local variables computed within the subsurface loop and used later on
1106 !****************************************************************************************
1107
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
37253280 d_t_diss_x(:,:) = 0. ; d_t_diss_w(:,:) = 0.
1108
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
37253280 d_u_x(:,:)=0. ; d_u_w(:,:)=0.
1109
8/8
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 18607680 times.
✓ Branch 3 taken 18720 times.
✓ Branch 4 taken 18720 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 18607680 times.
✓ Branch 7 taken 18720 times.
37253280 d_v_x(:,:)=0. ; d_v_w(:,:)=0.
1110
12/12
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 74880 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 74430720 times.
✓ Branch 5 taken 74880 times.
✓ Branch 6 taken 1920 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 74880 times.
✓ Branch 9 taken 1920 times.
✓ Branch 10 taken 74430720 times.
✓ Branch 11 taken 74880 times.
149015520 flux_t_x(:,:,:)=0. ; flux_t_w(:,:,:)=0.
1111
12/12
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 74880 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 74430720 times.
✓ Branch 5 taken 74880 times.
✓ Branch 6 taken 1920 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 74880 times.
✓ Branch 9 taken 1920 times.
✓ Branch 10 taken 74430720 times.
✓ Branch 11 taken 74880 times.
149015520 flux_q_x(:,:,:)=0. ; flux_q_w(:,:,:)=0.
1112 !
1113 !jyg<
1114
12/12
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 74880 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 74430720 times.
✓ Branch 5 taken 74880 times.
✓ Branch 6 taken 1920 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 74880 times.
✓ Branch 9 taken 1920 times.
✓ Branch 10 taken 74430720 times.
✓ Branch 11 taken 74880 times.
149015520 flux_u_x(:,:,:)=0. ; flux_u_w(:,:,:)=0.
1115
12/12
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 74880 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 74430720 times.
✓ Branch 5 taken 74880 times.
✓ Branch 6 taken 1920 times.
✓ Branch 7 taken 480 times.
✓ Branch 8 taken 74880 times.
✓ Branch 9 taken 1920 times.
✓ Branch 10 taken 74430720 times.
✓ Branch 11 taken 74880 times.
149015520 flux_v_x(:,:,:)=0. ; flux_v_w(:,:,:)=0.
1116
8/8
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
✓ Branch 4 taken 1920 times.
✓ Branch 5 taken 480 times.
✓ Branch 6 taken 1908480 times.
✓ Branch 7 taken 1920 times.
3821280 fluxlat_x(:,:)=0. ; fluxlat_w(:,:)=0.
1117 !>jyg
1118 !
1119 !jyg<
1120 ! pblh,plcl,capCL,cteiCL ... are meaningfull only over sub-surfaces
1121 ! actually present in the grid cell ==> value set to 999999.
1122 !
1123 !jyg<
1124
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 ustar(:,:) = 999999.
1125
4/4
✓ Branch 0 taken 2400 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2385600 times.
✓ Branch 3 taken 2400 times.
2388480 wstar(:,:) = 999999.
1126
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 windsp(:,:) = SQRT(u10m(:,:)**2 + v10m(:,:)**2 )
1127
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 u10m(:,:) = 999999.
1128
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 v10m(:,:) = 999999.
1129 !>jyg
1130 !
1131
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblh(:,:) = 999999. ! Hauteur de couche limite
1132
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 plcl(:,:) = 999999. ! Niveau de condensation de la CLA
1133
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 capCL(:,:) = 999999. ! CAPE de couche limite
1134
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 oliqCL(:,:) = 999999. ! eau_liqu integree de couche limite
1135
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 cteiCL(:,:) = 999999. ! cloud top instab. crit. couche limite
1136
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblt(:,:) = 999999. ! T a la Hauteur de couche limite
1137
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 therm(:,:) = 999999.
1138
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb1(:,:) = 999999. ! deep_cape
1139
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb2(:,:) = 999999. ! inhibition
1140
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb3(:,:) = 999999. ! Point Omega
1141 !
1142
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 t2m_x(:,:) = 999999.
1143
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 q2m_x(:,:) = 999999.
1144
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 ustar_x(:,:) = 999999.
1145
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 wstar_x(:,:) = 999999.
1146
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 u10m_x(:,:) = 999999.
1147
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 v10m_x(:,:) = 999999.
1148 !
1149
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblh_x(:,:) = 999999. ! Hauteur de couche limite
1150
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 plcl_x(:,:) = 999999. ! Niveau de condensation de la CLA
1151
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 capCL_x(:,:) = 999999. ! CAPE de couche limite
1152
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 oliqCL_x(:,:) = 999999. ! eau_liqu integree de couche limite
1153
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 cteiCL_x(:,:) = 999999. ! cloud top instab. crit. couche limite
1154
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblt_x(:,:) = 999999. ! T a la Hauteur de couche limite
1155
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 therm_x(:,:) = 999999.
1156
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb1_x(:,:) = 999999. ! deep_cape
1157
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb2_x(:,:) = 999999. ! inhibition
1158
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb3_x(:,:) = 999999. ! Point Omega
1159 !
1160
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 t2m_w(:,:) = 999999.
1161
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 q2m_w(:,:) = 999999.
1162
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 ustar_w(:,:) = 999999.
1163
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 wstar_w(:,:) = 999999.
1164
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 u10m_w(:,:) = 999999.
1165
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 v10m_w(:,:) = 999999.
1166
1167
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblh_w(:,:) = 999999. ! Hauteur de couche limite
1168
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 plcl_w(:,:) = 999999. ! Niveau de condensation de la CLA
1169
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 capCL_w(:,:) = 999999. ! CAPE de couche limite
1170
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 oliqCL_w(:,:) = 999999. ! eau_liqu integree de couche limite
1171
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 cteiCL_w(:,:) = 999999. ! cloud top instab. crit. couche limite
1172
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 pblt_w(:,:) = 999999. ! T a la Hauteur de couche limite
1173
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 therm_w(:,:) = 999999.
1174
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb1_w(:,:) = 999999. ! deep_cape
1175
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb2_w(:,:) = 999999. ! inhibition
1176
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 trmb3_w(:,:) = 999999. ! Point Omega
1177 !!!
1178 !
1179 !!!
1180 !****************************************************************************************
1181 ! 3) - Calculate pressure thickness of each layer
1182 ! - Calculate the wind at first layer
1183 ! - Mean calculations of albedo
1184 ! - Calculate net radiance at sub-surface
1185 !****************************************************************************************
1186
2/2
✓ Branch 0 taken 18720 times.
✓ Branch 1 taken 480 times.
19200 DO k = 1, klev
1187
2/2
✓ Branch 0 taken 18607680 times.
✓ Branch 1 taken 18720 times.
18626880 DO i = 1, klon
1188 18626400 delp(i,k) = paprs(i,k)-paprs(i,k+1)
1189 ENDDO
1190 ENDDO
1191
1192 !****************************************************************************************
1193 ! Test for rugos........ from physiq.. A la fin plutot???
1194 !
1195 !****************************************************************************************
1196
1197
2/2
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
2400 DO nsrf = 1, nbsrf
1198
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910880 DO i = 1, klon
1199 1908480 z0m(i,nsrf) = MAX(z0m(i,nsrf),z0min)
1200 1920 z0h(i,nsrf) = MAX(z0h(i,nsrf),z0min)
1201 ENDDO
1202 ENDDO
1203
1204 ! Mean calculations of albedo
1205 !
1206 ! * alb : mean albedo for whole SW interval
1207 !
1208 ! Mean albedo for grid point
1209 ! * alb_m : mean albedo at whole SW interval
1210
1211
4/4
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2862720 times.
✓ Branch 3 taken 2880 times.
2866080 alb_dir_m(:,:) = 0.0
1212
4/4
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 2862720 times.
✓ Branch 3 taken 2880 times.
2866080 alb_dif_m(:,:) = 0.0
1213
2/2
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
3360 DO k = 1, nsw
1214
2/2
✓ Branch 0 taken 11520 times.
✓ Branch 1 taken 2880 times.
14880 DO nsrf = 1, nbsrf
1215
2/2
✓ Branch 0 taken 11450880 times.
✓ Branch 1 taken 11520 times.
11465280 DO i = 1, klon
1216 11450880 alb_dir_m(i,k) = alb_dir_m(i,k) + alb_dir(i,k,nsrf) * pctsrf(i,nsrf)
1217 11462400 alb_dif_m(i,k) = alb_dif_m(i,k) + alb_dif(i,k,nsrf) * pctsrf(i,nsrf)
1218 ENDDO
1219 ENDDO
1220 ENDDO
1221
1222 ! We here suppose the fraction f1 of incoming radiance of visible radiance
1223 ! as a fraction of all shortwave radiance
1224 f1 = 0.5
1225 ! f1 = 1 ! put f1=1 to recreate old calculations
1226
1227 !f1 is already included with SFRWL values in each surf files
1228
4/4
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 1908480 times.
✓ Branch 3 taken 1920 times.
1910880 alb=0.0
1229
2/2
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
3360 DO k=1,nsw
1230
2/2
✓ Branch 0 taken 11520 times.
✓ Branch 1 taken 2880 times.
14880 DO nsrf = 1, nbsrf
1231
2/2
✓ Branch 0 taken 11450880 times.
✓ Branch 1 taken 11520 times.
11465280 DO i = 1, klon
1232 11462400 alb(i,nsrf) = alb(i,nsrf) + alb_dir(i,k,nsrf)*SFRWL(k)
1233 ENDDO
1234 ENDDO
1235 ENDDO
1236
1237
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 alb_m=0.0
1238
2/2
✓ Branch 0 taken 2880 times.
✓ Branch 1 taken 480 times.
3360 DO k = 1,nsw
1239
2/2
✓ Branch 0 taken 2862720 times.
✓ Branch 1 taken 2880 times.
2866080 DO i = 1, klon
1240 2865600 alb_m(i) = alb_m(i) + alb_dir_m(i,k)*SFRWL(k)
1241 ENDDO
1242 ENDDO
1243 !albedo SB <<<
1244
1245
1246
1247 ! Calculation of mean temperature at surface grid points
1248
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 ztsol(:) = 0.0
1249
2/2
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
2400 DO nsrf = 1, nbsrf
1250
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910880 DO i = 1, klon
1251 1910400 ztsol(i) = ztsol(i) + ts(i,nsrf)*pctsrf(i,nsrf)
1252 ENDDO
1253 ENDDO
1254
1255 ! Linear distrubution on sub-surface of long- and shortwave net radiance
1256
2/2
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
2400 DO nsrf = 1, nbsrf
1257
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910880 DO i = 1, klon
1258 1908480 sollw(i,nsrf) = sollw_m(i) + 4.0*RSIGMA*ztsol(i)**3 * (ztsol(i)-ts(i,nsrf))
1259 !--OB this line is not satisfactory because alb is the direct albedo not total albedo
1260 1920 solsw(i,nsrf) = solsw_m(i) * (1.-alb(i,nsrf)) / (1.-alb_m(i))
1261 ENDDO
1262 ENDDO
1263 !
1264 !<al1: second order corrections
1265 !- net = dwn -up; up=sig( T4 + 4sum%T3T' + 6sum%T2T'2 +...)
1266 480 IF (iflag_order2_sollw == 1) THEN
1267 meansqT(:) = 0. ! as working buffer
1268 DO nsrf = 1, nbsrf
1269 DO i = 1, klon
1270 meansqT(i) = meansqT(i)+(ts(i,nsrf)-ztsol(i))**2 *pctsrf(i,nsrf)
1271 ENDDO
1272 ENDDO
1273 DO nsrf = 1, nbsrf
1274 DO i = 1, klon
1275 sollw(i,nsrf) = sollw(i,nsrf) &
1276 + 6.0*RSIGMA*ztsol(i)**2 *(meansqT(i)-(ztsol(i)-ts(i,nsrf))**2)
1277 ENDDO
1278 ENDDO
1279 ENDIF ! iflag_order2_sollw == 1
1280 !>al1
1281
1282 !--OB add diffuse fraction of SW down
1283
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 480 times.
480 DO n=1,nbcf_out
1284
0/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
480 IF (cfname_out(n) == "swdownfdiff" ) fields_out(:,n) = solswfdiff_m(:)
1285 ENDDO
1286 ! >> PC
1287
1/6
✗ Branch 0 not taken.
✓ Branch 1 taken 480 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
480 IF (carbon_cycle_cpl .AND. carbon_cycle_tr .AND. nbcf_out.GT.0 ) THEN
1288 r_co2_ppm(:) = co2_send(:)
1289 DO n=1,nbcf_out
1290 IF (cfname_out(n) == "atmco2" ) fields_out(:,n) = co2_send(:)
1291 ENDDO
1292 ENDIF
1293
2/4
✓ Branch 0 taken 480 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 480 times.
480 IF ( .NOT. carbon_cycle_tr .AND. nbcf_out.GT.0 ) THEN
1294 r_co2_ppm(:) = co2_ppm ! Constant field
1295 DO n=1,nbcf_out
1296 IF (cfname_out(n) == "atmco2" ) fields_out(:,n) = co2_ppm
1297 ENDDO
1298 ENDIF
1299 ! << PC
1300
1301 !****************************************************************************************
1302 ! 4) Loop over different surfaces
1303 !
1304 ! Only points containing a fraction of the sub surface will be treated.
1305 !
1306 !****************************************************************************************
1307 !<<<<<<<<<<<<<
1308
2/2
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 480 times.
2400 loop_nbsrf: DO nsrf = 1, nbsrf !<<<<<<<<<<<<<
1309 !<<<<<<<<<<<<<
1310
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (prt_level >=10) print *,' Loop nsrf ',nsrf
1311 !
1312
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (iflag_split_ref == 3) THEN
1313 IF (nsrf == is_oce) THEN
1314 iflag_split = 1
1315 ELSE
1316 iflag_split=0
1317 ENDIF !! (nsrf == is_oce)
1318 ELSE
1319 1920 iflag_split = iflag_split_ref
1320 ENDIF !! (iflag_split_ref == 3)
1321
1322 ! Search for index(ni) and size(knon) of domaine to treat
1323
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 ni(:) = 0
1324 1920 knon = 0
1325
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 DO i = 1, klon
1326
2/2
✓ Branch 0 taken 788452 times.
✓ Branch 1 taken 1120028 times.
1910400 IF (pctsrf(i,nsrf) > 0.) THEN
1327 788452 knon = knon + 1
1328 788452 ni(knon) = i
1329 ENDIF
1330 ENDDO
1331
1332 !!! jyg le 19/08/2012
1333 ! IF (knon <= 0) THEN
1334 ! IF (prt_level >= 10) print *,' no grid point for nsrf= ',nsrf
1335 ! cycle loop_nbsrf
1336 ! ENDIF
1337 !!!
1338
1339 ! write index, with IOIPSL
1340
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1920 IF (debugindex .AND. mpi_size==1) THEN
1341 tabindx(:)=0.
1342 DO i=1,knon
1343 tabindx(i)=REAL(i)
1344 ENDDO
1345 debugtab(:,:) = 0.
1346 ndexbg(:) = 0
1347 CALL gath2cpl(tabindx,debugtab,knon,ni)
1348 CALL histwrite(nidbg,cl_surf(nsrf),itap,debugtab,nbp_lon*nbp_lat, ndexbg)
1349 ENDIF
1350
1351 !****************************************************************************************
1352 ! 5) Compress variables
1353 !
1354 !****************************************************************************************
1355
1356 !
1357 !jyg< (20190926)
1358 ! Provisional : set ybeta to standard values
1359
2/2
✓ Branch 0 taken 1440 times.
✓ Branch 1 taken 480 times.
1920 IF (nsrf .NE. is_ter) THEN
1360
2/2
✓ Branch 0 taken 1431360 times.
✓ Branch 1 taken 1440 times.
1432800 ybeta(:) = 1.
1361 ELSE
1362
1/2
✓ Branch 0 taken 480 times.
✗ Branch 1 not taken.
480 IF (iflag_split .EQ. 0) THEN
1363
2/2
✓ Branch 0 taken 477120 times.
✓ Branch 1 taken 480 times.
477600 ybeta(:) = 1.
1364 ELSE
1365 DO j = 1, knon
1366 i = ni(j)
1367 ybeta(j) = beta(i,nsrf)
1368 ENDDO
1369 ENDIF ! (iflag_split .LE.1)
1370 ENDIF ! (nsrf .NE. is_ter)
1371 !>jyg
1372 !
1373
2/2
✓ Branch 0 taken 788452 times.
✓ Branch 1 taken 1920 times.
790372 DO j = 1, knon
1374 788452 i = ni(j)
1375 788452 ypct(j) = pctsrf(i,nsrf)
1376 788452 yts(j) = ts(i,nsrf)
1377 788452 ysnow(j) = snow(i,nsrf)
1378 788452 yqsurf(j) = qsurf(i,nsrf)
1379 788452 yalb(j) = alb(i,nsrf)
1380 !albedo SB >>>
1381 788452 yalb_vis(j) = alb_dir(i,1,nsrf)
1382 788452 IF (nsw==6) THEN
1383 yalb_vis(j)=(alb_dir(i,1,nsrf)*SFRWL(1)+alb_dir(i,2,nsrf)*SFRWL(2) &
1384 788452 +alb_dir(i,3,nsrf)*SFRWL(3))/(SFRWL(1)+SFRWL(2)+SFRWL(3))
1385 ENDIF
1386 !albedo SB <<<
1387 788452 yrain_f(j) = rain_f(i)
1388 788452 ysnow_f(j) = snow_f(i)
1389 788452 yagesno(j) = agesno(i,nsrf)
1390 788452 yfder(j) = fder(i)
1391 788452 ylwdown(j) = lwdown_m(i)
1392 788452 ygustiness(j) = gustiness(i)
1393 788452 ysolsw(j) = solsw(i,nsrf)
1394 788452 ysollw(j) = sollw(i,nsrf)
1395 788452 yz0m(j) = z0m(i,nsrf)
1396 788452 yz0h(j) = z0h(i,nsrf)
1397 788452 yrugoro(j) = rugoro(i)
1398 788452 yu1(j) = u(i,1)
1399 788452 yv1(j) = v(i,1)
1400 788452 ypaprs(j,klev+1) = paprs(i,klev+1)
1401 !jyg<
1402 !! ywindsp(j) = SQRT(u10m(i,nsrf)**2 + v10m(i,nsrf)**2 )
1403 788452 ywindsp(j) = windsp(i,nsrf)
1404 !>jyg
1405 ! Martin and Etienne
1406 788452 yzmea(j) = zmea(i)
1407 788452 yzsig(j) = zsig(i)
1408 788452 ycldt(j) = cldt(i)
1409 788452 yrmu0(j) = rmu0(i)
1410 ! Martin
1411 !!! nrlmd le 13/06/2011
1412 790372 y_delta_tsurf(j)=delta_tsurf(i,nsrf)
1413 !!!
1414 ENDDO
1415 ! >> PC
1416 !--compressing fields_out onto ORCHIDEE grid
1417 !--these fields are shared and used directly surf_land_orchidee_mod
1418
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 DO n = 1, nbcf_out
1419
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
1920 DO j = 1, knon
1420 i = ni(j)
1421 yfields_out(j,n) = fields_out(i,n)
1422 ENDDO
1423 ENDDO
1424 ! << PC
1425
2/2
✓ Branch 0 taken 74880 times.
✓ Branch 1 taken 1920 times.
76800 DO k = 1, klev
1426
2/2
✓ Branch 0 taken 30749628 times.
✓ Branch 1 taken 74880 times.
30826428 DO j = 1, knon
1427 30749628 i = ni(j)
1428 30749628 ypaprs(j,k) = paprs(i,k)
1429 30749628 ypplay(j,k) = pplay(i,k)
1430 30824508 ydelp(j,k) = delp(i,k)
1431 ENDDO
1432 ENDDO
1433 !
1434 !!! jyg le 07/02/2012 et le 10/04/2013
1435
2/2
✓ Branch 0 taken 76800 times.
✓ Branch 1 taken 1920 times.
78720 DO k = 1, klev+1
1436
2/2
✓ Branch 0 taken 31538080 times.
✓ Branch 1 taken 76800 times.
31616800 DO j = 1, knon
1437 31538080 i = ni(j)
1438 !jyg<
1439 !! ytke(j,k) = tke(i,k,nsrf)
1440 31614880 ytke(j,k) = tke_x(i,k,nsrf)
1441 ENDDO
1442 ENDDO
1443 !>jyg
1444
2/2
✓ Branch 0 taken 74880 times.
✓ Branch 1 taken 1920 times.
76800 DO k = 1, klev
1445
2/2
✓ Branch 0 taken 30749628 times.
✓ Branch 1 taken 74880 times.
30826428 DO j = 1, knon
1446 30749628 i = ni(j)
1447 30749628 y_treedrg(j,k) = treedrg(i,k,nsrf)
1448 30749628 yu(j,k) = u(i,k)
1449 30749628 yv(j,k) = v(i,k)
1450 30749628 yt(j,k) = t(i,k)
1451 30824508 yq(j,k) = q(i,k)
1452 ENDDO
1453 ENDDO
1454 !
1455
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (iflag_split.GE.1) THEN
1456 !!! nrlmd le 02/05/2011
1457 DO k = 1, klev
1458 DO j = 1, knon
1459 i = ni(j)
1460 yu_x(j,k) = u(i,k)
1461 yv_x(j,k) = v(i,k)
1462 yt_x(j,k) = t(i,k)-wake_s(i)*wake_dlt(i,k)
1463 yq_x(j,k) = q(i,k)-wake_s(i)*wake_dlq(i,k)
1464 yu_w(j,k) = u(i,k)
1465 yv_w(j,k) = v(i,k)
1466 yt_w(j,k) = t(i,k)+(1.-wake_s(i))*wake_dlt(i,k)
1467 yq_w(j,k) = q(i,k)+(1.-wake_s(i))*wake_dlq(i,k)
1468 !!!
1469 ENDDO
1470 ENDDO
1471
1472 IF (prt_level .ge. 10) THEN
1473 print *,'pbl_surface, wake_s(1), wake_dlt(1,:) ', wake_s(1), wake_dlt(1,:)
1474 print *,'pbl_surface, wake_s(1), wake_dlq(1,:) ', wake_s(1), wake_dlq(1,:)
1475 ENDIF
1476
1477 !!! nrlmd le 02/05/2011
1478 DO k = 1, klev+1
1479 DO j = 1, knon
1480 i = ni(j)
1481 !jyg<
1482 !! ytke_x(j,k) = tke(i,k,nsrf)-wake_s(i)*wake_dltke(i,k,nsrf)
1483 !! ytke_w(j,k) = tke(i,k,nsrf)+(1.-wake_s(i))*wake_dltke(i,k,nsrf)
1484 !! ywake_dltke(j,k) = wake_dltke(i,k,nsrf)
1485 !! ytke(j,k) = tke(i,k,nsrf)
1486 !
1487 ytke_x(j,k) = tke_x(i,k,nsrf)
1488 ytke(j,k) = tke_x(i,k,nsrf)+wake_s(i)*wake_dltke(i,k,nsrf)
1489 ytke_w(j,k) = tke_x(i,k,nsrf)+wake_dltke(i,k,nsrf)
1490 ywake_dltke(j,k) = wake_dltke(i,k,nsrf)
1491
1492 !>jyg
1493 ENDDO
1494 ENDDO
1495 !!!
1496 !!! jyg le 07/02/2012
1497 DO j = 1, knon
1498 i = ni(j)
1499 ywake_s(j)=wake_s(i)
1500 ywake_cstar(j)=wake_cstar(i)
1501 ywake_dens(j)=wake_dens(i)
1502 ENDDO
1503 !!!
1504 !!! nrlmd le 13/06/2011
1505 DO j=1,knon
1506 yts_x(j)=yts(j)-ywake_s(j)*y_delta_tsurf(j)
1507 yts_w(j)=yts(j)+(1.-ywake_s(j))*y_delta_tsurf(j)
1508 ENDDO
1509 !!!
1510 ENDIF ! (iflag_split .ge.1)
1511 !!!
1512
2/2
✓ Branch 0 taken 21120 times.
✓ Branch 1 taken 1920 times.
23040 DO k = 1, nsoilmx
1513
2/2
✓ Branch 0 taken 8672972 times.
✓ Branch 1 taken 21120 times.
8696012 DO j = 1, knon
1514 8672972 i = ni(j)
1515 8694092 ytsoil(j,k) = ftsoil(i,k,nsrf)
1516 ENDDO
1517 ENDDO
1518
1519 ! qsol(water height in soil) only for bucket continental model
1520
3/4
✓ Branch 0 taken 480 times.
✓ Branch 1 taken 1440 times.
✓ Branch 2 taken 480 times.
✗ Branch 3 not taken.
1920 IF ( nsrf .EQ. is_ter .AND. .NOT. ok_veget ) THEN
1521
2/2
✓ Branch 0 taken 247680 times.
✓ Branch 1 taken 480 times.
248160 DO j = 1, knon
1522 247680 i = ni(j)
1523 248160 yqsol(j) = qsol(i)
1524 ENDDO
1525 ENDIF
1526
1527
3/4
✓ Branch 0 taken 480 times.
✓ Branch 1 taken 1440 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 480 times.
1920 if (nsrf == is_oce .and. activate_ocean_skin >= 1) then
1528 if (activate_ocean_skin == 2 .and. type_ocean == "couple") then
1529 ydelta_sal(:knon) = delta_sal(ni(:knon))
1530 ydelta_sst(:knon) = delta_sst(ni(:knon))
1531 end if
1532
1533 yds_ns(:knon) = ds_ns(ni(:knon))
1534 ydt_ns(:knon) = dt_ns(ni(:knon))
1535 end if
1536
1537 !****************************************************************************************
1538 ! 6a) Calculate coefficients for turbulent diffusion at surface, cdragh et cdragm.
1539 !
1540 !****************************************************************************************
1541
1542
1543 !!! jyg le 07/02/2012
1544
1/2
✓ Branch 0 taken 1920 times.
✗ Branch 1 not taken.
1920 IF (iflag_split .eq.0) THEN
1545 !!!
1546 !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012
1547 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests)
1548 ! CALL clcdrag( knon, nsrf, ypaprs, ypplay, &
1549 ! yu(:,1), yv(:,1), yt(:,1), yq(:,1), &
1550 ! yts, yqsurf, yrugos, &
1551 ! ycdragm, ycdragh )
1552 ! Fuxing WANG, 04/03/2015, replace the clcdrag by the merged version: cdrag
1553
2/2
✓ Branch 0 taken 788452 times.
✓ Branch 1 taken 1920 times.
790372 DO i = 1, knon
1554 ! print*,'PBL ',i,RD
1555 ! print*,'PBL ',yt(i,1),ypaprs(i,1),ypplay(i,1)
1556 zgeo1(i) = RD * yt(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) &
1557 788452 * (ypaprs(i,1)-ypplay(i,1))
1558 1920 speed(i) = SQRT(yu(i,1)**2+yv(i,1)**2)
1559 ENDDO
1560 CALL cdrag(knon, nsrf, &
1561 speed, yt(:,1), yq(:,1), zgeo1, ypaprs(:,1),&
1562 yts, yqsurf, yz0m, yz0h, &
1563 1920 ycdragm, ycdragh, zri1, pref )
1564
1565 ! --- special Dice: on force cdragm ( a defaut de forcer ustar) MPL 05082013
1566 1920 IF (ok_prescr_ust) THEN
1567 DO i = 1, knon
1568 print *,'ycdragm avant=',ycdragm(i)
1569 vent= sqrt(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1))
1570 ! ycdragm(i) = ust*ust/(1.+(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1)))
1571 ! ycdragm(i) = ust*ust/((1.+sqrt(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1))) &
1572 ! *sqrt(yu(i,1)*yu(i,1)+yv(i,1)*yv(i,1)))
1573 ycdragm(i) = ust*ust/(1.+vent)/vent
1574 ! print *,'ycdragm ust yu yv apres=',ycdragm(i),ust,yu(i,1),yv(i,1)
1575 ENDDO
1576 ENDIF
1577
1578
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (prt_level >=10) print *,'clcdrag -> ycdragh ', ycdragh
1579 ELSE !(iflag_split .eq.0)
1580
1581 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests)
1582 ! CALL clcdrag( knon, nsrf, ypaprs, ypplay, &
1583 ! yu_x(:,1), yv_x(:,1), yt_x(:,1), yq_x(:,1), &
1584 ! yts_x, yqsurf, yrugos, &
1585 ! ycdragm_x, ycdragh_x )
1586 ! Fuxing WANG, 04/03/2015, replace the clcdrag by the merged version: cdrag
1587 DO i = 1, knon
1588 zgeo1_x(i) = RD * yt_x(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) &
1589 * (ypaprs(i,1)-ypplay(i,1))
1590 speed_x(i) = SQRT(yu_x(i,1)**2+yv_x(i,1)**2)
1591 ENDDO
1592
1593
1594 CALL cdrag(knon, nsrf, &
1595 speed_x, yt_x(:,1), yq_x(:,1), zgeo1_x, ypaprs(:,1),&
1596 yts_x, yqsurf_x, yz0m, yz0h, &
1597 ycdragm_x, ycdragh_x, zri1_x, pref_x )
1598
1599 ! --- special Dice. JYG+MPL 25112013
1600 IF (ok_prescr_ust) THEN
1601 DO i = 1, knon
1602 ! print *,'ycdragm_x avant=',ycdragm_x(i)
1603 vent= sqrt(yu_x(i,1)*yu_x(i,1)+yv_x(i,1)*yv_x(i,1))
1604 ycdragm_x(i) = ust*ust/(1.+vent)/vent
1605 ! print *,'ycdragm_x ust yu yv apres=',ycdragm_x(i),ust,yu_x(i,1),yv_x(i,1)
1606 ENDDO
1607 ENDIF
1608 IF (prt_level >=10) print *,'clcdrag -> ycdragh_x ', ycdragh_x
1609 !
1610 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests)
1611 ! CALL clcdrag( knon, nsrf, ypaprs, ypplay, &
1612 ! yu_w(:,1), yv_w(:,1), yt_w(:,1), yq_w(:,1), &
1613 ! yts_w, yqsurf, yz0m, &
1614 ! ycdragm_w, ycdragh_w )
1615 ! Fuxing WANG, 04/03/2015, replace the clcdrag by the merged version: cdrag
1616 DO i = 1, knon
1617 zgeo1_w(i) = RD * yt_w(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) &
1618 * (ypaprs(i,1)-ypplay(i,1))
1619 speed_w(i) = SQRT(yu_w(i,1)**2+yv_w(i,1)**2)
1620 ENDDO
1621 CALL cdrag(knon, nsrf, &
1622 speed_w, yt_w(:,1), yq_w(:,1), zgeo1_w, ypaprs(:,1),&
1623 yts_w, yqsurf_w, yz0m, yz0h, &
1624 ycdragm_w, ycdragh_w, zri1_w, pref_w )
1625 !
1626 zgeo1(:) = wake_s(:)*zgeo1_w(:) + (1.-wake_s(:))*zgeo1_x(:)
1627
1628 ! --- special Dice. JYG+MPL 25112013 puis BOMEX
1629 IF (ok_prescr_ust) THEN
1630 DO i = 1, knon
1631 ! print *,'ycdragm_w avant=',ycdragm_w(i)
1632 vent= sqrt(yu_w(i,1)*yu_w(i,1)+yv_w(i,1)*yv_w(i,1))
1633 ycdragm_w(i) = ust*ust/(1.+vent)/vent
1634 ! print *,'ycdragm_w ust yu yv apres=',ycdragm_w(i),ust,yu_w(i,1),yv_w(i,1)
1635 ENDDO
1636 ENDIF
1637 IF (prt_level >=10) print *,'clcdrag -> ycdragh_w ', ycdragh_w
1638 !!!
1639 ENDIF ! (iflag_split .eq.0)
1640 !!!
1641
1642
1643 !****************************************************************************************
1644 ! 6b) Calculate coefficients for turbulent diffusion in the atmosphere, ycoefh et ycoefm.
1645 !
1646 !****************************************************************************************
1647
1648 !!! jyg le 07/02/2012
1649
1/2
✓ Branch 0 taken 1920 times.
✗ Branch 1 not taken.
1920 IF (iflag_split .eq.0) THEN
1650 !!!
1651 !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012
1652
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (prt_level >=10) THEN
1653 print *,' args coef_diff_turb: yu ', yu
1654 print *,' args coef_diff_turb: yv ', yv
1655 print *,' args coef_diff_turb: yq ', yq
1656 print *,' args coef_diff_turb: yt ', yt
1657 print *,' args coef_diff_turb: yts ', yts
1658 print *,' args coef_diff_turb: yz0m ', yz0m
1659 print *,' args coef_diff_turb: yqsurf ', yqsurf
1660 print *,' args coef_diff_turb: ycdragm ', ycdragm
1661 print *,' args coef_diff_turb: ycdragh ', ycdragh
1662 print *,' args coef_diff_turb: ytke ', ytke
1663
1664 ENDIF
1665 CALL coef_diff_turb(dtime, nsrf, knon, ni, &
1666 ypaprs, ypplay, yu, yv, yq, yt, yts, yqsurf, ycdragm, &
1667 1920 ycoefm, ycoefh, ytke, y_treedrg)
1668 ! ycoefm, ycoefh, ytke)
1669 !FC y_treedrg ajoute
1670 1920 IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
1671 ! In this case, coef_diff_turb is called for the Cd only
1672 DO k = 2, klev
1673 DO j = 1, knon
1674 i = ni(j)
1675 ycoefh(j,k) = zcoefh(i,k,nsrf)
1676 ycoefm(j,k) = zcoefm(i,k,nsrf)
1677 ENDDO
1678 ENDDO
1679 ENDIF
1680
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (prt_level >=10) print *,'coef_diff_turb -> ycoefh ',ycoefh
1681 !
1682 ELSE !(iflag_split .eq.0)
1683 IF (prt_level >=10) THEN
1684 print *,' args coef_diff_turb: yu_x ', yu_x
1685 print *,' args coef_diff_turb: yv_x ', yv_x
1686 print *,' args coef_diff_turb: yq_x ', yq_x
1687 print *,' args coef_diff_turb: yt_x ', yt_x
1688 print *,' args coef_diff_turb: yts_x ', yts_x
1689 print *,' args coef_diff_turb: yqsurf ', yqsurf
1690 print *,' args coef_diff_turb: ycdragm_x ', ycdragm_x
1691 print *,' args coef_diff_turb: ycdragh_x ', ycdragh_x
1692 print *,' args coef_diff_turb: ytke_x ', ytke_x
1693
1694 ENDIF
1695 CALL coef_diff_turb(dtime, nsrf, knon, ni, &
1696 ypaprs, ypplay, yu_x, yv_x, yq_x, yt_x, yts_x, yqsurf_x, ycdragm_x, &
1697 ycoefm_x, ycoefh_x, ytke_x,y_treedrg)
1698 ! ycoefm_x, ycoefh_x, ytke_x)
1699 !FC doit on le mettre ( on ne l utilise pas si il y a du spliting)
1700 IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
1701 ! In this case, coef_diff_turb is called for the Cd only
1702 DO k = 2, klev
1703 DO j = 1, knon
1704 i = ni(j)
1705 ycoefh_x(j,k) = zcoefh(i,k,nsrf)
1706 ycoefm_x(j,k) = zcoefm(i,k,nsrf)
1707 ENDDO
1708 ENDDO
1709 ENDIF
1710 IF (prt_level >=10) print *,'coef_diff_turb -> ycoefh_x ',ycoefh_x
1711 !
1712 IF (prt_level >=10) THEN
1713 print *,' args coef_diff_turb: yu_w ', yu_w
1714 print *,' args coef_diff_turb: yv_w ', yv_w
1715 print *,' args coef_diff_turb: yq_w ', yq_w
1716 print *,' args coef_diff_turb: yt_w ', yt_w
1717 print *,' args coef_diff_turb: yts_w ', yts_w
1718 print *,' args coef_diff_turb: yqsurf ', yqsurf
1719 print *,' args coef_diff_turb: ycdragm_w ', ycdragm_w
1720 print *,' args coef_diff_turb: ycdragh_w ', ycdragh_w
1721 print *,' args coef_diff_turb: ytke_w ', ytke_w
1722 ENDIF
1723 CALL coef_diff_turb(dtime, nsrf, knon, ni, &
1724 ypaprs, ypplay, yu_w, yv_w, yq_w, yt_w, yts_w, yqsurf_w, ycdragm_w, &
1725 ycoefm_w, ycoefh_w, ytke_w,y_treedrg)
1726 ! ycoefm_w, ycoefh_w, ytke_w)
1727 IF (iflag_pbl>=20.AND.iflag_pbl<30) THEN
1728 ! In this case, coef_diff_turb is called for the Cd only
1729 DO k = 2, klev
1730 DO j = 1, knon
1731 i = ni(j)
1732 ycoefh_w(j,k) = zcoefh(i,k,nsrf)
1733 ycoefm_w(j,k) = zcoefm(i,k,nsrf)
1734 ENDDO
1735 ENDDO
1736 ENDIF
1737 IF (prt_level >=10) print *,'coef_diff_turb -> ycoefh_w ',ycoefh_w
1738 !
1739 !!!jyg le 10/04/2013
1740 !! En attendant de traiter le transport des traceurs dans les poches froides, formule
1741 !! arbitraire pour ycoefh et ycoefm
1742 DO k = 2,klev
1743 DO j = 1,knon
1744 ycoefh(j,k) = ycoefh_x(j,k) + ywake_s(j)*(ycoefh_w(j,k) - ycoefh_x(j,k))
1745 ycoefm(j,k) = ycoefm_x(j,k) + ywake_s(j)*(ycoefm_w(j,k) - ycoefm_x(j,k))
1746 ENDDO
1747 ENDDO
1748 !!!
1749 ENDIF ! (iflag_split .eq.0)
1750 !!!
1751
1752 !****************************************************************************************
1753 !
1754 ! 8) "La descente" - "The downhill"
1755 !
1756 ! climb_hq_down and climb_wind_down calculate the coefficients
1757 ! Ccoef_X et Dcoef_X for X=[H, Q, U, V].
1758 ! Only the coefficients at surface for H and Q are returned.
1759 !
1760 !****************************************************************************************
1761
1762 ! - Calculate the coefficients Ccoef_H, Ccoef_Q, Dcoef_H and Dcoef_Q
1763 !!! jyg le 07/02/2012
1764
1/2
✓ Branch 0 taken 1920 times.
✗ Branch 1 not taken.
1920 IF (iflag_split .eq.0) THEN
1765 !!!
1766 !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012
1767 CALL climb_hq_down(knon, ycoefh, ypaprs, ypplay, &
1768 ydelp, yt, yq, dtime, &
1769 !!! jyg le 09/05/2011
1770 CcoefH, CcoefQ, DcoefH, DcoefQ, &
1771 Kcoef_hq, gama_q, gama_h, &
1772 !!!
1773 1920 AcoefH, AcoefQ, BcoefH, BcoefQ)
1774 ELSE !(iflag_split .eq.0)
1775 CALL climb_hq_down(knon, ycoefh_x, ypaprs, ypplay, &
1776 ydelp, yt_x, yq_x, dtime, &
1777 !!! nrlmd le 02/05/2011
1778 CcoefH_x, CcoefQ_x, DcoefH_x, DcoefQ_x, &
1779 Kcoef_hq_x, gama_q_x, gama_h_x, &
1780 !!!
1781 AcoefH_x, AcoefQ_x, BcoefH_x, BcoefQ_x)
1782 !!!
1783 IF (prt_level >=10) THEN
1784 PRINT *,'pbl_surface (climb_hq_down.x->) AcoefH_x ',AcoefH_x
1785 PRINT *,'pbl_surface (climb_hq_down.x->) AcoefQ_x ',AcoefQ_x
1786 PRINT *,'pbl_surface (climb_hq_down.x->) BcoefH_x ',BcoefH_x
1787 PRINT *,'pbl_surface (climb_hq_down.x->) BcoefQ_x ',BcoefQ_x
1788 ENDIF
1789 !
1790 CALL climb_hq_down(knon, ycoefh_w, ypaprs, ypplay, &
1791 ydelp, yt_w, yq_w, dtime, &
1792 !!! nrlmd le 02/05/2011
1793 CcoefH_w, CcoefQ_w, DcoefH_w, DcoefQ_w, &
1794 Kcoef_hq_w, gama_q_w, gama_h_w, &
1795 !!!
1796 AcoefH_w, AcoefQ_w, BcoefH_w, BcoefQ_w)
1797 !!!
1798 IF (prt_level >=10) THEN
1799 PRINT *,'pbl_surface (climb_hq_down.w->) AcoefH_w ',AcoefH_w
1800 PRINT *,'pbl_surface (climb_hq_down.w->) AcoefQ_w ',AcoefQ_w
1801 PRINT *,'pbl_surface (climb_hq_down.w->) BcoefH_w ',BcoefH_w
1802 PRINT *,'pbl_surface (climb_hq_down.w->) BcoefQ_w ',BcoefQ_w
1803 ENDIF
1804 !!!
1805 ENDIF ! (iflag_split .eq.0)
1806 !!!
1807
1808 ! - Calculate the coefficients Ccoef_U, Ccoef_V, Dcoef_U and Dcoef_V
1809 !!! jyg le 07/02/2012
1810
1/2
✓ Branch 0 taken 1920 times.
✗ Branch 1 not taken.
1920 IF (iflag_split .eq.0) THEN
1811 !!! nrlmd & jyg les 02/05/2011, 13/06/2011, 05/02/2012
1812 CALL climb_wind_down(knon, dtime, ycoefm, ypplay, ypaprs, yt, ydelp, yu, yv, &
1813 !!! jyg le 09/05/2011
1814 CcoefU, CcoefV, DcoefU, DcoefV, &
1815 Kcoef_m, alf_1, alf_2, &
1816 !!!
1817 1920 AcoefU, AcoefV, BcoefU, BcoefV)
1818 ELSE ! (iflag_split .eq.0)
1819 CALL climb_wind_down(knon, dtime, ycoefm_x, ypplay, ypaprs, yt_x, ydelp, yu_x, yv_x, &
1820 !!! nrlmd le 02/05/2011
1821 CcoefU_x, CcoefV_x, DcoefU_x, DcoefV_x, &
1822 Kcoef_m_x, alf_1_x, alf_2_x, &
1823 !!!
1824 AcoefU_x, AcoefV_x, BcoefU_x, BcoefV_x)
1825 !
1826 CALL climb_wind_down(knon, dtime, ycoefm_w, ypplay, ypaprs, yt_w, ydelp, yu_w, yv_w, &
1827 !!! nrlmd le 02/05/2011
1828 CcoefU_w, CcoefV_w, DcoefU_w, DcoefV_w, &
1829 Kcoef_m_w, alf_1_w, alf_2_w, &
1830 !!!
1831 AcoefU_w, AcoefV_w, BcoefU_w, BcoefV_w)
1832 !!!
1833 ENDIF ! (iflag_split .eq.0)
1834 !!!
1835
1836 !****************************************************************************************
1837 ! 9) Small calculations
1838 !
1839 !****************************************************************************************
1840
1841 ! - Reference pressure is given the values at surface level
1842
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 ypsref(:) = ypaprs(:,1)
1843
1844 ! - CO2 field on 2D grid to be sent to ORCHIDEE
1845 ! Transform to compressed field
1846
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (carbon_cycle_cpl) THEN
1847 DO i=1,knon
1848 r_co2_ppm(i) = co2_send(ni(i))
1849 ENDDO
1850 ELSE
1851
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 r_co2_ppm(:) = co2_ppm ! Constant field
1852 ENDIF
1853
1854 !!! nrlmd le 02/05/2011 -----------------------On raccorde les 2 colonnes dans la couche 1
1855 !----------------------------------------------------------------------------------------
1856 !!! jyg le 07/02/2012
1857 !!! jyg le 01/02/2017
1858
1/2
✓ Branch 0 taken 1920 times.
✗ Branch 1 not taken.
1920 IF (iflag_split .eq. 0) THEN
1859
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 yt1(:) = yt(:,1)
1860
2/2
✓ Branch 0 taken 1908480 times.
✓ Branch 1 taken 1920 times.
1910400 yq1(:) = yq(:,1)
1861 ELSE IF (iflag_split .ge. 1) THEN
1862 !
1863 ! Cdragq computation
1864 ! ------------------
1865 !******************************************************************************
1866 ! Cdragq computed from cdrag
1867 ! The difference comes only from a factor (f_z0qh_oce) on z0, so that
1868 ! it can be computed inside wx_pbl0_merge
1869 ! More complicated appraches may require the propagation through
1870 ! pbl_surface of an independant cdragq variable.
1871 !******************************************************************************
1872 !
1873 IF ( f_z0qh_oce .ne. 1. .and. nsrf .eq.is_oce) THEN
1874 ! Si on suit les formulations par exemple de Tessel, on
1875 ! a z0h=0.4*nu/u*, z0q=0.62*nu/u*, d'ou f_z0qh_oce=0.62/0.4=1.55
1876 !! ycdragq_x(1:knon)=ycdragh_x(1:knon)* &
1877 !! log(z1lay(1:knon)/yz0h(1:knon))/log(z1lay(1:knon)/(f_z0qh_oce*yz0h(1:knon)))
1878 !! ycdragq_w(1:knon)=ycdragh_w(1:knon)* &
1879 !! log(z1lay(1:knon)/yz0h(1:knon))/log(z1lay(1:knon)/(f_z0qh_oce*yz0h(1:knon)))
1880 !
1881 DO j = 1,knon
1882 z1lay = zgeo1(j)/RG
1883 fact_cdrag = log(z1lay/yz0h(j))/log(z1lay/(f_z0qh_oce*yz0h(j)))
1884 ycdragq_x(j)=ycdragh_x(j)*fact_cdrag
1885 ycdragq_w(j)=ycdragh_w(j)*fact_cdrag
1886 !! Print *,'YYYYpbl0: fact_cdrag ', fact_cdrag
1887 ENDDO ! j = 1,knon
1888 !
1889 !! Print *,'YYYYpbl0: z1lay, yz0h, f_z0qh_oce, ycdragh_w, ycdragq_w ', &
1890 !! z1lay, yz0h(1:knon), f_z0qh_oce, ycdragh_w(1:knon), ycdragq_w(1:knon)
1891 ELSE
1892 ycdragq_x(1:knon)=ycdragh_x(1:knon)
1893 ycdragq_w(1:knon)=ycdragh_w(1:knon)
1894 ENDIF ! ( f_z0qh_oce .ne. 1. .and. nsrf .eq.is_oce)
1895 !
1896 CALL wx_pbl_prelim_0(knon, nsrf, dtime, ypplay, ypaprs, ywake_s, &
1897 yts, y_delta_tsurf, ygustiness, &
1898 yt_x, yt_w, yq_x, yq_w, &
1899 yu_x, yu_w, yv_x, yv_w, &
1900 ycdragh_x, ycdragh_w, ycdragq_x, ycdragq_w, &
1901 ycdragm_x, ycdragm_w, &
1902 AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
1903 AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
1904 BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
1905 BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
1906 Kech_h_x, Kech_h_w, Kech_h &
1907 )
1908 CALL wx_pbl_prelim_beta(knon, dtime, ywake_s, ybeta, &
1909 BcoefQ_x, BcoefQ_w &
1910 )
1911 CALL wx_pbl0_merge(knon, ypplay, ypaprs, &
1912 ywake_s, ydTs0, ydqs0, &
1913 yt_x, yt_w, yq_x, yq_w, &
1914 yu_x, yu_w, yv_x, yv_w, &
1915 ycdragh_x, ycdragh_w, ycdragq_x, ycdragq_w, &
1916 ycdragm_x, ycdragm_w, &
1917 AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
1918 AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
1919 BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &
1920 BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w, &
1921 AcoefH_0, AcoefQ_0, AcoefU, AcoefV, &
1922 BcoefH_0, BcoefQ_0, BcoefU, BcoefV, &
1923 ycdragh, ycdragq, ycdragm, &
1924 yt1, yq1, yu1, yv1 &
1925 )
1926 IF (iflag_split .eq. 2 .AND. nsrf .ne. is_oce) THEN
1927 CALL wx_pbl_dts_merge(knon, dtime, ypplay, ypaprs, &
1928 ywake_s, ybeta, ywake_cstar, ywake_dens, &
1929 AcoefH_x, AcoefH_w, &
1930 BcoefH_x, BcoefH_w, &
1931 AcoefH_0, AcoefQ_0, BcoefH_0, BcoefQ_0, &
1932 AcoefH, AcoefQ, BcoefH, BcoefQ, &
1933 HTphiT_b, dd_HTphiT, HTphiQ_b, dd_HTphiQ, HTRn_b, dd_HTRn, &
1934 phiT0_b, dphiT0, phiQ0_b, dphiQ0, Rn0_b, dRn0, &
1935 yg_T, yg_Q, &
1936 yGamma_dTs_phiT, yGamma_dQs_phiQ, &
1937 ydTs_ins, ydqs_ins &
1938 )
1939 ELSE !
1940 AcoefH(:) = AcoefH_0(:)
1941 AcoefQ(:) = AcoefQ_0(:)
1942 BcoefH(:) = BcoefH_0(:)
1943 BcoefQ(:) = BcoefQ_0(:)
1944 yg_T(:) = 0.
1945 yg_Q(:) = 0.
1946 yGamma_dTs_phiT(:) = 0.
1947 yGamma_dQs_phiQ(:) = 0.
1948 ydTs_ins(:) = 0.
1949 ydqs_ins(:) = 0.
1950 ENDIF ! (iflag_split .eq. 2)
1951 ENDIF ! (iflag_split .eq.0)
1952 !!!
1953
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (prt_level >=10) THEN
1954 PRINT *,'pbl_surface (merge->): yt(1,:) ',yt(1,:)
1955 PRINT *,'pbl_surface (merge->): yq(1,:) ',yq(1,:)
1956 PRINT *,'pbl_surface (merge->): yu(1,:) ',yu(1,:)
1957 PRINT *,'pbl_surface (merge->): yv(1,:) ',yv(1,:)
1958 PRINT *,'pbl_surface (merge->): AcoefH(1), AcoefQ(1), AcoefU(1), AcoefV(1) ', &
1959 AcoefH(1), AcoefQ(1), AcoefU(1), AcoefV(1)
1960 PRINT *,'pbl_surface (merge->): BcoefH(1), BcoefQ(1), BcoefU(1), BcoefV(1) ', &
1961 BcoefH(1), BcoefQ(1), BcoefU(1), BcoefV(1)
1962
1963 ENDIF
1964
1965 ! Save initial value of z0h for use in evappot (z0h wiil be computed again in the surface models)
1966
2/2
✓ Branch 0 taken 788452 times.
✓ Branch 1 taken 1920 times.
790372 yz0h_old(1:knon) = yz0h(1:knon)
1967 !
1968 !****************************************************************************************
1969 !
1970 ! Calulate t2m and q2m for the case of calculation at land grid points
1971 ! t2m and q2m are needed as input to ORCHIDEE
1972 !
1973 !****************************************************************************************
1974
2/2
✓ Branch 0 taken 480 times.
✓ Branch 1 taken 1440 times.
1920 IF (nsrf == is_ter) THEN
1975
1976
2/2
✓ Branch 0 taken 247680 times.
✓ Branch 1 taken 480 times.
248160 DO i = 1, knon
1977 zgeo1(i) = RD * yt(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) &
1978 480 * (ypaprs(i,1)-ypplay(i,1))
1979 ENDDO
1980
1981 ! Calculate the temperature et relative humidity at 2m and the wind at 10m
1982
1/2
✓ Branch 0 taken 480 times.
✗ Branch 1 not taken.
480 IF (iflag_new_t2mq2m==1) THEN
1983 CALL stdlevvarn(klon, knon, is_ter, zxli, &
1984 yu(:,1), yv(:,1), yt(:,1), yq(:,1), zgeo1, &
1985 yts, yqsurf, yz0m, yz0h, ypaprs(:,1), ypplay(:,1), &
1986 yt2m, yq2m, yt10m, yq10m, yu10m, yustar, &
1987
1/2
✓ Branch 2 taken 480 times.
✗ Branch 3 not taken.
480 yn2mout(:, nsrf, :))
1988 ELSE
1989 CALL stdlevvar(klon, knon, is_ter, zxli, &
1990 yu(:,1), yv(:,1), yt(:,1), yq(:,1), zgeo1, &
1991 yts, yqsurf, yz0m, yz0h, ypaprs(:,1), ypplay(:,1), &
1992 yt2m, yq2m, yt10m, yq10m, yu10m, yustar)
1993 ENDIF
1994
1995 ENDIF
1996
1997 !****************************************************************************************
1998 !
1999 ! 10) Switch according to current surface
2000 ! It is necessary to start with the continental surfaces because the ocean
2001 ! needs their run-off.
2002 !
2003 !****************************************************************************************
2004 480 SELECT CASE(nsrf)
2005
2006 CASE(is_ter)
2007 ! print*,"DEBUGTS",yts(knon/2),ylwdown(knon/2)
2008 CALL surf_land(itap, dtime, date0, jour, knon, ni,&
2009 rlon, rlat, yrmu0, &
2010 debut, lafin, ydelp(:,1), r_co2_ppm, ysolsw, ysollw, yalb, &
2011 !!jyg yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
2012 yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
2013 AcoefH, AcoefQ, BcoefH, BcoefQ, &
2014 AcoefU, AcoefV, BcoefU, BcoefV, &
2015 ypsref, yu1, yv1, ygustiness, yrugoro, pctsrf, &
2016 ylwdown, yq2m, yt2m, &
2017 ysnow, yqsol, yagesno, ytsoil, &
2018 yz0m, yz0h, SFRWL, yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,&
2019 yqsurf, ytsurf_new, y_dflux_t, y_dflux_q, &
2020 y_flux_u1, y_flux_v1, &
2021 480 yveget,ylai,yheight )
2022
2023 !FC quid qd yveget ylai yheight ne sont pas definit
2024 !FC yveget,ylai,yheight, &
2025 480 IF (ifl_pbltree .ge. 1) THEN
2026 CALL freinage(knon, yu, yv, yt, &
2027 ! yveget,ylai, yheight,ypaprs,ypplay,y_d_u_frein,y_d_v_frein)
2028 yveget,ylai, yheight,ypaprs,ypplay,y_treedrg, y_d_u_frein,y_d_v_frein)
2029 ENDIF
2030
2031
2032 ! Special DICE MPL 05082013 puis BOMEX
2033 960 IF (ok_prescr_ust) THEN
2034 DO j=1,knon
2035 ! ysnow(:)=0.
2036 ! yqsol(:)=0.
2037 ! yagesno(:)=50.
2038 ! ytsoil(:,:)=300.
2039 ! yz0_new(:)=0.001
2040 ! yevap(:)=flat/RLVTT
2041 ! yfluxlat(:)=-flat
2042 ! yfluxsens(:)=-fsens
2043 ! yqsurf(:)=0.
2044 ! ytsurf_new(:)=tg
2045 ! y_dflux_t(:)=0.
2046 ! y_dflux_q(:)=0.
2047 y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
2048 y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
2049 ENDDO
2050 ENDIF
2051
2052 CASE(is_lic)
2053 ! Martin
2054 CALL surf_landice(itap, dtime, knon, ni, &
2055 rlon, rlat, debut, lafin, &
2056 yrmu0, ylwdown, yalb, zgeo1, &
2057 ysolsw, ysollw, yts, ypplay(:,1), &
2058 !!jyg ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
2059 ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
2060 AcoefH, AcoefQ, BcoefH, BcoefQ, &
2061 AcoefU, AcoefV, BcoefU, BcoefV, &
2062 ypsref, yu1, yv1, ygustiness, yrugoro, pctsrf, &
2063 ysnow, yqsurf, yqsol, yagesno, &
2064 ytsoil, yz0m, yz0h, SFRWL, yalb_dir_new, yalb_dif_new, yevap,yfluxsens,yfluxlat, &
2065 ytsurf_new, y_dflux_t, y_dflux_q, &
2066 yzmea, yzsig, ycldt, &
2067 ysnowhgt, yqsnow, ytoice, ysissnow, &
2068 yalb3_new, yrunoff, &
2069 480 y_flux_u1, y_flux_v1)
2070
2071 !jyg<
2072 !! alb3_lic(:)=0.
2073 !>jyg
2074
2/2
✓ Branch 0 taken 72960 times.
✓ Branch 1 taken 480 times.
73440 DO j = 1, knon
2075 72960 i = ni(j)
2076 72960 alb3_lic(i) = yalb3_new(j)
2077 72960 snowhgt(i) = ysnowhgt(j)
2078 72960 qsnow(i) = yqsnow(j)
2079 72960 to_ice(i) = ytoice(j)
2080 72960 sissnow(i) = ysissnow(j)
2081 73440 runoff(i) = yrunoff(j)
2082 ENDDO
2083 ! Martin
2084 ! Special DICE MPL 05082013 puis BOMEX MPL 20150410
2085 960 IF (ok_prescr_ust) THEN
2086 DO j=1,knon
2087 y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
2088 y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
2089 ENDDO
2090 ENDIF
2091
2092 CASE(is_oce)
2093 CALL surf_ocean(rlon, rlat, ysolsw, ysollw, yalb_vis, &
2094 ywindsp, rmu0, yfder, yts, &
2095 itap, dtime, jour, knon, ni, &
2096 !!jyg ypplay(:,1), zgeo1/RG, ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
2097 ypplay(:,1), zgeo1(1:knon)/RG, ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),& ! ym missing init
2098 AcoefH, AcoefQ, BcoefH, BcoefQ, &
2099 AcoefU, AcoefV, BcoefU, BcoefV, &
2100 ypsref, yu1, yv1, ygustiness, yrugoro, pctsrf, &
2101 ysnow, yqsurf, yagesno, &
2102 yz0m, yz0h, SFRWL,yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,&
2103 ytsurf_new, y_dflux_t, y_dflux_q, slab_wfbils, &
2104 y_flux_u1, y_flux_v1, ydelta_sst(:knon), ydelta_sal(:knon), &
2105 yds_ns(:knon), ydt_ns(:knon), ydter(:knon), ydser(:knon), &
2106
3/4
✓ Branch 0 taken 480 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 362977 times.
✓ Branch 3 taken 480 times.
363457 ytkt(:knon), ytks(:knon), ytaur(:knon), ysss)
2107
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 480 times.
480 IF (prt_level >=10) THEN
2108 print *,'arg de surf_ocean: ycdragh ',ycdragh
2109 print *,'arg de surf_ocean: ycdragm ',ycdragm
2110 print *,'arg de surf_ocean: yt ', yt
2111 print *,'arg de surf_ocean: yq ', yq
2112 print *,'arg de surf_ocean: yts ', yts
2113 print *,'arg de surf_ocean: AcoefH ',AcoefH
2114 print *,'arg de surf_ocean: AcoefQ ',AcoefQ
2115 print *,'arg de surf_ocean: BcoefH ',BcoefH
2116 print *,'arg de surf_ocean: BcoefQ ',BcoefQ
2117 print *,'arg de surf_ocean: yevap ',yevap
2118 print *,'arg de surf_ocean: yfluxsens ',yfluxsens
2119 print *,'arg de surf_ocean: yfluxlat ',yfluxlat
2120 print *,'arg de surf_ocean: ytsurf_new ',ytsurf_new
2121 ENDIF
2122 ! Special DICE MPL 05082013 puis BOMEX MPL 20150410
2123 960 IF (ok_prescr_ust) THEN
2124 DO j=1,knon
2125 y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
2126 y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
2127 ENDDO
2128 ENDIF
2129
2130 CASE(is_sic)
2131 CALL surf_seaice( &
2132 !albedo SB >>>
2133 rlon, rlat, ysolsw, ysollw, yalb_vis, yfder, &
2134 !albedo SB <<<
2135 itap, dtime, jour, knon, ni, &
2136 lafin, &
2137 !!jyg yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
2138 yts, ypplay(:,1), ycdragh, ycdragm, yrain_f, ysnow_f, yt1, yq1,&
2139 AcoefH, AcoefQ, BcoefH, BcoefQ, &
2140 AcoefU, AcoefV, BcoefU, BcoefV, &
2141 ypsref, yu1, yv1, ygustiness, pctsrf, &
2142 ysnow, yqsurf, yqsol, yagesno, ytsoil, &
2143 !albedo SB >>>
2144 yz0m, yz0h, SFRWL, yalb_dir_new, yalb_dif_new, yevap, yfluxsens,yfluxlat,&
2145 !albedo SB <<<
2146 ytsurf_new, y_dflux_t, y_dflux_q, &
2147 480 y_flux_u1, y_flux_v1)
2148
2149 ! Special DICE MPL 05082013 puis BOMEX MPL 20150410
2150 480 IF (ok_prescr_ust) THEN
2151 DO j=1,knon
2152 y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1)
2153 y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1)
2154 ENDDO
2155 ENDIF
2156
2157 CASE DEFAULT
2158 WRITE(lunout,*) 'Surface index = ', nsrf
2159 abort_message = 'Surface index not valid'
2160
4/5
✓ Branch 0 taken 480 times.
✓ Branch 1 taken 480 times.
✓ Branch 2 taken 480 times.
✓ Branch 3 taken 480 times.
✗ Branch 4 not taken.
1920 CALL abort_physic(modname,abort_message,1)
2161 END SELECT
2162
2163
2164 !****************************************************************************************
2165 ! 11) - Calcul the increment of surface temperature
2166 !
2167 !****************************************************************************************
2168
2169 1920 IF (evap0>=0.) THEN
2170 yevap(:)=evap0
2171 yevap(:)=RLVTT*evap0
2172 ENDIF
2173
2174
2/2
✓ Branch 0 taken 788452 times.
✓ Branch 1 taken 1920 times.
790372 y_d_ts(1:knon) = ytsurf_new(1:knon) - yts(1:knon)
2175
2176 !****************************************************************************************
2177 !
2178 ! 12) "La remontee" - "The uphill"
2179 !
2180 ! The fluxes (y_flux_X) and tendancy (y_d_X) are calculated
2181 ! for X=H, Q, U and V, for all vertical levels.
2182 !
2183 !****************************************************************************************
2184 !!
2185 !!!
2186 !!! jyg le 10/04/2013 et EV 10/2020
2187
2188 1920 IF (ok_forc_tsurf) THEN
2189 DO j=1,knon
2190 ytsurf_new(j)=tg
2191 y_d_ts(j) = ytsurf_new(j) - yts(j)
2192 ENDDO
2193 ENDIF ! ok_forc_tsurf
2194
2195 !!!
2196 1920 IF (ok_flux_surf) THEN
2197 IF (prt_level >=10) THEN
2198 PRINT *,'pbl_surface: fsens flat RLVTT=',fsens,flat,RLVTT
2199 ENDIF
2200 y_flux_t1(:) = fsens
2201 y_flux_q1(:) = flat/RLVTT
2202 yfluxlat(:) = flat
2203 !
2204 !! Test sur iflag_split retire le 2/02/2018, sans vraiment comprendre la raison de ce test. (jyg)
2205 !! IF (iflag_split .eq.0) THEN
2206 DO j=1,knon
2207 Kech_h(j) = ycdragh(j) * (1.0+SQRT(yu(j,1)**2+yv(j,1)**2)) * &
2208 ypplay(j,1)/(RD*yt(j,1))
2209 ENDDO
2210 !! ENDIF ! (iflag_split .eq.0)
2211
2212 DO j = 1, knon
2213 yt1_new=(1./RCPD)*(AcoefH(j)+BcoefH(j)*y_flux_t1(j)*dtime)
2214 ytsurf_new(j)=yt1_new-y_flux_t1(j)/(Kech_h(j)*RCPD)
2215 ENDDO
2216
2217 DO j=1,knon
2218 y_d_ts(j) = ytsurf_new(j) - yts(j)
2219 ENDDO
2220
2221 ELSE ! (ok_flux_surf)
2222
2/2
✓ Branch 0 taken 1920 times.
✓ Branch 1 taken 788452 times.
790372 DO j=1,knon
2223 788452 y_flux_t1(j) = yfluxsens(j)
2224 790372 y_flux_q1(j) = -yevap(j)
2225 ENDDO
2226 ENDIF ! (ok_flux_surf)
2227 !
2228 ! ------------------------------------------------------------------------------
2229 ! 12a) Splitting
2230 ! ------------------------------------------------------------------------------
2231
2232
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1920 times.
1920 IF (iflag_split .GE. 1) THEN
2233 !
2234 IF (nsrf .ne. is_oce) THEN
2235 !
2236 ! Compute potential evaporation and aridity factor (jyg, 20200328)
2237 ybeta_prev(:) = ybeta(:)
2238 DO j = 1, knon
2239 yqa(j) = AcoefQ(j) - BcoefQ(j)*yevap(j)*dtime
2240 ENDDO
2241 !
2242 CALL wx_evappot(knon, yqa, yTsurf_new, yevap_pot)
2243 !
2244 ybeta(1:knon) = min(yevap(1:knon)/yevap_pot(1:knon), 1.)
2245
2246 IF (prt_level >=10) THEN
2247 DO j=1,knon
2248 print*,'y_flux_t1,yfluxlat,wakes' &
2249 & , y_flux_t1(j), yfluxlat(j), ywake_s(j)
2250 print*,'beta_prev, beta, ytsurf_new', ybeta_prev(j), ybeta(j), ytsurf_new(j)
2251 print*,'inertia,facteur,cstar', inertia, facteur,wake_cstar(j)
2252 ENDDO
2253 ENDIF ! (prt_level >=10)
2254 !
2255 ! Second call to wx_pbl0_merge and wx_pbl_dts_merge in order to take into account
2256 ! the update of the aridity coeficient beta.
2257 !
2258 CALL wx_pbl_prelim_beta(knon, dtime, ywake_s, ybeta, &
2259 BcoefQ_x, BcoefQ_w &
2260 )
2261 CALL wx_pbl0_merge(knon, ypplay, ypaprs, &
2262 ywake_s, ydTs0, ydqs0, &
2263 yt_x, yt_w, yq_x, yq_w, &
2264 yu_x, yu_w, yv_x, yv_w, &
2265 ycdragh_x, ycdragh_w, ycdragq_x, ycdragq_w, &
2266 ycdragm_x, ycdragm_w, &
2267 AcoefH_x, AcoefH_w, AcoefQ_x, AcoefQ_w, &
2268 AcoefU_x, AcoefU_w, AcoefV_x, AcoefV_w, &
2269 BcoefH_x, BcoefH_w, BcoefQ_x, BcoefQ_w, &