Unipost strange high, mid, low cloud cover output

All other topics about postprocessing model data (GrADS and other software), about other numerical weather prediction software (including WRF-NMM and WRF-ARW discussion unrelated to UEMS/WRF EMS), and general meteorology talk go in this forum.
oib
Posts: 118
Joined: Mon Jan 31, 2011 3:29 pm

Unipost strange high, mid, low cloud cover output

Post by oib » Mon Oct 06, 2014 4:39 pm

Hi all,

while post-processing WRF output with unipost (Unified Post Processor), I have encountered a strange output for the low, middle and high cloud cover (fields LCDClcll, MCDCmcll and HCDChcll) calculated by this tool.

The output is like it has a bad accuracy... it's not easy to describe with words, so please look at the two images below.

First image is the output obtained with WRF-EMS V3.4.1.
That image is correct and it's the expected output.
Image

Second image is the output obtained with self compiled WRFV3.4.1 and UPP2.0
It looks terrible... don't you think? :?
Image

Does anybody has encountered a such strange cloud cover output from unipost and could tell me how could I fix this?

Note 1: same WRF core (ARW), same namelists
Note 2: all the others UPP output fields look good. Only the cloud cover L,M,H is so strange.
Note 3: the image is terrible also using other mp_physic schemes

meteoadriatic
Posts: 1584
Joined: Wed Aug 19, 2009 10:05 am

Re: Unipost strange high, mid, low cloud cover output

Post by meteoadriatic » Mon Oct 06, 2014 5:23 pm

Hi,

So, first image is from EMSUPP and second is from original unipost?

oib
Posts: 118
Joined: Mon Jan 31, 2011 3:29 pm

Re: Unipost strange high, mid, low cloud cover output

Post by oib » Mon Oct 06, 2014 8:04 pm

Yes,
first image from WRF-EMS 3.4.1 > emsupp
second image from WRF 3.4.1 > unipost 2.0
Also using WRF 3.6 > unipost 2.2 the resulting image is so bad.

meteoadriatic
Posts: 1584
Joined: Wed Aug 19, 2009 10:05 am

Re: Unipost strange high, mid, low cloud cover output

Post by meteoadriatic » Tue Oct 07, 2014 5:08 am

EMSUPP is pretty much changed and I believe that cloud cover from ARW is an area where Robert tried to match ARW output that from NMM core. In default UPP there is a difference in how cloud cover is calculated from NMM and ARW core. I must admit that I also don't like ARW cloud cover much. It was much better from ARWpost than now from UPP.

This is what I'm getting from ARW:
http://meteoadriatic.net/prognoza/karte ... blaka.html

And this from NMM:
http://meteoadriatic.net/prognoza/karte ... blaka.html

Both are produced with UPP v2.1.

If there is source of changes that Robert made to EMS version of UPP, maybe we could be able to reproduce a cloud cover portion of those changes in UPP code without breaking the rest?

oib
Posts: 118
Joined: Mon Jan 31, 2011 3:29 pm

Re: Unipost strange high, mid, low cloud cover output

Post by oib » Tue Oct 07, 2014 6:50 am

meteoadriatic wrote:EMSUPP is pretty much changed and I believe that cloud cover from ARW is an area where Robert tried to match ARW output that from NMM core. In default UPP there is a difference in how cloud cover is calculated from NMM and ARW core. I must admit that I also don't like ARW cloud cover much. It was much better from ARWpost than now from UPP.
I agree with you, comparing EMSUPP calculated cloud cover for ARW and NMM, I also have noticed that NMM seems much close to reality.
This is what I'm getting from ARW:
http://meteoadriatic.net/prognoza/karte ... blaka.html

And this from NMM:
http://meteoadriatic.net/prognoza/karte ... blaka.html
Both are produced with UPP v2.1.
How do you calculate the cloud cover shown on your site? I guess you use GRADS, your input is at least RH at various pressure level, then you look for the max value of RH in the three big L,M,H portions of tropospere...
If there is source of changes that Robert made to EMS version of UPP, maybe we could be able to reproduce a cloud cover portion of those changes in UPP code without breaking the rest?
That's a great idea, but Robert does share that code?

