[ncl-talk] Vertical cross section plot of WRF_Reflectivity (10 Cm) (REFL_10CM) through various longitude corresponding to a single lat

Trisanu Banik baniktrisanu at gmail.com
Wed Sep 19 07:51:51 MDT 2018


Hi

I am still struggling with the plot of vertical cross section of
reflectivity with respect to height and various lat keeping long constant
and vice versa.
During the search of cross sectional plots in web, I got few functions that
might be helpful for generating vertical cross sectional plot with respect
to height.

But my data has four dimensions time, eta level, lat, long. If I consider
the values for particular time it will become 3D i.e. level, lat, long. Now
to convert eta level to pressure I have utilized "q_isobaric =
int2p_n_Wrap(P_HYD,REFL_10CM,level,linlog,0) " this. Presently I am able to
plot reflectivity w..r.t pressure for various lat long.

Now the challenge is to convert vertical level to height. Various inbuilt
functions are there in NCL that convert pressure to height  like
"wrf_user_vert_interp"
and gsn_csm_pres_hgt etc. But my data dimension does not satisfy the
functions requirement. In wrf_out file, the necessary variables related to
this are, one dimentional vertical eta level (ZNW), Hydrostatic Pressure
level (P_HYD) and reflectivity (REFL_10CM). No height related 3D parameter
is available in the wrf_out file. Only terrain height is available which is
2D.

For your convenience, I have attached my tentative code. Please guide me to
plot the vertical cross section of reflectivity with Height in Y axis for
various lat long.

Thanks & Regards
Trisanu



*Trisanu Banik,PhD*

*Research Scientist*

*North Eastern Space Applications Centre (NESAC)*
*Government of India*
*Department of Space*

*Umiam-793103, Meghalaya*
*Mobile-9774837581*



On Thu, Sep 13, 2018 at 7:58 PM Jim Means <jim at weatherextreme.com> wrote:

> In addition to Soma's suggestion, you might also look at the cross section
> plot examples here:
>
> http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/NCL_examples.htm
>
> On 9/13/2018 7:09 AM, Soma Roy wrote:
>
> See the different examples at the below link:
> https://www.ncl.ucar.edu/Applications/height_long.shtml
>
> Best,
> Soma
>
> On Thu, Sep 13, 2018, 19:10 Trisanu Banik <baniktrisanu at gmail.com> wrote:
>
>> Hi,
>>
>> I need help to plot a vertical cross section plot of WRF REFL_10CM
>> (Reflectivity). The parameter is four dimensional (Time, eta level, lat,
>> lon). I tried to plot the vertical cross section of reflectivity with
>> respect to height for a particular time. But the REFL_10CM parameter
>> contain only eta level. Therefore whenever I generated plot, it always
>> provide vertical cross section w.r.t eta level only. i need suggestion how
>> I can convert eta level to pressure level/Height level. So that, I can plot
>> a vertical cross section of WRF reflectivity for various longitude
>> corresponding to a single latitude. Here I have added a sample plot. I need
>> to plot vertical cross section w.r.t height (not w.r.t eta level)
>>
>> Please help me to resolve the issue.
>>
>>
>> *Trisanu Banik,PhD*
>>
>> *Research Scientist *
>>
>> *North Eastern Space Applications Centre (NESAC) *
>> *Government of India*
>> *Department of Space*
>>
>> *Umiam-793103, Meghalaya *
>> *Mobile-9774837581*
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
>
> James D. Means, Ph.D.
> Senior Atmospheric & Climate Scientist
> California Office
> Tele: 619-495-1638 | Fax: 775-636-8430
> 930 Tahoe Blvd., Suite 802-560
> Incline Village, Nevada 89451
> jim at weatherextreme.com | vcard
> <http://www.weatherextreme.com/vcards/James%20Means.vcf>
> www.weatherextreme.com
> <http://www.weatherextreme.com/>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180919/4e698922/attachment.html>
-------------- next part --------------
 a = addfile ("wrfout_d03_2017-04-03_06:00:00_ctrl" , "r")
 time = 1
 XLAT = wrf_user_getvar(a,"XLAT",time);
 XLONG = wrf_user_getvar(a,"XLONG",time);
 HGT = wrf_user_getvar(a,"HGT",time);
 REFL_10CM=wrf_user_getvar(a,"REFL_10CM",time)
 P_HYD=wrf_user_getvar(a,"P",time)
 ZNW=wrf_user_getvar(a,"ZNW",time)
 U=wrf_user_getvar(a,"U",time)
 V=wrf_user_getvar(a,"V",time)
 W=wrf_user_getvar(a,"W",time)
 DNW=wrf_user_getvar(a,"DNW",time)
 CF2=wrf_user_getvar(a,"CF2",time)

 
  P0mb = 1000.

 lats =(/24.2015/)
 lons =(/92.768/)
 nm = getind_latlon2d (XLAT,XLONG, lats,lons)
 print(nm)



 ;---Define other arguments required by vinth2p
   interp = 2

 level = (/  1000, 970, 950, 925, 900, 875, 850, 825, 810, 800, 775, 750, 725, 710, 700, 680, 650, 625,   \
              600,575, 550,525, 500,475, 450,425, 400, 375,350,325, 300,275, 250, 225, 200 /)

