Regridding question

From: ssarkar (ssarkar AT forestone.com)
Date: Fri Oct 07 2005 - 14:21:05 MDT


Hi Guys,
I am new to NCL and am trying to convert a 73x144 lat lon grid to a 181x360 lat lon grid using the linint2 function. Heres what I have done so far:

gfile=addfile("gfs.t00z.pgrbf192.grb","r") ;read a GFS model grib file
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
pc=gfile->A_PCP_2_SFC_acc12h ; read the 12 hour Total surface ppt (lat| 73, lon| 144)

; Since linint2 expects lat array in ascending order hence:
pcflip = new((/73,144/),float)
k=72
do i = 0,72
pcflip(i,:) = pc(k,:)
   k = k-1
end do
newlon=fspan(0.,359,360) ; define new longitude
newlat=fspan(-90.,90,181) ; define new output latitude
pc_regrid = linint2_Wrap(pcflip&lon_2,pcflip&lat_2,pcflip,False,newlon,newlat,0)

 ; Then flip the data back again along the latitude
 k = 180
do i = 0,180
pcregrid_flip(i,:) = pc_regrid(k,:)
  k = k-1
end do

So my final regridded varibale is pcregrid_flip
I am not sure i am doing the right thing here? the plots of the original and regridded variables looks somewhat different which maybe due to interpolation but i just want to make sure from you guys. Also shuold i use f2sfh insetad of linint2??
Any suggestion will be most welcome
Thanks

Sudipta Sarkar


_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Fri Oct 07 2005 - 17:57:59 MDT