I think that official unipost calculate L,M,H cloud cover fraction with the Fortran code of file /UPPV2.x/src/unipost/CLDFRAC_ZHAO.f, based on "Zhao/Moorthi's prognostic cloud microphysics scheme"

Code: Select all

!-----------------------------------
      subroutine progcld1                                               &
!...................................

!  ---  inputs:
          ( plyr,tlyr,qlyr,qstl,clw,                        &
            xlat,xlon,                                      &
            IX, NLAY, iflip,                                &
!  ---  outputs:
            cldtot                                          &
           )

! =================   subprogram documentation block   ================ !
!                                                                       !
! subprogram:    progcld1    computes cloud related quantities using    !
!   zhao/moorthi's prognostic cloud microphysics scheme.                !
!                                                                       !
! abstract:  this program computes cloud fractions from cloud           !
!   condensates, calculates liquid/ice cloud droplet effective radius,  !
!   and computes the low, mid, high, total and boundary layer cloud     !
!   fractions and the vertical indices of low, mid, and high cloud      !
!   top and base.  the three vertical cloud domains are set up in the   !
!   initial subroutine "cldinit".                                       !
!                                                                       !
! program history log:                                                  !
!      11-xx-1992   y.h., k.a.c, a.k. - cloud parameterization          !
!         'cldjms' patterned after slingo and slingo's work (jgr,       !
!         1992), stratiform clouds are allowed in any layer except      !
!         the surface and upper stratosphere. the relative humidity     !
!         criterion may cery in different model layers.                 !
!      10-25-1995   kenneth campana   - tuned cloud rh curves           !
!         rh-cld relation from tables created using mitchell-hahn       !
!         tuning technique on airforce rtneph observations.             !
!      11-02-1995   kenneth campana   - the bl relationships used       !
!         below llyr, except in marine stratus regions.                 !
!      04-11-1996   kenneth campana   - save bl cld amt in cld(,5)      !
!      12-29-1998   s. moorthi        - prognostic cloud method         !
!      04-15-2003   yu-tai hou        - rewritten in frotran 90         !
!         modulized form, seperate prognostic and diagnostic methods    !
!         into two packages.                                            !
!                                                                       !
! usage:         call progcld1                                          !
!                                                                       !
! subprograms called:   gethml                                          !
!                                                                       !
! attributes:                                                           !
!   language:   fortran 90                                              !
!   machine:    ibm-sp, sgi                                             !
!                                                                       !
!                                                                       !
!  ====================  defination of variables  ====================  !
!                                                                       !
! input variables:                                                      !
!   plyr  (IX,NLAY) : model layer mean pressure in mb (100Pa)           !
!   tlyr  (IX,NLAY) : model layer mean temperature in k                 !
!   qlyr  (IX,NLAY) : layer specific humidity in gm/gm                  !
!   qstl  (IX,NLAY) : layer saturate humidity in gm/gm                  !
!   rhly  (IX,NLAY) : layer relative humidity (=qlyr/qstl)              !
!   clw   (IX,NLAY) : layer cloud condensate amount                     !
!   xlat  (IX)      : grid latitude in radians                          !
!   xlon  (IX)      : grid longitude in radians  (not used)             !
!   slmsk (IX)      : sea/land mask array (sea:0,land:1,sea-ice:2)      !
!   IX              : horizontal dimention                              !
!   NLAY            : vertical layer/level dimensions                   !
!   iflip           : control flag for in/out vertical indexing         !
!                     =0: index from toa to surface                     !
!                     =1: index from surface to toa                     !
!   iovr            : control flag for cloud overlap                    !
!                     =0 random overlapping clouds                      !
!                     =1 max/ran overlapping clouds                     !
!                                                                       !
! output variables:                                                     !
!   clouds(IX,NLAY,NF_CLDS) : cloud profiles                            !
!      clouds(:,:,1) - layer total cloud fraction                       !
!      clouds(:,:,2) - layer cloud liq water path         (g/m**2)      !
!      clouds(:,:,3) - mean eff radius for liq cloud      (micron)      !
!      clouds(:,:,4) - layer cloud ice water path         (g/m**2)      !
!      clouds(:,:,5) - mean eff radius for ice cloud      (micron)      !
!      clouds(:,:,6) - layer rain drop water path         not assigned  !
!      clouds(:,:,7) - mean eff radius for rain drop      (micron)      !
!  *** clouds(:,:,8) - layer snow flake water path        not assigned  !
!      clouds(:,:,9) - mean eff radius for snow flake     (micron)      !
!  *** fu's scheme need to be normalized by snow density (g/m**3/1.0e6) !
!   clds  (IX,5)    : fraction of clouds for low, mid, hi, tot, bl      !
!   mtop  (IX,3)    : vertical indices for low, mid, hi cloud tops      !
!   mbot  (IX,3)    : vertical indices for low, mid, hi cloud bases     !
!                                                                       !
!  ====================    end of description    =====================  !
!
      use kinds, only: r_kind
      implicit none
      real, parameter:: climit=0.001
