source: LMDZ6/trunk/libf/phylmdiso/phys_state_var_mod.F90 @ 4077

Last change on this file since 4077 was 4040, checked in by crisi, 3 years ago

mettre à jour avec le cv_gen

File size: 32.8 KB
RevLine 
[3927]1!
[3940]2! $Id: phys_state_var_mod.F90 3888 2021-05-05 10:50:37Z jyg $
[3927]3!
4      MODULE phys_state_var_mod
5! Variables sauvegardees pour le startphy.nc
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11      USE dimphy
12      USE netcdf, only: nf90_fill_real
13      INTEGER, PARAMETER :: nlevSTD=17
14      INTEGER, PARAMETER :: nlevSTD8=8
15      INTEGER, PARAMETER :: nlevSTD3=3
16      INTEGER, PARAMETER :: nout=3
17      INTEGER, PARAMETER :: napisccp=1
18      INTEGER, SAVE :: radpas  ! radiation is called every "radpas" step
19      INTEGER, SAVE :: cvpas   ! convection is called every "cvpas" step
20      INTEGER, SAVE :: cvpas_0 = 1 ! reference value for cvpas
21      INTEGER, SAVE :: wkpas   ! wake scheme is called every "wkpas" step
22      REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
23!$OMP THREADPRIVATE(radpas)
24!$OMP THREADPRIVATE(cvpas)
25!$OMP THREADPRIVATE(cvpas_0)
26!$OMP THREADPRIVATE(wkpas)
27      REAL, SAVE :: phys_tstep=0, solaire_etat0
28!$OMP THREADPRIVATE(phys_tstep, solaire_etat0)
29
30      REAL, ALLOCATABLE, SAVE :: pctsrf(:,:)
31!$OMP THREADPRIVATE(pctsrf)
32      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
33!$OMP THREADPRIVATE(ftsol)
[3940]34      REAL, ALLOCATABLE, SAVE :: beta_aridity(:,:)
35!$OMP THREADPRIVATE(beta_aridity)
[3927]36      REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
37!$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
38!FC drag des arbres
39      REAL, ALLOCATABLE, SAVE :: treedrg(:,:,:)
40!$OMP THREADPRIVATE(treedrg)
41
42!      character(len=6), SAVE :: ocean
43!!!!!!$OMP THREADPRIVATE(ocean)
44!      logical, SAVE :: ok_veget
45!!!!!!$OMP THREADPRIVATE(ok_veget)
46      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
47!$OMP THREADPRIVATE(falb1, falb2)
48
49!albedo SB >>>
50      REAL, ALLOCATABLE, SAVE :: falb_dif(:,:,:), falb_dir(:,:,:)
[3940]51      REAL, ALLOCATABLE, SAVE :: chl_con(:)
[3927]52!$OMP THREADPRIVATE(falb_dir,falb_dif,chl_con)
53!albedo SB <<<
54
55
56      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
57!$OMP THREADPRIVATE( rain_fall, snow_fall)
58      REAL, ALLOCATABLE, SAVE :: solsw(:), solswfdiff(:), sollw(:)
59!$OMP THREADPRIVATE(solsw, solswfdiff, sollw)
60      REAL, ALLOCATABLE, SAVE :: radsol(:)
61!$OMP THREADPRIVATE(radsol)
62      REAL, ALLOCATABLE, SAVE :: swradcorr(:)
63!$OMP THREADPRIVATE(swradcorr)
64#ifdef ISO
65      REAL,ALLOCATABLE,SAVE :: xtsol(:,:),fxtevap(:,:,:)
66!$OMP THREADPRIVATE(xtsol,fxtevap)
67      REAL, ALLOCATABLE, SAVE :: xtrain_fall(:,:), xtsnow_fall(:,:)
68!$OMP THREADPRIVATE(xtrain_fall,xtsnow_fall)
69#endif
70
71!clesphy0 param physiq
72!
73! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
74!
75      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
76!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
77      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
78!$OMP THREADPRIVATE(zthe, zpic, zval)
79!     REAL tabcntr0(100)
80      REAL, ALLOCATABLE, SAVE :: rugoro(:)
81!$OMP THREADPRIVATE(rugoro)
82      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
83!$OMP THREADPRIVATE(t_ancien, q_ancien)
84      REAL, ALLOCATABLE, SAVE :: ql_ancien(:,:), qs_ancien(:,:)
85!$OMP THREADPRIVATE(ql_ancien, qs_ancien)
86      REAL, ALLOCATABLE, SAVE :: prw_ancien(:), prlw_ancien(:), prsw_ancien(:)
87!$OMP THREADPRIVATE(prw_ancien, prlw_ancien, prsw_ancien)
88#ifdef ISO
89      REAL, ALLOCATABLE, SAVE :: xt_ancien(:,:,:),xtl_ancien(:,:,:),xts_ancien(:,:,:)
90!$OMP THREADPRIVATE(xt_ancien,xtl_ancien,xts_ancien)
91#endif
92      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
93!$OMP THREADPRIVATE(u_ancien, v_ancien)
94!!! RomP >>>
95      REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:)
96!$OMP THREADPRIVATE(tr_ancien)
97!!! RomP <<<
98      LOGICAL, SAVE :: ancien_ok
99!$OMP THREADPRIVATE(ancien_ok)
100      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
101!$OMP THREADPRIVATE(clwcon,rnebcon)
102      REAL, ALLOCATABLE, SAVE :: qtc_cv(:,:),sigt_cv(:,:)
103!$OMP THREADPRIVATE(qtc_cv,sigt_cv)
104      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
105!$OMP THREADPRIVATE(ratqs)
106      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
107      REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie
108      REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum
109!$OMP THREADPRIVATE(pbl_tke, coefh,coefm)
110      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
111!$OMP THREADPRIVATE(zmax0,f0)
112      REAL, ALLOCATABLE, SAVE :: sig1(:,:), w01(:,:)
113!$OMP THREADPRIVATE(sig1,w01)
114      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
115!$OMP THREADPRIVATE(entr_therm,fm_therm)
116      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
117!$OMP THREADPRIVATE(detr_therm)
118!IM 150408
119!     pour phsystoke avec thermiques
120      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
121!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
122! radiation outputs
123      REAL,ALLOCATABLE,SAVE :: swdnc0(:,:), swdn0(:,:), swdn(:,:)
124!$OMP THREADPRIVATE(swdnc0,swdn0,swdn)
125      REAL,ALLOCATABLE,SAVE :: swupc0(:,:), swup0(:,:), swup(:,:)
126!$OMP THREADPRIVATE(swupc0, swup0,swup)
127      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
128!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
129      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
130!$OMP THREADPRIVATE(SWup200clr,SWup200)
131      REAL,ALLOCATABLE,SAVE :: lwdnc0(:,:), lwdn0(:,:), lwdn(:,:)
132!$OMP THREADPRIVATE(lwdnc0,lwdn0,lwdn)
133      REAL,ALLOCATABLE,SAVE :: lwupc0(:,:), lwup0(:,:), lwup(:,:)
134!$OMP THREADPRIVATE(lwupc0,lwup0,lwup)
135      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
136!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
137      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
138!$OMP THREADPRIVATE(LWup200clr,LWup200)
139      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
140!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
141! pressure level
142      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
143!$OMP THREADPRIVATE(tsumSTD)
144      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
145!$OMP THREADPRIVATE(usumSTD,vsumSTD)
146      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
147!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
148      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
149!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
150      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
151!$OMP THREADPRIVATE(tnondef)
152      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
153!$OMP THREADPRIVATE(uvsumSTD)
154      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
155!$OMP THREADPRIVATE(vqsumSTD)
156      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
157!$OMP THREADPRIVATE(vTsumSTD)
158      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
159!$OMP THREADPRIVATE(wqsumSTD)
160      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
161!$OMP THREADPRIVATE(vphisumSTD)
162      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
163!$OMP THREADPRIVATE(wTsumSTD)
164      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
165!$OMP THREADPRIVATE(u2sumSTD)
166      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
167!$OMP THREADPRIVATE(v2sumSTD)
168      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
169!$OMP THREADPRIVATE(T2sumSTD)
170      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
171!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
172!IM begin
173      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
174!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
175      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
176!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
177      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
178!$OMP THREADPRIVATE(philevSTD)
179      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
180!$OMP THREADPRIVATE(uvSTD)
181      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
182!$OMP THREADPRIVATE(vqSTD)
183      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
184!$OMP THREADPRIVATE(vTSTD)
185      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
186!$OMP THREADPRIVATE(wqSTD)
187      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
188!$OMP THREADPRIVATE(vphiSTD)
189      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
190!$OMP THREADPRIVATE(wTSTD)
191      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
192!$OMP THREADPRIVATE(u2STD)
193      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
194!$OMP THREADPRIVATE(v2STD)
195      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
196!$OMP THREADPRIVATE(T2STD)
197      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
198!$OMP THREADPRIVATE(O3STD,O3daySTD)
199!IM end
200      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
201!$OMP THREADPRIVATE(seed_old)
202      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
203!$OMP THREADPRIVATE(zuthe,zvthe)
204      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
205!$OMP THREADPRIVATE(alb_neig)
206!cloud base mass flux
207      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
208!$OMP THREADPRIVATE(ema_cbmf)
209!cloud base pressure & cloud top pressure
210      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
211!$OMP THREADPRIVATE(ema_pcb,ema_pct)
212      REAL,ALLOCATABLE,SAVE :: Mipsh(:,:)     ! mass flux shed from  adiab. ascents
213!$OMP THREADPRIVATE(Mipsh)
214      REAL,ALLOCATABLE,SAVE :: Ma(:,:)       ! undilute upward mass flux
215!$OMP THREADPRIVATE(Ma)
216      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
217!$OMP THREADPRIVATE(qcondc)
218      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
219!$OMP THREADPRIVATE(wd)
220      REAL,ALLOCATABLE,SAVE :: sigd(:)
221!$OMP THREADPRIVATE(sigd)
222!
223      REAL,ALLOCATABLE,SAVE :: cin(:)
224!$OMP THREADPRIVATE(cin)
225! ftd : convective heating due to unsaturated downdraughts
226      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
227!$OMP THREADPRIVATE(ftd)
228! fqd : convective moistening due to unsaturated downdraughts
229      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
230!$OMP THREADPRIVATE(fqd)
231#ifdef ISO
232      REAL, ALLOCATABLE, SAVE :: fxtd(:,:,:)
233!$OMP THREADPRIVATE(fxtd)
234#endif
235!34EK
236! -- Variables de controle de ALE et ALP
237!ALE : Energie disponible pour soulevement : utilisee par la
238!      convection d'Emanuel pour le declenchement et la regulation
239      REAL,ALLOCATABLE,SAVE :: ALE(:)
240!$OMP THREADPRIVATE(ALE)
241!ALP : Puissance  disponible pour soulevement
242      REAL,ALLOCATABLE,SAVE :: ALP(:)
243!$OMP THREADPRIVATE(ALP)
244!
245! nouvelles variables pour le couplage convection-couche limite
246      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
247!$OMP THREADPRIVATE(Ale_bl)
248      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
249!$OMP THREADPRIVATE(Alp_bl)
250      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
251!$OMP THREADPRIVATE(lalim_conv)
252      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
253!$OMP THREADPRIVATE(wght_th)
254      REAL,ALLOCATABLE,SAVE    :: ale_wake(:)
255!$OMP THREADPRIVATE(ale_wake)
256      REAL,ALLOCATABLE,SAVE    :: ale_bl_stat(:)
257!$OMP THREADPRIVATE(ale_bl_stat)
258!
259! variables de la wake
260! wake_deltat : ecart de temperature avec la zone non perturbee
261! wake_deltaq : ecart d'humidite avec la zone non perturbee
262! wake_s      : fraction surfacique occupee par la poche froide
263! awake_dens  : number of active wakes per unit area
264! wake_dens   : number of wakes per unit area
[4040]265! cv_gen      : birth rate of cumulonimbus per unit area.
[3927]266! wake_occ    : occurence of wakes (= 1 if wakes occur, =0 otherwise)
267! wake_Cstar  : vitesse d'etalement de la poche
268! wake_pe     : wake potential energy - WAPE
269! wake_fip    : Gust Front Impinging power - ALP
270      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
271!$OMP THREADPRIVATE(wake_deltat)
272      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
273!$OMP THREADPRIVATE(wake_deltaq)
274#ifdef ISO
275      REAL, ALLOCATABLE, SAVE :: wake_deltaxt(:,:,:)
276!$OMP THREADPRIVATE(wake_deltaxt)
277#endif
278      REAL,ALLOCATABLE,SAVE :: wake_s(:)
279!$OMP THREADPRIVATE(wake_s)
280      REAL,ALLOCATABLE,SAVE :: awake_dens(:), wake_dens(:)
281!$OMP THREADPRIVATE(awake_dens, wake_dens)
[4040]282      REAL,ALLOCATABLE,SAVE :: cv_gen(:)
283!$OMP THREADPRIVATE(cv_gen)
[3927]284      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
285!$OMP THREADPRIVATE(wake_Cstar)
286      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
287!$OMP THREADPRIVATE(wake_pe)
288      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
289!$OMP THREADPRIVATE(wake_fip)
290!
291!jyg<
292! variables related to the spitting of the PBL between wake and
293! off-wake regions.
294! wake_delta_pbl_TKE : difference TKE_w - TKE_x
295      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
296!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
[3940]297!nrlmd<
298      REAL, ALLOCATABLE, SAVE :: delta_tsurf(:,:) ! Surface temperature difference inside-outside cold pool
299!$OMP THREADPRIVATE(delta_tsurf)
300!>nrlmd
[3927]301!>jyg
302!
303! pfrac_impa : Produits des coefs lessivage impaction
304! pfrac_nucl : Produits des coefs lessivage nucleation
305! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
306      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
307!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
308      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
309!$OMP THREADPRIVATE(pfrac_1nucl)
310!
311      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
312!$OMP THREADPRIVATE(total_rain,nday_rain)
313      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
314!$OMP THREADPRIVATE(paire_ter)
315! albsol1: albedo du sol total pour SW visible
316! albsol2: albedo du sol total pour SW proche IR
317      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
318!$OMP THREADPRIVATE(albsol1,albsol2)
319
320!albedo SB >>>
321      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
322!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
323!albedo SB <<<
324
325
326      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
327      ! column-density of ozone in a layer, in kilo-Dobsons
328      ! Third dimension has size 1 or 2.
329      ! "wo(:, :, 1)" is for the average day-night field,
330      ! "wo(:, :, 2)" is for daylight time.
331      !$OMP THREADPRIVATE(wo)
332
333! heat : chauffage solaire
334! heat0: chauffage solaire ciel clair
335! cool : refroidissement infrarouge
336! cool0 : refroidissement infrarouge ciel clair
337! sollwdown : downward LW flux at surface
338! sollwdownclr : downward CS LW flux at surface
339! toplwdown : downward CS LW flux at TOA
340! toplwdownclr : downward CS LW flux at TOA
341! heat_volc : chauffage solaire du au volcanisme
342! cool_volc : refroidissement infrarouge du au volcanisme
343      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
344!$OMP THREADPRIVATE(clwcon0,rnebcon0)
345      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
346!$OMP THREADPRIVATE(heat)
347      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
348!$OMP THREADPRIVATE(heat0)
349      REAL,ALLOCATABLE,SAVE :: cool(:,:)
350!$OMP THREADPRIVATE(cool)
351      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
352!$OMP THREADPRIVATE(cool0)
353      REAL,ALLOCATABLE,SAVE :: heat_volc(:,:)   
354!$OMP THREADPRIVATE(heat_volc)
355      REAL,ALLOCATABLE,SAVE :: cool_volc(:,:)
356!$OMP THREADPRIVATE(cool_volc)
357      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
358!$OMP THREADPRIVATE(topsw,toplw)
359      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
360!$OMP THREADPRIVATE(sollwdown)
361      REAL,ALLOCATABLE,SAVE :: gustiness(:)
362!$OMP THREADPRIVATE(gustiness)
363      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
364!$OMP THREADPRIVATE(sollwdownclr)
365      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
366!$OMP THREADPRIVATE(toplwdown)
367      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
368!$OMP THREADPRIVATE(toplwdownclr)
369      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
370!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
371      REAL,ALLOCATABLE,SAVE :: albpla(:)
372!$OMP THREADPRIVATE(albpla)
373
374!IM ajout variables CFMIP2/CMIP5
375      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
376!$OMP THREADPRIVATE(heatp, coolp)
377      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
378!$OMP THREADPRIVATE(heat0p, cool0p)
379      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
380!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
381      REAL,ALLOCATABLE,SAVE :: albplap(:)
382!$OMP THREADPRIVATE(albplap)
383      REAL,ALLOCATABLE,SAVE :: solswp(:), solswfdiffp(:), sollwp(:)
384!$OMP THREADPRIVATE(solswp, solswfdiffp, sollwp)
385      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
386!$OMP THREADPRIVATE(sollwdownp)
387      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
388      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
389!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
390      REAL,ALLOCATABLE,SAVE :: lwdnc0p(:,:), lwdn0p(:,:), lwdnp(:,:)
391      REAL,ALLOCATABLE,SAVE :: lwupc0p(:,:), lwup0p(:,:), lwupp(:,:)
392!$OMP THREADPRIVATE(lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp)
393      REAL,ALLOCATABLE,SAVE :: swdnc0p(:,:), swdn0p(:,:), swdnp(:,:)
394      REAL,ALLOCATABLE,SAVE :: swupc0p(:,:), swup0p(:,:), swupp(:,:)
395!$OMP THREADPRIVATE(swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp)
396
397! pbase : cloud base pressure
398! bbase : cloud base buoyancy
399      REAL,ALLOCATABLE,SAVE :: cape(:)
400!$OMP THREADPRIVATE(cape)
401      REAL,ALLOCATABLE,SAVE :: pbase(:)
402!$OMP THREADPRIVATE(pbase)
403      REAL,ALLOCATABLE,SAVE :: bbase(:)
404!$OMP THREADPRIVATE(bbase)
405!
406      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
407!$OMP THREADPRIVATE( zqasc)
408      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
409!$OMP THREADPRIVATE(ibas_con,itop_con)
410      REAL,SAVE,ALLOCATABLE :: rain_con(:)
411!$OMP THREADPRIVATE(rain_con)
412      REAL,SAVE,ALLOCATABLE :: snow_con(:)
413!$OMP THREADPRIVATE(snow_con)
414!
415#ifdef ISO
416      REAL,SAVE,ALLOCATABLE :: xtrain_con(:,:)
417!$OMP THREADPRIVATE(xtrain_con)
418      REAL,SAVE,ALLOCATABLE :: xtsnow_con(:,:)
419!$OMP THREADPRIVATE(xtsnow_con)
420#endif
421      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
422!$OMP THREADPRIVATE(rlonPOS)
423      REAL,SAVE,ALLOCATABLE :: newsst(:)
424!$OMP THREADPRIVATE(newsst)
425      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
426!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
427!
428! ok_ade=T -ADE=topswad-topsw
429! ok_aie=T ->
430!       ok_ade=T -AIE=topswai-topswad
431!       ok_ade=F -AIE=topswai-topsw
432!
433!topswad, solswad : Aerosol direct effect
434      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
435!$OMP THREADPRIVATE(topswad,solswad)
436!topswai, solswai : Aerosol indirect effect
437      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
438!$OMP THREADPRIVATE(topswai,solswai)
439
440      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
441!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
442      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
443!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
444      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
445!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
446      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
447!$OMP THREADPRIVATE(ccm)
448
449      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
450!$OMP THREADPRIVATE(ale_bl_trig)
451
[3940]452      REAL,SAVE,ALLOCATABLE :: ratqs_inter(:,:)
453!$OMP THREADPRIVATE(ratqs_inter)
454
[3927]455#ifdef ISO
456#ifdef ISOTRAC
457      INTEGER,SAVE,ALLOCATABLE :: bassin_map(:)
458!$OMP THREADPRIVATE(bassin_map)
459      INTEGER,SAVE,ALLOCATABLE :: boite_map(:,:)
460!$OMP THREADPRIVATE(boite_map)
461#endif   
462#endif
463      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
464      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
465      ! tendencies on wind due to gravity waves
466
467      LOGICAL,SAVE :: is_initialized=.FALSE.
468!$OMP THREADPRIVATE(is_initialized)   
469
[3940]470      ! Ocean-atmosphere interface:
[3927]471
[3940]472      REAL, ALLOCATABLE, SAVE:: ds_ns(:) ! (klon)
473      ! "delta salinity near surface". Salinity variation in the
474      ! near-surface turbulent layer. That is subskin salinity minus
475      ! foundation salinity. In ppt.
476
477      REAL, ALLOCATABLE, SAVE:: dt_ns(:) ! (klon)
478      ! "delta temperature near surface". Temperature variation in the
479      ! near-surface turbulent layer. That is subskin temperature
480      ! minus foundation temperature. (Can be negative.) In K.
481     
482      REAL, ALLOCATABLE, SAVE:: delta_sst(:) ! (klon)
483      ! Ocean-air interface temperature minus bulk SST, in
484      ! K. Allocated and defined only if activate_ocean_skin >= 1.
485
486      REAL, ALLOCATABLE, SAVE:: delta_sal(:) ! (klon)
487      ! Ocean-air interface salinity minus bulk salinity, in ppt
488     
489      !$OMP THREADPRIVATE(delta_sal, ds_ns, dt_ns, delta_sst)
490
491    CONTAINS
492
[3927]493!======================================================================
494SUBROUTINE phys_state_var_init(read_climoz)
495USE dimphy
496USE aero_mod
497USE infotrac_phy, ONLY : nbtr
498#ifdef ISO
499USE infotrac_phy, ONLY : ntraciso,niso
500#endif
501USE indice_sol_mod
[3940]502use config_ocean_skin_m, only: activate_ocean_skin
[3927]503IMPLICIT NONE
504
505integer, intent(in)::  read_climoz
506! read ozone climatology
507! Allowed values are 0, 1 and 2
508! 0: do not read an ozone climatology
509! 1: read a single ozone climatology that will be used day and night
510! 2: read two ozone climatologies, the average day and night
511! climatology and the daylight climatology
512
513include "clesphys.h"
514
[3940]515      print*, 'is_initialized', is_initialized
[3927]516      IF (is_initialized) RETURN
517      is_initialized=.TRUE.
518      ALLOCATE(pctsrf(klon,nbsrf))
519      ALLOCATE(ftsol(klon,nbsrf))
[3940]520      ALLOCATE(beta_aridity(klon,nbsrf))
[3927]521      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
522      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
523!FC
524      ALLOCATE(treedrg(klon,klev,nbsrf))
525      ALLOCATE(falb1(klon,nbsrf))
526      ALLOCATE(falb2(klon,nbsrf))
527!albedo SB >>>
[3940]528      print*, 'allocate falb'
[3927]529      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
[4040]530!!      print*, 'allocate falb good', falb_dir(1,1,1)
[3927]531      ALLOCATE(chl_con(klon))
532!albedo SB <<<
533      ALLOCATE(rain_fall(klon))
534      ALLOCATE(snow_fall(klon))
535      ALLOCATE(solsw(klon), solswfdiff(klon), sollw(klon))
536      sollw=0.0
537      ALLOCATE(radsol(klon))
538      ALLOCATE(swradcorr(klon))
539      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
540      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
541
542      ALLOCATE(rugoro(klon))
543      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
544      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
545      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
546      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
547!!! Rom P >>>
548      ALLOCATE(tr_ancien(klon,klev,nbtr))
549!!! Rom P <<<
550      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
551      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
552      ALLOCATE(ratqs(klon,klev))
553      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
554!nrlmd<
555      ALLOCATE(delta_tsurf(klon,nbsrf))
556!>nrlmd
557      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
558      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
559      ALLOCATE(zmax0(klon), f0(klon))
560      ALLOCATE(sig1(klon,klev), w01(klon,klev))
561      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
562      ALLOCATE(detr_therm(klon,klev))
563!     pour phsystoke avec thermiques
564      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
565! radiation outputs
566      ALLOCATE(swdnc0(klon,klevp1), swdn0(klon,klevp1), swdn(klon,klevp1))
567      ALLOCATE(swupc0(klon,klevp1), swup0(klon,klevp1), swup(klon,klevp1))
568      ALLOCATE(lwdnc0(klon,klevp1), lwdn0(klon,klevp1), lwdn(klon,klevp1))
569      ALLOCATE(lwupc0(klon,klevp1), lwup0(klon,klevp1), lwup(klon,klevp1))
570      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
571      ALLOCATE(SWup200clr(klon), SWup200(klon))
572      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
573      ALLOCATE(LWup200clr(klon), LWup200(klon))
574      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
575! pressure level
576      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
577      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
578      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
579      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
580      ALLOCATE(tnondef(klon,nlevSTD,nout))
581      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
582      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
583      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
584      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
585      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
586      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
587      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
588      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
589      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
590      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
591      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
592!IM beg
593      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
594      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
595      ALLOCATE(philevSTD(klon,nlevSTD))
596      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
597      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
598      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
599      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
600      ALLOCATE(T2STD(klon,nlevSTD))
601      ALLOCATE(O3STD(klon,nlevSTD))
602      ALLOCATE(O3daySTD(klon,nlevSTD))
603!IM end
604      ALLOCATE(seed_old(klon,napisccp))
605      ALLOCATE(zuthe(klon),zvthe(klon))
606      ALLOCATE(alb_neig(klon))
607!cloud base mass flux
608      ALLOCATE(ema_cbmf(klon))
609!cloud base pressure & cloud top pressure
610      ALLOCATE(ema_pcb(klon), ema_pct(klon))
611!
612      ALLOCATE(Mipsh(klon,klev))
613      ALLOCATE(Ma(klon,klev))
614      ALLOCATE(qcondc(klon,klev))
615      ALLOCATE(wd(klon))
616      ALLOCATE(sigd(klon))
617      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
618      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
619      ALLOCATE(Ale_bl(klon))
620      ALLOCATE(ale_wake(klon))
621      ALLOCATE(ale_bl_stat(klon))
622      ale_bl_stat(:)=0
623      ALLOCATE(Alp_bl(klon))
624      ALLOCATE(lalim_conv(klon))
625      ALLOCATE(wght_th(klon,klev))
626      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
627      ALLOCATE(wake_s(klon), awake_dens(klon), wake_dens(klon))
[4040]628!!      awake_dens = 0.  ! initialized in phyetat0
629      ALLOCATE(cv_gen(klon))
[3927]630      ALLOCATE(wake_Cstar(klon))
631      ALLOCATE(wake_pe(klon), wake_fip(klon))
632!jyg<
633      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
634!>jyg
635      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
636      ALLOCATE(pfrac_1nucl(klon,klev))
637      ALLOCATE(total_rain(klon), nday_rain(klon))
638      ALLOCATE(paire_ter(klon))
639      ALLOCATE(albsol1(klon), albsol2(klon))
640!albedo SB >>>
641      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
642!albedo SB <<<
643
644      if (read_climoz <= 1) then
645         ALLOCATE(wo(klon,klev, 1))
646      else
647         ! read_climoz == 2
648         ALLOCATE(wo(klon,klev, 2))
649      end if
650     
651      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
652      ALLOCATE(heat(klon,klev), heat0(klon,klev))
653      ALLOCATE(cool(klon,klev), cool0(klon,klev))
654      ALLOCATE(heat_volc(klon,klev), cool_volc(klon,klev))
655      ALLOCATE(topsw(klon), toplw(klon))
656      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
657      sollwdown = 0.
658      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
659      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
660      sollw0 = 0.
661      ALLOCATE(albpla(klon))
662!IM ajout variables CFMIP2/CMIP5
663      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
664      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
665      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
666      ALLOCATE(albplap(klon))
667      ALLOCATE(solswp(klon), solswfdiffp(klon), sollwp(klon))
668      ALLOCATE(gustiness(klon))
669      ALLOCATE(sollwdownp(klon))
670      ALLOCATE(topsw0p(klon),toplw0p(klon))
671      ALLOCATE(solsw0p(klon),sollw0p(klon))
672      ALLOCATE(lwdnc0p(klon,klevp1), lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
673      ALLOCATE(lwupc0p(klon,klevp1), lwup0p(klon,klevp1), lwupp(klon,klevp1))
674      ALLOCATE(swdnc0p(klon,klevp1), swdn0p(klon,klevp1), swdnp(klon,klevp1))
675      ALLOCATE(swupc0p(klon,klevp1), swup0p(klon,klevp1), swupp(klon,klevp1))
676
677      ALLOCATE(cape(klon))
678      ALLOCATE(pbase(klon),bbase(klon))
679      ALLOCATE(zqasc(klon,klev))
680      ALLOCATE(ibas_con(klon), itop_con(klon))
681      ALLOCATE(rain_con(klon), snow_con(klon))
682      ALLOCATE(rlonPOS(klon))
683      ALLOCATE(newsst(klon))
684      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
685      ALLOCATE(topswad(klon), solswad(klon))
686      ALLOCATE(topswai(klon), solswai(klon))
687      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
688      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
689      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
690      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
691      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
692      ALLOCATE(ccm(klon,klev,nbands))
693
694#ifdef ISO
695      ALLOCATE(xtsol(niso,klon),fxtevap(ntraciso,klon,nbsrf))
696      ALLOCATE(fxtd(ntraciso,klon,klev))
697      ALLOCATE(wake_deltaxt(ntraciso,klon,klev))
698      ALLOCATE(xt_ancien(ntraciso,klon,klev))
699      ALLOCATE(xtl_ancien(ntraciso,klon,klev))
700      ALLOCATE(xts_ancien(ntraciso,klon,klev))
701      ALLOCATE(xtrain_fall(ntraciso,klon))
702      ALLOCATE(xtsnow_fall(ntraciso,klon))
703      ALLOCATE(xtrain_con(ntraciso,klon))
704      ALLOCATE(xtsnow_con(ntraciso,klon))
705#ifdef ISOTRAC
706      ALLOCATE(bassin_map(klon))
707      ALLOCATE(boite_map(klon,klev)) 
708#endif     
709#endif
[3940]710
[3927]711      ALLOCATE(ale_bl_trig(klon))
[3940]712      ALLOCATE(ratqs_inter(klon,klev))
[3927]713      IF (ok_gwd_rando) THEN
[3940]714        ALLOCATE(du_gwd_rando(klon, klev))
[3927]715        du_gwd_rando(:,:)=0.
716      ENDIF
717      IF (.not. ok_hines .and. ok_gwd_rando) THEN
718        ALLOCATE(du_gwd_front(klon, klev))
719        du_gwd_front(:,:) = 0 !ym missing init   
720      ENDIF
[3940]721      if (activate_ocean_skin >= 1) ALLOCATE(delta_sal(klon), ds_ns(klon), &
722           dt_ns(klon), delta_sst(klon))
[3927]723
[3940]724    END SUBROUTINE phys_state_var_init
725
[3927]726!======================================================================
[3940]727    SUBROUTINE phys_state_var_end
728      ! Useful only for lmdz1d.
[3927]729!USE dimphy
730USE indice_sol_mod
[3940]731use config_ocean_skin_m, only: activate_ocean_skin
[3927]732IMPLICIT NONE
733include "clesphys.h"
734
[3940]735      DEALLOCATE(pctsrf, ftsol, falb1, falb2)
736      DEALLOCATE(beta_aridity)
737      DEALLOCATE(qsol,fevap,z0m,z0h,agesno)
[3927]738!FC
[3940]739      DEALLOCATE(treedrg)
740      DEALLOCATE(rain_fall, snow_fall, solsw, solswfdiff, sollw, radsol, swradcorr)
741      DEALLOCATE(zmea, zstd, zsig, zgam)
742      DEALLOCATE(zthe, zpic, zval)
743      DEALLOCATE(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
744      DEALLOCATE(qs_ancien, ql_ancien)
745      DEALLOCATE(prw_ancien, prlw_ancien, prsw_ancien)
746      DEALLOCATE(qtc_cv,sigt_cv)
747      DEALLOCATE(u_ancien, v_ancien)
748      DEALLOCATE(tr_ancien)                           !RomP
749      DEALLOCATE(ratqs, pbl_tke,coefh,coefm)
750      DEALLOCATE(zmax0, f0)
751      DEALLOCATE(sig1, w01)
752      DEALLOCATE(entr_therm, fm_therm)
753      DEALLOCATE(detr_therm)
754      DEALLOCATE(clwcon0th, rnebcon0th)
[3927]755! radiation outputs
[3940]756      DEALLOCATE(swdnc0, swdn0, swdn)
757      DEALLOCATE(swupc0, swup0, swup)
758      DEALLOCATE(lwdnc0, lwdn0, lwdn)
759      DEALLOCATE(lwupc0, lwup0, lwup)
760      DEALLOCATE(SWdn200clr, SWdn200)
761      DEALLOCATE(SWup200clr, SWup200)
762      DEALLOCATE(LWdn200clr, LWdn200)
763      DEALLOCATE(LWup200clr, LWup200)
764      DEALLOCATE(LWdnTOA, LWdnTOAclr)
[3927]765! pressure level
[3940]766      DEALLOCATE(tsumSTD)
767      DEALLOCATE(usumSTD, vsumSTD)
768      DEALLOCATE(wsumSTD, phisumSTD)
769      DEALLOCATE(tnondef)
770      DEALLOCATE(qsumSTD, rhsumSTD)
771      DEALLOCATE(uvsumSTD)
772      DEALLOCATE(vqsumSTD)
773      DEALLOCATE(vTsumSTD)
774      DEALLOCATE(wqsumSTD)
775      DEALLOCATE(vphisumSTD)
776      DEALLOCATE(wTsumSTD)
777      DEALLOCATE(u2sumSTD)
778      DEALLOCATE(v2sumSTD)
779      DEALLOCATE(T2sumSTD)
780      DEALLOCATE(O3sumSTD)
781      DEALLOCATE(O3daysumSTD)
[3927]782!IM beg
[3940]783      DEALLOCATE(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
784      DEALLOCATE(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
[3927]785!IM end
[3940]786      DEALLOCATE(seed_old)
787      DEALLOCATE(zuthe, zvthe)
788      DEALLOCATE(alb_neig)
789      DEALLOCATE(ema_cbmf)
790      DEALLOCATE(ema_pcb, ema_pct)
791      DEALLOCATE(Mipsh, Ma, qcondc)
792      DEALLOCATE(wd, sigd)
793      DEALLOCATE(cin, ALE, ALP)
794      DEALLOCATE(ftd, fqd)
795      DEALLOCATE(Ale_bl, Alp_bl)
796      DEALLOCATE(ale_wake)
797      DEALLOCATE(ale_bl_stat)
798      DEALLOCATE(lalim_conv, wght_th)
799      DEALLOCATE(wake_deltat, wake_deltaq)
800      DEALLOCATE(wake_s, awake_dens, wake_dens)
[4040]801      DEALLOCATE(cv_gen)
[3940]802      DEALLOCATE(wake_Cstar, wake_pe, wake_fip)
[3927]803!jyg<
[3940]804      DEALLOCATE(wake_delta_pbl_TKE)
805!nrlmd<
806      DEALLOCATE(delta_tsurf)
807!>nrlmd
[3927]808!>jyg
[3940]809      DEALLOCATE(pfrac_impa, pfrac_nucl)
810      DEALLOCATE(pfrac_1nucl)
811      DEALLOCATE(total_rain, nday_rain)
812      DEALLOCATE(paire_ter)
813      DEALLOCATE(albsol1, albsol2)
[3927]814!albedo SB >>>
[3940]815      DEALLOCATE(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
[3927]816!albedo SB <<<
[3940]817      DEALLOCATE(wo)
818      DEALLOCATE(clwcon0,rnebcon0)
819      DEALLOCATE(heat, heat0)
820      DEALLOCATE(cool, cool0)
821      DEALLOCATE(heat_volc, cool_volc)
822      DEALLOCATE(topsw, toplw)
823      DEALLOCATE(sollwdown, sollwdownclr)
824      DEALLOCATE(gustiness)
825      DEALLOCATE(toplwdown, toplwdownclr)
826      DEALLOCATE(topsw0,toplw0,solsw0,sollw0)
827      DEALLOCATE(albpla)
[3927]828!IM ajout variables CFMIP2/CMIP5
[3940]829      DEALLOCATE(heatp, coolp)
830      DEALLOCATE(heat0p, cool0p)
831      DEALLOCATE(radsolp, topswp, toplwp)
832      DEALLOCATE(albplap)
833      DEALLOCATE(solswp, solswfdiffp, sollwp)
834      DEALLOCATE(sollwdownp)
835      DEALLOCATE(topsw0p,toplw0p)
836      DEALLOCATE(solsw0p,sollw0p)
837      DEALLOCATE(lwdnc0p, lwdn0p, lwdnp)
838      DEALLOCATE(lwupc0p, lwup0p, lwupp)
839      DEALLOCATE(swdnc0p, swdn0p, swdnp)
840      DEALLOCATE(swupc0p, swup0p, swupp)
841      DEALLOCATE(cape)
842      DEALLOCATE(pbase,bbase)
843      DEALLOCATE(zqasc)
844      DEALLOCATE(ibas_con, itop_con)
845      DEALLOCATE(rain_con, snow_con)
846      DEALLOCATE(rlonPOS)
847      DEALLOCATE(newsst)
848      DEALLOCATE(ustar,u10m, v10m,wstar)
849      DEALLOCATE(topswad, solswad)
850      DEALLOCATE(topswai, solswai)
851      DEALLOCATE(tau_aero,piz_aero,cg_aero)
852      DEALLOCATE(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
853      DEALLOCATE(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
854      DEALLOCATE(ccm)
855      if (ok_gwd_rando) DEALLOCATE(du_gwd_rando)
856      if (.not. ok_hines .and. ok_gwd_rando) DEALLOCATE(du_gwd_front)
857      DEALLOCATE(ale_bl_trig)
858      DEALLOCATE(ratqs_inter)
[3927]859
[3940]860      if (activate_ocean_skin >= 1) deALLOCATE(delta_sal, ds_ns, dt_ns, &
861           delta_sst)
862
[3927]863#ifdef ISO   
[3940]864      DEALLOCATE(xtsol,fxtevap) 
865      DEALLOCATE(xt_ancien,xtl_ancien,xts_ancien, fxtd, wake_deltaxt)
866      DEALLOCATE(xtrain_fall, xtsnow_fall, xtrain_con, xtsnow_con)
[3927]867#ifdef ISOTRAC
[3940]868      DEALLOCATE(bassin_map,boite_map)
[3927]869#endif       
870#endif
871      is_initialized=.FALSE.
[3940]872     
[3927]873END SUBROUTINE phys_state_var_end
874
875      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.