I am computing vorticity advection on a fixed 20-km grid with the script below.
With high resolution 500-hPa wind data, slight noises in the wind lead to moderate
noise in the vorticity and much worse noise when computing the vorticity advection,
after computing the derivate twice with the leap frog method.
You can see what I mean from the attached plot of vorticity advection.
Any suggestions? Should I smooth the wind data first? Or is there a better method
than using leap frog?
Thanks, Michael
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
a=addfile("/volumes/data/azi/regcm_output/spinup/1996/GL_ATM.1996090100.nc","r")
uu=a->u
vv=a->v
pp=a->ps
u=dim_avg_Wrap(uu(iy|:,jx|:,kz|:,time|48:51))
v=dim_avg_Wrap(vv(iy|:,jx|:,kz|:,time|48:51))
sigma=a->sigma
xlat=a->xlat
xlon=a->xlon
ptop=a->ptop ; hPa
ps=dim_avg_Wrap(pp(iy|:,jx|:,time|48:51)) ; hPa
p=new((/126,150,18/),float)
do i=0,17
p(:,:,i)=ps*sigma(i)
end do
copy_VarCoords(u,p)
uwnd=int2p(p,u,500.,1)
vwnd=int2p(p,v,500.,1)
uwind=uwnd(:,:,0)
vwind=vwnd(:,:,0)
copy_VarCoords(ps,uwind)
copy_VarCoords(ps,vwind)
dvdx=new((/126,150/),float)
dvdx=0.
dudy=new((/126,150/),float)
dudy=0.
vort=new((/126,150/),float)
vort=0.
do i=1,124
do j=1,148
dvdx(i,j)=(vwind(i,j+1)-vwind(i,j-1))/40./1000. ; s-1
dudy(i,j)=(uwind(i+1,j)-uwind(i-1,j))/40./1000. ; s-1
vort(i,j)=dvdx(i,j)-dudy(i,j)
end do
end do
copy_VarCoords(ps,dvdx)
copy_VarCoords(ps,dudy)
copy_VarCoords(ps,vort)
dvortdx=new((/126,150/),float)
dvortdx=0.
dvortdy=new((/126,150/),float)
dvortdy=0.
do i=1,124
do j=1,148
dvortdx(i,j)=(vort(i,j+1)-vort(i,j-1))/40./1000.
dvortdy(i,j)=(vort(i+1,j)-vort(i-1,j))/40./1000.
end do
end do
adv=new((/126,150/),float)
adv=0.
do i=0,125
do j=0,149
adv(i,j)=-1.*uwind(i,j)*dvortdx(i,j)-1.*vwind(i,j)*dvortdy(i,j)
end do
end do
copy_VarCoords(ps,adv)
adv@grid_mapping="rcm_map"
adv@coordinates="xlat xlon"
vort@grid_mapping="rcm_map"
vort@coordinates="xlat xlon"
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT