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

Last change on this file since 2793 was 2730, checked in by jyg, 8 years ago

New input parameter: nbapp_wk = number of calls to
wake routines per day. If =0, call at every physic
time step.

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