Changeset 2902 for LMDZ5/trunk/libf


Ignore:
Timestamp:
Jun 2, 2017, 6:55:20 PM (8 years ago)
Author:
jyg
Message:

Corrections for energy conservation in the
convective scheme (activated by fl_cor_ebil>=2):
(i) The properties of the adiabatic updraught are
now determined by mixing static energies of the
feeding layers and not the enthalpies:
cv3_vertmix.F90 becomes cv3_enthalpmix.F90;
new routine: cv3_estatmix.F90.
(ii) Correction to cv3p_mixing concerning air
detrained directly from the adiabatic updraught
(hent was zero).

Location:
LMDZ5/trunk/libf/phylmd
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/cv3_routines.F90

    r2901 r2902  
    280280
    281281SUBROUTINE cv3_feed(len, nd, ok_conserv_q, &
    282                     t, q, u, v, p, ph, hm, gz, &
     282                    t, q, u, v, p, ph, h, gz, &
    283283                    p1feed, p2feed, wght, &
    284284                    wghti, tnk, thnk, qnk, qsnk, unk, vnk, &
     
    286286
    287287  USE mod_phys_lmdz_transfert_para, ONLY : bcast
     288  USE add_phys_tend_mod, ONLY: fl_cor_ebil
    288289  IMPLICIT NONE
    289290
     
    295296! - here, nk(i)=minorig
    296297! - icb defined differently (plcl compared with ph instead of p)
     298! - dry static energy as argument instead of moist static energy
    297299
    298300! Main differences with convect3:
     
    310312  REAL, DIMENSION (len, nd), INTENT (IN)             :: t, q, p
    311313  REAL, DIMENSION (len, nd), INTENT (IN)             :: u, v
    312   REAL, DIMENSION (len, nd), INTENT (IN)             :: hm, gz
     314  REAL, DIMENSION (len, nd), INTENT (IN)             :: h, gz
    313315  REAL, DIMENSION (len, nd+1), INTENT (IN)           :: ph
    314316  REAL, DIMENSION (len), INTENT (IN)                 :: p1feed
     
    381383    pup(i) = p2feed(i)
    382384  END DO
    383   CALL cv3_vertmix(len, nd, iflag, p1feed, pup, p, ph, &
    384                    t, q, u, v, wght, &
    385                    wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclup)
     385  IF (fl_cor_ebil >=2 ) THEN
     386    CALL cv3_estatmix(len, nd, iflag, p1feed, pup, p, ph, &
     387                     t, q, u, v, h, gz, wght, &
     388                     wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclup)
     389  ELSE
     390    CALL cv3_enthalpmix(len, nd, iflag, p1feed, pup, p, ph, &
     391                       t, q, u, v, wght, &
     392                       wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclup)
     393  ENDIF  ! (fl_cor_ebil >=2 )
    386394! 1.b- LCL associated with ph(nk+1)
    387395  DO i = 1, len
    388396    plo(i) = ph(i, nk(i)+1)
    389397  END DO
    390   CALL cv3_vertmix(len, nd, iflag, p1feed, plo, p, ph, &
    391                    t, q, u, v, wght, &
    392                    wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plcllo)
     398  IF (fl_cor_ebil >=2 ) THEN
     399    CALL cv3_estatmix(len, nd, iflag, p1feed, plo, p, ph, &
     400                     t, q, u, v, h, gz, wght, &
     401                     wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plcllo)
     402  ELSE
     403    CALL cv3_enthalpmix(len, nd, iflag, p1feed, plo, p, ph, &
     404                       t, q, u, v, wght, &
     405                       wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plcllo)
     406  ENDIF  ! (fl_cor_ebil >=2 )
    393407! 2- Iterations
    394408  niter = 5
     
    437451!jyg>
    438452
    439     CALL cv3_vertmix(len, nd, iflag, p1feed, pfeed, p, ph, &
    440                    t, q, u, v, wght, &
    441                    wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclfeed)
     453    IF (fl_cor_ebil >=2 ) THEN
     454      CALL cv3_estatmix(len, nd, iflag, p1feed, pfeed, p, ph, &
     455                       t, q, u, v, h, gz, wght, &
     456                       wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclfeed)
     457    ELSE
     458      CALL cv3_enthalpmix(len, nd, iflag, p1feed, pfeed, p, ph, &
     459                         t, q, u, v, wght, &
     460                         wghti, nk, tnk, thnk, qnk, qsnk, unk, vnk, plclfeed)
     461    ENDIF  ! (fl_cor_ebil >=2 )
    442462!jyg20140217<
    443463    IF (ok_new_feed) THEN
     
    16501670      DO i = 1, ncum
    16511671        IF ((k>=icb(i)) .AND. (k<=inb(i))) THEN
     1672!jyg<   (energy conservation tests)
     1673!!          hp(i, k) = hnk(i) + (lv(i,k)+(cpd-cpv)*tp(i,k))*ep(i, k)*clw(i, k)
     1674!!          hp(i, k) = ( hnk(i) + (lv(i,k)+(cpd-cpv)*t(i,k))*ep(i, k)*clw(i, k) ) / &
     1675!!                     (1. - ep(i,k)*clw(i,k))
     1676!!          hp(i, k) = ( hnk(i) + (lv(i,k)+(cpd-cl)*t(i,k))*ep(i, k)*clw(i, k) ) / &
     1677!!                     (1. - ep(i,k)*clw(i,k))
    16521678          hp(i, k) = hnk(i) + (lv(i,k)+(cpd-cpv)*t(i,k))*ep(i, k)*clw(i, k)
    16531679        END IF
     
    35433569                                    t(il,i)*(cpv-cpd)*(rr(il,i)-qent(il,i,i)))*cpinv
    35443570        END IF
    3545 
    3546 
    3547 
     3571!
    35483572! sb: on ne fait pas encore la correction permettant de mieux
    35493573! conserver l'eau:
  • LMDZ5/trunk/libf/phylmd/cv3p_mixing.F90

    r2900 r2902  
    254254        uent(il, i, i) = unk(il)
    255255        vent(il, i, i) = vnk(il)
     256        IF (fl_cor_ebil .GE. 2) THEN
     257          hent(il, i, i) = hp(il,i)
     258        ENDIF
    256259        elij(il, i, i) = clw(il, i)*(1.-ep(il,i))
    257260        Sij(il, i, i) = 0.0
    258261      END IF
    259262    END DO
    260   END DO
     263  END DO ! i = minorig + 1, nl
    261264
    262265!jyg!  DO j = 1, ntra
     
    663666        vent(il, i, i) = vnk(il)
    664667        elij(il, i, i) = clw(il, i)*(1.-ep(il,i))
    665         Sij(il, i, i) = 0.0
     668        IF (fl_cor_ebil .GE. 2) THEN
     669          hent(il, i, i) = hp(il,i)
     670          Sigij(il, i, i) = 0.0
     671        ELSE
     672          Sij(il, i, i) = 0.0
     673        ENDIF
    666674      END IF
    667675    END DO ! il
  • LMDZ5/trunk/libf/phylmd/cva_driver.F90

    r2853 r2902  
    4040
    4141  USE print_control_mod, ONLY: prt_level, lunout
     42  USE add_phys_tend_mod, ONLY: fl_cor_ebil
    4243  IMPLICIT NONE
    4344
     
    730731             PRINT *, 'cva_driver -> cv3_feed'
    731732    CALL cv3_feed(len, nd, ok_conserv_q, &                 ! nd->na
    732                   t1, q1, u1, v1, p1, ph1, hm1, gz1, &
     733                  t1, q1, u1, v1, p1, ph1, h1, gz1, &
    733734                  p1feed1, p2feed1, wght1, &
    734735                  wghti1, tnk1, thnk1, qnk1, qsnk1, unk1, vnk1, &
  • LMDZ5/trunk/libf/phylmd/physiq_mod.F90

    r2897 r2902  
    245245
    246246    USE cmp_seri_mod
    247     USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, prt_enerbil, &
     247    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
    248248  &      fl_ebil, fl_cor_ebil
    249249
Note: See TracChangeset for help on using the changeset viewer.