;; h_level = (/ 500., 1000., 1500., 2000., 2500., 3000., 3500., 4000., 4500., 5000., 5500., 6000., 6500., 7000., 7500., 8000., 8500., 9000., 9500., 10000., 10500., \
            11000., 11500., 12000., 12500., 13000. /)

 height = h_level(1)

 
   linlog = -1   ; any option

   q_isobaric = int2p_n_Wrap(P_HYD,REFL_10CM,level,linlog,0) ; (time,lev,lat,lon)
; ;  height = int2p_n_Wrap(HGT,P_HYD,level,linlog,0);
   dimvar       = dimsizes(q_isobaric)
    print(dimvar)
    lev         = dimvar(0)                      ; 35
    nlat         = dimvar(1)                      ; 372
    mlon         = dimvar(2)
; dimsrh = dimsizes(REFL_10CM)
; plane = (/ dimsrh(1)/2, dimsrh(2)/2 /)
; p_plane = wrf_user_intrp3d(REFL_10CM,P_HYD,"v",level,0.,False)
 level at units = "mb"
;rh_plane1 = wrf_user_intrp3d(REFL_10CM,P_HYD,"v",plane,0.0,False)
       printVarSummary(q_isobaric)
;       printVarSummary(height)
 wks = gsn_open_wks("png","cross")

  cmap     := read_colormap_file("BlAqGrYeOrReVi200")
;  cmap     := read_colormap_files("GMT_gray")
  cmap(0,:) = (/0,0,0,0/)    ; make first color fully transparent

   resx = True
   resx at gsnMaximize          = True
  ;resx at gsnSpreadColors      = True            ; spread out color table [default v6.1.0]
  resx at lbLabelAutoStride    = True            ; default v6.1.0

   resx at cnFillOn             = True            ; turn on color fill
   resx at cnLinesOn            = False           ; turn lines on/off         ; True is default
   resx at cnLineLabelsOn       = False          ; turn line labels on/off   ; True is default
 ;  resx at cnFillPalette        = "ncl_default"
 ;  resx at cnFillPalette        = "MPL_StepSeq"   ;ELECMAG
    resx at cnFillPalette       =cmap
   ;  resx at cnFillPalette(8,:) = (/0,0,0,0/)    ; make first color fully transparent
   nLabels                   = 8              ; arbitrary
   resx at tmXBLabels           = new(nLabels,"string")
   resx at tmXBMode             = "Explicit"
  ; resx at cmap     := read_colormap_file("rainbow+gray")
  ; resx at cnFillPalette(0,:) = (/0,0,0,0/)    ; make first color fully transparent
; resx at tmXBTickStartF  = tt   ; Force tickmark labelling to start at first value
; resx at trYMinF = (max (P_HYD(:,1,1)))
;resx at trYMaxF = (min(P_HYD(:,1,1)))
resx at trYReverse      = True


  ml = 35
    hh= XLONG(1,ml)
    print(hh)
    resx at tmXBValues         := toint(fspan(0,nlat-1,nLabels))
    do i=0,nLabels-1
       x = XLONG(resx at tmXBValues(i),ml)
       y = XLAT(resx at tmXBValues(i),ml)
       resx at tmXBLabels(i) = sprintf("%5.1f", y)+"~C~"+sprintf("%5.1f", x)
    end do
  tt=min(x);
  print(tt)
    resx at tiMainString = "Full South-North Grid Line X-Section: ml="+ml
 ; units at resx = "Pa"


  plot1  = gsn_csm_contour(wks, q_isobaric(:,:,ml), resx )   ; (29, 349) at ml


More information about the ncl-talk mailing list