!  ---  inputs
      integer,  intent(in) :: IX, NLAY, iflip

      real (kind=r_kind), dimension(ix,nlay), intent(in) :: plyr,  &
            tlyr, qlyr, qstl, clw

      real (kind=r_kind), dimension(ix),   intent(in) :: xlat, xlon

!  ---  outputs
!      real (kind=kind_phys), dimension(:,:,:), intent(out) :: clouds

      real (kind=r_kind), dimension(ix,nlay),   intent(out) :: cldtot

!      integer,               dimension(:,:),   intent(out) :: mtop,mbot

!  ---  local variables:
!      real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv,      &
!     &       cwp, cip, crp, csp, rew, rei, res, rer, delp, tem2d

!      real (kind=kind_phys) :: ptop1(IX,4)
      real (kind=r_kind) :: rhly(ix,nlay)
      real (kind=r_kind) :: clwmin, clwm, clwt, onemrh, value,       &
            tem1, tem2, tem3

      integer, dimension(IX) :: kinver

      integer :: i, k, id, id1

      logical :: inversn(IX)

!
!===> ... begin here
!
!      clouds(:,:,:) = 0.0

      do k = 1, NLAY
        do i = 1, IX
          cldtot(i,k) = 0.0
	  rhly(i,k)   = qlyr(i,k)/qstl(i,k) ! Chuang: add RH computation here
        enddo
      enddo

!  ---  layer cloud fraction

      if (iflip == 0) then                 ! input data from toa to sfc

        do i = 1, IX
          inversn(i) = .false.
          kinver (i) = 1
        enddo

        do k = NLAY-1, 2, -1
          do i = 1, IX
            if (plyr(i,k) > 600.0 .and. (.not.inversn(i))) then
              tem1 = tlyr(i,k-1) - tlyr(i,k)

              if (tem1 > 0.1 .and. tlyr(i,k) > 278.0) then
                inversn(i) = .true.
                kinver(i)  = k
              endif
            endif
          enddo
        enddo

        clwmin = 0.0
        do k = NLAY, 1, -1
          do i = 1, IX
            clwt = 1.0e-6 * (plyr(i,k)*0.001)
!           clwt = 2.0e-6 * (plyr(i,k)*0.001)

            if (clw(i,k) > clwt .or.                                    &
              (inversn(i) .and. k >= kinver(i)) ) then

              onemrh= max( 1.e-10, 1.0-rhly(i,k) )
              clwm  = clwmin / max( 0.01, plyr(i,k)*0.001 )

              tem1  = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
              tem1  = 2000.0 / tem1
