source: LMDZ5/trunk/libf/phylmd/phys_local_var_mod.F90 @ 1893

Last change on this file since 1893 was 1872, checked in by Laurent Fairhead, 11 years ago

Correction de bugs suite à l'intégration de SISVAT


Bug corrections following integration of SISVAT

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.8 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 1872 2013-09-18 12:27:33Z fairhead $
3!
4      MODULE phys_local_var_mod
5! Variables locales pour effectuer les appels en serie
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11
12      REAL, SAVE, ALLOCATABLE :: t_seri(:,:), q_seri(:,:)
13      !$OMP THREADPRIVATE(t_seri, q_seri)
14      REAL, SAVE, ALLOCATABLE :: ql_seri(:,:),qs_seri(:,:)
15      !$OMP THREADPRIVATE(ql_seri,qs_seri)
16      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
17      !$OMP THREADPRIVATE(u_seri, v_seri)
18
19      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
20      !$OMP THREADPRIVATE(tr_seri)
21      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
22      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
23      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
24      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
25!!!!
26      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
27      !$OMP THREADPRIVATE(d_tr_dyn)
28!!!!
29      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:)
30      !$OMP THREADPRIVATE(d_t_con,d_q_con)
31      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
32      !$OMP THREADPRIVATE(d_u_con,d_v_con)
33      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
34      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
35      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:)
36      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc)
37      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
38      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
39      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
40      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
41      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
42      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
43      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:)
44      !$OMP THREADPRIVATE(d_t_eva,d_q_eva)
45      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
46      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
47      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
48      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
49      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
50      !$OMP THREADPRIVATE(plul_th,plul_st)
51!tendances dues a oro et lif
52      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
53      !$OMP THREADPRIVATE(d_t_oli)
54      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
55      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
56      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_t_diss(:,:)
57      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf,d_t_diss)
58      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
59      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
60      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
61      !$OMP THREADPRIVATE(d_t_oro)
62      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
63      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
64      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
65      !$OMP THREADPRIVATE(d_t_lif)
66      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
67      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
68! Tendances Ondes de G non oro (runs strato).
69      REAL, SAVE, ALLOCATABLE :: d_u_hin(:,:)
70      !$OMP THREADPRIVATE(d_u_hin)
71      REAL, SAVE, ALLOCATABLE :: d_v_hin(:,:)
72      !$OMP THREADPRIVATE(d_v_hin)
73      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
74      !$OMP THREADPRIVATE(d_t_hin)
75
76! tendance du a la conersion Ec -> E thermique
77      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
78      !$OMP THREADPRIVATE(d_t_ec)
79      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
80      !$OMP THREADPRIVATE(d_ts, d_tr)
81
82! diagnostique pour le rayonnement
83      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
84      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
85      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
86      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
87      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
88      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
89      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
90      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
91      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
92      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
93      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
94      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
95      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
96      !$OMP THREADPRIVATE(tausum_aero)
97      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
98      !$OMP THREADPRIVATE(tau3d_aero)
99      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
100      !$OMP THREADPRIVATE(scdnc)
101      REAL, SAVE, ALLOCATABLE :: cldncl(:)
102      !$OMP THREADPRIVATE(cldncl)
103      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
104      !$OMP THREADPRIVATE(reffclwtop)
105      REAL, SAVE, ALLOCATABLE :: lcc(:)
106      !$OMP THREADPRIVATE(lcc)
107      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
108      !$OMP THREADPRIVATE(reffclws)
109      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
110      !$OMP THREADPRIVATE(reffclwc)
111      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
112      !$OMP THREADPRIVATE(cldnvi)
113      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
114      !$OMP THREADPRIVATE(lcc3d)
115      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
116      !$OMP THREADPRIVATE(lcc3dcon)
117      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
118      !$OMP THREADPRIVATE(lcc3dstra)
119      REAL, SAVE, ALLOCATABLE :: od550aer(:)
120      !$OMP THREADPRIVATE(od550aer)
121      REAL, SAVE, ALLOCATABLE :: absvisaer(:)
122      !$OMP THREADPRIVATE(absvisaer)
123      REAL, SAVE, ALLOCATABLE :: od865aer(:)
124      !$OMP THREADPRIVATE(od865aer)
125      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
126      !$OMP THREADPRIVATE(ec550aer)
127      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
128      !$OMP THREADPRIVATE(od550lt1aer)
129      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
130      !$OMP THREADPRIVATE(sconcso4)
131      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
132      !$OMP THREADPRIVATE(sconcoa)
133      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
134      !$OMP THREADPRIVATE(sconcbc)
135      REAL, SAVE, ALLOCATABLE :: sconcss(:)
136      !$OMP THREADPRIVATE(sconcss)
137      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
138      !$OMP THREADPRIVATE(sconcdust)
139      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
140      !$OMP THREADPRIVATE(concso4)
141      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
142      !$OMP THREADPRIVATE(concoa)
143      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
144      !$OMP THREADPRIVATE(concbc)
145      REAL, SAVE, ALLOCATABLE :: concss(:,:)
146      !$OMP THREADPRIVATE(concss)
147      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
148      !$OMP THREADPRIVATE(concdust)
149      REAL, SAVE, ALLOCATABLE :: loadso4(:)
150      !$OMP THREADPRIVATE(loadso4)
151      REAL, SAVE, ALLOCATABLE :: loadoa(:)
152      !$OMP THREADPRIVATE(loadoa)
153      REAL, SAVE, ALLOCATABLE :: loadbc(:)
154      !$OMP THREADPRIVATE(loadbc)
155      REAL, SAVE, ALLOCATABLE :: loadss(:)
156      !$OMP THREADPRIVATE(loadss)
157      REAL, SAVE, ALLOCATABLE :: loaddust(:)
158      !$OMP THREADPRIVATE(loaddust)
159      REAL, SAVE, ALLOCATABLE :: load_tmp1(:)
160      !$OMP THREADPRIVATE(load_tmp1)
161      REAL, SAVE, ALLOCATABLE :: load_tmp2(:)
162      !$OMP THREADPRIVATE(load_tmp2)
163      REAL, SAVE, ALLOCATABLE :: load_tmp3(:)
164      !$OMP THREADPRIVATE(load_tmp3)
165      REAL, SAVE, ALLOCATABLE :: load_tmp4(:)
166      !$OMP THREADPRIVATE(load_tmp4)
167      REAL, SAVE, ALLOCATABLE :: load_tmp5(:)
168      !$OMP THREADPRIVATE(load_tmp5)
169      REAL, SAVE, ALLOCATABLE :: load_tmp6(:)
170      !$OMP THREADPRIVATE(load_tmp6)
171      REAL, SAVE, ALLOCATABLE :: load_tmp7(:)
172      !$OMP THREADPRIVATE(load_tmp7)
173
174!IM ajout variables CFMIP2/CMIP5
175      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
176!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
177      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
178!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
179      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
180!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
181      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
182!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
183      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
184!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
185      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
186!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
187
188
189!Ajout de celles nécessaires au phys_output_write_mod
190      REAL, SAVE, ALLOCATABLE :: slp(:)
191!$OMP THREADPRIVATE(slp)
192      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
193!$OMP THREADPRIVATE(sens, flwp, fiwp)
194      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_wake, alp_wake, bils
195!$OMP THREADPRIVATE(ale_wake, alp_wake, bils)
196      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
197!$OMP THREADPRIVATE(cdragm, cdragh)
198      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m, qsol
199!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m, qsol)
200      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, fder, plcl, plfc, prw
201!$OMP THREADPRIVATE(dthmin, evap, fder, plcl, plfc, prw)
202      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
203!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
204      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
205!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
206      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
207!$OMP THREADPRIVATE(slab_wfbils)
208      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, ve, vq, zxffonte
209!$OMP THREADPRIVATE(tpot, tpote, ue, uq, ve, vq, zxffonte)
210      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
211!$OMP THREADPRIVATE(zxfqcalving)
212      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxrugs, zxtsol, snow_lsc, zxfqfonte
213!$OMP THREADPRIVATE(zxfluxlat, zxrugs, zxtsol, snow_lsc, zxfqfonte)
214      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc
215!$OMP THREADPRIVATE(zxqsurf, rain_lsc)
216      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wake_h, wbeff, zmax_th, zq2m, zt2m
217!$OMP THREADPRIVATE(wake_h, wbeff, zmax_th, zq2m, zt2m)
218      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
219!$OMP THREADPRIVATE(weak_inversion)
220      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_bl_stat,alp_bl_conv,alp_bl_det
221!$OMP THREADPRIVATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
222      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
223!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
224      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
225!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
226      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
227!$OMP THREADPRIVATE(proba_notrig, random_notrig)
228      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
229!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
230      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fevap, fluxlat, fsollw,evap_pot
231!$OMP THREADPRIVATE(t2m, fevap, fluxlat, fsollw,evap_pot)
232      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
233!$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
234!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
235      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
236!$OMP THREADPRIVATE(lambda_th)
237      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
238!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
239      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
240!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
241      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wake_omg, zx_rh
242!$OMP THREADPRIVATE(wake_omg, zx_rh)
243      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: frugs, agesno
244!$OMP THREADPRIVATE(frugs, agesno)
245      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
246!$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
247      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
248!$OMP THREADPRIVATE(Vprecip, zw2)
249      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
250!$OMP THREADPRIVATE(pmfd, pmfu)
251      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
252!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
253      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
254!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
255      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
256!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
257
258! ug et d'autres encore:
259      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
260!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
261      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
262!$OMP THREADPRIVATE(beta_prec)
263      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb
264!$OMP THREADPRIVATE(rneb)
265
266! variables de sorties MM
267      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
268      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
269!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
270!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
271
272CONTAINS
273
274!======================================================================
275SUBROUTINE phys_local_var_init
276USE dimphy
277USE infotrac, ONLY : nbtr
278USE aero_mod
279USE indice_sol_mod
280USE phys_output_var_mod
281USE phys_state_var_mod
282
283IMPLICIT NONE
284      allocate(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev))
285      allocate(u_seri(klon,klev),v_seri(klon,klev))
286
287      allocate(tr_seri(klon,klev,nbtr))
288      allocate(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
289      allocate(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
290      allocate(d_tr_dyn(klon,klev,nbtr))                   !RomP
291      allocate(d_t_con(klon,klev),d_q_con(klon,klev))
292      allocate(d_u_con(klon,klev),d_v_con(klon,klev))
293      allocate(d_t_wake(klon,klev),d_q_wake(klon,klev))
294      allocate(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
295      allocate(d_ql_lsc(klon,klev))
296      allocate(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
297      allocate(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
298      allocate(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
299      allocate(d_t_eva(klon,klev),d_q_eva(klon,klev))
300      allocate(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
301      allocate(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
302      allocate(plul_st(klon),plul_th(klon))
303      allocate(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
304      allocate(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
305      allocate(d_t_oli(klon,klev),d_t_oro(klon,klev))
306      allocate(d_u_oli(klon,klev),d_v_oli(klon,klev))
307      allocate(d_u_oro(klon,klev),d_v_oro(klon,klev))
308      allocate(d_t_lif(klon,klev),d_t_ec(klon,klev))
309      allocate(d_u_lif(klon,klev),d_v_lif(klon,klev))
310      allocate(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
311      allocate(topswad_aero(klon), solswad_aero(klon))
312      allocate(topswai_aero(klon), solswai_aero(klon))
313      allocate(topswad0_aero(klon), solswad0_aero(klon))
314      allocate(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
315      allocate(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
316      allocate(topswcf_aero(klon,3), solswcf_aero(klon,3))
317      allocate(d_u_hin(klon,klev),d_v_hin(klon,klev),d_t_hin(klon,klev))
318      allocate(tausum_aero(klon,nwave,naero_spc))
319      allocate(tau3d_aero(klon,klev,nwave,naero_spc))
320      allocate(scdnc(klon, klev))
321      allocate(cldncl(klon))
322      allocate(reffclwtop(klon))
323      allocate(lcc(klon))
324      allocate(reffclws(klon, klev))
325      allocate(reffclwc(klon, klev))
326      allocate(cldnvi(klon))
327      allocate(lcc3d(klon, klev))
328      allocate(lcc3dcon(klon, klev))
329      allocate(lcc3dstra(klon, klev))
330      allocate(od550aer(klon))   
331      allocate(od865aer(klon))   
332      allocate(absvisaer(klon)) 
333      allocate(ec550aer(klon,klev))
334      allocate(od550lt1aer(klon))               
335      allocate(sconcso4(klon))
336      allocate(sconcoa(klon))
337      allocate(sconcbc(klon))
338      allocate(sconcss(klon))
339      allocate(sconcdust(klon))
340      allocate(concso4(klon,klev))
341      allocate(concoa(klon,klev))
342      allocate(concbc(klon,klev))
343      allocate(concss(klon,klev))
344      allocate(concdust(klon,klev))
345      allocate(loadso4(klon))
346      allocate(loadoa(klon))
347      allocate(loadbc(klon))
348      allocate(loadss(klon))
349      allocate(loaddust(klon))
350      allocate(load_tmp1(klon))
351      allocate(load_tmp2(klon))
352      allocate(load_tmp3(klon))
353      allocate(load_tmp4(klon))
354      allocate(load_tmp5(klon))
355      allocate(load_tmp6(klon))
356      allocate(load_tmp7(klon))
357
358!IM ajout variables CFMIP2/CMIP5
359      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
360      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
361      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
362      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
363      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
364      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
365
366! FH Ajout de celles nécessaires au phys_output_write_mod
367
368      ALLOCATE(slp(klon))
369      ALLOCATE(ale_wake(klon), alp_wake(klon), bils(klon))
370      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
371      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon), qsol(klon))
372      ALLOCATE(dthmin(klon), evap(klon), fder(klon), plcl(klon), plfc(klon))
373      ALLOCATE(prw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
374      ALLOCATE(s_lcl(klon))
375      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
376      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
377      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
378      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon), zxrugs(klon))
379      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
380      ALLOCATE(rain_lsc(klon), wake_h(klon), wbeff(klon), zmax_th(klon))
381      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
382      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
383      ALLOCATE(ale_bl_stat(klon), alp_bl_conv(klon), alp_bl_det(klon))
384      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
385      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
386      ALLOCATE(proba_notrig(klon), random_notrig(klon))
387
388      ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
389!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
390      ALLOCATE(upwd(klon, klev), omega(klon, klev))
391!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
392      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
393      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
394      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
395      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
396      ALLOCATE(zphi(klon, klev), wake_omg(klon, klev), zx_rh(klon, klev))
397      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
398
399      ALLOCATE(t2m(klon, nbsrf), fevap(klon, nbsrf), fluxlat(klon, nbsrf))
400      ALLOCATE(frugs(klon, nbsrf), agesno(klon, nbsrf), fsollw(klon, nbsrf))
401      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
402      ALLOCATE(evap_pot(klon, nbsrf))
403
404      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
405      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
406      ALLOCATE(zw2(klon, klev+1))
407
408      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
409      ALLOCATE(fluxt(klon, klev, nbsrf))
410
411      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
412      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
413      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
414      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
415
416! ug et d'autres encore:
417      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
418      ALLOCATE(beta_prec(klon,klev))
419      ALLOCATE(rneb(klon,klev))
420
421
422      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
423      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
424
425
426
427END SUBROUTINE phys_local_var_init
428
429!======================================================================
430SUBROUTINE phys_local_var_end
431USE dimphy
432USE indice_sol_mod
433IMPLICIT NONE
434      deallocate(t_seri,q_seri,ql_seri,qs_seri)
435      deallocate(u_seri,v_seri)
436
437      deallocate(tr_seri)
438      deallocate(d_t_dyn,d_q_dyn)
439      deallocate(d_u_dyn,d_v_dyn)
440      deallocate(d_tr_dyn)                      !RomP
441      deallocate(d_t_con,d_q_con)
442      deallocate(d_u_con,d_v_con)
443      deallocate(d_t_wake,d_q_wake)
444      deallocate(d_t_lsc,d_q_lsc)
445      deallocate(d_ql_lsc)
446      deallocate(d_t_ajsb,d_q_ajsb)
447      deallocate(d_t_ajs,d_q_ajs)
448      deallocate(d_u_ajs,d_v_ajs)
449      deallocate(d_t_eva,d_q_eva)
450      deallocate(d_t_lscst,d_q_lscst)
451      deallocate(d_t_lscth,d_q_lscth)
452      deallocate(plul_st,plul_th)
453      deallocate(d_t_vdf,d_q_vdf,d_t_diss)
454      deallocate(d_u_vdf,d_v_vdf)
455      deallocate(d_t_oli,d_t_oro)
456      deallocate(d_u_oli,d_v_oli)
457      deallocate(d_u_oro,d_v_oro)
458      deallocate(d_t_lif,d_t_ec)
459      deallocate(d_u_lif,d_v_lif)
460      deallocate(d_ts, d_tr)
461      deallocate(topswad_aero,solswad_aero)
462      deallocate(topswai_aero,solswai_aero)
463      deallocate(topswad0_aero,solswad0_aero)
464      deallocate(topsw_aero,solsw_aero)
465      deallocate(topsw0_aero,solsw0_aero)
466      deallocate(topswcf_aero,solswcf_aero)
467      deallocate(tausum_aero)
468      deallocate(tau3d_aero)
469      deallocate(scdnc)
470      deallocate(cldncl)
471      deallocate(reffclwtop)
472      deallocate(lcc)
473      deallocate(reffclws)
474      deallocate(reffclwc)
475      deallocate(cldnvi)
476      deallocate(lcc3d)
477      deallocate(lcc3dcon)
478      deallocate(lcc3dstra)
479      deallocate(od550aer)       
480      deallocate(od865aer)
481      deallocate(absvisaer)
482      deallocate(ec550aer)
483      deallocate(od550lt1aer)
484      deallocate(sconcso4)
485      deallocate(sconcoa)
486      deallocate(sconcbc)
487      deallocate(sconcss)
488      deallocate(sconcdust)
489      deallocate(concso4)
490      deallocate(concoa)
491      deallocate(concbc)
492      deallocate(concss)
493      deallocate(concdust)
494      deallocate(loadso4)
495      deallocate(loadoa)
496      deallocate(loadbc)
497      deallocate(loadss)
498      deallocate(loaddust)
499      deallocate(load_tmp1)
500      deallocate(load_tmp2)
501      deallocate(load_tmp3)
502      deallocate(load_tmp4)
503      deallocate(load_tmp5)
504      deallocate(load_tmp6)
505      deallocate(load_tmp7)
506      deallocate(d_u_hin,d_v_hin,d_t_hin)
507
508!IM ajout variables CFMIP2/CMIP5
509      deallocate(topswad_aerop, solswad_aerop)
510      deallocate(topswai_aerop, solswai_aerop)
511      deallocate(topswad0_aerop, solswad0_aerop)
512      deallocate(topsw_aerop, topsw0_aerop)
513      deallocate(solsw_aerop, solsw0_aerop)
514      deallocate(topswcf_aerop, solswcf_aerop)
515
516
517! FH Ajout de celles nécessaires au phys_output_write_mod
518      DEALLOCATE(slp)
519      DEALLOCATE(ale_wake, alp_wake, bils)
520      DEALLOCATE(cdragm, cdragh, cldh, cldl)
521      DEALLOCATE(cldm, cldq, cldt, qsat2m, qsol)
522      DEALLOCATE(dthmin, evap, fder, plcl, plfc)
523      DEALLOCATE(prw, zustar, zu10m, zv10m, rh2m, s_lcl)
524      DEALLOCATE(s_pblh, s_pblt, s_therm)
525      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
526      DEALLOCATE(uq, ve, vq, zxffonte)
527      DEALLOCATE(zxfqcalving, zxfluxlat, zxrugs)
528      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
529      DEALLOCATE(rain_lsc, wake_h, wbeff, zmax_th)
530      DEALLOCATE(zq2m, zt2m, weak_inversion)
531      DEALLOCATE(sens, flwp, fiwp)
532      DEALLOCATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
533      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
534      DEALLOCATE(alp_bl_stat, n2, s2)
535      DEALLOCATE(proba_notrig, random_notrig)
536
537      DEALLOCATE(dnwd, dnwd0)
538!      DEALLOCATE(upwd, omega, coefh)
539      DEALLOCATE(upwd, omega)
540!      DEALLOCATE(coefm, lambda_th, cldemi)
541      DEALLOCATE(lambda_th, cldemi)
542      DEALLOCATE(cldfra, cldtau, fiwc)
543      DEALLOCATE(fl, re, flwc)
544      DEALLOCATE(ref_liq, ref_ice, theta)
545      DEALLOCATE(zphi, wake_omg, zx_rh)
546      DEALLOCATE(pmfd, pmfu)
547
548      DEALLOCATE(t2m, fevap, fluxlat)
549      DEALLOCATE(frugs, agesno, fsollw, evap_pot)
550      DEALLOCATE(fsolsw, wfbils, wfbilo)
551
552      DEALLOCATE(pmflxr, pmflxs, prfl)
553      DEALLOCATE(psfl, fraca, Vprecip)
554      DEALLOCATE(zw2)
555
556      DEALLOCATE(fluxu, fluxv)
557      DEALLOCATE(fluxt)
558
559      DEALLOCATE(uwriteSTD, vwriteSTD)
560      DEALLOCATE(wwriteSTD, phiwriteSTD)
561      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
562
563! ug et d'autres encore:
564      DEALLOCATE(wdtrainA, wdtrainM)
565      DEALLOCATE(beta_prec)
566      DEALLOCATE(rneb)
567      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
568
569END SUBROUTINE phys_local_var_end
570
571END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.