source: LMDZ4/trunk/libf/phylmd/phys_state_var_mod.F90 @ 983

Last change on this file since 983 was 970, checked in by Laurent Fairhead, 16 years ago

Corrections petits bugs divers
LF

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