Ignore:
Timestamp:
Feb 29, 2024, 7:42:12 PM (3 months ago)
Author:
evignon
Message:

commission pour la suite du travail sur la mise a jour
de la param de neige soufflee

File:
1 edited

Legend:

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

    r4828 r4835  
    22
    33contains
    4 subroutine blowing_snow_sublim_sedim(ngrid,nlay,dtime,temp,qv,qbs,pplay,paprs,dtemp_bs,dq_bs,dqbs_bs,bsfl,precip_bs)
     4subroutine blowing_snow_sublim_sedim(ngrid,nlay,dtime,temp,qv,qb,pplay,paprs,dtemp_bs,dqv_bs,dqb_bs,bsfl,precip_bs)
    55
    66!==============================================================================
     
    1111
    1212
    13 use lmdz_blowing_snow_ini, only : coef_eva_bs,RTT,RD,RG,expo_eva_bs, fallv_bs, qbsmin
    14 use lmdz_blowing_snow_ini, only : RCPD, RLSTT, RLMLT, RLVTT, RVTMP2, tbsmelt, taumeltbs0
     13use lmdz_blowing_snow_ini, only : iflag_sublim_bs, iflag_sedim_bs, coef_sub_bs,RTT,RD,RG,fallv_bs
     14use lmdz_blowing_snow_ini, only : qbmin, RCPD, RLSTT, RLMLT, RLVTT, RVTMP2, RV, RPI, tbsmelt, taumeltbs0, rhobs, r_bs
    1515USE lmdz_lscp_tools, only : calc_qsat_ecmwf
    1616
     
    2929real, intent(in), dimension(ngrid,nlay) :: temp
    3030real, intent(in), dimension(ngrid,nlay) :: qv
    31 real, intent(in), dimension(ngrid,nlay) :: qbs
     31real, intent(in), dimension(ngrid,nlay) :: qb
    3232real, intent(in), dimension(ngrid,nlay) :: pplay
    3333real, intent(in), dimension(ngrid,nlay+1) :: paprs
     
    4040
    4141real, intent(out), dimension(ngrid,nlay) :: dtemp_bs
    42 real, intent(out), dimension(ngrid,nlay) :: dq_bs
    43 real, intent(out), dimension(ngrid,nlay) :: dqbs_bs
     42real, intent(out), dimension(ngrid,nlay) :: dqv_bs
     43real, intent(out), dimension(ngrid,nlay) :: dqb_bs
    4444real, intent(out), dimension(ngrid,nlay+1) :: bsfl
    4545real, intent(out), dimension(ngrid)      :: precip_bs
     
    5151
    5252integer                                  :: k,i,n
    53 real                                     :: cpd, cpw, dqsub, maxdqsub, dqbsmelt
    54 real                                     :: dqsedim,precbs, dqmelt, zmelt, taumeltbs
    55 real                                     :: maxdqmelt, rhoair, dz
    56 real, dimension(ngrid)                   :: zt,zq,zqbs,qsi,dqsi,qsl, dqsl,qzero,sedim,sedimn
    57 real, dimension(ngrid)                   :: zqbsi, zqbs_up, zmair
    58 real, dimension(ngrid)                   :: zvelo
     53real                                     :: cpd, cpw, dqbsub, maxdqbsub, dqbmelt, zmair
     54real                                     :: dqsedim,precbs, dqvmelt, zmelt, taumeltbs
     55real                                     :: maxdqvmelt, rhoair, dz, dqbsedim
     56real                                     :: delta_p, b_p, a_p, c_p, c_sub, qvsub
     57real                                     :: p0, T0, Dv, Aprime, Bprime, Ka
     58real, dimension(ngrid)                   :: ztemp,zqv,zqb,zpres,qsi,dqsi,qsl,dqsl,qzero,sedim
     59real, dimension(ngrid)                   :: zpaprsup, zpaprsdn, ztemp_up, zqb_up, zvelo
     60real, dimension(ngrid,nlay)              :: temp_seri, qb_seri, qv_seri
    5961
    6062!++++++++++++++++++++++++++++++++++++++++++++++++++
     
    6466qzero(:)=0.
    6567dtemp_bs(:,:)=0.
    66 dq_bs(:,:)=0.
    67 dqbs_bs(:,:)=0.
     68dqv_bs(:,:)=0.
     69dqb_bs(:,:)=0.
    6870zvelo(:)=0.
    69 zt(:)=0.
    70 zq(:)=0.
    71 zqbs(:)=0.
    7271sedim(:)=0.
    73 sedimn(:)=0.
    74 
     72precip_bs(:)=0.
     73bsfl(:,:)=0.
     74
     75
     76Ka=2.4e-2      ! thermal conductivity of the air, SI
     77p0=101325.0    ! ref pressure
     78
     79
     80DO k=1,nlay
     81   DO i=1,ngrid
     82      temp_seri(i,k)=temp(i,k)
     83      qv_seri(i,k)=qv(i,k)
     84      qb_seri(i,k)=qb(i,k)
     85   ENDDO
     86ENDDO
     87
     88
     89! Sedimentation scheme
     90!----------------------
     91
     92IF (iflag_sedim_bs .GT. 0) THEN
    7593! begin of top-down loop
    7694DO k = nlay, 1, -1
    7795   
    7896    DO i=1,ngrid
    79         zt(i)=temp(i,k)
    80         zq(i)=qv(i,k)
    81         zqbs(i)=qbs(i,k)
     97        ztemp(i)=temp_seri(i,k)
     98        zqv(i)=qv_seri(i,k)
     99        zqb(i)=qb_seri(i,k)
     100        zpres(i)=pplay(i,k)
     101        zpaprsup(i)=paprs(i,k+1)
     102        zpaprsdn(i)=paprs(i,k)
    82103    ENDDO
    83104
    84      ! thermalization of blowing snow precip coming from above     
     105    ! thermalization of blowing snow precip coming from above     
    85106    IF (k.LE.nlay-1) THEN
    86107
    87108        DO i = 1, ngrid
    88             zmair(i)=(paprs(i,k)-paprs(i,k+1))/RG
     109            zmair=(zpaprsdn(i)-zpaprsup(i))/RG
    89110            ! RVTMP2=rcpv/rcpd-1
    90             cpd=RCPD*(1.0+RVTMP2*zq(i))
     111            cpd=RCPD*(1.0+RVTMP2*zqv(i))
    91112            cpw=RCPD*RVTMP2
    92             ! zqbs_up: blowing snow mass that has to be thermalized with
     113            ! zqb_up: blowing snow mass that has to be thermalized with
    93114            ! layer's air so that precipitation at the ground has the
    94115            ! same temperature as the lowermost layer
    95             zqbs_up(i) = sedim(i)*dtime/zmair(i)
     116            zqb_up(i) = sedim(i)*dtime/zmair
     117            ztemp_up(i)=temp_seri(i,k+1)
     118
    96119            ! t(i,k+1)+d_t(i,k+1): new temperature of the overlying layer
    97             zt(i) = ( (temp(i,k+1)+dtemp_bs(i,k+1))*zqbs_up(i)*cpw + cpd*zt(i) ) &
    98              / (cpd + zqbs_up(i)*cpw)
     120            ztemp(i) = ( ztemp_up(i)*zqb_up(i)*cpw + cpd*ztemp(i) ) &
     121                  / (cpd + zqb_up(i)*cpw)
    99122        ENDDO
    100     ENDIF
    101 
    102 
    103 
    104     ! calulation saturation specific humidity
    105     CALL CALC_QSAT_ECMWF(ngrid,zt(:),qzero(:),pplay(:,k),RTT,2,.false.,qsi(:),dqsi(:))
    106     CALL CALC_QSAT_ECMWF(ngrid,zt(:),qzero(:),pplay(:,k),RTT,1,.false.,qsl(:),dqsl(:))
    107    
    108    
    109     ! 3 processes: melting, sublimation and precipitation of blowing snow
     123
     124     ENDIF
     125
     126     DO i = 1, ngrid
     127
     128       rhoair  = zpres(i) / ztemp(i) / RD
     129       dz      = (zpaprsdn(i)-zpaprsup(i)) / (rhoair*RG)
     130       ! BS fall velocity assumed to be constant for now
     131       zvelo(i) = fallv_bs
     132       ! dqb/dt_sedim=1/rho(sedim/dz - rho w qb/dz)
     133       ! implicit resolution
     134       dqbsedim = (sedim(i)/rhoair/dz*dtime+zqb(i))/(1.+zvelo(i)*dtime/dz) - zqb(i)
     135       ! flux and dqb update
     136       zqb(i)=zqb(i)+dqbsedim
     137       !sedim(i) = sedim(i)-dqbsedim/dtime*rhoair*dz
     138       sedim(i)=rhoair*zvelo(i)*zqb(i)
     139
     140
     141       ! variables update:
     142       bsfl(i,k)=sedim(i)
     143
     144       qb_seri(i,k) = zqb(i)
     145       qv_seri(i,k) = zqv(i)
     146       temp_seri(i,k) = ztemp(i)
     147
     148     ENDDO ! Loop on ngrid
     149
     150
     151ENDDO ! vertical loop
     152
     153
     154!surface bs flux
     155DO i = 1, ngrid
     156  precip_bs(i) = sedim(i)
     157ENDDO
     158
     159ENDIF
     160
     161
     162
     163
     164!+++++++++++++++++++++++++++++++++++++++++++++++
     165! Sublimation and melting
     166!++++++++++++++++++++++++++++++++++++++++++++++
     167IF (iflag_sublim_bs .GT. 0) THEN
     168
     169DO k = 1, nlay
     170
     171    DO i=1,ngrid
     172        ztemp(i)=temp_seri(i,k)
     173        zqv(i)=qv_seri(i,k)
     174        zqb(i)=qb_seri(i,k)
     175        zpres(i)=pplay(i,k)
     176        zpaprsup(i)=paprs(i,k+1)
     177        zpaprsdn(i)=paprs(i,k)
     178    ENDDO
     179
     180   ! calulation saturation specific humidity
     181    CALL CALC_QSAT_ECMWF(ngrid,ztemp(:),qzero(:),zpres(:),RTT,2,.false.,qsi(:),dqsi(:))
     182
     183
    110184    DO i = 1, ngrid
    111185
    112           rhoair  = pplay(i,k) / zt(i) / RD
    113           dz      = (paprs(i,k)-paprs(i,k+1)) / (rhoair*RG)
     186          rhoair  = zpres(i) / ztemp(i) / RD
     187          dz      = (zpaprsdn(i)-zpaprsup(i)) / (rhoair*RG)
    114188          ! BS fall velocity assumed to be constant for now
    115189          zvelo(i) = fallv_bs
    116190
    117191
    118           IF (zt(i) .GT. RTT) THEN
    119              
     192          IF (ztemp(i) .GT. RTT) THEN
     193
    120194             ! if temperature is positive, we assume that part of the blowing snow
    121195             ! already present  melts and evaporates with a typical time
    122196             ! constant taumeltbs
    123            
    124              taumeltbs=taumeltbs0*exp(-max(0.,(zt(i)-RTT)/(tbsmelt-RTT)))
    125              dqmelt=min(zqbs(i),-1.*zqbs(i)*(exp(-dtime/taumeltbs)-1.))
    126              maxdqmelt= max(RCPD*(1.0+RVTMP2*(zq(i)+zqbs(i)))*(zt(i)-RTT)/(RLMLT+RLVTT),0.)
    127              dqmelt=min(dqmelt,maxdqmelt)
    128              ! q update, melting + evaporation
    129              zq(i) = zq(i) + dqmelt
     197
     198             taumeltbs=taumeltbs0*exp(-max(0.,(ztemp(i)-RTT)/(tbsmelt-RTT)))
     199             dqvmelt=min(zqb(i),-1.*zqb(i)*(exp(-dtime/taumeltbs)-1.))
     200             maxdqvmelt= max(RCPD*(1.0+RVTMP2*(zqv(i)+zqb(i)))*(ztemp(i)-RTT)/(RLMLT+RLVTT),0.)
     201             dqvmelt=min(dqvmelt,maxdqvmelt)
     202             ! qv update, melting + evaporation
     203             zqv(i) = zqv(i) + dqvmelt
    130204             ! temp update melting + evaporation
    131              zt(i) = zt(i) - dqmelt * (RLMLT+RLVTT)/RCPD/(1.0+RVTMP2*(zq(i)+zqbs(i)))
    132              ! qbs update melting + evaporation
    133              zqbs(i)=zqbs(i)-dqmelt
    134 
    135           ELSE 
     205             ztemp(i) = ztemp(i) - dqvmelt * (RLMLT+RLVTT)/RCPD/(1.0+RVTMP2*(zqv(i)+zqb(i)))
     206             ! qb update melting + evaporation
     207             zqb(i)=zqb(i)-dqvmelt
     208
     209          ELSE
    136210              ! negative celcius temperature     
    137211              ! Sublimation scheme   
    138              
    139               rhoair=pplay(i,k)/zt(i)/RD
    140               dqsub = 1./rhoair*coef_eva_bs*(1.0-zq(i)/qsi(i))*((rhoair*zvelo(i)*zqbs(i))**expo_eva_bs)*dtime
    141               dqsub = MAX(0.0,MIN(dqsub,zqbs(i)))
    142 
    143               ! Sublimation limit: we ensure that the whole mesh does not exceed saturation wrt ice
    144               maxdqsub = MAX(0.0, qsi(i)-zq(i))
    145               dqsub = MIN(dqsub,maxdqsub)
    146 
     212
     213
     214              ! Sublimation formulation for ice crystals from Pruppacher & Klett, Rutledge & Hobbs 1983
     215              ! assuming monodispered crystal distrib
     216              ! dqb/dt_sub=-coef_sub_bs*(1-qv/qsi)*nc*8*r_bs/(Aprime+Bprime)
     217              ! assuming Mi=rhobs*4/3*pi*r_bs**3
     218              ! rhoair qb=nc*Mi -> nc=rhoair qb/Mi
     219              ! dqb/dt_sub=-coef_sub_bs*(1-qv/qsi)*6*rhoair*qb/(rhobs*pi*r_bs**2)/(Aprime+Bprime)
     220              ! dqb/dt_sub=-c_sub(1-qv/qsi)*qb
     221              ! c_sub=coef_sub_bs*6*rhoair/(rhobs*pi*r_bs**2)/(Aprime+Bprime)
     222              !
     223              ! Note the strong coupling between specific contents of water vapor and blowing snow during sublimation
     224              ! equations dqv/dt_sub and dqb/dt_sub must be solved jointly to prevent irrealistic increase of water vapor
     225              ! at typical physics time steps
     226              ! we thus solve the differential equation using an implicit scheme for both qb and qv
     227 
     228              ! we do not consider deposition, only sublimation
     229              IF (zqv(i) .LT. qsi(i)) THEN
     230                 rhoair=zpres(i)/ztemp(i)/RD
     231                 !diffusivity of water vapor
     232                 Dv=0.0001*0.211*(p0/zpres(i))*((ztemp(i)/RTT)**1.94) ! water vapor diffusivity in air, SI
     233                 Ka=(5.69+0.017*(ztemp(i)-RTT))*1.e-5*100.*4.184                ! thermal conductivity of the air, SI
     234                 Aprime=RLSTT/Ka/ztemp(i)*(RLSTT/RV/ztemp(i) -1.)
     235                 Bprime=1./(rhoair*Dv*qsi(i))
     236                 c_sub=coef_sub_bs*6.*rhoair/(rhobs*RPI*r_bs**2)/(Aprime+Bprime)
     237                 c_p=-zqb(i)
     238                 b_p=1.+c_sub*dtime-c_sub*dtime/qsi(i)*zqb(i)-c_sub*dtime/qsi(i)*zqv(i)
     239                 a_p=c_sub*dtime/qsi(i)
     240                 delta_p=(b_p**2)-4.*a_p*c_p 
     241                 dqbsub=(-b_p+sqrt(delta_p))/(2.*a_p) - zqb(i)       
     242                 dqbsub = MIN(0.0,MAX(dqbsub,-zqb(i)))
     243
     244                 ! Sublimation limit: we ensure that the whole mesh does not exceed saturation wrt ice
     245                 maxdqbsub = MAX(0.0, qsi(i)-zqv(i))
     246                 dqbsub = MAX(dqbsub,-maxdqbsub)
     247              ELSE
     248                 dqbsub=0.
     249              ENDIF
    147250
    148251              ! vapor, temperature, precip fluxes update following sublimation
    149               zq(i) = zq(i) + dqsub     
    150               zqbs(i)=zqbs(i)-dqsub           
    151               zt(i) = zt(i) - dqsub*RLSTT/RCPD/(1.0+RVTMP2*(zq(i)+zqbs(i)))
     252              zqv(i) = zqv(i) - dqbsub
     253              zqb(i) = zqb(i) + dqbsub
     254              ztemp(i) = ztemp(i) + dqbsub*RLSTT/RCPD/(1.0+RVTMP2*(zqv(i)+zqb(i)))
    152255
    153256          ENDIF
    154257
    155         ! Sedimentation scheme
    156         !----------------------
    157 
    158         sedimn(i) = rhoair*zqbs(i)*zvelo(i)
    159 
    160         ! exact numerical resolution of sedimentation
    161         ! assuming fall velocity is constant
    162 
    163         zqbs(i) = zqbs(i)*exp(-zvelo(i)/dz*dtime)+sedim(i)/rhoair/zvelo(i)
    164 
    165         ! flux update
    166         sedim(i) = sedimn(i)
    167 
    168 
    169 
    170         ! if qbs<qbsmin, sublimate or melt and evaporate qbs
    171         ! see Gerber et al. 2023, JGR Atmos for the choice of qbsmin
    172         IF (zqbs(i) .LT. qbsmin) THEN                       
    173               zq(i) = zq(i)+zqbs(i)
    174               IF (zt(i) .LT. RTT) THEN
    175                  zt(i) = zt(i) - zqbs(i) * RLSTT/RCPD/(1.0+RVTMP2*(zq(i)+zqbs(i)))
     258          ! if qb<qbmin, sublimate or melt and evaporate qb
     259          ! see Gerber et al. 2023, JGR Atmos for the choice of qbmin
     260
     261          IF (zqb(i) .LT. qbmin) THEN
     262              zqv(i) = zqv(i)+zqb(i)
     263              IF (ztemp(i) .LT. RTT) THEN
     264                 ztemp(i) = ztemp(i) - zqb(i) * RLSTT/RCPD/(1.0+RVTMP2*(zqv(i)))
    176265              ELSE
    177                  zt(i) = zt(i) - zqbs(i) * (RLVTT+RLMLT)/RCPD/(1.0+RVTMP2*(zq(i)+zqbs(i)))
     266                 ztemp(i) = ztemp(i) - zqb(i) * (RLVTT+RLMLT)/RCPD/(1.0+RVTMP2*(zqv(i)))
    178267              ENDIF
    179               zqbs(i)=0.
    180         ENDIF
    181 
    182 
    183     ! Outputs:
    184         bsfl(i,k)=sedim(i)
    185         dqbs_bs(i,k) = zqbs(i)-qbs(i,k)
    186         dq_bs(i,k) = zq(i) - qv(i,k)
    187         dtemp_bs(i,k) = zt(i) - temp(i,k)
    188 
    189     ENDDO ! Loop on ngrid
    190 
    191 
    192 ENDDO ! vertical loop
    193 
    194 
    195 !surface bs flux
    196 DO i = 1, ngrid
    197   precip_bs(i) = sedim(i)
    198 ENDDO
     268              zqb(i)=0.
     269          ENDIF
     270
     271     ! variables update
     272     temp_seri(i,k)=ztemp(i)
     273     qv_seri(i,k)=zqv(i)
     274     qb_seri(i,k)=zqb(i)
     275     ENDDO
     276ENDDO
     277
     278ENDIF
     279
     280
     281! OUTPUTS
     282!++++++++++
     283
     284! 3D variables
     285DO k=1,nlay
     286   DO i=1,ngrid
     287        dqb_bs(i,k) = qb_seri(i,k) - qb(i,k)
     288        dqv_bs(i,k) = qv_seri(i,k) - qv(i,k)
     289        dtemp_bs(i,k) = temp_seri(i,k) - temp(i,k)
     290   ENDDO
     291ENDDO
     292
    199293
    200294
Note: See TracChangeset for help on using the changeset viewer.