!             tem1  = 1000.0 / tem1
!             if (inversn(i) .and. k >= kinver(i)) tem1 = tem1 * 5.0

              value = max( min( tem1*(clw(i,k)-clwm), 50.0 ), 0.0 )
              tem2  = sqrt( sqrt(rhly(i,k)) )

              cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
            endif
          enddo
        enddo

      else                                 ! input data from sfc to toa

        do i = 1, IX
          inversn(i) = .false.
          kinver (i) = NLAY
        enddo

        do k = 2, NLAY
          do i = 1, IX
            if (plyr(i,k) > 600.0 .and. (.not.inversn(i))) then
              tem1 = tlyr(i,k+1) - tlyr(i,k)

              if (tem1 > 0.1 .and. tlyr(i,k) > 278.0) then
                inversn(i) = .true.
                kinver(i)  = k
              endif
            endif
          enddo
        enddo

        clwmin = 0.0
        do k = 1, NLAY
          do i = 1, IX
            clwt = 1.0e-6 * (plyr(i,k)*0.001)
!           clwt = 2.0e-6 * (plyr(i,k)*0.001)

            if (clw(i,k) > clwt .or.                                    &
              (inversn(i) .and. k <= kinver(i)) ) then

              onemrh= max( 1.e-10, 1.0-rhly(i,k) )
              clwm  = clwmin / max( 0.01, plyr(i,k)*0.001 )

              tem1  = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
              tem1  = 2000.0 / tem1
!             tem1  = 1000.0 / tem1
!             if (inversn(i) .and. k <= kinver(i)) tem1 = tem1 * 5.0

              value = max( min( tem1*(clw(i,k)-clwm), 50.0 ), 0.0 )
              tem2  = sqrt( sqrt(rhly(i,k)) )

              cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
            endif
          enddo
        enddo

      endif                                ! end_if_flip

      where (cldtot < climit)
        cldtot = 0.0
      endwhere
!
      return
!...................................
      end subroutine progcld1
!-----------------------------------

meteoadriatic
Posts: 1584
Joined: Wed Aug 19, 2009 10:05 am

Re: Unipost strange high, mid, low cloud cover output

Post by meteoadriatic » Tue Oct 07, 2014 1:12 pm

oib wrote:How do you calculate the cloud cover shown on your site? I guess you use GRADS, your input is at least RH at various pressure level, then you look for the max value of RH in the three big L,M,H portions of tropospere...
Simply using cloud fractions from UPP, nothing too much fancy:

Code: Select all

'set gxout shade2'

# High clouds
  'set rgb 31 238 238 238'
  'set rgb 32 235 239 245'
  'set rgb 33 209 240 252'
  'set rgb 34 194 232 252'
  'set rgb 35 179 224 252'
  'set rgb 36 164 219 252'
  'set rgb 37 149 214 252'
  'set clevs 0 25 50 80 95 98 99'
  'set ccols 37 37 36 35 34 33 32 31'
'd HCDChcl+cos(lat*3.1416/180)*1e-6'

# Mid clouds
  'set rgb 24 186 186 186'
  'set rgb 25 197 197 197'
  'set rgb 26 206 206 206'
  'set rgb 27 215 215 215'
  'set rgb 28 220 220 220'
  'set rgb 29 225 225 225'
  'set rgb 30 232 232 232'
  'set rgb 31 238 238 238'
  'set clevs 35 75 85 90 95 98 99'
  'set ccols -1 30 29 28 27 26 25 24'
'd MCDCmcl+cos(lat*3.1416/180)*1e-6'


# Low clouds
  'set rgb 17  99  99  99'
  'set rgb 18 110 110 110'
  'set rgb 19 120 120 120'
  'set rgb 20 133 133 133'
  'set rgb 21 145 145 145'
  'set rgb 22 160 160 160'
  'set rgb 23 175 175 175'
  'set rgb 24 186 186 186'
  'set clevs 35 80 90 95 97 98 99'
  'set ccols -1 23 22 21 20 19 18 17'
