source: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/phys_state_var_mod.F90 @ 5223

Last change on this file since 5223 was 2003, checked in by Laurent Fairhead, 11 years ago

Nouvelle version qui inclut les effets des aérosols et propose les mêmes diagnostics des effets
directs et indirects que l'ancienne version du rayonnement.
OB


New RRTM version that includes the effects of aerosols and outputs the same direct and indirect effects
diagnostics as the old version
OB

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