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

Last change on this file since 2686 was 2635, checked in by jyg, 8 years ago

Some cleaning in the wake routines: (i) the wake
number per unit area (wdens) is now a state
variable (held constant for the time being);
(ii) wake state variable changes are computed in
subroutine 'physiq' if iflag_wake_tend=1 (it is
computed within wake routines if
iflag_wake_tend=0, consistent with earlier
versions); (iii) the new routine 'add_wake_tend'
adds tendencies to wake state variables; (iv)
tendencies due to various processes (pbl, wakes,
thermals) are named and added separately.

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