source: LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90 @ 1705

Last change on this file since 1705 was 1670, checked in by idelkadi, 12 years ago

Modifications for inclusion of chimere dust emission module :
u* is passed from the boundary layer parameterization to the physics
main routine (physiq.F) and then to phytrac, traclmdz and change_srf_frac.
The interface of traclmdz is enriched with 4 other variables.
Also u* and the vertically cumulated amount of tracers is added in the
outputs.

Modifications pour l'inclusion du module d'émission de poussière de Chimere :
u* est passé depuis la couche limite vers le programme principal de la
physique (physiq.F) et ensuite à phytrac, traclmdz et change_srf_frac.
L'interface de traclmdz est enrichie avec 4 autres variables.
Les variables u* et les cumuls verticaux des traceurs sont ajoutés
dans les sorties.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.9 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 1670 2012-10-17 08:42:04Z emillour $
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      INTEGER, PARAMETER :: nlevSTD=17
13      INTEGER, PARAMETER :: nlevSTD8=8
14      INTEGER, PARAMETER :: nlevSTD3=3
15      INTEGER, PARAMETER :: nout=3
16      INTEGER, PARAMETER :: napisccp=1
17      INTEGER, SAVE :: radpas
18!$OMP THREADPRIVATE(radpas)
19      REAL, SAVE :: dtime, solaire_etat0
20!$OMP THREADPRIVATE(dtime, solaire_etat0)
21
22      REAL, ALLOCATABLE, SAVE :: rlat(:), rlon(:), pctsrf(:,:)
23!$OMP THREADPRIVATE(rlat, rlon, pctsrf)
24      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
25!$OMP THREADPRIVATE(ftsol)
26!      character(len=6), SAVE :: ocean
27!!!!!!$OMP THREADPRIVATE(ocean)
28!      logical, SAVE :: ok_veget
29!!!!!!$OMP THREADPRIVATE(ok_veget)
30      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
31!$OMP THREADPRIVATE(falb1, falb2)
32      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
33!$OMP THREADPRIVATE( rain_fall, snow_fall)
34      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
35!$OMP THREADPRIVATE(solsw, sollw)
36      REAL, ALLOCATABLE, SAVE :: radsol(:)
37!$OMP THREADPRIVATE(radsol)
38
39!clesphy0 param physiq
40!
41! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
42!
43      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
44!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
45      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
46!$OMP THREADPRIVATE(zthe, zpic, zval)
47!     REAL tabcntr0(100)
48      REAL, ALLOCATABLE, SAVE :: rugoro(:)
49!$OMP THREADPRIVATE(rugoro)
50      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
51!$OMP THREADPRIVATE(t_ancien, q_ancien)
52      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
53!$OMP THREADPRIVATE(u_ancien, v_ancien)
54      LOGICAL, SAVE :: ancien_ok
55!$OMP THREADPRIVATE(ancien_ok)
56      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
57!$OMP THREADPRIVATE(clwcon,rnebcon)
58      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
59!$OMP THREADPRIVATE(ratqs)
60      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
61!$OMP THREADPRIVATE(pbl_tke)
62      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
63!$OMP THREADPRIVATE(zmax0,f0)
64      REAL, ALLOCATABLE, SAVE :: ema_work1(:,:), ema_work2(:,:)
65!$OMP THREADPRIVATE(ema_work1,ema_work2)
66      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
67!$OMP THREADPRIVATE(entr_therm,fm_therm)
68      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
69!$OMP THREADPRIVATE(detr_therm)
70!IM 150408
71!     pour phsystoke avec thermiques
72      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
73!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
74! radiation outputs
75      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
76!$OMP THREADPRIVATE(swdn0,swdn)
77      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
78!$OMP THREADPRIVATE(swup0,swup)
79      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
80!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
81      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
82!$OMP THREADPRIVATE(SWup200clr,SWup200)
83      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
84!$OMP THREADPRIVATE(lwdn0,lwdn)
85      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
86!$OMP THREADPRIVATE(lwup0,lwup)
87      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
88!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
89      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
90!$OMP THREADPRIVATE(LWup200clr,LWup200)
91      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
92!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
93! pressure level
94      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
95!$OMP THREADPRIVATE(tsumSTD)
96      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
97!$OMP THREADPRIVATE(usumSTD,vsumSTD)
98      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
99!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
100      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
101!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
102      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
103!$OMP THREADPRIVATE(tnondef)
104      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
105!$OMP THREADPRIVATE(uvsumSTD)
106      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
107!$OMP THREADPRIVATE(vqsumSTD)
108      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
109!$OMP THREADPRIVATE(vTsumSTD)
110      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
111!$OMP THREADPRIVATE(wqsumSTD)
112      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
113!$OMP THREADPRIVATE(vphisumSTD)
114      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
115!$OMP THREADPRIVATE(wTsumSTD)
116      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
117!$OMP THREADPRIVATE(u2sumSTD)
118      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
119!$OMP THREADPRIVATE(v2sumSTD)
120      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
121!$OMP THREADPRIVATE(T2sumSTD)
122      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
123!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
124!IM begin
125      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
126!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
127      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
128!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
129      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
130!$OMP THREADPRIVATE(philevSTD)
131      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
132!$OMP THREADPRIVATE(uvSTD)
133      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
134!$OMP THREADPRIVATE(vqSTD)
135      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
136!$OMP THREADPRIVATE(vTSTD)
137      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
138!$OMP THREADPRIVATE(wqSTD)
139      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
140!$OMP THREADPRIVATE(vphiSTD)
141      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
142!$OMP THREADPRIVATE(wTSTD)
143      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
144!$OMP THREADPRIVATE(u2STD)
145      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
146!$OMP THREADPRIVATE(v2STD)
147      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
148!$OMP THREADPRIVATE(T2STD)
149      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
150!$OMP THREADPRIVATE(O3STD,O3daySTD)
151!IM end
152      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
153!$OMP THREADPRIVATE(seed_old)
154      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
155!$OMP THREADPRIVATE(zuthe,zvthe)
156      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
157!$OMP THREADPRIVATE(alb_neig)
158!cloud base mass flux
159      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
160!$OMP THREADPRIVATE(ema_cbmf)
161!cloud base pressure & cloud top pressure
162      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
163!$OMP THREADPRIVATE(ema_pcb,ema_pct)
164      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
165!$OMP THREADPRIVATE(Ma)
166      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
167!$OMP THREADPRIVATE(qcondc)
168      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
169!$OMP THREADPRIVATE(wd)
170      REAL,ALLOCATABLE,SAVE :: sigd(:)
171!$OMP THREADPRIVATE(sigd)
172!
173      REAL,ALLOCATABLE,SAVE :: cin(:)
174!$OMP THREADPRIVATE(cin)
175! ftd : differential heating between wake and environment
176      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
177!$OMP THREADPRIVATE(ftd)
178! fqd : differential moistening between wake and environment
179      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
180!$OMP THREADPRIVATE(fqd)
181!34EK
182! -- Variables de controle de ALE et ALP
183!ALE : Energie disponible pour soulevement : utilisee par la
184!      convection d'Emanuel pour le declenchement et la regulation
185      REAL,ALLOCATABLE,SAVE :: ALE(:)
186!$OMP THREADPRIVATE(ALE)
187!ALP : Puissance  disponible pour soulevement
188      REAL,ALLOCATABLE,SAVE :: ALP(:)
189!$OMP THREADPRIVATE(ALP)
190!
191! nouvelles variables pour le couplage convection-couche limite
192      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
193!$OMP THREADPRIVATE(Ale_bl)
194      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
195!$OMP THREADPRIVATE(Alp_bl)
196      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
197!$OMP THREADPRIVATE(lalim_conv)
198      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
199!$OMP THREADPRIVATE(wght_th)
200!
201! variables de la wake
202! wake_deltat : ecart de temperature avec la zone non perturbee
203! wake_deltaq : ecart d'humidite avec la zone non perturbee
204! wake_Cstar  : vitesse d'etalement de la poche
205! wake_s      : fraction surfacique occupee par la poche froide
206! wake_pe     : wake potential energy - WAPE
207! wake_fip    : Gust Front Impinging power - ALP
208! dt_wake, dq_wake: LS tendencies due to wake
209      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
210!$OMP THREADPRIVATE(wake_deltat)
211      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
212!$OMP THREADPRIVATE(wake_deltaq)
213      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
214!$OMP THREADPRIVATE(wake_Cstar)
215      REAL,ALLOCATABLE,SAVE :: wake_s(:)
216!$OMP THREADPRIVATE(wake_s)
217      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
218!$OMP THREADPRIVATE(wake_pe)
219      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
220!$OMP THREADPRIVATE(wake_fip)
221      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
222!$OMP THREADPRIVATE(dt_wake)
223      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
224!$OMP THREADPRIVATE(dq_wake)
225!
226! pfrac_impa : Produits des coefs lessivage impaction
227! pfrac_nucl : Produits des coefs lessivage nucleation
228! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
229      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
230!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
231      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
232!$OMP THREADPRIVATE(pfrac_1nucl)
233!
234      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
235!$OMP THREADPRIVATE(total_rain,nday_rain)
236      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
237!$OMP THREADPRIVATE(paire_ter)
238! albsol1: albedo du sol total pour SW visible
239! albsol2: albedo du sol total pour SW proche IR
240      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
241!$OMP THREADPRIVATE(albsol1,albsol2)
242
243      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
244      ! column-density of ozone in a layer, in kilo-Dobsons
245      ! Third dimension has size 1 or 2.
246      ! "wo(:, :, 1)" is for the average day-night field,
247      ! "wo(:, :, 2)" is for daylight time.
248      !$OMP THREADPRIVATE(wo)
249
250! heat : chauffage solaire
251! heat0: chauffage solaire ciel clair
252! cool : refroidissement infrarouge
253! cool0 : refroidissement infrarouge ciel clair
254! sollwdown : downward LW flux at surface
255! sollwdownclr : downward CS LW flux at surface
256! toplwdown : downward CS LW flux at TOA
257! toplwdownclr : downward CS LW flux at TOA
258      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
259!$OMP THREADPRIVATE(clwcon0,rnebcon0)
260      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
261!$OMP THREADPRIVATE(heat)
262      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
263!$OMP THREADPRIVATE(heat0)
264      REAL,ALLOCATABLE,SAVE :: cool(:,:)
265!$OMP THREADPRIVATE(cool)
266      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
267!$OMP THREADPRIVATE(cool0)
268      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
269!$OMP THREADPRIVATE(topsw,toplw)
270      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
271!$OMP THREADPRIVATE(sollwdown)
272      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
273!$OMP THREADPRIVATE(sollwdownclr)
274      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
275!$OMP THREADPRIVATE(toplwdown)
276      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
277!$OMP THREADPRIVATE(toplwdownclr)
278      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
279!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
280      REAL,ALLOCATABLE,SAVE :: albpla(:)
281!$OMP THREADPRIVATE(albpla)
282
283!IM ajout variables CFMIP2/CMIP5
284      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
285!$OMP THREADPRIVATE(heatp, coolp)
286      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
287!$OMP THREADPRIVATE(heat0p, cool0p)
288      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
289!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
290      REAL,ALLOCATABLE,SAVE :: albplap(:)
291!$OMP THREADPRIVATE(albplap)
292      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
293!$OMP THREADPRIVATE(solswp, sollwp)
294      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
295!$OMP THREADPRIVATE(sollwdownp)
296      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
297      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
298!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
299      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
300      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
301!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
302      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
303      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
304!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
305
306! pbase : cloud base pressure
307! bbase : cloud base buoyancy
308      REAL,ALLOCATABLE,SAVE :: cape(:)
309!$OMP THREADPRIVATE(cape)
310      REAL,ALLOCATABLE,SAVE :: pbase(:)
311!$OMP THREADPRIVATE(pbase)
312      REAL,ALLOCATABLE,SAVE :: bbase(:)
313!$OMP THREADPRIVATE(bbase)
314!
315      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
316!$OMP THREADPRIVATE( zqasc)
317      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
318!$OMP THREADPRIVATE(ibas_con,itop_con)
319      REAL,SAVE,ALLOCATABLE :: rain_con(:)
320!$OMP THREADPRIVATE(rain_con)
321      REAL,SAVE,ALLOCATABLE :: snow_con(:)
322!$OMP THREADPRIVATE(snow_con)
323!
324      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
325!$OMP THREADPRIVATE(rlonPOS)
326      REAL,SAVE,ALLOCATABLE :: newsst(:)
327!$OMP THREADPRIVATE(newsst)
328      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:)
329!$OMP THREADPRIVATE(ustar,u10m,v10m)
330!
331! ok_ade=T -ADE=topswad-topsw
332! ok_aie=T ->
333!       ok_ade=T -AIE=topswai-topswad
334!       ok_ade=F -AIE=topswai-topsw
335!
336!topswad, solswad : Aerosol direct effect
337      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
338!$OMP THREADPRIVATE(topswad,solswad)
339!topswai, solswai : Aerosol indirect effect
340      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
341!$OMP THREADPRIVATE(topswai,solswai)
342
343      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
344!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
345      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
346!$OMP THREADPRIVATE(ccm)
347
348!!! nrlmd le 10/04/2012
349      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
350!$OMP THREADPRIVATE(ale_bl_trig)
351!!! fin nrlmd le 10/04/2012
352
353CONTAINS
354
355!======================================================================
356SUBROUTINE phys_state_var_init(read_climoz)
357use dimphy
358USE control_mod
359use aero_mod
360IMPLICIT NONE
361
362integer, intent(in)::  read_climoz
363! read ozone climatology
364! Allowed values are 0, 1 and 2
365! 0: do not read an ozone climatology
366! 1: read a single ozone climatology that will be used day and night
367! 2: read two ozone climatologies, the average day and night
368! climatology and the daylight climatology
369
370#include "indicesol.h"
371      ALLOCATE(rlat(klon), rlon(klon))
372      ALLOCATE(pctsrf(klon,nbsrf))
373      ALLOCATE(ftsol(klon,nbsrf))
374      ALLOCATE(falb1(klon,nbsrf))
375      ALLOCATE(falb2(klon,nbsrf))
376      ALLOCATE(rain_fall(klon))
377      ALLOCATE(snow_fall(klon))
378      ALLOCATE(solsw(klon), sollw(klon))
379      ALLOCATE(radsol(klon))
380      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
381      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
382
383      ALLOCATE(rugoro(klon))
384      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
385      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
386      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
387      ALLOCATE(ratqs(klon,klev))
388      ALLOCATE(pbl_tke(klon,klev+1,nbsrf))
389      ALLOCATE(zmax0(klon), f0(klon))
390      ALLOCATE(ema_work1(klon,klev), ema_work2(klon,klev))
391      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
392      ALLOCATE(detr_therm(klon,klev))
393!     pour phsystoke avec thermiques
394      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
395! radiation outputs
396      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
397      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
398      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
399      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
400      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
401      ALLOCATE(SWup200clr(klon), SWup200(klon))
402      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
403      ALLOCATE(LWup200clr(klon), LWup200(klon))
404      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
405! pressure level
406      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
407      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
408      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
409      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
410      ALLOCATE(tnondef(klon,nlevSTD,nout))
411      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
412      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
413      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
414      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
415      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
416      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
417      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
418      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
419      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
420      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
421      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
422!IM beg
423      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
424      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
425      ALLOCATE(philevSTD(klon,nlevSTD))
426      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
427      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
428      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
429      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
430      ALLOCATE(T2STD(klon,nlevSTD))
431      ALLOCATE(O3STD(klon,nlevSTD))
432      ALLOCATE(O3daySTD(klon,nlevSTD))
433!IM end
434      ALLOCATE(seed_old(klon,napisccp))
435      ALLOCATE(zuthe(klon),zvthe(klon))
436      ALLOCATE(alb_neig(klon))
437!cloud base mass flux
438      ALLOCATE(ema_cbmf(klon))
439!cloud base pressure & cloud top pressure
440      ALLOCATE(ema_pcb(klon), ema_pct(klon))
441!
442      ALLOCATE(Ma(klon,klev))
443      ALLOCATE(qcondc(klon,klev))
444      ALLOCATE(wd(klon))
445      ALLOCATE(sigd(klon))
446      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
447      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
448      ALLOCATE(Ale_bl(klon))
449      ALLOCATE(Alp_bl(klon))
450      ALLOCATE(lalim_conv(klon))
451      ALLOCATE(wght_th(klon,klev))
452      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
453      ALLOCATE(wake_Cstar(klon), wake_s(klon))
454      ALLOCATE(wake_pe(klon), wake_fip(klon))
455      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
456      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
457      ALLOCATE(pfrac_1nucl(klon,klev))
458      ALLOCATE(total_rain(klon), nday_rain(klon))
459      ALLOCATE(paire_ter(klon))
460      ALLOCATE(albsol1(klon), albsol2(klon))
461
462      if (read_climoz <= 1) then
463         ALLOCATE(wo(klon,klev, 1))
464      else
465         ! read_climoz == 2
466         ALLOCATE(wo(klon,klev, 2))
467      end if
468     
469      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
470      ALLOCATE(heat(klon,klev), heat0(klon,klev))
471      ALLOCATE(cool(klon,klev), cool0(klon,klev))
472      ALLOCATE(topsw(klon), toplw(klon))
473      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
474      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
475      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
476      ALLOCATE(albpla(klon))
477!IM ajout variables CFMIP2/CMIP5
478      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
479      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
480      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
481      ALLOCATE(albplap(klon))
482      ALLOCATE(solswp(klon), sollwp(klon))
483      ALLOCATE(sollwdownp(klon))
484      ALLOCATE(topsw0p(klon),toplw0p(klon))
485      ALLOCATE(solsw0p(klon),sollw0p(klon))
486      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
487      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
488      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
489      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
490
491      ALLOCATE(cape(klon))
492      ALLOCATE(pbase(klon),bbase(klon))
493      ALLOCATE(zqasc(klon,klev))
494      ALLOCATE(ibas_con(klon), itop_con(klon))
495      ALLOCATE(rain_con(klon), snow_con(klon))
496      ALLOCATE(rlonPOS(klon))
497      ALLOCATE(newsst(klon))
498      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf))
499      ALLOCATE(topswad(klon), solswad(klon))
500      ALLOCATE(topswai(klon), solswai(klon))
501      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
502      ALLOCATE(ccm(klon,klev,nbands))
503
504!!! nrlmd le 10/04/2012
505      ALLOCATE(ale_bl_trig(klon))
506!!! fin nrlmd le 10/04/2012
507
508END SUBROUTINE phys_state_var_init
509
510!======================================================================
511SUBROUTINE phys_state_var_end
512use dimphy
513use control_mod
514IMPLICIT NONE
515#include "indicesol.h"
516
517      deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2)
518      deallocate(rain_fall, snow_fall, solsw, sollw, radsol)
519      deallocate(zmea, zstd, zsig, zgam)
520      deallocate(zthe, zpic, zval)
521      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
522      deallocate(        u_ancien, v_ancien                 )
523      deallocate(ratqs, pbl_tke)
524      deallocate(zmax0, f0)
525      deallocate(ema_work1, ema_work2)
526      deallocate(entr_therm, fm_therm)
527      deallocate(detr_therm)
528      deallocate(clwcon0th, rnebcon0th)
529! radiation outputs
530      deallocate(swdn0, swdn)
531      deallocate(swup0, swup)
532      deallocate(lwdn0, lwdn)
533      deallocate(lwup0, lwup)
534      deallocate(SWdn200clr, SWdn200)
535      deallocate(SWup200clr, SWup200)
536      deallocate(LWdn200clr, LWdn200)
537      deallocate(LWup200clr, LWup200)
538      deallocate(LWdnTOA, LWdnTOAclr)
539! pressure level
540      deallocate(tsumSTD)
541      deallocate(usumSTD, vsumSTD)
542      deallocate(wsumSTD, phisumSTD)
543      deallocate(tnondef)
544      deallocate(qsumSTD, rhsumSTD)
545      deallocate(uvsumSTD)
546      deallocate(vqsumSTD)
547      deallocate(vTsumSTD)
548      deallocate(wqsumSTD)
549      deallocate(vphisumSTD)
550      deallocate(wTsumSTD)
551      deallocate(u2sumSTD)
552      deallocate(v2sumSTD)
553      deallocate(T2sumSTD)
554      deallocate(O3sumSTD)
555      deallocate(O3daysumSTD)
556!IM beg
557      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
558      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
559!IM end
560      deallocate(seed_old)
561      deallocate(zuthe, zvthe)
562      deallocate(alb_neig)
563      deallocate(ema_cbmf)
564      deallocate(ema_pcb, ema_pct)
565      deallocate(Ma, qcondc)
566      deallocate(wd, sigd)
567      deallocate(cin, ALE, ALP)
568      deallocate(ftd, fqd)
569      deallocate(Ale_bl, Alp_bl)
570      deallocate(lalim_conv, wght_th)
571      deallocate(wake_deltat, wake_deltaq)
572      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
573      deallocate(dt_wake, dq_wake)
574      deallocate(pfrac_impa, pfrac_nucl)
575      deallocate(pfrac_1nucl)
576      deallocate(total_rain, nday_rain)
577      deallocate(paire_ter)
578      deallocate(albsol1, albsol2)
579      deallocate(wo)
580      deallocate(clwcon0,rnebcon0)
581      deallocate(heat, heat0)
582      deallocate(cool, cool0)
583      deallocate(topsw, toplw)
584      deallocate(sollwdown, sollwdownclr)
585      deallocate(toplwdown, toplwdownclr)
586      deallocate(topsw0,toplw0,solsw0,sollw0)
587      deallocate(albpla)
588!IM ajout variables CFMIP2/CMIP5
589      deallocate(heatp, coolp)
590      deallocate(heat0p, cool0p)
591      deallocate(radsolp, topswp, toplwp)
592      deallocate(albplap)
593      deallocate(solswp, sollwp)
594      deallocate(sollwdownp)
595      deallocate(topsw0p,toplw0p)
596      deallocate(solsw0p,sollw0p)
597      deallocate(lwdn0p, lwdnp)
598      deallocate(lwup0p, lwupp)
599      deallocate(swdn0p, swdnp)
600      deallocate(swup0p, swupp)
601      deallocate(cape)
602      deallocate(pbase,bbase)
603      deallocate(zqasc)
604      deallocate(ibas_con, itop_con)
605      deallocate(rain_con, snow_con)
606      deallocate(rlonPOS)
607      deallocate(newsst)
608      deallocate(ustar,u10m, v10m)
609      deallocate(topswad, solswad)
610      deallocate(topswai, solswai)
611      deallocate(tau_aero,piz_aero,cg_aero)
612      deallocate(ccm)
613       
614!!! nrlmd le 10/04/2012
615      deallocate(ale_bl_trig)
616!!! fin nrlmd le 10/04/2012
617
618END SUBROUTINE phys_state_var_end
619
620      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.