source: LMDZ5/branches/IPSLCM5A2.1_ISO/libf/phylmd/phys_state_var_mod.F90 @ 3488

Last change on this file since 3488 was 2499, checked in by oboucher, 9 years ago

Various changes to diagnose properly 2D tendency in q, ql, qs from dynamics
as previous diagnostics were incorrect.
Cleaned up all such diagnostics in physiq_mod.F90 as well

  • 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 2499 2016-04-24 10:38:19Z 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
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 : differential heating between wake and environment
206      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
207!$OMP THREADPRIVATE(ftd)
208! fqd : differential moistening between wake and environment
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_Cstar  : vitesse d'etalement de la poche
235! wake_s      : fraction surfacique occupee par la poche froide
236! wake_pe     : wake potential energy - WAPE
237! wake_fip    : Gust Front Impinging power - ALP
238! dt_wake, dq_wake: LS tendencies due to wake
239      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
240!$OMP THREADPRIVATE(wake_deltat)
241      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
242!$OMP THREADPRIVATE(wake_deltaq)
243      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
244!$OMP THREADPRIVATE(wake_Cstar)
245      REAL,ALLOCATABLE,SAVE :: wake_s(:)
246!$OMP THREADPRIVATE(wake_s)
247      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
248!$OMP THREADPRIVATE(wake_pe)
249      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
250!$OMP THREADPRIVATE(wake_fip)
251      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
252!$OMP THREADPRIVATE(dt_wake)
253      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
254!$OMP THREADPRIVATE(dq_wake)
255!
256!jyg<
257! variables related to the spitting of the PBL between wake and
258! off-wake regions.
259! wake_delta_pbl_TKE : difference TKE_w - TKE_x
260      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
261!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
262!>jyg
263!
264! pfrac_impa : Produits des coefs lessivage impaction
265! pfrac_nucl : Produits des coefs lessivage nucleation
266! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
267      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
268!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
269      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
270!$OMP THREADPRIVATE(pfrac_1nucl)
271!
272      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
273!$OMP THREADPRIVATE(total_rain,nday_rain)
274      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
275!$OMP THREADPRIVATE(paire_ter)
276! albsol1: albedo du sol total pour SW visible
277! albsol2: albedo du sol total pour SW proche IR
278      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
279!$OMP THREADPRIVATE(albsol1,albsol2)
280
281!albedo SB >>>
282      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
283!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
284!albedo SB <<<
285
286
287      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
288      ! column-density of ozone in a layer, in kilo-Dobsons
289      ! Third dimension has size 1 or 2.
290      ! "wo(:, :, 1)" is for the average day-night field,
291      ! "wo(:, :, 2)" is for daylight time.
292      !$OMP THREADPRIVATE(wo)
293
294! heat : chauffage solaire
295! heat0: chauffage solaire ciel clair
296! cool : refroidissement infrarouge
297! cool0 : refroidissement infrarouge ciel clair
298! sollwdown : downward LW flux at surface
299! sollwdownclr : downward CS LW flux at surface
300! toplwdown : downward CS LW flux at TOA
301! toplwdownclr : downward CS LW flux at TOA
302      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
303!$OMP THREADPRIVATE(clwcon0,rnebcon0)
304      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
305!$OMP THREADPRIVATE(heat)
306      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
307!$OMP THREADPRIVATE(heat0)
308      REAL,ALLOCATABLE,SAVE :: cool(:,:)
309!$OMP THREADPRIVATE(cool)
310      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
311!$OMP THREADPRIVATE(cool0)
312      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
313!$OMP THREADPRIVATE(topsw,toplw)
314      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
315!$OMP THREADPRIVATE(sollwdown)
316      REAL,ALLOCATABLE,SAVE :: gustiness(:)
317!$OMP THREADPRIVATE(gustiness)
318      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
319!$OMP THREADPRIVATE(sollwdownclr)
320      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
321!$OMP THREADPRIVATE(toplwdown)
322      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
323!$OMP THREADPRIVATE(toplwdownclr)
324      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
325!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
326      REAL,ALLOCATABLE,SAVE :: albpla(:)
327!$OMP THREADPRIVATE(albpla)
328
329!IM ajout variables CFMIP2/CMIP5
330      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
331!$OMP THREADPRIVATE(heatp, coolp)
332      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
333!$OMP THREADPRIVATE(heat0p, cool0p)
334      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
335!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
336      REAL,ALLOCATABLE,SAVE :: albplap(:)
337!$OMP THREADPRIVATE(albplap)
338      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
339!$OMP THREADPRIVATE(solswp, sollwp)
340      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
341!$OMP THREADPRIVATE(sollwdownp)
342      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
343      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
344!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
345      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
346      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
347!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
348      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
349      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
350!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
351
352! pbase : cloud base pressure
353! bbase : cloud base buoyancy
354      REAL,ALLOCATABLE,SAVE :: cape(:)
355!$OMP THREADPRIVATE(cape)
356      REAL,ALLOCATABLE,SAVE :: pbase(:)
357!$OMP THREADPRIVATE(pbase)
358      REAL,ALLOCATABLE,SAVE :: bbase(:)
359!$OMP THREADPRIVATE(bbase)
360!
361      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
362!$OMP THREADPRIVATE( zqasc)
363      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
364!$OMP THREADPRIVATE(ibas_con,itop_con)
365      REAL,SAVE,ALLOCATABLE :: rain_con(:)
366!$OMP THREADPRIVATE(rain_con)
367      REAL,SAVE,ALLOCATABLE :: snow_con(:)
368!$OMP THREADPRIVATE(snow_con)
369!
370      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
371!$OMP THREADPRIVATE(rlonPOS)
372      REAL,SAVE,ALLOCATABLE :: newsst(:)
373!$OMP THREADPRIVATE(newsst)
374      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
375!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
376!
377! ok_ade=T -ADE=topswad-topsw
378! ok_aie=T ->
379!       ok_ade=T -AIE=topswai-topswad
380!       ok_ade=F -AIE=topswai-topsw
381!
382!topswad, solswad : Aerosol direct effect
383      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
384!$OMP THREADPRIVATE(topswad,solswad)
385!topswai, solswai : Aerosol indirect effect
386      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
387!$OMP THREADPRIVATE(topswai,solswai)
388
389      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
390!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
391      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
392!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
393      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
394!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
395      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
396!$OMP THREADPRIVATE(ccm)
397
398!!! nrlmd le 10/04/2012
399      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
400!$OMP THREADPRIVATE(ale_bl_trig)
401!!! fin nrlmd le 10/04/2012
402
403      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
404      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
405      ! tendencies on wind due to gravity waves
406
407CONTAINS
408
409!======================================================================
410SUBROUTINE phys_state_var_init(read_climoz)
411USE dimphy
412USE aero_mod
413USE infotrac_phy, ONLY : nbtr
414USE indice_sol_mod
415IMPLICIT NONE
416
417integer, intent(in)::  read_climoz
418! read ozone climatology
419! Allowed values are 0, 1 and 2
420! 0: do not read an ozone climatology
421! 1: read a single ozone climatology that will be used day and night
422! 2: read two ozone climatologies, the average day and night
423! climatology and the daylight climatology
424
425include "clesphys.h"
426
427      ALLOCATE(pctsrf(klon,nbsrf))
428      ALLOCATE(ftsol(klon,nbsrf))
429      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
430      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
431      ALLOCATE(falb1(klon,nbsrf))
432      ALLOCATE(falb2(klon,nbsrf))
433!albedo SB >>>
434      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
435      ALLOCATE(chl_con(klon))
436!albedo SB <<<
437      ALLOCATE(rain_fall(klon))
438      ALLOCATE(snow_fall(klon))
439      ALLOCATE(solsw(klon), sollw(klon))
440      ALLOCATE(radsol(klon))
441      ALLOCATE(swradcorr(klon))
442      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
443      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
444
445      ALLOCATE(rugoro(klon))
446      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
447      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
448      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
449      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
450!!! Rom P >>>
451      ALLOCATE(tr_ancien(klon,klev,nbtr))
452!!! Rom P <<<
453      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
454      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
455      ALLOCATE(ratqs(klon,klev))
456      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
457!nrlmd<
458      ALLOCATE(delta_tsurf(klon,nbsrf))
459!>nrlmd
460      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
461      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
462      ALLOCATE(zmax0(klon), f0(klon))
463      ALLOCATE(sig1(klon,klev), w01(klon,klev))
464      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
465      ALLOCATE(detr_therm(klon,klev))
466!     pour phsystoke avec thermiques
467      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
468! radiation outputs
469      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
470      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
471      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
472      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
473      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
474      ALLOCATE(SWup200clr(klon), SWup200(klon))
475      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
476      ALLOCATE(LWup200clr(klon), LWup200(klon))
477      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
478! pressure level
479      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
480      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
481      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
482      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
483      ALLOCATE(tnondef(klon,nlevSTD,nout))
484      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
485      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
486      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
487      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
488      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
489      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
490      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
491      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
492      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
493      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
494      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
495!IM beg
496      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
497      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
498      ALLOCATE(philevSTD(klon,nlevSTD))
499      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
500      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
501      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
502      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
503      ALLOCATE(T2STD(klon,nlevSTD))
504      ALLOCATE(O3STD(klon,nlevSTD))
505      ALLOCATE(O3daySTD(klon,nlevSTD))
506!IM end
507      ALLOCATE(seed_old(klon,napisccp))
508      ALLOCATE(zuthe(klon),zvthe(klon))
509      ALLOCATE(alb_neig(klon))
510!cloud base mass flux
511      ALLOCATE(ema_cbmf(klon))
512!cloud base pressure & cloud top pressure
513      ALLOCATE(ema_pcb(klon), ema_pct(klon))
514!
515      ALLOCATE(Ma(klon,klev))
516      ALLOCATE(qcondc(klon,klev))
517      ALLOCATE(wd(klon))
518      ALLOCATE(sigd(klon))
519      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
520      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
521      ALLOCATE(Ale_bl(klon))
522      ALLOCATE(Alp_bl(klon))
523      ALLOCATE(lalim_conv(klon))
524      ALLOCATE(wght_th(klon,klev))
525      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
526      ALLOCATE(wake_Cstar(klon), wake_s(klon))
527      ALLOCATE(wake_pe(klon), wake_fip(klon))
528      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
529!jyg<
530      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
531!>jyg
532      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
533      ALLOCATE(pfrac_1nucl(klon,klev))
534      ALLOCATE(total_rain(klon), nday_rain(klon))
535      ALLOCATE(paire_ter(klon))
536      ALLOCATE(albsol1(klon), albsol2(klon))
537!albedo SB >>>
538      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
539!albedo SB <<<
540
541      if (read_climoz <= 1) then
542         ALLOCATE(wo(klon,klev, 1))
543      else
544         ! read_climoz == 2
545         ALLOCATE(wo(klon,klev, 2))
546      end if
547     
548      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
549      ALLOCATE(heat(klon,klev), heat0(klon,klev))
550      ALLOCATE(cool(klon,klev), cool0(klon,klev))
551      ALLOCATE(topsw(klon), toplw(klon))
552      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
553      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
554      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
555      ALLOCATE(albpla(klon))
556!IM ajout variables CFMIP2/CMIP5
557      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
558      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
559      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
560      ALLOCATE(albplap(klon))
561      ALLOCATE(solswp(klon), sollwp(klon))
562      ALLOCATE(gustiness(klon))
563      ALLOCATE(sollwdownp(klon))
564      ALLOCATE(topsw0p(klon),toplw0p(klon))
565      ALLOCATE(solsw0p(klon),sollw0p(klon))
566      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
567      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
568      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
569      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
570
571      ALLOCATE(cape(klon))
572      ALLOCATE(pbase(klon),bbase(klon))
573      ALLOCATE(zqasc(klon,klev))
574      ALLOCATE(ibas_con(klon), itop_con(klon))
575      ALLOCATE(rain_con(klon), snow_con(klon))
576      ALLOCATE(rlonPOS(klon))
577      ALLOCATE(newsst(klon))
578      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
579      ALLOCATE(topswad(klon), solswad(klon))
580      ALLOCATE(topswai(klon), solswai(klon))
581      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
582      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
583      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
584      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
585      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
586      ALLOCATE(ccm(klon,klev,nbands))
587
588!!! nrlmd le 10/04/2012
589      ALLOCATE(ale_bl_trig(klon))
590!!! fin nrlmd le 10/04/2012
591      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev))
592      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
593
594END SUBROUTINE phys_state_var_init
595
596!======================================================================
597SUBROUTINE phys_state_var_end
598!USE dimphy
599USE indice_sol_mod
600IMPLICIT NONE
601include "clesphys.h"
602
603      deallocate(pctsrf, ftsol, falb1, falb2)
604      deallocate(qsol,fevap,z0m,z0h,agesno)
605      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
606      deallocate(zmea, zstd, zsig, zgam)
607      deallocate(zthe, zpic, zval)
608      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
609      deallocate(qs_ancien, ql_ancien)
610      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
611      deallocate(qtc_cv,sigt_cv)
612      deallocate(u_ancien, v_ancien)
613      deallocate(tr_ancien)                           !RomP
614      deallocate(ratqs, pbl_tke,coefh,coefm)
615!nrlmd<
616      deallocate(delta_tsurf)
617!>nrlmd
618      deallocate(zmax0, f0)
619      deallocate(sig1, w01)
620      deallocate(entr_therm, fm_therm)
621      deallocate(detr_therm)
622      deallocate(clwcon0th, rnebcon0th)
623! radiation outputs
624      deallocate(swdn0, swdn)
625      deallocate(swup0, swup)
626      deallocate(lwdn0, lwdn)
627      deallocate(lwup0, lwup)
628      deallocate(SWdn200clr, SWdn200)
629      deallocate(SWup200clr, SWup200)
630      deallocate(LWdn200clr, LWdn200)
631      deallocate(LWup200clr, LWup200)
632      deallocate(LWdnTOA, LWdnTOAclr)
633! pressure level
634      deallocate(tsumSTD)
635      deallocate(usumSTD, vsumSTD)
636      deallocate(wsumSTD, phisumSTD)
637      deallocate(tnondef)
638      deallocate(qsumSTD, rhsumSTD)
639      deallocate(uvsumSTD)
640      deallocate(vqsumSTD)
641      deallocate(vTsumSTD)
642      deallocate(wqsumSTD)
643      deallocate(vphisumSTD)
644      deallocate(wTsumSTD)
645      deallocate(u2sumSTD)
646      deallocate(v2sumSTD)
647      deallocate(T2sumSTD)
648      deallocate(O3sumSTD)
649      deallocate(O3daysumSTD)
650!IM beg
651      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
652      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
653!IM end
654      deallocate(seed_old)
655      deallocate(zuthe, zvthe)
656      deallocate(alb_neig)
657      deallocate(ema_cbmf)
658      deallocate(ema_pcb, ema_pct)
659      deallocate(Ma, qcondc)
660      deallocate(wd, sigd)
661      deallocate(cin, ALE, ALP)
662      deallocate(ftd, fqd)
663      deallocate(Ale_bl, Alp_bl)
664      deallocate(lalim_conv, wght_th)
665      deallocate(wake_deltat, wake_deltaq)
666      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
667      deallocate(dt_wake, dq_wake)
668!jyg<
669      deallocate(wake_delta_pbl_TKE)
670!>jyg
671      deallocate(pfrac_impa, pfrac_nucl)
672      deallocate(pfrac_1nucl)
673      deallocate(total_rain, nday_rain)
674      deallocate(paire_ter)
675      deallocate(albsol1, albsol2)
676!albedo SB >>>
677      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
678!albedo SB <<<
679      deallocate(wo)
680      deallocate(clwcon0,rnebcon0)
681      deallocate(heat, heat0)
682      deallocate(cool, cool0)
683      deallocate(topsw, toplw)
684      deallocate(sollwdown, sollwdownclr)
685      deallocate(gustiness)
686      deallocate(toplwdown, toplwdownclr)
687      deallocate(topsw0,toplw0,solsw0,sollw0)
688      deallocate(albpla)
689!IM ajout variables CFMIP2/CMIP5
690      deallocate(heatp, coolp)
691      deallocate(heat0p, cool0p)
692      deallocate(radsolp, topswp, toplwp)
693      deallocate(albplap)
694      deallocate(solswp, sollwp)
695      deallocate(sollwdownp)
696      deallocate(topsw0p,toplw0p)
697      deallocate(solsw0p,sollw0p)
698      deallocate(lwdn0p, lwdnp)
699      deallocate(lwup0p, lwupp)
700      deallocate(swdn0p, swdnp)
701      deallocate(swup0p, swupp)
702      deallocate(cape)
703      deallocate(pbase,bbase)
704      deallocate(zqasc)
705      deallocate(ibas_con, itop_con)
706      deallocate(rain_con, snow_con)
707      deallocate(rlonPOS)
708      deallocate(newsst)
709      deallocate(ustar,u10m, v10m,wstar)
710      deallocate(topswad, solswad)
711      deallocate(topswai, solswai)
712      deallocate(tau_aero,piz_aero,cg_aero)
713      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
714      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
715      deallocate(ccm)
716      if (ok_gwd_rando) deallocate(du_gwd_rando)
717      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
718       
719!!! nrlmd le 10/04/2012
720      deallocate(ale_bl_trig)
721!!! fin nrlmd le 10/04/2012
722
723END SUBROUTINE phys_state_var_end
724
725      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.