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

Last change on this file since 3650 was 3606, checked in by acozic, 5 years ago

several commit for branche IPSLCM5A2

  • comment a lot of write on infotrac
  • add initialization for variable pbl_tke (it's use before to be calculed)
  • comment condition to call aerosol_meteo_calc because this routine is now call by all inca version
  • add a condition on output write of od550aer, o865aer, ...loaddust (there are calculed by lmdz only when we work in new physic)
  • 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 3606 2019-11-28 16:07:28Z acozic $
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      pbl_tke(:,:,:) = 0.
458!nrlmd<
459      ALLOCATE(delta_tsurf(klon,nbsrf))
460!>nrlmd
461      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
462      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
463      ALLOCATE(zmax0(klon), f0(klon))
464      ALLOCATE(sig1(klon,klev), w01(klon,klev))
465      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
466      ALLOCATE(detr_therm(klon,klev))
467!     pour phsystoke avec thermiques
468      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
469! radiation outputs
470      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
471      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
472      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
473      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
474      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
475      ALLOCATE(SWup200clr(klon), SWup200(klon))
476      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
477      ALLOCATE(LWup200clr(klon), LWup200(klon))
478      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
479! pressure level
480      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
481      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
482      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
483      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
484      ALLOCATE(tnondef(klon,nlevSTD,nout))
485      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
486      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
487      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
488      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
489      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
490      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
491      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
492      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
493      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
494      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
495      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
496!IM beg
497      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
498      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
499      ALLOCATE(philevSTD(klon,nlevSTD))
500      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
501      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
502      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
503      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
504      ALLOCATE(T2STD(klon,nlevSTD))
505      ALLOCATE(O3STD(klon,nlevSTD))
506      ALLOCATE(O3daySTD(klon,nlevSTD))
507!IM end
508      ALLOCATE(seed_old(klon,napisccp))
509      ALLOCATE(zuthe(klon),zvthe(klon))
510      ALLOCATE(alb_neig(klon))
511!cloud base mass flux
512      ALLOCATE(ema_cbmf(klon))
513!cloud base pressure & cloud top pressure
514      ALLOCATE(ema_pcb(klon), ema_pct(klon))
515!
516      ALLOCATE(Ma(klon,klev))
517      ALLOCATE(qcondc(klon,klev))
518      ALLOCATE(wd(klon))
519      ALLOCATE(sigd(klon))
520      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
521      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
522      ALLOCATE(Ale_bl(klon))
523      ALLOCATE(Alp_bl(klon))
524      ALLOCATE(lalim_conv(klon))
525      ALLOCATE(wght_th(klon,klev))
526      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
527      ALLOCATE(wake_Cstar(klon), wake_s(klon))
528      ALLOCATE(wake_pe(klon), wake_fip(klon))
529      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
530!jyg<
531      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
532!>jyg
533      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
534      ALLOCATE(pfrac_1nucl(klon,klev))
535      ALLOCATE(total_rain(klon), nday_rain(klon))
536      ALLOCATE(paire_ter(klon))
537      ALLOCATE(albsol1(klon), albsol2(klon))
538!albedo SB >>>
539      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
540!albedo SB <<<
541
542      if (read_climoz <= 1) then
543         ALLOCATE(wo(klon,klev, 1))
544      else
545         ! read_climoz == 2
546         ALLOCATE(wo(klon,klev, 2))
547      end if
548     
549      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
550      ALLOCATE(heat(klon,klev), heat0(klon,klev))
551      ALLOCATE(cool(klon,klev), cool0(klon,klev))
552      ALLOCATE(topsw(klon), toplw(klon))
553      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
554      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
555      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
556      ALLOCATE(albpla(klon))
557!IM ajout variables CFMIP2/CMIP5
558      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
559      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
560      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
561      ALLOCATE(albplap(klon))
562      ALLOCATE(solswp(klon), sollwp(klon))
563      ALLOCATE(gustiness(klon))
564      ALLOCATE(sollwdownp(klon))
565      ALLOCATE(topsw0p(klon),toplw0p(klon))
566      ALLOCATE(solsw0p(klon),sollw0p(klon))
567      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
568      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
569      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
570      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
571
572      ALLOCATE(cape(klon))
573      ALLOCATE(pbase(klon),bbase(klon))
574      ALLOCATE(zqasc(klon,klev))
575      ALLOCATE(ibas_con(klon), itop_con(klon))
576      ALLOCATE(rain_con(klon), snow_con(klon))
577      ALLOCATE(rlonPOS(klon))
578      ALLOCATE(newsst(klon))
579      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
580      ALLOCATE(topswad(klon), solswad(klon))
581      ALLOCATE(topswai(klon), solswai(klon))
582      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
583      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
584      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
585      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
586      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
587      ALLOCATE(ccm(klon,klev,nbands))
588
589!!! nrlmd le 10/04/2012
590      ALLOCATE(ale_bl_trig(klon))
591!!! fin nrlmd le 10/04/2012
592      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev))
593      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
594
595END SUBROUTINE phys_state_var_init
596
597!======================================================================
598SUBROUTINE phys_state_var_end
599!USE dimphy
600USE indice_sol_mod
601IMPLICIT NONE
602include "clesphys.h"
603
604      deallocate(pctsrf, ftsol, falb1, falb2)
605      deallocate(qsol,fevap,z0m,z0h,agesno)
606      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
607      deallocate(zmea, zstd, zsig, zgam)
608      deallocate(zthe, zpic, zval)
609      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
610      deallocate(qs_ancien, ql_ancien)
611      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
612      deallocate(qtc_cv,sigt_cv)
613      deallocate(u_ancien, v_ancien)
614      deallocate(tr_ancien)                           !RomP
615      deallocate(ratqs, pbl_tke,coefh,coefm)
616!nrlmd<
617      deallocate(delta_tsurf)
618!>nrlmd
619      deallocate(zmax0, f0)
620      deallocate(sig1, w01)
621      deallocate(entr_therm, fm_therm)
622      deallocate(detr_therm)
623      deallocate(clwcon0th, rnebcon0th)
624! radiation outputs
625      deallocate(swdn0, swdn)
626      deallocate(swup0, swup)
627      deallocate(lwdn0, lwdn)
628      deallocate(lwup0, lwup)
629      deallocate(SWdn200clr, SWdn200)
630      deallocate(SWup200clr, SWup200)
631      deallocate(LWdn200clr, LWdn200)
632      deallocate(LWup200clr, LWup200)
633      deallocate(LWdnTOA, LWdnTOAclr)
634! pressure level
635      deallocate(tsumSTD)
636      deallocate(usumSTD, vsumSTD)
637      deallocate(wsumSTD, phisumSTD)
638      deallocate(tnondef)
639      deallocate(qsumSTD, rhsumSTD)
640      deallocate(uvsumSTD)
641      deallocate(vqsumSTD)
642      deallocate(vTsumSTD)
643      deallocate(wqsumSTD)
644      deallocate(vphisumSTD)
645      deallocate(wTsumSTD)
646      deallocate(u2sumSTD)
647      deallocate(v2sumSTD)
648      deallocate(T2sumSTD)
649      deallocate(O3sumSTD)
650      deallocate(O3daysumSTD)
651!IM beg
652      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
653      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
654!IM end
655      deallocate(seed_old)
656      deallocate(zuthe, zvthe)
657      deallocate(alb_neig)
658      deallocate(ema_cbmf)
659      deallocate(ema_pcb, ema_pct)
660      deallocate(Ma, qcondc)
661      deallocate(wd, sigd)
662      deallocate(cin, ALE, ALP)
663      deallocate(ftd, fqd)
664      deallocate(Ale_bl, Alp_bl)
665      deallocate(lalim_conv, wght_th)
666      deallocate(wake_deltat, wake_deltaq)
667      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
668      deallocate(dt_wake, dq_wake)
669!jyg<
670      deallocate(wake_delta_pbl_TKE)
671!>jyg
672      deallocate(pfrac_impa, pfrac_nucl)
673      deallocate(pfrac_1nucl)
674      deallocate(total_rain, nday_rain)
675      deallocate(paire_ter)
676      deallocate(albsol1, albsol2)
677!albedo SB >>>
678      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
679!albedo SB <<<
680      deallocate(wo)
681      deallocate(clwcon0,rnebcon0)
682      deallocate(heat, heat0)
683      deallocate(cool, cool0)
684      deallocate(topsw, toplw)
685      deallocate(sollwdown, sollwdownclr)
686      deallocate(gustiness)
687      deallocate(toplwdown, toplwdownclr)
688      deallocate(topsw0,toplw0,solsw0,sollw0)
689      deallocate(albpla)
690!IM ajout variables CFMIP2/CMIP5
691      deallocate(heatp, coolp)
692      deallocate(heat0p, cool0p)
693      deallocate(radsolp, topswp, toplwp)
694      deallocate(albplap)
695      deallocate(solswp, sollwp)
696      deallocate(sollwdownp)
697      deallocate(topsw0p,toplw0p)
698      deallocate(solsw0p,sollw0p)
699      deallocate(lwdn0p, lwdnp)
700      deallocate(lwup0p, lwupp)
701      deallocate(swdn0p, swdnp)
702      deallocate(swup0p, swupp)
703      deallocate(cape)
704      deallocate(pbase,bbase)
705      deallocate(zqasc)
706      deallocate(ibas_con, itop_con)
707      deallocate(rain_con, snow_con)
708      deallocate(rlonPOS)
709      deallocate(newsst)
710      deallocate(ustar,u10m, v10m,wstar)
711      deallocate(topswad, solswad)
712      deallocate(topswai, solswai)
713      deallocate(tau_aero,piz_aero,cg_aero)
714      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
715      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
716      deallocate(ccm)
717      if (ok_gwd_rando) deallocate(du_gwd_rando)
718      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
719       
720!!! nrlmd le 10/04/2012
721      deallocate(ale_bl_trig)
722!!! fin nrlmd le 10/04/2012
723
724END SUBROUTINE phys_state_var_end
725
726      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.