Hello,
I am trying to interpolate 20 CR precipitation data using linint2_Wrap
function. The data is gaussian gridded. I would like to interpolate to a
fixed grid. I have tried a few other functions as well (g2fsh_Wrap,
linint2_Wrap etc). I get all Fillvalues (-32767) when I print the
interpolated "prate". I am attaching the script here. I am just a beginner
in ncl and would appreciate any help with this.
Thanks,
Durga
;regrid_pprate.ncl
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
;************************************************
; read in netCDF file
;************************************************
cdf_file = addfile("/Volumes/HD2/UCR/Data/20CR/prate.mon.mean.nc","r")
lon=cdf_file->lon
lat=cdf_file->lat
prate=cdf_file->prate
;************************************************
; interpolate to new grid
;***********************************************
prate@_FillValue= -32767h
newlat = fspan(90.0,-90,96)
newlon = fspan(0.,358.,144)
prate1 = short2flt(prate(0,:,:))
; print(prate1)
; prate2 =flt2dble(prate1)
; printVarSummary(prate1)
; do ne=0,0
; newprate = linint2(lon,lat,prate1,False,newlon,newlat,0)
newprate = linint2_Wrap(lon,lat,prate1,False,newlon,newlat,0)
; end do
; newsst!0 ="lat"
; newsst!1 = "lon"
; newsst&lat = newlat
; newsst&lon = newlon
print(prate1(:,50)*1e5)
print(newprate(:,50)*1e5)
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 29 18:01:25 2013
This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT