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

Last change on this file since 5447 was 2952, checked in by Laurent Fairhead, 7 years ago

Parametrization of drag by copses
Need version 4465 of ORCHIDEE at least

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