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

Last change on this file since 2186 was 2181, checked in by jyg, 10 years ago

1/ Update of the loop on sub-surfaces in pbl_surface_mod.F90 : all initializations
are removed from the loop and put before the loop.
2/ The possibility of nudging RH, T, u, and v is added in lmdz1d.F90 (and in
1DUTILS.h).

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