Changeset 2799


Ignore:
Timestamp:
Feb 24, 2017, 7:50:33 PM (8 years ago)
Author:
jyg
Message:

New diagnostics to verify energy conservation.
Some corrections to improve energy conservation.
Some bug correction.

New output variables and new flags are

introduced:

(1)New variables: d_xx_col is the budget over

each column of variable "xx".

(2) fl_ebil: 0 -> no diag; 1 -> diags activated
(3) fl_cor_ebil: 0 -> no correction ensuring

energy conservation; 1 -> first set of
corrections.

+ ok_bad_ecmwf_thermo: if true, a bug setting

RVTMP2 to 0 is fixed; for backward compatibility
the default is "false".

Location:
LMDZ5/trunk/libf/phylmd
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/YOETHF.h

    r2635 r2799  
    1919      REAL R5ALVCP,R5ALSCP,RALVDCP,RALSDCP,RALFDCP,RTWAT,RTBER,RTBERCU
    2020      REAL RTICE,RTICECU,RTWAT_RTICE_R,RTWAT_RTICECU_R,RKOOP1,RKOOP2
     21      LOGICAL OK_BAD_ECMWF_THERMO ! If TRUE, then variables set by rrtm/suphec.F90
     22                                  ! If FALSE, then variables set by suphel.F90
    2123      COMMON /YOETHF/R2ES, R3LES, R3IES, R4LES, R4IES, R5LES, R5IES,    &
    2224     &               RVTMP2, RHOH2O,                                    &
     
    2426     &               RALFDCP,RTWAT,RTBER,RTBERCU,                       &
    2527     &               RTICE,RTICECU,RTWAT_RTICE_R,RTWAT_RTICECU_R,RKOOP1,&
    26      &               RKOOP2
     28     &               RKOOP2,                                            &
     29     &               OK_BAD_ECMWF_THERMO
    2730
    2831!$OMP THREADPRIVATE(/YOETHF/)
  • LMDZ5/trunk/libf/phylmd/climb_hq_mod.F90

    r2159 r2799  
    99  SAVE
    1010  PRIVATE
    11   PUBLIC :: climb_hq_down, climb_hq_up
     11  PUBLIC :: climb_hq_down, climb_hq_up, d_h_col_vdf, f_h_bnd
    1212
    1313  REAL, DIMENSION(:,:), ALLOCATABLE :: gamaq, gamah
     
    2323  REAL, DIMENSION(:,:), ALLOCATABLE :: Kcoefhq
    2424  !$OMP THREADPRIVATE(Kcoefhq)
     25  REAL, SAVE, DIMENSION(:,:), ALLOCATABLE :: h_old ! for diagnostics, h before solving diffusion
     26  !$OMP THREADPRIVATE(h_old)
     27  REAL, SAVE, DIMENSION(:), ALLOCATABLE :: d_h_col_vdf ! for diagnostics, vertical integral of enthalpy change
     28  !$OMP THREADPRIVATE(d_h_col_vdf)
     29  REAL, SAVE, DIMENSION(:), ALLOCATABLE :: f_h_bnd ! for diagnostics, enthalpy flux at surface
     30  !$OMP THREADPRIVATE(d_h_bnd)
    2531
    2632CONTAINS
     
    7177    LOGICAL, SAVE                            :: first=.TRUE.
    7278    !$OMP THREADPRIVATE(first)
    73     REAL, DIMENSION(klon,klev)               :: local_H
     79! JLD now renamed h_old and declared in module
     80!    REAL, DIMENSION(klon,klev)               :: local_H
    7481    REAL, DIMENSION(klon)                    :: psref
    7582    REAL                                     :: delz, pkh
    7683    INTEGER                                  :: k, i, ierr
    77 
    7884! Include
    7985!****************************************************************************************
     
    113119       ALLOCATE(gamah(1:klon,2:klev), STAT=ierr)
    114120       IF ( ierr /= 0 ) PRINT*,' pb in allloc gamah, ierr=', ierr
     121       
     122       ALLOCATE(h_old(klon,klev), STAT=ierr)
     123       IF ( ierr /= 0 )  PRINT*,' pb in allloc h_old, ierr=', ierr
     124       
     125       ALLOCATE(d_h_col_vdf(klon), STAT=ierr)
     126       IF ( ierr /= 0 )  PRINT*,' pb in allloc d_h_col_vdf, ierr=', ierr
     127       
     128       ALLOCATE(f_h_bnd(klon), STAT=ierr)
     129       IF ( ierr /= 0 )  PRINT*,' pb in allloc f_h_bnd, ierr=', ierr
    115130    END IF
    116131
     
    177192!
    178193!****************************************************************************************
    179     local_H(:,:) = 0.0
     194    h_old(:,:) = 0.0
    180195
    181196    DO k=1,klev
    182197       DO i = 1, knon
    183198          ! convertie la temperature en entalpie potentielle
    184           local_H(i,k) = RCPD * temp(i,k) * &
     199          h_old(i,k) = RCPD * temp(i,k) * &
    185200               (psref(i)/pplay(i,k))**RKAPPA
    186201       ENDDO
    187202    ENDDO
    188203
    189     CALL calc_coef(knon, Kcoefhq(:,:), gamah(:,:), delp(:,:), local_H(:,:), &
     204    CALL calc_coef(knon, Kcoefhq(:,:), gamah(:,:), delp(:,:), h_old(:,:), &
    190205         Ccoef_H(:,:), Dcoef_H(:,:), Acoef_H, Bcoef_H)
    191206 
     
    349364! 1)
    350365! Definition of some variables
     366    REAL, DIMENSION(klon,klev)               :: d_h, zairm
    351367!
    352368!****************************************************************************************
     
    355371    d_q(:,:)    = 0.0
    356372    d_t(:,:)    = 0.0
     373    d_h(:,:)    = 0.0
     374    f_h_bnd(:)= 0.0
    357375
    358376    psref(1:knon) = paprs(1:knon,1) 
     
    393411    q_new(1:knon,1) = Acoef_Q(1:knon) + Bcoef_Q(1:knon)*flx_q1(1:knon)*dtime
    394412    h_new(1:knon,1) = Acoef_H(1:knon) + Bcoef_H(1:knon)*flx_h1(1:knon)*dtime
    395    
     413    f_h_bnd(1:knon) = flx_h1(1:knon)
    396414!- All the other layers
    397415    DO k = 2, klev
     
    427445!
    428446!****************************************************************************************
    429 
     447    d_h_col_vdf(:) = 0.0
    430448    DO k = 1, klev
    431449       DO i = 1, knon
    432450          d_t(i,k) = h_new(i,k)/(psref(i)/pplay(i,k))**RKAPPA/RCPD - t_old(i,k)
    433451          d_q(i,k) = q_new(i,k) - q_old(i,k)
    434        END DO
     452          d_h(i,k) = h_new(i,k) - h_old(i,k)
     453!JLD          d_t(i,k) = d_h(i,k)/(psref(i)/pplay(i,k))**RKAPPA/RCPD    !correction a venir
     454    ! layer air mass
     455          zairm(i, k) = (paprs(i,k)-paprs(i,k+1))/rg
     456          d_h_col_vdf(i) = d_h_col_vdf(i) + d_h(i,k)*zairm(i,k)
     457        END DO
    435458    END DO
    436459
     
    448471       DEALLOCATE(Kcoefhq,stat=ierr)
    449472       IF ( ierr /= 0 )  PRINT*,' pb in dealllocate Kcoefhq, ierr=', ierr
     473       DEALLOCATE(h_old, d_h_col_vdf, f_h_bnd, stat=ierr)
     474       IF ( ierr /= 0 )  PRINT*,' pb in dealllocate h_old, d_h_col_vdf, f_h_bnd, ierr=', ierr
    450475    END IF
    451476  END SUBROUTINE climb_hq_up
  • LMDZ5/trunk/libf/phylmd/phys_output_var_mod.F90

    r2752 r2799  
    2424  REAL, SAVE, ALLOCATABLE :: bils_latent(:) ! bilan de chaleur au sol
    2525  !$OMP THREADPRIVATE(bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
     26  ! output variables for energy conservation tests, computed in add_phys_tend
     27  REAL, SAVE, ALLOCATABLE :: d_qw_col(:)      ! watter vapour mass budget for each column (kg/m2/s)
     28  REAL, SAVE, ALLOCATABLE :: d_ql_col(:)      ! liquid watter mass budget for each column (kg/m2/s)
     29  REAL, SAVE, ALLOCATABLE :: d_qs_col(:)      ! solid watter mass budget for each column (kg/m2/s)
     30  REAL, SAVE, ALLOCATABLE :: d_qt_col(:)      ! total watter mass budget for each column (kg/m2/s)
     31  REAL, SAVE, ALLOCATABLE :: d_ek_col(:)      ! kinetic energy budget for each column (W/m2)
     32  REAL, SAVE, ALLOCATABLE :: d_h_dair_col(:)  ! enthalpy budget of dry air for each column (W/m2)
     33  REAL, SAVE, ALLOCATABLE :: d_h_qw_col(:)    ! enthalpy budget of watter vapour for each column (W/m2)
     34  REAL, SAVE, ALLOCATABLE :: d_h_ql_col(:)    ! enthalpy budget of liquid watter for each column (W/m2)
     35  REAL, SAVE, ALLOCATABLE :: d_h_qs_col(:)    ! enthalpy budget of solid watter  for each column (W/m2)
     36  REAL, SAVE, ALLOCATABLE :: d_h_col(:)       ! total enthalpy budget for each column (W/m2)
     37  !$OMP THREADPRIVATE(d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col)
     38  !$OMP THREADPRIVATE(d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col
    2639
    2740! Marine
     
    121134
    122135    allocate (bils_ec(klon),bils_ech(klon),bils_tke(klon),bils_diss(klon),bils_kinetic(klon),bils_enthalp(klon),bils_latent(klon))
     136    allocate (d_qw_col(klon), d_ql_col(klon), d_qs_col(klon), d_qt_col(klon), d_ek_col(klon), d_h_dair_col(klon) &
     137  &         , d_h_qw_col(klon), d_h_ql_col(klon), d_h_qs_col(klon), d_h_col(klon))
     138    d_qw_col=0. ; d_ql_col=0. ; d_qs_col=0. ; d_qt_col=0. ; d_ek_col=0. ; d_h_dair_col =0.
     139    d_h_qw_col=0. ; d_h_ql_col=0. ; d_h_qs_col=0. ; d_h_col=0.
    123140
    124141! Marine
     
    155172    deallocate(snow_o,zfra_o,itau_con)
    156173    deallocate (bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
     174    deallocate (d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col &
     175  &           , d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col)
    157176
    158177! Marine
  • LMDZ5/trunk/libf/phylmd/physiq_mod.F90

    r2795 r2799  
    242242
    243243    USE cmp_seri_mod
     244    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, prt_enerbil, &
     245  &      fl_ebil, fl_cor_ebil
    244246
    245247    !IM stations CFMIP
     
    406408    REAL pphis(klon)
    407409    REAL presnivs(klev)
    408     REAL znivsig(klev)
    409     real pir
     410!JLD    REAL znivsig(klev)
     411!JLD    real pir
    410412
    411413    REAL u(klon,klev)
     
    467469    ! jmin_debut : indice minimum de j; nbptj : nombre de points en
    468470    ! direction j (latitude)
    469     INTEGER imin_debut, nbpti
    470     INTEGER jmin_debut, nbptj
     471!JLD    INTEGER imin_debut, nbpti
     472!JLD    INTEGER jmin_debut, nbptj
    471473    !IM: region='3d' <==> sorties en global
    472474    CHARACTER*3 region
     
    617619    real env_tke_max0(klon)     ! TKE dans l'environnement au LCL
    618620
    619     !---D\'eclenchement stochastique
    620     integer :: tau_trig(klon)
     621!JLD    !---D\'eclenchement stochastique
     622!JLD    integer :: tau_trig(klon)
    621623
    622624    REAL,SAVE :: random_notrig_max=1.
     
    652654    REAL beta_prec_fisrt(klon,klev) ! taux de conv de l'eau cond (fisrt)
    653655    ! RomP <<<
    654 
    655     REAL          :: calday
    656656
    657657    !IM cf FH pour Tiedtke 080604
     
    751751    REAL conv_t(klon,klev) ! convergence de la temperature(K/s)
    752752    !
     753#ifdef INCA
    753754    REAL zxsnow_dummy(klon)
     755#endif
    754756    REAL zsav_tsol(klon)
    755757    !
     
    762764    LOGICAL zx_ajustq
    763765    !
    764     REAL za, zb
    765     REAL zx_t, zx_qs, zdelta, zcor, zlvdcp, zlsdcp
     766    REAL za
     767    REAL zx_t, zx_qs, zdelta, zcor
    766768    real zqsat(klon,klev)
    767769    !
    768     INTEGER i, k, iq, j, nsrf, ll, l
     770    INTEGER i, k, iq, nsrf, l
    769771    !
    770772    REAL t_coup
     
    874876
    875877    !
    876     integer itau_w   ! pas de temps ecriture = itap + itau_phy
     878!JLD    integer itau_w   ! pas de temps ecriture = itap + itau_phy
    877879    !
    878880    !
     
    886888    REAL tabcntr0( length       )
    887889    !
    888     INTEGER ndex2d(nbp_lon*nbp_lat)
     890!JLD    INTEGER ndex2d(nbp_lon*nbp_lat)
    889891    !IM
    890892    !
    891893    !IM AMIP2 BEG
    892     REAL moyglo, mountor
     894!JLD    REAL moyglo, mountor
    893895    !IM 141004 BEG
    894896    REAL zustrdr(klon), zvstrdr(klon)
     
    904906    !  REAL airedyn(nbp_lon+1,nbp_lat)
    905907    !IM 190504 END
    906     LOGICAL ok_msk
    907     REAL msk(klon)
     908!JLD    LOGICAL ok_msk
     909!JLD    REAL msk(klon)
    908910    !ym A voir plus tard
    909911    !ym      REAL zm_wo(jjmp1, klev)
     
    912914    REAL zx_tmp_fi2d(klon)      ! variable temporaire grille physique
    913915    REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D
    914     REAL zx_tmp_2d(nbp_lon,nbp_lat)
    915     REAL zx_lon(nbp_lon,nbp_lat)
    916     REAL zx_lat(nbp_lon,nbp_lat)
     916!JLD    REAL zx_tmp_2d(nbp_lon,nbp_lat)
     917!JLD    REAL zx_lon(nbp_lon,nbp_lat)
     918!JLD    REAL zx_lat(nbp_lon,nbp_lat)
    917919    !
    918920    INTEGER nid_ctesGCM
     
    930932    REAL uq_lay(klon,klev) ! transport zonal de l'eau a chaque niveau vert.
    931933    !
    932     REAL zjulian
    933     SAVE zjulian
    934 !$OMP THREADPRIVATE(zjulian)
    935 
    936     INTEGER nhori, nvert
    937     REAL zsto
    938     REAL zstophy, zout
     934!JLD    REAL zjulian
     935!JLD    SAVE zjulian
     936!JLD!$OMP THREADPRIVATE(zjulian)
     937
     938!JLD    INTEGER nhori, nvert
     939!JLD    REAL zsto
     940!JLD    REAL zstophy, zout
    939941
    940942    character*20 modname
     
    950952    parameter (prof2d_on = 1, prof3d_on = 2, &
    951953         prof2d_av = 3, prof3d_av = 4)
    952     !     Variables liees au bilan d'energie et d'enthalpi
    953954    REAL ztsol(klon)
    954     REAL      d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec
    955     REAL      d_h_vcol_phy
    956     REAL      fs_bound, fq_bound
    957     SAVE      d_h_vcol_phy
    958     !$OMP THREADPRIVATE(d_h_vcol_phy)
    959     REAL      zero_v(klon)
    960     CHARACTER*40 ztit
    961     INTEGER   ip_ebil  ! PRINT level for energy conserv. diag.
    962     SAVE      ip_ebil
    963     DATA      ip_ebil/0/
    964     !$OMP THREADPRIVATE(ip_ebil)
    965955    REAL q2m(klon,nbsrf)  ! humidite a 2m
    966956
    967957    !IM: t2m, q2m, ustar, u10m, v10m et t2mincels, t2maxcels
    968958    CHARACTER*40 t2mincels, t2maxcels       !t2m min., t2m max
    969     CHARACTER*40 tinst, tave, typeval
     959    CHARACTER*40 tinst, tave
    970960    REAL cldtaupi(klon,klev) ! Cloud optical thickness for
    971961    ! pre-industrial (pi) aerosols
     
    10251015    ! vars_climoz(1:read_climoz): variables names in climoz file.
    10261016
    1027     INTEGER ierr
    10281017    include "YOMCST.h"
    10291018    include "YOETHF.h"
     
    10391028    ! Declarations pour Simulateur COSP
    10401029    !============================================================
     1030#ifdef CPP_COSP
    10411031    real :: mr_ozone(klon,klev)
    1042 
     1032#endif
    10431033    !IM stations CFMIP
    10441034    INTEGER, SAVE :: nCFMIP
     
    10891079    !--OB variables for mass fixer (hard coded for now)
    10901080    logical, parameter :: mass_fixer=.false.
    1091     real qql1(klon),qql2(klon),zdz,corrqql
     1081    real qql1(klon),qql2(klon),corrqql
    10921082
    10931083    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
     
    11931183
    11941184    modname = 'physiq'
    1195     !IM
    1196     IF (ip_ebil_phy.ge.1) THEN
    1197        DO i=1,klon
    1198           zero_v(i)=0.
    1199        ENDDO
    1200     ENDIF
    12011185
    12021186    IF (debut) THEN
     
    12101194       iflag_wake_tend = 0
    12111195       CALL getin_p('iflag_wake_tend',iflag_wake_tend)
     1196       ok_bad_ecmwf_thermo=.TRUE. ! By default thermodynamical constants are set
     1197                                  ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
     1198       CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
     1199       fl_ebil = 0 ! by default, conservation diagnostics are desactivated
     1200       CALL getin_p('fl_ebil',fl_ebil)
     1201       fl_cor_ebil = 0 ! by default, no correction to ensure energy conservation
     1202       CALL getin_p('fl_cor_ebil',fl_cor_ebil)
    12121203    ENDIF
    12131204
     
    12731264       clwcon(:,:) = 0.0
    12741265
    1275        !IM     
    1276        IF (ip_ebil_phy.ge.1) d_h_vcol_phy=0.
    12771266       !
    12781267       print*,'iflag_coupl,iflag_clos,iflag_wake', &
     
    20081997     CALL add_phys_tend &
    20091998            (du0,dv0,d_t_eva,d_q_eva,d_ql_eva,d_qi_eva,paprs,&
    2010                'eva',abortphy,flag_inhib_tend)
     1999               'eva',abortphy,flag_inhib_tend,itap)
     2000    call prt_enerbil('eva',itap)
    20112001
    20122002    !=========================================================================
     
    22302220          CALL add_pbl_tend &
    22312221               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,&
    2232                'vdf',abortphy,flag_inhib_tend)
     2222               'vdf',abortphy,flag_inhib_tend,itap)
    22332223       ELSE
    22342224          CALL add_phys_tend &
    22352225               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,&
    2236                'vdf',abortphy,flag_inhib_tend)
    2237        ENDIF
     2226               'vdf',abortphy,flag_inhib_tend,itap)
     2227       ENDIF
     2228       call prt_enerbil('vdf',itap)
    22382229       !--------------------------------------------------------------------
    22392230
     
    26162607
    26172608    CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, &
    2618          'convection',abortphy,flag_inhib_tend)
     2609         'convection',abortphy,flag_inhib_tend,itap)
     2610    call prt_enerbil('convection',itap)
    26192611
    26202612    !-------------------------------------------------------------------------
     
    27452737       ! ajout des tendances des poches froides
    27462738       CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake', &
    2747             abortphy,flag_inhib_tend)
     2739            abortphy,flag_inhib_tend,itap)
     2740       call prt_enerbil('wake',itap)
    27482741       !------------------------------------------------------------------------
    27492742
     
    27542747            (d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_wk, wake_k, &
    27552748             'wake', abortphy)
    2756 
     2749          call prt_enerbil('wake',itap)
    27572750       ENDIF   ! (iflag_wake_tend .GT. 0.)
    27582751
     
    28752868             CALL add_wake_tend &
    28762869                 (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy)
     2870             call prt_enerbil('the',itap)
    28772871          !
    28782872          ENDIF  ! (mod(iflag_pbl_split/2,2) .EQ. 1)
    28792873          !
    28802874          CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
    2881                              dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend)
     2875                             dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend,itap)
     2876          call prt_enerbil('thermals',itap)
    28822877          !
    28832878!
     
    29412936          ! ajout des tendances de l'ajustement sec ou des thermiques
    29422937          CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs, &
    2943                'ajsb',abortphy,flag_inhib_tend)
     2938               'ajsb',abortphy,flag_inhib_tend,itap)
     2939          call prt_enerbil('ajsb',itap)
    29442940          d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:)
    29452941          d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_ajsb(:,:)
     
    29842980    WHERE (snow_lsc < 0) snow_lsc = 0.
    29852981
     2982!+JLD
     2983!    write(*,9000) 'phys lsc',"enerbil: bil_q, bil_e,",rain_lsc+snow_lsc &
     2984!        & ,((rcw-rcpd)*rain_lsc + (rcs-rcpd)*snow_lsc)*t_seri(1,1)-rlvtt*rain_lsc+rlstt*snow_lsc &
     2985!        & ,rain_lsc,snow_lsc
     2986!    write(*,9000) "rcpv","rcw",rcpv,rcw,rcs,t_seri(1,1)
     2987!-JLD
    29862988    CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs, &
    2987          'lsc',abortphy,flag_inhib_tend)
     2989         'lsc',abortphy,flag_inhib_tend,itap)
     2990    call prt_enerbil('lsc',itap)
    29882991    rain_num(:)=0.
    29892992    DO k = 1, klev
     
    37643767    ENDDO
    37653768
    3766     CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy,flag_inhib_tend)
    3767     CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy,flag_inhib_tend)
     3769    CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy,flag_inhib_tend,itap)
     3770    call prt_enerbil('SW',itap)
     3771    CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy,flag_inhib_tend,itap)
     3772    call prt_enerbil('LW',itap)
    37683773
    37693774    !
     
    38353840       ! ajout des tendances de la trainee de l'orographie
    38363841       CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro', &
    3837             abortphy,flag_inhib_tend)
     3842            abortphy,flag_inhib_tend,itap)
     3843       call prt_enerbil('oro',itap)
    38383844       !----------------------------------------------------------------------
    38393845       !
     
    38813887       ! ajout des tendances de la portance de l'orographie
    38823888       CALL add_phys_tend(d_u_lif, d_v_lif, d_t_lif, dq0, dql0, dqi0, paprs, &
    3883             'lif', abortphy,flag_inhib_tend)
     3889            'lif', abortphy,flag_inhib_tend,itap)
     3890       call prt_enerbil('lif',itap)
    38843891    ENDIF ! fin de test sur ok_orolf
    38853892
     
    39043911       d_t_hin(:, :)=0.
    39053912       CALL add_phys_tend(du_gwd_hines, dv_gwd_hines, d_t_hin, dq0, dql0, &
    3906             dqi0, paprs, 'hin', abortphy,flag_inhib_tend)
     3913            dqi0, paprs, 'hin', abortphy,flag_inhib_tend,itap)
     3914       call prt_enerbil('hin',itap)
    39073915    ENDIF
    39083916
     
    39213929
    39223930       CALL add_phys_tend(du_gwd_front, dv_gwd_front, dt0, dq0, dql0, dqi0, &
    3923             paprs, 'front_gwd_rando', abortphy,flag_inhib_tend)
     3931            paprs, 'front_gwd_rando', abortphy,flag_inhib_tend,itap)
     3932       call prt_enerbil('front_gwd_rando',itap)
    39243933    ENDIF
    39253934
     
    39293938            du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress)
    39303939       CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0, dqi0, &
    3931             paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend)
     3940            paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend,itap)
     3941       call prt_enerbil('flott_gwd_rando',itap)
    39323942       zustr_gwd_rando=0.
    39333943       zvstr_gwd_rando=0.
     
    39793989       ! ajout de la tendance d'humidite due au methane
    39803990       CALL add_phys_tend(du0, dv0, dt0, d_q_ch4*dtime, dql0, dqi0, paprs, &
    3981             'q_ch4', abortphy,flag_inhib_tend)
     3991            'q_ch4', abortphy,flag_inhib_tend,itap)
    39823992    ENDIF
    39833993    !
  • LMDZ5/trunk/libf/phylmd/reevap.F90

    r2705 r2799  
    22   &         d_t_eva,d_q_eva,d_ql_eva,d_qs_eva)
    33
    4 
     4    ! flag to include modifications to ensure energy conservation (if flag >0)
     5    USE add_phys_tend_mod, only : fl_cor_ebil
     6   
    57    IMPLICIT none
    68    !>======================================================================
     
    2527    DO k = 1, klev  ! re-evaporation de l'eau liquide nuageuse
    2628       DO i = 1, klon
     29        if (fl_cor_ebil .GT. 0) then
     30          zlvdcp=RLVTT/RCPD/(1.0+RVTMP2*(q_seri(i,k)+ql_seri(i,k)+qs_seri(i,k)))
     31          zlsdcp=RLSTT/RCPD/(1.0+RVTMP2*(q_seri(i,k)+ql_seri(i,k)+qs_seri(i,k)))
     32        else
    2733          zlvdcp=RLVTT/RCPD/(1.0+RVTMP2*q_seri(i,k))
    2834          !jyg<
     
    3036          !                  A verifier !!!
    3137          zlsdcp=RLSTT/RCPD/(1.0+RVTMP2*q_seri(i,k))
     38        end if
    3239          IF (iflag_ice_thermo .EQ. 0) THEN
    3340             zlsdcp=zlvdcp
  • LMDZ5/trunk/libf/phylmd/rrtm/suphec.F90

    r2345 r2799  
    129129
    130130IF (LHOOK) CALL DR_HOOK('SUPHEC',0,ZHOOK_HANDLE)
    131 !CALL GSTATS(1811,0) ! MPL 28.11.08
    132 !RVTMP2=RCPV/RCPD-1.0_JPRB   !use cp,moist
    133 RVTMP2=0.0_JPRB              !neglect cp,moist
    134 RHOH2O=RATM/100._JPRB
    135 R2ES=611.21_JPRB*RD/RV
    136 R3LES=17.502_JPRB
    137 R3IES=22.587_JPRB
    138 R4LES=32.19_JPRB
    139 R4IES=-0.7_JPRB
    140 R5LES=R3LES*(RTT-R4LES)
    141 R5IES=R3IES*(RTT-R4IES)
    142 R5ALVCP=R5LES*RLVTT/RCPD
    143 R5ALSCP=R5IES*RLSTT/RCPD
    144 RALVDCP=RLVTT/RCPD
    145 RALSDCP=RLSTT/RCPD
    146 RALFDCP=RLMLT/RCPD
    147 RTWAT=RTT
    148 RTBER=RTT-5._JPRB
    149 RTBERCU=RTT-5.0_JPRB
    150 RTICE=RTT-23._JPRB
    151 RTICECU=RTT-23._JPRB
    152 
    153 RTWAT_RTICE_R=1.0_JPRB/(RTWAT-RTICE)
    154 RTWAT_RTICECU_R=1.0_JPRB/(RTWAT-RTICECU)
    155 IF(NPHYINT == 0) THEN
    156   ISMAX=NSMAX
    157 ELSE
    158   ISMAX=PHYS_GRID%NSMAX
    159 ENDIF
    160 
    161 RKOOP1=2.583_JPRB
    162 RKOOP2=0.48116E-2_JPRB
     131!
     132  IF (OK_BAD_ECMWF_THERMO) THEN
     133!
     134     ! Modify constants defined in suphel.F90 and set RVTMP2 to 0.
     135     ! CALL GSTATS(1811,0) ! MPL 28.11.08
     136     ! RVTMP2=RCPV/RCPD-1.0_JPRB   !use cp,moist
     137     RVTMP2=0.0_JPRB              !neglect cp,moist
     138     RHOH2O=RATM/100._JPRB
     139     R2ES=611.21_JPRB*RD/RV
     140     R3LES=17.502_JPRB
     141     R3IES=22.587_JPRB
     142     R4LES=32.19_JPRB
     143     R4IES=-0.7_JPRB
     144     R5LES=R3LES*(RTT-R4LES)
     145     R5IES=R3IES*(RTT-R4IES)
     146     R5ALVCP=R5LES*RLVTT/RCPD
     147     R5ALSCP=R5IES*RLSTT/RCPD
     148     RALVDCP=RLVTT/RCPD
     149     RALSDCP=RLSTT/RCPD
     150     RALFDCP=RLMLT/RCPD
     151     RTWAT=RTT
     152     RTBER=RTT-5._JPRB
     153     RTBERCU=RTT-5.0_JPRB
     154     RTICE=RTT-23._JPRB
     155     RTICECU=RTT-23._JPRB
     156     
     157     RTWAT_RTICE_R=1.0_JPRB/(RTWAT-RTICE)
     158     RTWAT_RTICECU_R=1.0_JPRB/(RTWAT-RTICECU)
     159     IF(NPHYINT == 0) THEN
     160       ISMAX=NSMAX
     161     ELSE
     162       ISMAX=PHYS_GRID%NSMAX
     163     ENDIF
     164     
     165     RKOOP1=2.583_JPRB
     166     RKOOP2=0.48116E-2_JPRB
     167     
     168  ELSE
     169     ! Keep constants defined in suphel.F90
     170     RTICE=RTT-23._JPRB
     171!
     172  ENDIF  ! (OK_BAD_ECMWF_THERMO)
    163173
    164174!     ------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.