NCL Home > Documentation > Functions > WRF

wrf_smooth_2d

Smooths a given field.

Prototype

	procedure wrf_smooth_2d (
		fld   : numeric,  
		iter  : integer   
	)

Arguments

fld

Field to smooth. Must contain at least two dimensions.

iter

Number of smoothing passes to apply to the field.

Description

This procedure operates directly on fld and smooths it using a nine point average. This code is from the original "filter2d" routine in the WRF "wrf_user_fortran_util_0.f" Fortran file.

See Also

See the full list of WRF functions.

Examples

Example 1

  nc_file=addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")

  T  = nc_file->T(time,:,:,:)
  th = T + 300.

  P  = nc_file->P(time,:,:,:)
  PB = nc_file->PB(time,:,:,:)
  p  = ( P + PB )

  tk = wrf_tk( p , th )

  QVAPOR = nc_file->QVAPOR(time,:,:,:)
  PH     = nc_file->PH(time,:,:,:)
  PHB    = nc_file->PHB(time,:,:,:)
  var    = ( PH + PHB ) / 9.81
  dim    = dimsizes(var)
  z      = 0.5 * ( var(0:dim(0)-2,:,:) + var(1:dim(0)-1,:,:) )

 ; Sea level pressure [hPa]
  slp   = wrf_slp( z, tk, p, QVAPOR )

 ; Smooth SLP
     wrf_smooth_2d(slp,3)
Example 2

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

  a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")

  time = 1
  slp = wrf_user_getvar(a,"slp",time)  ; calculate SLP

  ; Smooth SLP
  wrf_smooth_2d(slp,3)