MODULE phys_state_var_mod ! Variables sauvegardees pour le startphy.nc !====================================================================== ! ! !====================================================================== ! Declaration des variables USE dimphy INTEGER, PARAMETER :: nlevSTD=17 INTEGER, PARAMETER :: nout=3 INTEGER, PARAMETER :: napisccp=1 REAL, SAVE :: dtime, co2_ppm_etat0, solaire_etat0 REAL, ALLOCATABLE, SAVE :: rlat(:), rlon(:), pctsrf(:,:) REAL, ALLOCATABLE, SAVE :: ftsol(:,:) character(len=6), SAVE :: ocean logical, SAVE :: ok_veget REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:) REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:) REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:) REAL, ALLOCATABLE, SAVE :: radsol(:) !clesphy0 param physiq ! ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): ! REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:) REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:) ! REAL tabcntr0(100) REAL, ALLOCATABLE, SAVE :: rugoro(:) REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:) LOGICAL, SAVE :: ancien_ok REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:) REAL, ALLOCATABLE, SAVE :: ratqs(:,:) REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) ! REAL, ALLOCATABLE, SAVE :: ema_work1(:,:), ema_work2(:,:) REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:) REAL, ALLOCATABLE, SAVE :: detr_therm(:,:) !IM 150408 ! pour phsystoke avec thermiques REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:) ! radiation outputs REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:) REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:) REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:) REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:) REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:) REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:) REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:) REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:) REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:) ! pressure level REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:) REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:) REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:) INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:) REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:) REAL,ALLOCATABLE,SAVE :: alb_neig(:) !cloud base mass flux REAL,ALLOCATABLE,SAVE :: ema_workcbmf(:), ema_cbmf(:) !cloud base pressure & cloud top pressure REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:) REAL,ALLOCATABLE,SAVE :: Ma(:,:) ! undilute upward mass flux REAL,ALLOCATABLE,SAVE :: qcondc(:,:) ! in-cld water content from convect REAL,ALLOCATABLE,SAVE :: wd(:) ! sb REAL,ALLOCATABLE,SAVE :: sigd(:) ! REAL,ALLOCATABLE,SAVE :: cin(:) ! ftd : differential heating between wake and environment REAL,ALLOCATABLE,SAVE :: ftd(:,:) ! fqd : differential moistening between wake and environment REAL,ALLOCATABLE,SAVE :: fqd(:,:) !34EK ! -- Variables de controle de ALE et ALP !ALE : Energie disponible pour soulevement : utilisee par la ! convection d'Emanuel pour le declenchement et la regulation REAL,ALLOCATABLE,SAVE :: ALE(:) !ALP : Puissance disponible pour soulevement REAL,ALLOCATABLE,SAVE :: ALP(:) ! ! nouvelles variables pour le couplage convection-couche limite REAL,ALLOCATABLE,SAVE :: Ale_bl(:) REAL,ALLOCATABLE,SAVE :: Alp_bl(:) INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:) REAL,ALLOCATABLE,SAVE :: wght_th(:,:) ! ! variables de la wake ! wake_deltat : ecart de temperature avec la zone non perturbee ! wake_deltaq : ecart d'humidite avec la zone non perturbee ! wake_Cstar : vitesse d'etalement de la poche ! wake_s : fraction surfacique occupee par la poche froide ! wake_fip : Gust Front Impinging power - ALP ! dt_wake, dq_wake: LS tendencies due to wake REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:) REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:) REAL,ALLOCATABLE,SAVE :: wake_Cstar(:) REAL,ALLOCATABLE,SAVE :: wake_s(:) REAL,ALLOCATABLE,SAVE :: wake_fip(:) REAL,ALLOCATABLE,SAVE :: dt_wake(:,:) REAL,ALLOCATABLE,SAVE :: dq_wake(:,:) ! ! pfrac_impa : Produits des coefs lessivage impaction ! pfrac_nucl : Produits des coefs lessivage nucleation ! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1) REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:) REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:) ! REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) REAL,ALLOCATABLE,SAVE :: paire_ter(:) ! albsol1: albedo du sol total pour SW visible ! albsol2: albedo du sol total pour SW proche IR REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:) REAL,ALLOCATABLE,SAVE :: wo(:,:) ! ! heat : chauffage solaire ! heat0: chauffage solaire ciel clair ! cool : refroidissement infrarouge ! cool0 : refroidissement infrarouge ciel clair ! sollwdown : downward LW flux at surface ! sollwdownclr : downward CS LW flux at surface ! toplwdown : downward CS LW flux at TOA ! toplwdownclr : downward CS LW flux at TOA REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:) REAL,ALLOCATABLE,SAVE :: heat(:,:) REAL,ALLOCATABLE,SAVE :: heat0(:,:) REAL,ALLOCATABLE,SAVE :: cool(:,:) REAL,ALLOCATABLE,SAVE :: cool0(:,:) REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:) REAL,ALLOCATABLE,SAVE :: sollwdown(:) REAL,ALLOCATABLE,SAVE :: sollwdownclr(:) REAL,ALLOCATABLE,SAVE :: toplwdown(:) REAL,ALLOCATABLE,SAVE :: toplwdownclr(:) REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:) REAL,ALLOCATABLE,SAVE :: albpla(:) ! pbase : cloud base pressure ! bbase : cloud base buoyancy REAL,ALLOCATABLE,SAVE :: cape(:) REAL,ALLOCATABLE,SAVE :: pbase(:) REAL,ALLOCATABLE,SAVE :: bbase(:) ! REAL,SAVE,ALLOCATABLE :: zqasc(:,:) INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:) REAL,SAVE,ALLOCATABLE :: rain_con(:) REAL,SAVE,ALLOCATABLE :: snow_con(:) ! ! sulfate_pi : SO4 aerosol concentration [ug/m3] (pre-industrial value) REAL,SAVE,ALLOCATABLE :: sulfate_pi(:, :) REAL,SAVE,ALLOCATABLE :: rlonPOS(:) REAL,SAVE,ALLOCATABLE :: newsst(:) REAL,SAVE,ALLOCATABLE :: u10m(:,:), v10m(:,:) ! ! ok_ade=T -ADE=topswad-topsw ! ok_aie=T -> ! ok_ade=T -AIE=topswai-topswad ! ok_ade=F -AIE=topswai-topsw ! !topswad, solswad : Aerosol direct effect REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:) !topswai, solswai : Aerosol indirect effect REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:) REAL,SAVE,ALLOCATABLE :: tau_ae(:,:,:), piz_ae(:,:,:) REAL,SAVE,ALLOCATABLE :: cg_ae(:,:,:) ! Les variables suivants uniquement pour un configuration avec INCA ! topswad_inca, solswad_inca : Aerosol direct effect REAL,SAVE,ALLOCATABLE :: topswad_inca(:), solswad_inca(:) ! topswad0_inca, solswad0_inca : Aerosol direct effect REAL,SAVE,ALLOCATABLE :: topswad0_inca(:), solswad0_inca(:) ! topswai_inca, solswai_inca : Aerosol indirect effect REAL,SAVE,ALLOCATABLE :: topswai_inca(:), solswai_inca(:) REAL,SAVE,ALLOCATABLE :: topsw_inca(:,:), solsw_inca(:,:) REAL,SAVE,ALLOCATABLE :: topsw0_inca(:,:), solsw0_inca(:,:) REAL,SAVE,ALLOCATABLE :: tau_inca(:,:,:,:) REAL,SAVE,ALLOCATABLE :: piz_inca(:,:,:,:) REAL,SAVE,ALLOCATABLE :: cg_inca(:,:,:,:) REAL,SAVE,ALLOCATABLE :: ccm(:,:,:) CONTAINS !====================================================================== SUBROUTINE phys_state_var_init use dimphy IMPLICIT NONE #include "indicesol.h" #include "control.h" ALLOCATE(rlat(klon), rlon(klon)) ALLOCATE(pctsrf(klon,nbsrf)) ALLOCATE(ftsol(klon,nbsrf)) ALLOCATE(falb1(klon,nbsrf)) ALLOCATE(falb2(klon,nbsrf)) ALLOCATE(rain_fall(klon)) ALLOCATE(snow_fall(klon)) ALLOCATE(solsw(klon), sollw(klon)) ALLOCATE(radsol(klon)) ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon)) ALLOCATE(zthe(klon), zpic(klon), zval(klon)) ALLOCATE(rugoro(klon)) ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev)) ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev)) ALLOCATE(ratqs(klon,klev)) ALLOCATE(pbl_tke(klon,klev+1,nbsrf)) ALLOCATE(zmax0(klon), f0(klon)) ALLOCATE(ema_work1(klon,klev), ema_work2(klon,klev)) ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1)) ALLOCATE(detr_therm(klon,klev)) ! pour phsystoke avec thermiques ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev)) ! radiation outputs ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1)) ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1)) ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1)) ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1)) ALLOCATE(SWdn200clr(klon), SWdn200(klon)) ALLOCATE(SWup200clr(klon), SWup200(klon)) ALLOCATE(LWdn200clr(klon), LWdn200(klon)) ALLOCATE(LWup200clr(klon), LWup200(klon)) ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon)) ! pressure level ALLOCATE(tsumSTD(klon,nlevSTD,nout)) ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout)) ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout)) ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout)) ALLOCATE(tnondef(klon,nlevSTD,nout)) ALLOCATE(uvsumSTD(klon,nlevSTD,nout)) ALLOCATE(vqsumSTD(klon,nlevSTD,nout)) ALLOCATE(vTsumSTD(klon,nlevSTD,nout)) ALLOCATE(wqsumSTD(klon,nlevSTD,nout)) ALLOCATE(vphisumSTD(klon,nlevSTD,nout)) ALLOCATE(wTsumSTD(klon,nlevSTD,nout)) ALLOCATE(u2sumSTD(klon,nlevSTD,nout)) ALLOCATE(v2sumSTD(klon,nlevSTD,nout)) ALLOCATE(T2sumSTD(klon,nlevSTD,nout)) ALLOCATE(seed_old(klon,napisccp)) ALLOCATE(zuthe(klon),zvthe(klon)) ALLOCATE(alb_neig(klon)) !cloud base mass flux ALLOCATE(ema_workcbmf(klon), ema_cbmf(klon)) !cloud base pressure & cloud top pressure ALLOCATE(ema_pcb(klon), ema_pct(klon)) ! ALLOCATE(Ma(klon,klev)) ALLOCATE(qcondc(klon,klev)) ALLOCATE(wd(klon)) ALLOCATE(sigd(klon)) ALLOCATE(cin(klon), ALE(klon), ALP(klon)) ALLOCATE(ftd(klon,klev), fqd(klon,klev)) ALLOCATE(Ale_bl(klon)) ALLOCATE(Alp_bl(klon)) ALLOCATE(lalim_conv(klon)) ALLOCATE(wght_th(klon,klev)) ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev)) ALLOCATE(wake_Cstar(klon), wake_s(klon), wake_fip(klon)) ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev)) ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev)) ALLOCATE(pfrac_1nucl(klon,klev)) ALLOCATE(total_rain(klon), nday_rain(klon)) ALLOCATE(paire_ter(klon)) ALLOCATE(albsol1(klon), albsol2(klon)) ALLOCATE(wo(klon,klev)) ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev)) ALLOCATE(heat(klon,klev), heat0(klon,klev)) ALLOCATE(cool(klon,klev), cool0(klon,klev)) ALLOCATE(topsw(klon), toplw(klon)) ALLOCATE(sollwdown(klon), sollwdownclr(klon)) ALLOCATE(toplwdown(klon), toplwdownclr(klon)) ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon)) ALLOCATE(albpla(klon)) ALLOCATE(cape(klon)) ALLOCATE(pbase(klon),bbase(klon)) ALLOCATE(zqasc(klon,klev)) ALLOCATE(ibas_con(klon), itop_con(klon)) ALLOCATE(rain_con(klon), snow_con(klon)) ! ALLOCATE(sulfate_pi(klon, klev)) ALLOCATE(rlonPOS(klon)) ALLOCATE(newsst(klon)) ALLOCATE(u10m(klon,nbsrf), v10m(klon,nbsrf)) ALLOCATE(topswad(klon), solswad(klon)) ALLOCATE(topswai(klon), solswai(klon)) ALLOCATE(tau_ae(klon,klev,2), piz_ae(klon,klev,2)) ALLOCATE(cg_ae(klon,klev,2)) IF (config_inca /= 'none') THEN ALLOCATE(topswad_inca(klon), solswad_inca(klon)) ALLOCATE(topswad0_inca(klon), solswad0_inca(klon)) ALLOCATE(topswai_inca(klon), solswai_inca(klon)) ALLOCATE(topsw_inca(klon,9), solsw_inca(klon,9)) ALLOCATE(topsw0_inca(klon,9), solsw0_inca(klon,9)) END IF ! Following 4 variables are needed only by INCA but must be ! allocated as they exist in the phytrac argument list ALLOCATE(tau_inca(klon,klev,9,2)) ALLOCATE(piz_inca(klon,klev,9,2)) ALLOCATE(cg_inca(klon,klev,9,2)) ALLOCATE(ccm(klon,klev,2)) END SUBROUTINE phys_state_var_init !====================================================================== SUBROUTINE phys_state_var_end use dimphy IMPLICIT NONE #include "indicesol.h" #include "control.h" deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2) deallocate(rain_fall, snow_fall, solsw, sollw, radsol) deallocate(zmea, zstd, zsig, zgam) deallocate(zthe, zpic, zval) deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon) deallocate(ratqs, pbl_tke) deallocate(zmax0, f0) deallocate(ema_work1, ema_work2) deallocate(entr_therm, fm_therm) deallocate(detr_therm) deallocate(clwcon0th, rnebcon0th) ! radiation outputs deallocate(swdn0, swdn) deallocate(swup0, swup) deallocate(lwdn0, lwdn) deallocate(lwup0, lwup) deallocate(SWdn200clr, SWdn200) deallocate(SWup200clr, SWup200) deallocate(LWdn200clr, LWdn200) deallocate(LWup200clr, LWup200) deallocate(LWdnTOA, LWdnTOAclr) ! pressure level deallocate(tsumSTD) deallocate(usumSTD, vsumSTD) deallocate(wsumSTD, phisumSTD) deallocate(tnondef) deallocate(uvsumSTD) deallocate(vqsumSTD) deallocate(vTsumSTD) deallocate(wqsumSTD) deallocate(vphisumSTD) deallocate(wTsumSTD) deallocate(u2sumSTD) deallocate(v2sumSTD) deallocate(T2sumSTD) deallocate(seed_old) deallocate(zuthe, zvthe) deallocate(alb_neig) deallocate(ema_workcbmf, ema_cbmf) deallocate(ema_pcb, ema_pct) deallocate(Ma, qcondc) deallocate(wd, sigd) deallocate(cin, ALE, ALP) deallocate(ftd, fqd) deallocate(Ale_bl, Alp_bl) deallocate(lalim_conv, wght_th) deallocate(wake_deltat, wake_deltaq) deallocate(wake_Cstar, wake_s, wake_fip) deallocate(dt_wake, dq_wake) deallocate(pfrac_impa, pfrac_nucl) deallocate(pfrac_1nucl) deallocate(total_rain, nday_rain) deallocate(paire_ter) deallocate(albsol1, albsol2) deallocate(wo) deallocate(clwcon0,rnebcon0) deallocate(heat, heat0) deallocate(cool, cool0) deallocate(topsw, toplw) deallocate(sollwdown, sollwdownclr) deallocate(toplwdown, toplwdownclr) deallocate(topsw0,toplw0,solsw0,sollw0) deallocate(albpla) deallocate(cape) deallocate(pbase,bbase) deallocate(zqasc) deallocate(ibas_con, itop_con) deallocate(rain_con, snow_con) ! deallocate(sulfate_pi) deallocate(rlonPOS) deallocate(newsst) deallocate(u10m, v10m) deallocate(topswad, solswad) deallocate(topswai, solswai) deallocate(tau_ae, piz_ae) deallocate(cg_ae) IF (config_inca /= 'none') THEN deallocate(topswad_inca, solswad_inca) deallocate(topswad0_inca, solswad0_inca) deallocate(topswai_inca, solswai_inca) deallocate(topsw_inca, solsw_inca) deallocate(topsw0_inca, solsw0_inca) END IF deallocate(tau_inca) deallocate(piz_inca) deallocate(cg_inca) deallocate(ccm) END SUBROUTINE phys_state_var_end END MODULE phys_state_var_mod