'd LCDClcl+cos(lat*3.1416/180)*1e-6'
It is the same grads code for both NMM and ARW.
oib wrote:
If there is source of changes that Robert made to EMS version of UPP, maybe we could be able to reproduce a cloud cover portion of those changes in UPP code without breaking the rest?
That's a great idea, but Robert does share that code?
So far I didn't found that. There are source EMS patches for WPS and WRF inside wrfems/util/wrfems directory, but nothing for UPP. At least, we can ask him.

I didn't tried to dive into fortran code of UPP yet, however, in ARWpost it was beautifully simple written and easy to understand and edit.

oib
Posts: 118
Joined: Mon Jan 31, 2011 3:29 pm

Re: Unipost strange high, mid, low cloud cover output

Post by oib » Wed Oct 08, 2014 8:34 am

meteoadriatic wrote:
oib wrote:How do you calculate the cloud cover shown on your site? I guess you use GRADS, your input is at least RH at various pressure level, then you look for the max value of RH in the three big L,M,H portions of tropospere...
Simply using cloud fractions from UPP
I would like to do this, but, as sayd in my first post, my self-compiled unipost produce bad grids for HCDChcl, MCDCmcl, LCDClcl. So I can't go this way. :?

My curiosity: why do you add the cosine of the latitude to the cloud cover fraction?

meteoadriatic
Posts: 1584
Joined: Wed Aug 19, 2009 10:05 am

Re: Unipost strange high, mid, low cloud cover output

Post by meteoadriatic » Wed Oct 08, 2014 1:32 pm

oib wrote:
meteoadriatic wrote:
oib wrote:How do you calculate the cloud cover shown on your site? I guess you use GRADS, your input is at least RH at various pressure level, then you look for the max value of RH in the three big L,M,H portions of tropospere...
Simply using cloud fractions from UPP
I would like to do this, but, as sayd in my first post, my self-compiled unipost produce bad grids for HCDChcl, MCDCmcl, LCDClcl. So I can't go this way. :?
I guess it will be same as my result? Or worse? I didn't changed anything to UPP code.
oib wrote:My curiosity: why do you add the cosine of the latitude to the cloud cover fraction?
I add that to all fields that can become empty when using shaded gxout, because if there is varible = 0 over whole domain I would lose cbar information and depending on script also will mess with background color (blue in this example). This way I ensure there is always something very small in displayed variable but not large enough to get it's shade color.

oib
Posts: 118
Joined: Mon Jan 31, 2011 3:29 pm

Re: Unipost strange high, mid, low cloud cover output

Post by oib » Thu Oct 09, 2014 1:22 pm

meteoadriatic wrote: I guess it will be same as my result? Or worse? I didn't changed anything to UPP code.
Your cloud depiction seems to have a resolution not so high as the model resolution (i.e. this ARW 4 Km map) but are well smoothed.
Mine instead seems both low-res and are not smoothed, they seems pixelated as you observe in the second image I have posted.
meteoadriatic wrote: I add that to all fields that can become empty when using shaded gxout, because if there is varible = 0 over whole domain I would lose cbar information and depending on script also will mess with background color (blue in this example). This way I ensure there is always something very small in displayed variable but not large enough to get it's shade color.
:D Thank's ;)

----

In the meantime, I have run with NMM and got perfect maps for H, M, L fraction clouds.
Therefore, the problem affects only the ARW core.
Is there anyone willing to download one of my WRF V3.{4,5,6} ARW wrf_out_* file, to process it with UPP V2.{0,1,2} and then to send the resulting GRIB file or to show here the resulting GrADS plot for one of HCDChcl, MCDCmcl, LCDClcl? :oops:

Thanks

meteoadriatic
Posts: 1584
Joined: Wed Aug 19, 2009 10:05 am

Re: Unipost strange high, mid, low cloud cover output

Post by meteoadriatic » Thu Oct 09, 2014 4:40 pm

oib wrote: Is there anyone willing to download one of my WRF V3.{4,5,6} ARW wrf_out_* file, to process it with UPP V2.{0,1,2} and then to send the resulting GRIB file or to show here the resulting GrADS plot for one of HCDChcl, MCDCmcl, LCDClcl? :oops:
Sure no problem, give me the link.

Post Reply