Ignore:
Timestamp:
Feb 22, 2024, 5:29:02 PM (3 months ago)
Author:
evignon
Message:

changements suite à l'atelier nuage d'aujourd'hui.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/lmdz_lscp_poprecip.F90

    r4823 r4830  
    2323
    2424USE lmdz_lscp_ini, ONLY : prt_level, lunout
    25 USE lmdz_lscp_ini, ONLY : coef_eva, coef_eva_i, expo_eva, expo_eva_i, thresh_precip_frac
     25USE lmdz_lscp_ini, ONLY : coef_eva, coef_sub, expo_eva, expo_sub, thresh_precip_frac
    2626USE lmdz_lscp_ini, ONLY : RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG
    2727USE lmdz_lscp_tools, ONLY : calc_qsat_ecmwf
     
    149149    !--Sublimation of the solid precipitation coming from above
    150150    !--(same formula as for liquid precip)
    151     dsnowsub = - precipfracclr(i) * coef_eva_i * (1. - qvap(i) / qsati(i)) &
    152              * ( snowclr(i) / MAX(thresh_precip_frac, precipfracclr(i)) ) ** expo_eva_i &
     151    dsnowsub = - precipfracclr(i) * coef_sub * (1. - qvap(i) / qsati(i)) &
     152             * ( snowclr(i) / MAX(thresh_precip_frac, precipfracclr(i)) ) ** expo_sub &
    153153             * temp(i) * RD / pplay(i) &
    154154             * ( paprsdn(i) - paprsup(i) ) / RG
     
    229229! - aggregation (agg)
    230230! - riming (rim)
    231 ! - collection (coll)
     231! - collection (col)
    232232! - melting (melt)
    233 ! - freezing (free)
     233! - freezing (freez)
    234234!
    235235SUBROUTINE poprecip_postcld( &
     
    238238           precipfracclr, precipfraccld, &
    239239           rain, rainclr, raincld, snow, snowclr, snowcld, &
    240            qrain, qsnow, dqrauto, dqrcol, dqrmelt, dqrfreez, &
     240           qraindiag, qsnowdiag, dqrauto, dqrcol, dqrmelt, dqrfreez, &
    241241           dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
    242242
     
    251251                          tau_auto_snow_min, tau_auto_snow_max,                &
    252252                          thresh_precip_frac, eps, air_thermal_conduct,        &
    253                           coef_ventil, alpha_freez, gamma_freez, temp_nowater, &
    254                           iflag_cloudth_vert, iflag_rain_incloud_vol
     253                          coef_ventil, alpha_freez, beta_freez, temp_nowater,  &
     254                          iflag_cloudth_vert, iflag_rain_incloud_vol,          &
     255                          cld_lc_lsc_snow, cld_lc_con_snow, gamma_freez,       &
     256                          rain_fallspeed_clr, rain_fallspeed_cld,              &
     257                          snow_fallspeed_clr, snow_fallspeed_cld
    255258
    256259
     
    286289REAL,    INTENT(INOUT), DIMENSION(klon) :: snowcld        !--flux of snow gridbox-mean in cloudy air coming from the layer above [kg/s/m2]
    287290
    288 REAL,    INTENT(OUT),   DIMENSION(klon) :: qrain          !--specific rain content [kg/kg]
    289 REAL,    INTENT(OUT),   DIMENSION(klon) :: qsnow          !--specific snow content [kg/kg]
     291REAL,    INTENT(OUT),   DIMENSION(klon) :: qraindiag      !--DIAGNOSTIC specific rain content [kg/kg]
     292REAL,    INTENT(OUT),   DIMENSION(klon) :: qsnowdiag      !--DIAGNOSTIC specific snow content [kg/kg]
    290293REAL,    INTENT(OUT),   DIMENSION(klon) :: dqrcol         !--rain tendendy due to collection by rain of liquid cloud droplets [kg/kg/s]
    291294REAL,    INTENT(OUT),   DIMENSION(klon) :: dqsagg         !--snow tendency due to collection of lcoud ice by aggregation [kg/kg/s]
     
    306309REAL, DIMENSION(klon) :: qtot !--includes vap, liq, ice and precip
    307310
    308 ! partition of the fluxes
     311!--Partition of the fluxes
    309312REAL :: dcldfra
    310313REAL :: precipfractot
     
    313316REAL :: draincld, dsnowcld
    314317
    315 ! collection, aggregation and riming
     318!--Collection, aggregation and riming
    316319REAL :: eff_cldfra
    317320REAL :: coef_col, coef_agg, coef_rim, coef_tmp, qrain_tmp
    318321REAL :: Eff_rain_liq, Eff_snow_ice, Eff_snow_liq
    319 REAL :: dqlcol           ! loss of liquid cloud content due to collection by rain [kg/kg/s]
    320 REAL :: dqiagg           ! loss of ice cloud content due to collection by aggregation [kg/kg/s]
    321 REAL :: dqlrim           ! loss of liquid cloud content due to riming on snow[kg/kg/s]
    322 
    323 ! autoconversion
     322REAL :: dqlcol           !--loss of liquid cloud content due to collection by rain [kg/kg/s]
     323REAL :: dqiagg           !--loss of ice cloud content due to collection by aggregation [kg/kg/s]
     324REAL :: dqlrim           !--loss of liquid cloud content due to riming on snow [kg/kg/s]
     325
     326!--Autoconversion
    324327REAL :: qthresh_auto_rain, tau_auto_rain, expo_auto_rain
    325328REAL :: qthresh_auto_snow, tau_auto_snow, expo_auto_snow
    326 REAL :: dqlauto          ! loss of liquid cloud content due to autoconversion to rain [kg/kg/s]
    327 REAL :: dqiauto          ! loss of ice cloud content due to autoconversion to snow [kg/kg/s]
    328 
    329 ! melting
     329REAL :: dqlauto          !--loss of liquid cloud content due to autoconversion to rain [kg/kg/s]
     330REAL :: dqiauto          !--loss of ice cloud content due to autoconversion to snow [kg/kg/s]
     331
     332!--Melting
    330333REAL :: dqsmelt_max
    331 REAL :: fallice_clr, fallice_cld
    332334REAL :: nb_snowflake_clr, nb_snowflake_cld
    333335REAL :: capa_snowflake, temp_wetbulb
     
    335337REAL, DIMENSION(klon) :: qzero, qsat, dqsat
    336338
    337 ! freezing
     339!--Freezing
    338340REAL :: dqrfreez_max
    339341REAL :: tau_freez
    340342REAL :: dqrclrfreez, dqrcldfreez, dqrtotfreez
     343REAL :: coef_freez
     344REAL :: dqifreez        !--loss of ice cloud content due to collection of ice from rain [kg/kg/s]
     345REAL :: Eff_rain_ice
    341346
    342347
     
    358363DO i = 1, klon
    359364
    360   ! variables initialisation
    361   dqlrim  = 0.
     365  !--Variables initialisation
    362366  dqlcol  = 0.
    363367  dqiagg  = 0.
    364368  dqiauto = 0.
    365369  dqlauto = 0.
     370  dqlrim  = 0.
     371  dqifreez= 0.
    366372
    367373  !--hum_to_flux: coef to convert a specific quantity to a flux
     
    401407  !--Tendency of the clear-sky precipitation fraction. We add a MAX on the
    402408  !--calculation of the current CS precip. frac.
    403   dprecipfracclr = MAX( 0., ( precipfractot - cldfra(i) ) ) - precipfracclr(i)
     409  !dprecipfracclr = MAX( 0., ( precipfractot - cldfra(i) ) ) - precipfracclr(i)
     410  !--We remove it, because precipfractot is guaranteed to be > cldfra (the MAX is activated
     411  !--if precipfractot < cldfra)
     412  dprecipfracclr = ( precipfractot - cldfra(i) ) - precipfracclr(i)
    404413  !--Tendency of the cloudy precipitation fraction. We add a MAX on the
    405414  !--calculation of the current CS precip. frac.
    406415  !dprecipfraccld = MAX( dcldfra , - precipfraccld(i) )
    407   !--We remove it, because cldfra is guaranteed to be > O (the MAX is activated
     416  !--We remove it, because cldfra is guaranteed to be > 0 (the MAX is activated
    408417  !--if cldfra < 0)
    409418  dprecipfraccld = dcldfra
     
    448457 
    449458
    450   ! if vertical heterogeneity is taken into account, we use
    451   ! the "true" volume fraction instead of a modified
    452   ! surface fraction (which is larger and artificially
    453   ! reduces the in-cloud water).
     459  !--If vertical heterogeneity is taken into account, we use
     460  !--the "true" volume fraction instead of a modified
     461  !--surface fraction (which is larger and artificially
     462  !--reduces the in-cloud water).
    454463  IF ( ( iflag_cloudth_vert .GE. 3 ) .AND. ( iflag_rain_incloud_vol .EQ. 1 ) ) THEN
    455464    eff_cldfra = ctot_vol(i)
     
    459468
    460469
    461   ! Start precipitation growth processes
     470  !--Start precipitation growth processes
    462471
    463472  !--If the cloud is big enough, the precipitation processes activate
     
    483492    !--get in-cloud mean quantities. The two divisions by eff_cldfra are
    484493    !--then simplified.
     494
     495    !--The sticking efficacy is perfect.
    485496    Eff_rain_liq = 1.
    486497    coef_col = gamma_col * 3. / 4. / rho_rain / r_rain * Eff_rain_liq
    487498    IF ((raincld(i) .GT. 0.) .AND. (coef_col .GT. 0.)) THEN
    488499      !-- ATTENTION Double implicit version
     500      !-- BEWARE the formule below is FALSE (because raincld is a flux, not a delta flux)
    489501      !qrain_tmp = raincld(i) / hum_to_flux(i)
    490502      !coef_tmp = coef_col * dtime * ( qrain_tmp / precipfraccld(i) + qliq(i) / eff_cldfra )
     
    495507      !--available.
    496508      !dqlcol = MAX( - qliq(i), dqlcol )
    497       !--Exact version, which does not need a barrier because of
     509      !--Exact explicit version, which does not need a barrier because of
    498510      !--the exponential decrease
    499511      dqlcol = qliq(i) * ( EXP( - dtime * coef_col * raincld(i) / precipfraccld(i) ) - 1. )
     
    517529      !--available.
    518530      !dqiagg = MAX( - qice(i), dqiagg )
    519       !--Exact version, which does not need a barrier because of
     531      !--Exact explicit version, which does not need a barrier because of
    520532      !--the exponential decrease
    521533      dqiagg = qice(i) * ( EXP( - dtime * coef_agg * snowcld(i) / precipfraccld(i) ) - 1. )
     
    536548    !--rain drops/snowflakes. It relies on the formulations by
    537549    !--Sundqvist 1978.
    538     ! TODO what else?
    539550
    540551    !--If we are in a convective point, we have different parameters
    541552    !--for the autoconversion
    542553    IF ( ptconv(i) ) THEN
    543         ! ATTENTION voir les constantes ici qui ne devraient pas etre identiques
    544554        qthresh_auto_rain = cld_lc_con
    545         qthresh_auto_snow = cld_lc_con
     555        qthresh_auto_snow = cld_lc_con_snow
    546556
    547557        tau_auto_rain = cld_tau_con
     
    553563        expo_auto_snow = cld_expo_con
    554564    ELSE
    555         ! ATTENTION voir les constantes ici qui ne devraient pas etre identiques
    556565        qthresh_auto_rain = cld_lc_lsc
    557         qthresh_auto_snow = cld_lc_lsc
     566        qthresh_auto_snow = cld_lc_lsc_snow
    558567
    559568        tau_auto_rain = cld_tau_lsc
     
    568577
    569578    ! Liquid water quantity to remove according to (Sundqvist, 1978)
    570     ! dqliq/dt = -qliq/tau * ( 1-exp(-(qcin/clw)**2) )
    571     !.........................................................
    572     ! we first treat the second term (with exponential) in an explicit way
    573     ! and then treat the first term (-q/tau) in an exact way
     579    ! dqliq/dt = -qliq/tau * ( 1-exp(-(qliqincld/qthresh)**2) )
     580    !
     581    !--And same formula for ice
     582    !
     583    !--We first treat the second term (with exponential) in an explicit way
     584    !--and then treat the first term (-q/tau) in an exact way
    574585
    575586    dqlauto = - qliq(i) * ( 1. - exp( - dtime / tau_auto_rain * ( 1. - exp( &
     
    602613    !--snow (graupel in fact) because of the collision between
    603614    !--those and falling snowflakes.
    604     !--The formula come from Muench and Lohmann 2020
     615    !--The formula comes from Muench and Lohmann 2020
    605616    !--NB.: this process needs a temperature adjustment
    606617
     
    631642    ENDIF
    632643
    633   ! ATTENTION veut on faire un processus similaire et symetrique qui
    634   ! convertirait la pluie en surfusion qui tombe sur des cristaux de glace
    635   ! en flux de neige ? (si la temperature est negative)
    636 
    637644  ENDIF ! cldfra .GE. seuil_neb
    638645
     
    658665  !--                the radius if the snowflake is a sphere [m]
    659666  !--temp_wetbulb: wet-bulb temperature [K]
    660   !--fallice: snow fall velocity (in clear/cloudy sky) [m/s]
     667  !--snow_fallspeed: snow fall velocity (in clear/cloudy sky) [m/s]
    661668  !--air_thermal_conduct: thermal conductivity of the air [J/m/K/s]
    662669  !--coef_ventil: ventilation coefficient [-]
     
    682689    !--In clear air
    683690    IF ( snowclr(i) .GT. 0. ) THEN
    684       ! ATTENTION fallice a definir
    685       fallice_clr = 1.
    686691      !--Calculated according to
    687692      !-- flux = velocity_snowflakes * nb_snowflakes * volume_snowflakes * rho_snow
    688       nb_snowflake_clr = snowclr(i) / precipfracclr(i) / fallice_clr &
     693      nb_snowflake_clr = snowclr(i) / precipfracclr(i) / snow_fallspeed_clr &
    689694                       / ( 4. / 3. * RPI * r_snow**3. * rho_snow )
    690695      dqsclrmelt = - nb_snowflake_clr * 4. * RPI * air_thermal_conduct &
    691696                   * capa_snowflake / RLMLT * coef_ventil &
    692697                   * MAX(0., temp_wetbulb - RTT) * dtime
     698
     699      !--Barrier to limit the melting flux to the clr snow flux in the mesh
    693700      dqsclrmelt = MAX( dqsclrmelt , -snowclr(i) / hum_to_flux(i))
    694       ELSE
    695       dqsclrmelt = 0.
    696701   ENDIF
    697702
    698703    !--In cloudy air
    699704    IF ( snowcld(i) .GT. 0. ) THEN
    700       ! ATTENTION fallice a definir
    701       fallice_cld = 1.
    702705      !--Calculated according to
    703706      !-- flux = velocity_snowflakes * nb_snowflakes * volume_snowflakes * rho_snow
    704       nb_snowflake_cld = snowcld(i) / precipfraccld(i) / fallice_cld &
     707      nb_snowflake_cld = snowcld(i) / precipfraccld(i) / snow_fallspeed_cld &
    705708                       / ( 4. / 3. * RPI * r_snow**3. * rho_snow )
    706709      dqscldmelt = - nb_snowflake_cld * 4. * RPI * air_thermal_conduct &
    707710                   * capa_snowflake / RLMLT * coef_ventil &
    708711                   * MAX(0., temp_wetbulb - RTT) * dtime
     712
     713      !--Barrier to limit the melting flux to the cld snow flux in the mesh
    709714      dqscldmelt = MAX( dqscldmelt , -snowcld(i) / hum_to_flux(i))
    710     ELSE
    711       dqscldmelt = 0.
    712715    ENDIF
    713716   
    714     !--Barriers
     717    !--Barrier on temperature. If the total melting flux leads to a
     718    !--positive temperature, it is limited to keep temperature above 0 degC.
    715719    !--It is activated if the total is LOWER than the max
    716720    !--because everything is negative
     
    769773                         * ( 1. + RVTMP2 * qtot(i) ))
    770774 
    771     tau_freez = 1. / ( gamma_freez &
     775    tau_freez = 1. / ( beta_freez &
    772776              * EXP( - alpha_freez * ( temp(i) - temp_nowater ) / ( RTT - temp_nowater ) ) )
     777
     778    !--Initialisation
     779    dqrclrfreez = 0.
     780    dqrcldfreez = 0.
    773781
    774782    !--In clear air
    775783    IF ( rainclr(i) .GT. 0. ) THEN
    776        !--Exact solution of dqrain/dt = -qrain/tau_freez
    777        dqrclrfreez = rainclr(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
    778        dqrclrfreez = MAX(dqrclrfreez, -rainclr(i) / hum_to_flux(i))
    779     ELSE
    780        dqrclrfreez = 0.
     784      !--Exact solution of dqrain/dt = -qrain/tau_freez
     785      dqrclrfreez = rainclr(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
    781786    ENDIF
    782787
    783788    !--In cloudy air
    784789    IF ( raincld(i) .GT. 0. ) THEN
    785        !--Exact solution of dqrain/dt = -qrain/tau_freez
    786        dqrcldfreez = raincld(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
    787        dqrcldfreez = MAX(dqrcldfreez, -raincld(i) / hum_to_flux(i))
    788     ELSE
    789        dqrcldfreez = 0.
     790      !--Exact solution of dqrain/dt = -qrain/tau_freez
     791      dqrcldfreez = raincld(i) / hum_to_flux(i) * ( EXP( - dtime / tau_freez ) - 1. )
     792
     793      !---------------------------------------------------------
     794      !--    FREEZING OF RAIN WITH CONTACT OF ICE CRYSTALS
     795      !---------------------------------------------------------
     796      !--Sub-process of freezing which quantifies the collision between
     797      !--ice crystals in suspension and falling rain droplets.
     798      !--The rain droplets freeze, becoming graupel, and carrying
     799      !--the ice crystal (which acted as an ice nucleating particle).
     800      !--The formula is adapted from the riming formula.
     801
     802      !--The sticking efficacy is perfect.
     803      Eff_rain_ice = 1.
     804      coef_freez = gamma_freez * 3. / 4. / rho_rain / r_rain * Eff_rain_ice
     805      !-- ATTENTION Double implicit version? + barriers if needed
     806      !--Exact version, which does not need a barrier because of
     807      !--the exponential decrease
     808      dqifreez = qice(i) * ( EXP( - dtime * coef_freez * raincld(i) / precipfraccld(i) ) - 1. )
     809
     810      !--We add the two freezing processes in cloud
     811      dqrcldfreez = dqrcldfreez - dqifreez
    790812    ENDIF
    791813
     
    838860
    839861  !--Diagnostics
    840   ! ATTENTION A REPRENDRE
    841   qrain(i) = rain(i) / hum_to_flux(i)
    842   qsnow(i) = snow(i) / hum_to_flux(i)
     862  !--BEWARE this is indeed a diagnostic: this is an estimation from
     863  !--the value of the flux at the bottom interface of the mesh and
     864  !--and assuming an upstream numerical calculation
     865  !--If ok_radocond_snow is TRUE, then the diagnostic qsnowdiag is
     866  !--used for computing the total ice water content in the mesh
     867  !--for radiation only
     868  qraindiag(i) = ( rainclr(i) / ( pplay(i) / RD / temp(i) ) / rain_fallspeed_clr &
     869                 + raincld(i) / ( pplay(i) / RD / temp(i) ) / rain_fallspeed_cld )
     870  qsnowdiag(i) = ( snowclr(i) / ( pplay(i) / RD / temp(i) ) / snow_fallspeed_clr &
     871                 + snowcld(i) / ( pplay(i) / RD / temp(i) ) / snow_fallspeed_cld )
    843872
    844873ENDDO ! loop on klon
Note: See TracChangeset for help on using the changeset viewer.