source: LMDZ6/trunk/libf/phylmd/phys_state_var_mod.F90 @ 4046

Last change on this file since 4046 was 3956, checked in by jyg, 3 years ago

Bug fixes concerning various variables ill-initialized, ill-used, ill-printed, or ill-placed.
+ cv_gen moved from phys_local_var_mod.F90 to phys_state_var_mod.F90; ==> changes in physiq_mod.F90
and phys_output_write.F90
+ awake_dens added in phys_state_var_mod.F90
+ cv_gen and awake_dens now initialized in phyetat0.F90 and written in phyredem.F90
+ cv_gen, awake_dens, and solswfdiff now initialized in old_lmdz1d.F90 and scm.F90
+ useless variables suppressed in pbl_surface_mod.F90.

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