Changeset 2871


Ignore:
Timestamp:
Jan 16, 2023, 4:47:11 PM (23 months ago)
Author:
jleconte
Message:

Improved rain evaporation for les + correction in callkeys

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90

    r2831 r2871  
    4242      logical,save :: generic_rain
    4343!$OMP THREADPRIVATE(varactive,varfixed,radfixed,sedimentation,generic_condensation,generic_rain)
    44       logical,save :: water,watercond,waterrain
    45 !$OMP THREADPRIVATE(water,watercond,waterrain)
    46       logical,save :: aeroco2,aeroh2o,aeroh2so4,aeroback2lay
    47 !$OMP THREADPRIVATE(aeroco2,aeroh2o,aeroh2so4,aeroback2lay)
     44      logical,save :: water ,watercond, waterrain, moistadjustment
     45!$OMP THREADPRIVATE(water, watercond, waterrain, moistadjustment)
     46      logical,save :: aeroco2, aeroh2o, aeroh2so4, aeroback2lay
     47!$OMP THREADPRIVATE(aeroco2, aeroh2o, aeroh2so4, aeroback2lay)
    4848      logical,save :: aeronh3, aeronlay, aeroaurora
    4949!$OMP THREADPRIVATE(aeronh3,aeronlay,aeroaurora)
     
    5252!$OMP THREADPRIVATE(aerovenus)
    5353      ! detailed sub-options when with "Venus-like" aerosol additions
    54       logical,save :: aerovenus1,aerovenus2,aerovenus2p,aerovenus3,aerovenusUV
    55 !$OMP THREADPRIVATE(aerovenus1,aerovenus2,aerovenus2p,aerovenus3,aerovenusUV)
     54      logical,save :: aerovenus1, aerovenus2, aerovenus2p, aerovenus3, aerovenusUV
     55!$OMP THREADPRIVATE(aerovenus1, aerovenus2, aerovenus2p, aerovenus3, aerovenusUV)
    5656
    57       logical,save :: aerofixco2,aerofixh2o
    58 !$OMP THREADPRIVATE(aerofixco2,aerofixh2o)
     57      logical,save :: aerofixco2, aerofixh2o
     58!$OMP THREADPRIVATE(aerofixco2, aerofixh2o)
    5959      integer,save :: aerogeneric ! number of aerosols of "generic" kind
    6060!$OMP THREADPRIVATE(aerogeneric)
  • trunk/LMDZ.GENERIC/libf/phystd/largescale.F90

    r2073 r2871  
    4040!     Options du programme
    4141      REAL, SAVE :: ratqs   ! determine largeur de la distribution de vapeur
    42 !$OMP THREADPRIVATE(ratqs)
     42      REAL, SAVE :: qvap_deep   ! deep mixing ratio of water vapor when simulating bottom less planets
     43!$OMP THREADPRIVATE(ratqs, qvap_deep)
    4344
    4445!     Variables locales
     
    7273         call getin_p("ratqs",ratqs)
    7374         write(*,*) " ratqs = ",ratqs
     75
     76         write(*,*) "Deep water vapor mixing ratio ? (no effect if negative) "
     77         qvap_deep=-1. ! default value
     78         call getin_p("qvap_deep",qvap_deep)
     79         write(*,*) " qvap_deep = ",qvap_deep
    7480
    7581         firstcall = .false.
     
    181187
    182188   Enddo ! k= nlayer, 1, -1
    183  
     189
     190   if (qvap_deep >= 0.) then
     191      !brings lower vapor ratio to a fixed value.
     192      ! tau=3600. seems too fast
     193      pdqvaplsc(1:ngrid,1) = (qvap_deep - pq(1:ngrid,1,igcm_h2o_vap))/14400. - pdq(1:ngrid,1,igcm_h2o_vap)
     194   endif
     195
    184196
    185197      end
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r2867 r2871  
    6161                              startphy_file, testradtimes, tlocked, &
    6262                              tracer, UseTurbDiff, water, watercond, &
    63                               waterrain, generic_rain, global1d, szangle
     63                              waterrain, generic_rain, global1d, moistadjustment, szangle
    6464      use generic_tracer_index_mod, only: generic_tracer_index
    6565      use nonoro_gwd_ran_mod, only: nonoro_gwd_ran
     
    8585         comm_FLUXTOP_LW,comm_FLUXSURF_SW,          &
    8686         comm_FLUXSURF_LW,comm_FLXGRD,              &
    87          comm_DTRAIN,comm_DTLSC,comm_H2OICE_REFF
     87         comm_DTRAIN,comm_DTLSC,comm_H2OICE_REFF,   &
     88         comm_LATENT_HF
     89
    8890#endif
    8991
     
    14251427            if(watercond.and.(RLVTT.gt.1.e-8))then
    14261428               
    1427                if (.not.calltherm) then
     1429               if ((.not.calltherm).and.moistadjustment) then
    14281430                  dqmoist(1:ngrid,1:nlayer,1:nq)=0.
    14291431                  dtmoist(1:ngrid,1:nlayer)=0.
     
    15061508               zdqssnow(1:ngrid)    = 0.0
    15071509
    1508                call rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,pt,pdt,pq,pdq,            &
     1510               call rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,pphi,pt,pdt,pq,pdq,            &
    15091511                         zdtrain,zdqrain,zdqsrain,zdqssnow,reevap_precip,cloudfrac)
    15101512
     
    24482450
    24492451            call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE)
    2450             call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)
     2452            if ((.not.calltherm).and.moistadjustment) then
     2453               call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)
     2454            endif
    24512455            call writediagfi(ngrid,"qsatatm","atm qsat"," ",3,qsat)
    24522456             
     
    25712575   comm_HR_SW(1:ngrid,1:nlayer) = zdtsw(1:ngrid,1:nlayer)
    25722576   comm_HR_LW(1:ngrid,1:nlayer) = zdtlw(1:ngrid,1:nlayer)
     2577   comm_ALBEQ(1:ngrid)=albedo_equivalent(1:ngrid)
     2578   if (.not.calldifv) comm_LATENT_HF(:)=0.0
    25732579   if ((tracer).and.(water)) then
    25742580     comm_CLOUDFRAC(1:ngrid,1:nlayer)=cloudfrac(1:ngrid,1:nlayer)
     
    25762582     comm_SURFRAIN(1:ngrid)=zdqsrain(1:ngrid)
    25772583     comm_DQVAP(1:ngrid,1:nlayer)=pdq(1:ngrid,1:nlayer,igcm_h2o_vap)
    2578      comm_ALBEQ(1:ngrid)=albedo_equivalent(1:ngrid)
     2584     comm_DQICE(1:ngrid,1:nlayer)=pdq(1:ngrid,1:nlayer,igcm_h2o_ice)
    25792585     comm_H2OICE_REFF(1:ngrid,1:nlayer)=reffrad(1:ngrid,1:nlayer,iaero_h2o)
    25802586     comm_REEVAP(1:ngrid)=reevap_precip(1:ngrid)
     
    25822588     comm_DTLSC(1:ngrid,1:nlayer)=dtlscale(1:ngrid,1:nlayer)
    25832589     comm_RH(1:ngrid,1:nlayer)=RH(1:ngrid,1:nlayer)
     2590   else
     2591      comm_CLOUDFRAC(1:ngrid,1:nlayer)=0.
     2592      comm_TOTCLOUDFRAC(1:ngrid)=0.
     2593      comm_SURFRAIN(1:ngrid)=0.
     2594      comm_DQVAP(1:ngrid,1:nlayer)=0.
     2595      comm_DQICE(1:ngrid,1:nlayer)=0.
     2596      comm_H2OICE_REFF(1:ngrid,1:nlayer)=0.
     2597      comm_REEVAP(1:ngrid)=0.
     2598      comm_DTRAIN(1:ngrid,1:nlayer)=0.
     2599      comm_DTLSC(1:ngrid,1:nlayer)=0.
     2600      comm_RH(1:ngrid,1:nlayer)=0.
    25842601   endif
    2585    !comm_DQICE(1:ngrid,1:nlayer)=zdqdyn(1:ngrid,1:nlayer)
    25862602   comm_FLUXTOP_DN(1:ngrid)=fluxtop_dn(1:ngrid)
    25872603   comm_FLUXABS_SW(1:ngrid)=fluxabs_sw(1:ngrid)
  • trunk/LMDZ.GENERIC/libf/phystd/rain.F90

    r1995 r2871  
    1 subroutine rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,reevap_precip,rneb)
     1subroutine rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,pphi,t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,reevap_precip,rneb)
    22
    33
     
    3030      real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa)
    3131      real,intent(in) :: pplay(ngrid,nlayer)   ! mid-layer pressure (Pa)
     32      real,intent(in) :: pphi(ngrid,nlayer)   ! mid-layer geopotential
    3233      real,intent(in) :: t(ngrid,nlayer) ! input temperature (K)
    3334      real,intent(in) :: pdt(ngrid,nlayer) ! input tendency on temperature (K/s)     
     
    7475      INTEGER i, k, n
    7576      REAL zqs(ngrid,nlayer),Tsat(ngrid,nlayer), zdelta, zcor
    76       REAL zrfl(ngrid), zrfln(ngrid), zqev, zqevt
     77      REAL precip_rate(ngrid), precip_rate_tmp(ngrid), zqev, zqevt
    7778
    7879      REAL zoliq(ngrid)
     
    8586      real tnext(ngrid,nlayer)
    8687
    87       real l2c(ngrid,nlayer)
     88      real dmass(ngrid,nlayer)
    8889      real dWtot
    8990
     
    177178      d_q(1:ngrid,1:nlayer) = 0.0
    178179      d_ql(1:ngrid,1:nlayer) = 0.0
    179       zrfl(1:ngrid) = 0.0
    180       zrfln(1:ngrid) = 0.0
     180      precip_rate(1:ngrid) = 0.0
     181      precip_rate_tmp(1:ngrid) = 0.0
    181182
    182183      ! calculate saturation mixing ratio
     
    192193      DO k = 1, nlayer
    193194         DO i = 1, ngrid
    194             l2c(i,k)=(pplev(i,k)-pplev(i,k+1))/g
     195            dmass(i,k)=(pplev(i,k)-pplev(i,k+1))/g
    195196         ENDDO
    196197      ENDDO
     
    203204         IF (evap_prec) THEN ! note no rneb dependence!
    204205            DO i = 1, ngrid
    205                IF (zrfl(i) .GT.0.) THEN
     206               IF (precip_rate(i) .GT.0.) THEN
    206207
    207208                  if(zt(i,k).gt.Tsat(i,k))then
    208 !!                   treat the case where all liquid water should boil
    209                      zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*l2c(i,k)/RLVTT/ptimestep,zrfl(i))
    210                      zrfl(i)=MAX(zrfl(i)-zqev,0.)
    211                      d_q(i,k)=zqev/l2c(i,k)*ptimestep
    212                      d_t(i,k) = - d_q(i,k) * RLVTT/RCPD
    213                   else
    214                      zqev = MAX (0.0, (zqs(i,k)-q(i,k)))*l2c(i,k)/ptimestep !there was a bug here
     209!!                   treat the case where all liquid water should boil
     210                     zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*dmass(i,k)/RLVTT/ptimestep,precip_rate(i))
     211                     precip_rate(i)=MAX(precip_rate(i)-zqev,0.)
     212                     d_q(i,k)=zqev/dmass(i,k)*ptimestep
     213                     d_t(i,k) = - d_q(i,k) * RLVTT/RCPD
     214                  else
     215                     zqev = MAX (0.0, (zqs(i,k)-q(i,k)))*dmass(i,k)/ptimestep !there was a bug here
    215216                     zqevt= 2.0e-5*(1.0-q(i,k)/zqs(i,k))    & !default was 2.e-5
    216                         *sqrt(zrfl(i))*l2c(i,k)/pplay(i,k)*zt(i,k)*R ! BC modif here
     217                        *sqrt(precip_rate(i))*dmass(i,k)/pplay(i,k)*zt(i,k)*R ! BC modif here
    217218                     zqevt = MAX (zqevt, 0.0)
    218219                     zqev  = MIN (zqev, zqevt)
    219220                     zqev  = MAX (zqev, 0.0)
    220                      zrfln(i)= zrfl(i) - zqev
    221                      zrfln(i)= max(zrfln(i),0.0)
    222 
    223                      d_q(i,k) = - (zrfln(i)-zrfl(i))/l2c(i,k)*ptimestep
     221                     precip_rate_tmp(i)= precip_rate(i) - zqev
     222                     precip_rate_tmp(i)= max(precip_rate_tmp(i),0.0)
     223
     224                     d_q(i,k) = - (precip_rate_tmp(i)-precip_rate(i))/dmass(i,k)*ptimestep
    224225                     !d_t(i,k) = d_q(i,k) * RLVTT/RCPD!/(1.0+RVTMP2*q(i,k)) ! double BC modif here
    225226                     d_t(i,k) = - d_q(i,k) * RLVTT/RCPD ! was bugged!
    226                      zrfl(i)  = zrfln(i)
    227                   end if
    228                      
    229 
    230                ENDIF ! of IF (zrfl(i) .GT.0.)
     227                     precip_rate(i)  = precip_rate_tmp(i)
     228                  end if
     229#ifdef MESOSCALE
     230                  d_t(i,k) = d_t(i,k)+(pphi(i,k+1)-pphi(i,k))*precip_rate(i)*ptimestep/(RCPD*dmass(i,k))
     231                  ! JL22. Accounts for gravitational energy of falling precipitations (probably not to be used in the GCM
     232                  !   where the counterpart is not included in the dynamics.)
     233#endif
     234
     235               ENDIF ! of IF (precip_rate(i) .GT.0.)
    231236            ENDDO
    232237         ENDIF ! of IF (evap_prec)
     
    253258                  IF ((ql(i,k)/zneb(i)).gt.lconvert)THEN ! precipitate!
    254259                     d_ql(i,k) = -MAX((ql(i,k)-lconvert*zneb(i)),0.0)
    255                      zrfl(i)   = zrfl(i) - d_ql(i,k)*l2c(i,k)/ptimestep
     260                     precip_rate(i)   = precip_rate(i) - d_ql(i,k)*dmass(i,k)/ptimestep
    256261                  ENDIF
    257262               ENDIF
     
    350355               IF (rneb(i,k).GT.0.0) THEN
    351356                  d_ql(i,k) = (zoliq(i) - ql(i,k))!/ptimestep
    352                   zrfl(i)   = zrfl(i)+ MAX(ql(i,k)-zoliq(i),0.0)*l2c(i,k)/ptimestep
     357                  precip_rate(i)   = precip_rate(i)+ MAX(ql(i,k)-zoliq(i),0.0)*dmass(i,k)/ptimestep
    353358               ENDIF
    354359            ENDDO
     
    361366!     Rain or snow on the ground
    362367      DO i = 1, ngrid
    363          if(zrfl(i).lt.0.0)then
     368         if(precip_rate(i).lt.0.0)then
    364369            print*,'Droplets of negative rain are falling...'
    365370            call abort
    366371         endif
    367372         IF (t(i,1) .LT. T_h2O_ice_liq) THEN
    368             dqssnow(i) = zrfl(i)
     373            dqssnow(i) = precip_rate(i)
    369374            dqsrain(i) = 0.0
    370375         ELSE
    371376            dqssnow(i) = 0.0
    372             dqsrain(i) = zrfl(i) ! liquid water = ice for now
     377            dqsrain(i) = precip_rate(i) ! liquid water = ice for now
    373378         ENDIF
    374379      ENDDO
     
    381386           reevap_precip(i)=0.
    382387           do k=1,nlayer
    383               reevap_precip(i)=reevap_precip(i)+dqrain(i,k,i_vap)*l2c(i,k)
     388              reevap_precip(i)=reevap_precip(i)+dqrain(i,k,i_vap)*dmass(i,k)
    384389           enddo
    385390        enddo
Note: See TracChangeset for help on using the changeset viewer.