source: LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_state_var_mod.F90 @ 1132

Last change on this file since 1132 was 1054, checked in by lmdzadmin, 16 years ago

Ajout sorties tendances dynamiques histLES
ACA/FH/IM

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.9 KB
Line 
1      MODULE phys_state_var_mod
2! Variables sauvegardees pour le startphy.nc
3!======================================================================
4!
5!
6!======================================================================
7! Declaration des variables
8      USE dimphy
9      INTEGER, PARAMETER :: nlevSTD=17
10      INTEGER, PARAMETER :: nout=3
11      INTEGER, PARAMETER :: napisccp=1
12      INTEGER, SAVE :: radpas
13      REAL, SAVE :: dtime, co2_ppm_etat0, solaire_etat0
14!$OMP THREADPRIVATE(radpas)
15!$OMP THREADPRIVATE(dtime, co2_ppm_etat0, solaire_etat0)
16
17      REAL, ALLOCATABLE, SAVE :: rlat(:), rlon(:), pctsrf(:,:)
18!$OMP THREADPRIVATE(rlat, rlon, pctsrf)
19      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
20!$OMP THREADPRIVATE(ftsol)
21!      character(len=6), SAVE :: ocean
22!!!!!!$OMP THREADPRIVATE(ocean)
23!      logical, SAVE :: ok_veget
24!!!!!!$OMP THREADPRIVATE(ok_veget)
25      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
26!$OMP THREADPRIVATE(falb1, falb2)
27      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
28!$OMP THREADPRIVATE( rain_fall, snow_fall)
29      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
30!$OMP THREADPRIVATE(solsw, sollw)
31      REAL, ALLOCATABLE, SAVE :: radsol(:)
32!$OMP THREADPRIVATE(radsol)
33
34!clesphy0 param physiq
35!
36! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
37!
38      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
39!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
40      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
41!$OMP THREADPRIVATE(zthe, zpic, zval)
42!     REAL tabcntr0(100)
43      REAL, ALLOCATABLE, SAVE :: rugoro(:)
44!$OMP THREADPRIVATE(rugoro)
45      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
46!$OMP THREADPRIVATE(t_ancien, q_ancien)
47      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
48!$OMP THREADPRIVATE(u_ancien, v_ancien)
49      LOGICAL, SAVE :: ancien_ok
50!$OMP THREADPRIVATE(ancien_ok)
51      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
52!$OMP THREADPRIVATE(clwcon,rnebcon)
53      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
54!$OMP THREADPRIVATE(ratqs)
55      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
56!$OMP THREADPRIVATE(pbl_tke)
57      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
58!$OMP THREADPRIVATE(zmax0,f0)
59      REAL, ALLOCATABLE, SAVE :: ema_work1(:,:), ema_work2(:,:)
60!$OMP THREADPRIVATE(ema_work1,ema_work2)
61      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
62!$OMP THREADPRIVATE(entr_therm,fm_therm)
63      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
64!$OMP THREADPRIVATE(detr_therm)
65!IM 150408
66!     pour phsystoke avec thermiques
67      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
68!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
69! radiation outputs
70      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
71!$OMP THREADPRIVATE(swdn0,swdn)
72      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
73!$OMP THREADPRIVATE(swup0,swup)
74      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
75!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
76      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
77!$OMP THREADPRIVATE(SWup200clr,SWup200)
78      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
79!$OMP THREADPRIVATE(lwdn0,lwdn)
80      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
81!$OMP THREADPRIVATE(lwup0,lwup)
82      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
83!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
84      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
85!$OMP THREADPRIVATE(LWup200clr,LWup200)
86      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
87!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
88! pressure level
89      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
90!$OMP THREADPRIVATE(tsumSTD)
91      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
92!$OMP THREADPRIVATE(usumSTD,vsumSTD)
93      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
94!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
95      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
96!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
97      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
98!$OMP THREADPRIVATE(tnondef)
99      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
100!$OMP THREADPRIVATE(uvsumSTD)
101      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
102!$OMP THREADPRIVATE(vqsumSTD)
103      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
104!$OMP THREADPRIVATE(vTsumSTD)
105      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
106!$OMP THREADPRIVATE(wqsumSTD)
107      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
108!$OMP THREADPRIVATE(vphisumSTD)
109      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
110!$OMP THREADPRIVATE(wTsumSTD)
111      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
112!$OMP THREADPRIVATE(u2sumSTD)
113      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
114!$OMP THREADPRIVATE(v2sumSTD)
115      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
116!$OMP THREADPRIVATE(T2sumSTD)
117      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
118!$OMP THREADPRIVATE(seed_old)
119      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
120!$OMP THREADPRIVATE(zuthe,zvthe)
121      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
122!$OMP THREADPRIVATE(alb_neig)
123!cloud base mass flux
124      REAL,ALLOCATABLE,SAVE :: ema_workcbmf(:), ema_cbmf(:)
125!$OMP THREADPRIVATE(ema_workcbmf,ema_cbmf)
126!cloud base pressure & cloud top pressure
127      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
128!$OMP THREADPRIVATE(ema_pcb,ema_pct)
129      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
130!$OMP THREADPRIVATE(Ma)
131      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
132!$OMP THREADPRIVATE(qcondc)
133      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
134!$OMP THREADPRIVATE(wd)
135      REAL,ALLOCATABLE,SAVE :: sigd(:)
136!$OMP THREADPRIVATE(sigd)
137!
138      REAL,ALLOCATABLE,SAVE :: cin(:)
139!$OMP THREADPRIVATE(cin)
140! ftd : differential heating between wake and environment
141      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
142!$OMP THREADPRIVATE(ftd)
143! fqd : differential moistening between wake and environment
144      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
145!$OMP THREADPRIVATE(fqd)
146!34EK
147! -- Variables de controle de ALE et ALP
148!ALE : Energie disponible pour soulevement : utilisee par la
149!      convection d'Emanuel pour le declenchement et la regulation
150      REAL,ALLOCATABLE,SAVE :: ALE(:)
151!$OMP THREADPRIVATE(ALE)
152!ALP : Puissance  disponible pour soulevement
153      REAL,ALLOCATABLE,SAVE :: ALP(:)
154!$OMP THREADPRIVATE(ALP)
155!
156! nouvelles variables pour le couplage convection-couche limite
157      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
158!$OMP THREADPRIVATE(Ale_bl)
159      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
160!$OMP THREADPRIVATE(Alp_bl)
161      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
162!$OMP THREADPRIVATE(lalim_conv)
163      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
164!$OMP THREADPRIVATE(wght_th)
165!
166! variables de la wake
167! wake_deltat : ecart de temperature avec la zone non perturbee
168! wake_deltaq : ecart d'humidite avec la zone non perturbee
169! wake_Cstar  : vitesse d'etalement de la poche
170! wake_s      : fraction surfacique occupee par la poche froide
171! wake_fip    : Gust Front Impinging power - ALP
172! dt_wake, dq_wake: LS tendencies due to wake
173      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
174!$OMP THREADPRIVATE(wake_deltat)
175      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
176!$OMP THREADPRIVATE(wake_deltaq)
177      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
178!$OMP THREADPRIVATE(wake_Cstar)
179      REAL,ALLOCATABLE,SAVE :: wake_s(:)
180!$OMP THREADPRIVATE(wake_s)
181      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
182!$OMP THREADPRIVATE(wake_fip)
183      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
184!$OMP THREADPRIVATE(dt_wake)
185      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
186!$OMP THREADPRIVATE(dq_wake)
187!
188! pfrac_impa : Produits des coefs lessivage impaction
189! pfrac_nucl : Produits des coefs lessivage nucleation
190! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
191      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
192!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
193      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
194!$OMP THREADPRIVATE(pfrac_1nucl)
195!
196      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
197!$OMP THREADPRIVATE(total_rain,nday_rain)
198      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
199!$OMP THREADPRIVATE(paire_ter)
200! albsol1: albedo du sol total pour SW visible
201! albsol2: albedo du sol total pour SW proche IR
202      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
203!$OMP THREADPRIVATE(albsol1,albsol2)
204      REAL,ALLOCATABLE,SAVE :: wo(:,:)
205!$OMP THREADPRIVATE(wo)
206!
207! heat : chauffage solaire
208! heat0: chauffage solaire ciel clair
209! cool : refroidissement infrarouge
210! cool0 : refroidissement infrarouge ciel clair
211! sollwdown : downward LW flux at surface
212! sollwdownclr : downward CS LW flux at surface
213! toplwdown : downward CS LW flux at TOA
214! toplwdownclr : downward CS LW flux at TOA
215      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
216!$OMP THREADPRIVATE(clwcon0,rnebcon0)
217      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
218!$OMP THREADPRIVATE(heat)
219      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
220!$OMP THREADPRIVATE(heat0)
221      REAL,ALLOCATABLE,SAVE :: cool(:,:)
222!$OMP THREADPRIVATE(cool)
223      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
224!$OMP THREADPRIVATE(cool0)
225      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
226!$OMP THREADPRIVATE(topsw,toplw)
227      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
228!$OMP THREADPRIVATE(sollwdown)
229      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
230!$OMP THREADPRIVATE(sollwdownclr)
231      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
232!$OMP THREADPRIVATE(toplwdown)
233      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
234!$OMP THREADPRIVATE(toplwdownclr)
235      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
236!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
237      REAL,ALLOCATABLE,SAVE :: albpla(:)
238!$OMP THREADPRIVATE(albpla)
239! pbase : cloud base pressure
240! bbase : cloud base buoyancy
241      REAL,ALLOCATABLE,SAVE :: cape(:)
242!$OMP THREADPRIVATE(cape)
243      REAL,ALLOCATABLE,SAVE :: pbase(:)
244!$OMP THREADPRIVATE(pbase)
245      REAL,ALLOCATABLE,SAVE :: bbase(:)
246!$OMP THREADPRIVATE(bbase)
247!
248      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
249!$OMP THREADPRIVATE( zqasc)
250      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
251!$OMP THREADPRIVATE(ibas_con,itop_con)
252      REAL,SAVE,ALLOCATABLE :: rain_con(:)
253!$OMP THREADPRIVATE(rain_con)
254      REAL,SAVE,ALLOCATABLE :: snow_con(:)
255!$OMP THREADPRIVATE(snow_con)
256!
257! sulfate_pi : SO4 aerosol concentration [ug/m3] (pre-industrial value)
258
259      REAL,SAVE,ALLOCATABLE :: sulfate_pi(:, :)
260!$OMP THREADPRIVATE(sulfate_pi)
261      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
262!$OMP THREADPRIVATE(rlonPOS)
263      REAL,SAVE,ALLOCATABLE :: newsst(:)
264!$OMP THREADPRIVATE(newsst)
265      REAL,SAVE,ALLOCATABLE :: u10m(:,:), v10m(:,:)
266!$OMP THREADPRIVATE(u10m,v10m)
267!
268! ok_ade=T -ADE=topswad-topsw
269! ok_aie=T ->
270!       ok_ade=T -AIE=topswai-topswad
271!        ok_ade=F -AIE=topswai-topsw
272!
273!topswad, solswad : Aerosol direct effect
274      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
275!$OMP THREADPRIVATE(topswad,solswad)
276!topswai, solswai : Aerosol indirect effect
277      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
278!$OMP THREADPRIVATE(topswai,solswai)
279      REAL,SAVE,ALLOCATABLE :: tau_ae(:,:,:), piz_ae(:,:,:)
280!$OMP THREADPRIVATE(tau_ae,piz_ae)
281      REAL,SAVE,ALLOCATABLE :: cg_ae(:,:,:)
282!$OMP THREADPRIVATE(cg_ae)
283
284! Les variables suivants uniquement pour un configuration avec INCA
285! topswad_inca, solswad_inca : Aerosol direct effect
286      REAL,SAVE,ALLOCATABLE :: topswad_inca(:), solswad_inca(:)
287!$OMP THREADPRIVATE(topswad_inca,solswad_inca)
288! topswad0_inca, solswad0_inca : Aerosol direct effect
289      REAL,SAVE,ALLOCATABLE :: topswad0_inca(:), solswad0_inca(:)
290!$OMP THREADPRIVATE(topswad0_inca,solswad0_inca)
291! topswai_inca, solswai_inca : Aerosol indirect effect
292      REAL,SAVE,ALLOCATABLE :: topswai_inca(:), solswai_inca(:)
293!$OMP THREADPRIVATE(topswai_inca,solswai_inca)
294      REAL,SAVE,ALLOCATABLE :: topsw_inca(:,:), solsw_inca(:,:)
295!$OMP THREADPRIVATE(topsw_inca,solsw_inca)
296      REAL,SAVE,ALLOCATABLE :: topsw0_inca(:,:), solsw0_inca(:,:)
297!$OMP THREADPRIVATE(topsw0_inca,solsw0_inca)
298      REAL,SAVE,ALLOCATABLE :: tau_inca(:,:,:,:)
299!$OMP THREADPRIVATE(tau_inca)
300      REAL,SAVE,ALLOCATABLE :: piz_inca(:,:,:,:)
301!$OMP THREADPRIVATE(piz_inca)
302      REAL,SAVE,ALLOCATABLE :: cg_inca(:,:,:,:)
303!$OMP THREADPRIVATE(cg_inca)
304      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
305!$OMP THREADPRIVATE(ccm)
306
307CONTAINS
308
309!======================================================================
310SUBROUTINE phys_state_var_init
311use dimphy
312IMPLICIT NONE
313#include "indicesol.h"
314#include "control.h"
315      ALLOCATE(rlat(klon), rlon(klon))
316      ALLOCATE(pctsrf(klon,nbsrf))
317      ALLOCATE(ftsol(klon,nbsrf))
318      ALLOCATE(falb1(klon,nbsrf))
319      ALLOCATE(falb2(klon,nbsrf))
320      ALLOCATE(rain_fall(klon))
321      ALLOCATE(snow_fall(klon))
322      ALLOCATE(solsw(klon), sollw(klon))
323      ALLOCATE(radsol(klon))
324      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
325      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
326
327      ALLOCATE(rugoro(klon))
328      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
329      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
330      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
331      ALLOCATE(ratqs(klon,klev))
332      ALLOCATE(pbl_tke(klon,klev+1,nbsrf))
333      ALLOCATE(zmax0(klon), f0(klon))
334      ALLOCATE(ema_work1(klon,klev), ema_work2(klon,klev))
335      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
336      ALLOCATE(detr_therm(klon,klev))
337!     pour phsystoke avec thermiques
338      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
339! radiation outputs
340      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
341      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
342      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
343      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
344      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
345      ALLOCATE(SWup200clr(klon), SWup200(klon))
346      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
347      ALLOCATE(LWup200clr(klon), LWup200(klon))
348      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
349! pressure level
350      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
351      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
352      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
353      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
354      ALLOCATE(tnondef(klon,nlevSTD,nout))
355      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
356      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
357      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
358      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
359      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
360      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
361      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
362      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
363      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
364      ALLOCATE(seed_old(klon,napisccp))
365      ALLOCATE(zuthe(klon),zvthe(klon))
366      ALLOCATE(alb_neig(klon))
367!cloud base mass flux
368      ALLOCATE(ema_workcbmf(klon), ema_cbmf(klon))
369!cloud base pressure & cloud top pressure
370      ALLOCATE(ema_pcb(klon), ema_pct(klon))
371!
372      ALLOCATE(Ma(klon,klev))
373      ALLOCATE(qcondc(klon,klev))
374      ALLOCATE(wd(klon))
375      ALLOCATE(sigd(klon))
376      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
377      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
378      ALLOCATE(Ale_bl(klon))
379      ALLOCATE(Alp_bl(klon))
380      ALLOCATE(lalim_conv(klon))
381      ALLOCATE(wght_th(klon,klev))
382      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
383      ALLOCATE(wake_Cstar(klon), wake_s(klon), wake_fip(klon))
384      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
385      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
386      ALLOCATE(pfrac_1nucl(klon,klev))
387      ALLOCATE(total_rain(klon), nday_rain(klon))
388      ALLOCATE(paire_ter(klon))
389      ALLOCATE(albsol1(klon), albsol2(klon))
390      ALLOCATE(wo(klon,klev))
391      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
392      ALLOCATE(heat(klon,klev), heat0(klon,klev))
393      ALLOCATE(cool(klon,klev), cool0(klon,klev))
394      ALLOCATE(topsw(klon), toplw(klon))
395      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
396      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
397      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
398      ALLOCATE(albpla(klon))
399      ALLOCATE(cape(klon))
400      ALLOCATE(pbase(klon),bbase(klon))
401      ALLOCATE(zqasc(klon,klev))
402      ALLOCATE(ibas_con(klon), itop_con(klon))
403      ALLOCATE(rain_con(klon), snow_con(klon))
404!
405      ALLOCATE(sulfate_pi(klon, klev))
406      ALLOCATE(rlonPOS(klon))
407      ALLOCATE(newsst(klon))
408      ALLOCATE(u10m(klon,nbsrf), v10m(klon,nbsrf))
409      ALLOCATE(topswad(klon), solswad(klon))
410      ALLOCATE(topswai(klon), solswai(klon))
411      ALLOCATE(tau_ae(klon,klev,2), piz_ae(klon,klev,2))
412      ALLOCATE(cg_ae(klon,klev,2))
413
414      IF (config_inca /= 'none') THEN
415         ALLOCATE(topswad_inca(klon), solswad_inca(klon))
416         ALLOCATE(topswad0_inca(klon), solswad0_inca(klon))
417         ALLOCATE(topswai_inca(klon), solswai_inca(klon))
418         ALLOCATE(topsw_inca(klon,9), solsw_inca(klon,9))
419         ALLOCATE(topsw0_inca(klon,9), solsw0_inca(klon,9))
420      END IF
421      ! Following 4 variables are needed only by INCA but must be
422      ! allocated as they exist in the phytrac argument list
423      ALLOCATE(tau_inca(klon,klev,9,2))
424      ALLOCATE(piz_inca(klon,klev,9,2))
425      ALLOCATE(cg_inca(klon,klev,9,2))
426      ALLOCATE(ccm(klon,klev,2))
427
428END SUBROUTINE phys_state_var_init
429
430!======================================================================
431SUBROUTINE phys_state_var_end
432use dimphy
433IMPLICIT NONE
434#include "indicesol.h"
435#include "control.h"
436
437      deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2)
438      deallocate(rain_fall, snow_fall, solsw, sollw, radsol)
439      deallocate(zmea, zstd, zsig, zgam)
440      deallocate(zthe, zpic, zval)
441      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
442      deallocate(        u_ancien, v_ancien                 )
443      deallocate(ratqs, pbl_tke)
444      deallocate(zmax0, f0)
445      deallocate(ema_work1, ema_work2)
446      deallocate(entr_therm, fm_therm)
447      deallocate(detr_therm)
448      deallocate(clwcon0th, rnebcon0th)
449! radiation outputs
450      deallocate(swdn0, swdn)
451      deallocate(swup0, swup)
452      deallocate(lwdn0, lwdn)
453      deallocate(lwup0, lwup)
454      deallocate(SWdn200clr, SWdn200)
455      deallocate(SWup200clr, SWup200)
456      deallocate(LWdn200clr, LWdn200)
457      deallocate(LWup200clr, LWup200)
458      deallocate(LWdnTOA, LWdnTOAclr)
459! pressure level
460      deallocate(tsumSTD)
461      deallocate(usumSTD, vsumSTD)
462      deallocate(wsumSTD, phisumSTD)
463      deallocate(tnondef)
464      deallocate(qsumSTD, rhsumSTD)
465      deallocate(uvsumSTD)
466      deallocate(vqsumSTD)
467      deallocate(vTsumSTD)
468      deallocate(wqsumSTD)
469      deallocate(vphisumSTD)
470      deallocate(wTsumSTD)
471      deallocate(u2sumSTD)
472      deallocate(v2sumSTD)
473      deallocate(T2sumSTD)
474      deallocate(seed_old)
475      deallocate(zuthe, zvthe)
476      deallocate(alb_neig)
477      deallocate(ema_workcbmf, ema_cbmf)
478      deallocate(ema_pcb, ema_pct)
479      deallocate(Ma, qcondc)
480      deallocate(wd, sigd)
481      deallocate(cin, ALE, ALP)
482      deallocate(ftd, fqd)
483      deallocate(Ale_bl, Alp_bl)
484      deallocate(lalim_conv, wght_th)
485      deallocate(wake_deltat, wake_deltaq)
486      deallocate(wake_Cstar, wake_s, wake_fip)
487      deallocate(dt_wake, dq_wake)
488      deallocate(pfrac_impa, pfrac_nucl)
489      deallocate(pfrac_1nucl)
490      deallocate(total_rain, nday_rain)
491      deallocate(paire_ter)
492      deallocate(albsol1, albsol2)
493      deallocate(wo)
494      deallocate(clwcon0,rnebcon0)
495      deallocate(heat, heat0)
496      deallocate(cool, cool0)
497      deallocate(topsw, toplw)
498      deallocate(sollwdown, sollwdownclr)
499      deallocate(toplwdown, toplwdownclr)
500      deallocate(topsw0,toplw0,solsw0,sollw0)
501      deallocate(albpla)
502      deallocate(cape)
503      deallocate(pbase,bbase)
504      deallocate(zqasc)
505      deallocate(ibas_con, itop_con)
506      deallocate(rain_con, snow_con)
507!
508      deallocate(sulfate_pi)
509      deallocate(rlonPOS)
510      deallocate(newsst)
511      deallocate(u10m, v10m)
512      deallocate(topswad, solswad)
513      deallocate(topswai, solswai)
514
515      deallocate(tau_ae, piz_ae)
516      deallocate(cg_ae)
517
518      IF (config_inca /= 'none') THEN
519         deallocate(topswad_inca, solswad_inca)
520         deallocate(topswad0_inca, solswad0_inca)
521         deallocate(topswai_inca, solswai_inca)
522         deallocate(topsw_inca, solsw_inca)
523         deallocate(topsw0_inca, solsw0_inca)
524      END IF
525      deallocate(tau_inca)
526      deallocate(piz_inca)
527      deallocate(cg_inca)
528      deallocate(ccm)
529       
530END SUBROUTINE phys_state_var_end
531
532      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.