NCL Home > Documentation > Functions > WRF, File IO

wrf_rip_dbz

Calculates simulated reflectivity using data extracted from ARW WRF model output.

Available in version 5.0.1 or later.

Prototype

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

	function wrf_rip_dbz (
		a           : file,     
		time    [1] : integer,  
		ivarint [1] : integer,  
		iopt    [1] : integer   
	)

	return_val  :  numeric

Arguments

a

File reference to the WRF netCDf file.

time

Time in file to retrieve.

ivarint

    ivarint=0, the intercept parameters are assumed constant (as
    in early Reisner-2), with values of 8x10^6, 2x10^7, and 4x10^6 m^-4,
    for rain, snow, and graupel, respectively.

    ivarint=1, variable intercept parameters are used, as calculated in
    Thompson, Rasmussen, and Manning (2004, Monthly Weather Review,
    Vol. 132, No. 2, pp. 519-542.)

iopt

    iopt=0, return the 2D maximum reflectivity

    iopt=1, return the 3D reflectivity

Return value

A 2D [iopt=0] or 3D [iopt=1] array containing the reflectivity.

Description

This function extracts data the necessary variables from the ARW WRF file, if available, and calculates requested reflectivity.

wrf_rip_dbz is part of a library of functions and procedures in WRFUserARW.ncl written to help users plot ARW WRF model data.

WRF-related questions should be sent to wrfhelp@ucar.edu.

See Also

See the full list of WRF functions.

Examples

Example 1

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

  dwrf = "/tmp/wrfout/"
  fwrf = "wrfout.nc"
  a    = addfile(dwrf+fwrf,"r")
  
  dimTim  = getfilevardimsizes(a,"Times")
  time_s  = chartostring(a->Times)
  ntim    =  dimTim(0)

  lat2d   = a->XLAT(0,:,:)
  lon2d   = a->XLONG(0,:,:)

  ivarint = 1       ; see documentation of wrf_rip_dbz
  iret    = 0       ; 0=> return 'maxdbz' [2D]
                    ; 1=> return 'dbz'    [3D]

  res                  = True          ; plot mods desired
  res@cnFillOn         = True          ; turn on color
  res@cnFillMode       = "CellFill"    ; Cell Mode
  res@cnLinesOn        =  False        ; Turn off contour lines
  res@gsnSpreadColors  = True          ; use full range of colormap
  res@gsnMaximize      = True 

  do nt=0,ntim-1
      mdbz = wrf_rip_dbz(a, nt, ivarint, iret )

      wks  = <gsn_open_wks("ps","maxdbz_"+nt)  
      gsn_define_colormap(wks,"radar")      ; specified color map

      maxdbz@lat2d = lat2d
      maxdbz@lon2d = lon2d

      WRF_map_c(a,res,0)
      res@gsnRightString = time_s(nt) 
      plot = gsn_csm_contour_map(wks,maxdbz,res)  ; contour the variable
  end do

end