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

Last change on this file since 2347 was 2345, checked in by Ehouarn Millour, 9 years ago

Physics/dynamics separation:

  • move test_disvert_m to dynlonlat_phylonlat/phylmd since it is only used by ce0l and relies on dynamics.
  • put "config_inca" in tracinca_mod so physics routines can get the info from there rather than from control_mod.
  • get rid of references to "control_mod" from within the physics.

EM

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