source: LMDZ6/trunk/libf/phylmd/phys_state_var_mod.F90 @ 3457

Last change on this file since 3457 was 3439, checked in by Laurent Fairhead, 6 years ago

Initialisations wrongly placed

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