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

Last change on this file since 2586 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
RevLine 
[1403]1!
2! $Id: phys_state_var_mod.F90 2499 2016-04-24 10:38:19Z jbmadeleine $
3!
[909]4      MODULE phys_state_var_mod
5! Variables sauvegardees pour le startphy.nc
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11      USE dimphy
[2271]12      USE netcdf, only: nf90_fill_real
[952]13      INTEGER, PARAMETER :: nlevSTD=17
[1352]14      INTEGER, PARAMETER :: nlevSTD8=8
15      INTEGER, PARAMETER :: nlevSTD3=3
[952]16      INTEGER, PARAMETER :: nout=3
17      INTEGER, PARAMETER :: napisccp=1
[967]18      INTEGER, SAVE :: radpas
[2271]19      REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
[1352]20!$OMP THREADPRIVATE(radpas)
[1279]21      REAL, SAVE :: dtime, solaire_etat0
22!$OMP THREADPRIVATE(dtime, solaire_etat0)
[967]23
[2399]24      REAL, ALLOCATABLE, SAVE :: pctsrf(:,:)
25!$OMP THREADPRIVATE(pctsrf)
[909]26      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
[967]27!$OMP THREADPRIVATE(ftsol)
[2243]28      REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
29!$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
[967]30!      character(len=6), SAVE :: ocean
31!!!!!!$OMP THREADPRIVATE(ocean)
32!      logical, SAVE :: ok_veget
33!!!!!!$OMP THREADPRIVATE(ok_veget)
[909]34      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
[967]35!$OMP THREADPRIVATE(falb1, falb2)
[2227]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
[909]44      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
[967]45!$OMP THREADPRIVATE( rain_fall, snow_fall)
[909]46      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
[967]47!$OMP THREADPRIVATE(solsw, sollw)
[909]48      REAL, ALLOCATABLE, SAVE :: radsol(:)
[967]49!$OMP THREADPRIVATE(radsol)
[2366]50      REAL, ALLOCATABLE, SAVE :: swradcorr(:)
51!$OMP THREADPRIVATE(swradcorr)
[967]52
[909]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(:)
[967]58!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
[909]59      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
[967]60!$OMP THREADPRIVATE(zthe, zpic, zval)
[909]61!     REAL tabcntr0(100)
62      REAL, ALLOCATABLE, SAVE :: rugoro(:)
[967]63!$OMP THREADPRIVATE(rugoro)
[909]64      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
[967]65!$OMP THREADPRIVATE(t_ancien, q_ancien)
[2497]66      REAL, ALLOCATABLE, SAVE :: ql_ancien(:,:), qs_ancien(:,:)
67!$OMP THREADPRIVATE(ql_ancien, qs_ancien)
[2499]68      REAL, ALLOCATABLE, SAVE :: prw_ancien(:), prlw_ancien(:), prsw_ancien(:)
69!$OMP THREADPRIVATE(prw_ancien, prlw_ancien, prsw_ancien)
[1054]70      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
71!$OMP THREADPRIVATE(u_ancien, v_ancien)
[1742]72!!! RomP >>>
73      REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:)
74!$OMP THREADPRIVATE(tr_ancien)
75!!! RomP <<<
[909]76      LOGICAL, SAVE :: ancien_ok
[967]77!$OMP THREADPRIVATE(ancien_ok)
[909]78      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
[967]79!$OMP THREADPRIVATE(clwcon,rnebcon)
[2205]80      REAL, ALLOCATABLE, SAVE :: qtc_cv(:,:),sigt_cv(:,:)
81!$OMP THREADPRIVATE(qtc_cv,sigt_cv)
[909]82      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
[967]83!$OMP THREADPRIVATE(ratqs)
[909]84      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
[1761]85      REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie
86      REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum
87!$OMP THREADPRIVATE(pbl_tke, coefh,coefm)
[2159]88!nrlmd<
89      REAL, ALLOCATABLE, SAVE :: delta_tsurf(:,:) ! Surface temperature difference inside-outside cold pool
90!$OMP THREADPRIVATE(delta_tsurf)
91!>nrlmd
[927]92      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
[967]93!$OMP THREADPRIVATE(zmax0,f0)
[1827]94      REAL, ALLOCATABLE, SAVE :: sig1(:,:), w01(:,:)
95!$OMP THREADPRIVATE(sig1,w01)
[942]96      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
[967]97!$OMP THREADPRIVATE(entr_therm,fm_therm)
[952]98      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
[967]99!$OMP THREADPRIVATE(detr_therm)
[952]100!IM 150408
101!     pour phsystoke avec thermiques
102      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
[967]103!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
[952]104! radiation outputs
105      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
[967]106!$OMP THREADPRIVATE(swdn0,swdn)
[952]107      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
[967]108!$OMP THREADPRIVATE(swup0,swup)
[952]109      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
[967]110!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
[952]111      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
[967]112!$OMP THREADPRIVATE(SWup200clr,SWup200)
[952]113      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
[967]114!$OMP THREADPRIVATE(lwdn0,lwdn)
[952]115      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
[967]116!$OMP THREADPRIVATE(lwup0,lwup)
[952]117      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
[967]118!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
[952]119      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
[967]120!$OMP THREADPRIVATE(LWup200clr,LWup200)
[952]121      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
[967]122!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
[952]123! pressure level
124      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
[967]125!$OMP THREADPRIVATE(tsumSTD)
[952]126      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
[967]127!$OMP THREADPRIVATE(usumSTD,vsumSTD)
[952]128      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
[967]129!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
[952]130      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
[967]131!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
[952]132      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
[967]133!$OMP THREADPRIVATE(tnondef)
[952]134      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
[967]135!$OMP THREADPRIVATE(uvsumSTD)
[952]136      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
[967]137!$OMP THREADPRIVATE(vqsumSTD)
[952]138      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
[967]139!$OMP THREADPRIVATE(vTsumSTD)
[952]140      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
[967]141!$OMP THREADPRIVATE(wqsumSTD)
[952]142      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
[967]143!$OMP THREADPRIVATE(vphisumSTD)
[952]144      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
[967]145!$OMP THREADPRIVATE(wTsumSTD)
[952]146      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
[967]147!$OMP THREADPRIVATE(u2sumSTD)
[952]148      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
[967]149!$OMP THREADPRIVATE(v2sumSTD)
[952]150      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
[967]151!$OMP THREADPRIVATE(T2sumSTD)
[1398]152      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
153!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
[1352]154!IM begin
155      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
[1362]156!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
[1352]157      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
[1362]158!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
[1352]159      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
[1362]160!$OMP THREADPRIVATE(philevSTD)
[1352]161      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
[1362]162!$OMP THREADPRIVATE(uvSTD)
[1352]163      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
[1362]164!$OMP THREADPRIVATE(vqSTD)
[1352]165      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
[1362]166!$OMP THREADPRIVATE(vTSTD)
[1352]167      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
[1362]168!$OMP THREADPRIVATE(wqSTD)
[1352]169      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
[1362]170!$OMP THREADPRIVATE(vphiSTD)
[1352]171      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
[1362]172!$OMP THREADPRIVATE(wTSTD)
[1352]173      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
[1362]174!$OMP THREADPRIVATE(u2STD)
[1352]175      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
[1362]176!$OMP THREADPRIVATE(v2STD)
[1352]177      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
[1362]178!$OMP THREADPRIVATE(T2STD)
[1398]179      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
180!$OMP THREADPRIVATE(O3STD,O3daySTD)
[1352]181!IM end
[952]182      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
[967]183!$OMP THREADPRIVATE(seed_old)
[952]184      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
[967]185!$OMP THREADPRIVATE(zuthe,zvthe)
[952]186      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
[967]187!$OMP THREADPRIVATE(alb_neig)
[952]188!cloud base mass flux
[1398]189      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
190!$OMP THREADPRIVATE(ema_cbmf)
[952]191!cloud base pressure & cloud top pressure
192      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
[967]193!$OMP THREADPRIVATE(ema_pcb,ema_pct)
[952]194      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
[967]195!$OMP THREADPRIVATE(Ma)
[952]196      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
[967]197!$OMP THREADPRIVATE(qcondc)
[952]198      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
[967]199!$OMP THREADPRIVATE(wd)
[952]200      REAL,ALLOCATABLE,SAVE :: sigd(:)
[967]201!$OMP THREADPRIVATE(sigd)
[952]202!
203      REAL,ALLOCATABLE,SAVE :: cin(:)
[967]204!$OMP THREADPRIVATE(cin)
[952]205! ftd : differential heating between wake and environment
206      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
[967]207!$OMP THREADPRIVATE(ftd)
[952]208! fqd : differential moistening between wake and environment
209      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
[967]210!$OMP THREADPRIVATE(fqd)
[952]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(:)
[967]216!$OMP THREADPRIVATE(ALE)
[952]217!ALP : Puissance  disponible pour soulevement
218      REAL,ALLOCATABLE,SAVE :: ALP(:)
[967]219!$OMP THREADPRIVATE(ALP)
[952]220!
221! nouvelles variables pour le couplage convection-couche limite
222      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
[967]223!$OMP THREADPRIVATE(Ale_bl)
[952]224      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
[967]225!$OMP THREADPRIVATE(Alp_bl)
[952]226      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
[967]227!$OMP THREADPRIVATE(lalim_conv)
[952]228      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
[967]229!$OMP THREADPRIVATE(wght_th)
[952]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
[1403]236! wake_pe     : wake potential energy - WAPE
[952]237! wake_fip    : Gust Front Impinging power - ALP
238! dt_wake, dq_wake: LS tendencies due to wake
239      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
[967]240!$OMP THREADPRIVATE(wake_deltat)
[952]241      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
[967]242!$OMP THREADPRIVATE(wake_deltaq)
[952]243      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
[967]244!$OMP THREADPRIVATE(wake_Cstar)
[952]245      REAL,ALLOCATABLE,SAVE :: wake_s(:)
[967]246!$OMP THREADPRIVATE(wake_s)
[1403]247      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
248!$OMP THREADPRIVATE(wake_pe)
[952]249      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
[967]250!$OMP THREADPRIVATE(wake_fip)
[952]251      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
[967]252!$OMP THREADPRIVATE(dt_wake)
[952]253      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
[967]254!$OMP THREADPRIVATE(dq_wake)
[952]255!
[2159]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!
[952]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(:,:)
[967]268!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
[952]269      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
[967]270!$OMP THREADPRIVATE(pfrac_1nucl)
[952]271!
272      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
[967]273!$OMP THREADPRIVATE(total_rain,nday_rain)
[952]274      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
[967]275!$OMP THREADPRIVATE(paire_ter)
[952]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(:)
[967]279!$OMP THREADPRIVATE(albsol1,albsol2)
[1279]280
[2227]281!albedo SB >>>
282      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
283!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
284!albedo SB <<<
285
286
[1279]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
[952]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(:,:)
[967]303!$OMP THREADPRIVATE(clwcon0,rnebcon0)
[952]304      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
[967]305!$OMP THREADPRIVATE(heat)
[952]306      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
[967]307!$OMP THREADPRIVATE(heat0)
[952]308      REAL,ALLOCATABLE,SAVE :: cool(:,:)
[967]309!$OMP THREADPRIVATE(cool)
[952]310      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
[967]311!$OMP THREADPRIVATE(cool0)
[952]312      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
[967]313!$OMP THREADPRIVATE(topsw,toplw)
[952]314      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
[967]315!$OMP THREADPRIVATE(sollwdown)
[2240]316      REAL,ALLOCATABLE,SAVE :: gustiness(:)
317!$OMP THREADPRIVATE(gustiness)
[952]318      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
[967]319!$OMP THREADPRIVATE(sollwdownclr)
[952]320      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
[967]321!$OMP THREADPRIVATE(toplwdown)
[952]322      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
[967]323!$OMP THREADPRIVATE(toplwdownclr)
[952]324      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
[967]325!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
[952]326      REAL,ALLOCATABLE,SAVE :: albpla(:)
[967]327!$OMP THREADPRIVATE(albpla)
[1539]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
[952]352! pbase : cloud base pressure
353! bbase : cloud base buoyancy
354      REAL,ALLOCATABLE,SAVE :: cape(:)
[967]355!$OMP THREADPRIVATE(cape)
[952]356      REAL,ALLOCATABLE,SAVE :: pbase(:)
[967]357!$OMP THREADPRIVATE(pbase)
[952]358      REAL,ALLOCATABLE,SAVE :: bbase(:)
[967]359!$OMP THREADPRIVATE(bbase)
[952]360!
361      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
[967]362!$OMP THREADPRIVATE( zqasc)
[952]363      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
[967]364!$OMP THREADPRIVATE(ibas_con,itop_con)
[952]365      REAL,SAVE,ALLOCATABLE :: rain_con(:)
[967]366!$OMP THREADPRIVATE(rain_con)
[952]367      REAL,SAVE,ALLOCATABLE :: snow_con(:)
[967]368!$OMP THREADPRIVATE(snow_con)
[952]369!
370      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
[967]371!$OMP THREADPRIVATE(rlonPOS)
[952]372      REAL,SAVE,ALLOCATABLE :: newsst(:)
[967]373!$OMP THREADPRIVATE(newsst)
[1813]374      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
375!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
[952]376!
377! ok_ade=T -ADE=topswad-topsw
378! ok_aie=T ->
379!       ok_ade=T -AIE=topswai-topswad
[1279]380!       ok_ade=F -AIE=topswai-topsw
[952]381!
382!topswad, solswad : Aerosol direct effect
383      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
[967]384!$OMP THREADPRIVATE(topswad,solswad)
[952]385!topswai, solswai : Aerosol indirect effect
386      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
[967]387!$OMP THREADPRIVATE(topswai,solswai)
[959]388
[1279]389      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
390!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
[2146]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)
[952]395      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
[967]396!$OMP THREADPRIVATE(ccm)
[952]397
[1638]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
[2333]403      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
404      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
[1938]405      ! tendencies on wind due to gravity waves
406
[909]407CONTAINS
408
409!======================================================================
[1279]410SUBROUTINE phys_state_var_init(read_climoz)
[1785]411USE dimphy
412USE aero_mod
[2320]413USE infotrac_phy, ONLY : nbtr
[1785]414USE indice_sol_mod
[909]415IMPLICIT NONE
[1279]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
[1938]425include "clesphys.h"
[2399]426
[952]427      ALLOCATE(pctsrf(klon,nbsrf))
428      ALLOCATE(ftsol(klon,nbsrf))
[2243]429      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
430      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
[952]431      ALLOCATE(falb1(klon,nbsrf))
432      ALLOCATE(falb2(klon,nbsrf))
[2227]433!albedo SB >>>
434      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
435      ALLOCATE(chl_con(klon))
436!albedo SB <<<
[952]437      ALLOCATE(rain_fall(klon))
438      ALLOCATE(snow_fall(klon))
[909]439      ALLOCATE(solsw(klon), sollw(klon))
[952]440      ALLOCATE(radsol(klon))
[2366]441      ALLOCATE(swradcorr(klon))
[952]442      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
443      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
[909]444
[952]445      ALLOCATE(rugoro(klon))
446      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
[2497]447      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
[2499]448      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
[1054]449      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
[1742]450!!! Rom P >>>
451      ALLOCATE(tr_ancien(klon,klev,nbtr))
452!!! Rom P <<<
[952]453      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
[2205]454      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
[952]455      ALLOCATE(ratqs(klon,klev))
[1761]456      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
[2159]457!nrlmd<
458      ALLOCATE(delta_tsurf(klon,nbsrf))
459!>nrlmd
[1761]460      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
461      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
[927]462      ALLOCATE(zmax0(klon), f0(klon))
[1827]463      ALLOCATE(sig1(klon,klev), w01(klon,klev))
[942]464      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
[952]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))
[1398]493      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
494      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
[1352]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))
[1398]504      ALLOCATE(O3STD(klon,nlevSTD))
505      ALLOCATE(O3daySTD(klon,nlevSTD))
[1352]506!IM end
[952]507      ALLOCATE(seed_old(klon,napisccp))
508      ALLOCATE(zuthe(klon),zvthe(klon))
509      ALLOCATE(alb_neig(klon))
510!cloud base mass flux
[1398]511      ALLOCATE(ema_cbmf(klon))
[952]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))
[1403]526      ALLOCATE(wake_Cstar(klon), wake_s(klon))
527      ALLOCATE(wake_pe(klon), wake_fip(klon))
[952]528      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
[2159]529!jyg<
[2181]530      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
[2159]531!>jyg
[952]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))
[2227]537!albedo SB >>>
538      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
539!albedo SB <<<
[1279]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     
[952]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))
[1539]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))
[2240]562      ALLOCATE(gustiness(klon))
[1539]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
[952]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))
[1813]578      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
[952]579      ALLOCATE(topswad(klon), solswad(klon))
580      ALLOCATE(topswai(klon), solswai(klon))
[1279]581      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
[2146]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))
[1279]586      ALLOCATE(ccm(klon,klev,nbands))
[959]587
[1638]588!!! nrlmd le 10/04/2012
589      ALLOCATE(ale_bl_trig(klon))
590!!! fin nrlmd le 10/04/2012
[2333]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))
[1638]593
[909]594END SUBROUTINE phys_state_var_init
595
596!======================================================================
597SUBROUTINE phys_state_var_end
[2399]598!USE dimphy
[1785]599USE indice_sol_mod
[909]600IMPLICIT NONE
[1938]601include "clesphys.h"
[909]602
[2399]603      deallocate(pctsrf, ftsol, falb1, falb2)
[2243]604      deallocate(qsol,fevap,z0m,z0h,agesno)
[2366]605      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
[952]606      deallocate(zmea, zstd, zsig, zgam)
607      deallocate(zthe, zpic, zval)
608      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
[2497]609      deallocate(qs_ancien, ql_ancien)
[2499]610      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
[2205]611      deallocate(qtc_cv,sigt_cv)
[2499]612      deallocate(u_ancien, v_ancien)
613      deallocate(tr_ancien)                           !RomP
[1761]614      deallocate(ratqs, pbl_tke,coefh,coefm)
[2159]615!nrlmd<
616      deallocate(delta_tsurf)
617!>nrlmd
[952]618      deallocate(zmax0, f0)
[1827]619      deallocate(sig1, w01)
[952]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)
[970]638      deallocate(qsumSTD, rhsumSTD)
[952]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)
[1398]648      deallocate(O3sumSTD)
649      deallocate(O3daysumSTD)
[1352]650!IM beg
651      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
[1398]652      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
[1352]653!IM end
[952]654      deallocate(seed_old)
655      deallocate(zuthe, zvthe)
656      deallocate(alb_neig)
[1398]657      deallocate(ema_cbmf)
[952]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)
[1403]666      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
[952]667      deallocate(dt_wake, dq_wake)
[2159]668!jyg<
669      deallocate(wake_delta_pbl_TKE)
670!>jyg
[952]671      deallocate(pfrac_impa, pfrac_nucl)
672      deallocate(pfrac_1nucl)
673      deallocate(total_rain, nday_rain)
674      deallocate(paire_ter)
675      deallocate(albsol1, albsol2)
[2227]676!albedo SB >>>
677      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
678!albedo SB <<<
[952]679      deallocate(wo)
680      deallocate(clwcon0,rnebcon0)
681      deallocate(heat, heat0)
682      deallocate(cool, cool0)
683      deallocate(topsw, toplw)
684      deallocate(sollwdown, sollwdownclr)
[2240]685      deallocate(gustiness)
[952]686      deallocate(toplwdown, toplwdownclr)
687      deallocate(topsw0,toplw0,solsw0,sollw0)
688      deallocate(albpla)
[1539]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)
[952]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)
[1813]709      deallocate(ustar,u10m, v10m,wstar)
[952]710      deallocate(topswad, solswad)
711      deallocate(topswai, solswai)
[1279]712      deallocate(tau_aero,piz_aero,cg_aero)
[2146]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)
[952]715      deallocate(ccm)
[2333]716      if (ok_gwd_rando) deallocate(du_gwd_rando)
717      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
[959]718       
[1638]719!!! nrlmd le 10/04/2012
720      deallocate(ale_bl_trig)
721!!! fin nrlmd le 10/04/2012
722
[909]723END SUBROUTINE phys_state_var_end
724
725      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.