It is my speculation, that the WRF longitudes are negative
while the CPC are positive.
pr = short2flt(precip(547,:,:)) ;2d for simplicity
pr = pr*25.4 ;get to mm
pr_at_units = "mm"
pr = lonFlip( pr )
printVarSummary( pr ) ; note lon coordinates
xgrd = rgrid2rcm(pr&lat, pr&lon, pr, xlat,xlon,0)
James Correia wrote:
> Hi-
> I am trying to interpolate the monthly rainfall from 0.25 degree CPC
> data to the WRF model grid. I have attached the lat and lon (1d
> arrays) to the variable, but I can only get it rgrid2rcm to return
> missing values.
>
> here is the code snippet:
> ;read in wrf 2d arrays for lat and lon
> xlat = g->XLAT(0,:,:) ; 2d
> xlon = g->XLONG(0,:,:)
>
> ;read in CPC data
> lat = f->lat(:) ;1d
> lon = f->lon(:)
>
> pr = short2flt(precip(547,:,:)) ;2d for simplicity
> var = pr*25.4 ;get to mm
> copy_varCoords(pr,var) ;just in case
> var@_FillValue = -999.
>
> xgrd = rgrid2rcm(var&lat,var&lon,var,xlat,xlon,0)
>
> ;;;;;;;;;;;
> I can plot the "var" variable just fine. However, xgrd has all missing
> values.
>
> I have tried to set the missing value flag to 0, but that didnt fly:
> 0.0 currently not supported as a missing value, expect inaccurate plot.
>
> The CPC data has lots of missing values at the edges of the US. I
> doubt that makes a difference.
>
> Am I misisng something?
>
> --
> James Correia Jr.
> Post Doc
> Climate Physics Group, PNNL
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-- ====================================================== Dennis J. Shea tel: 303-497-1361 | P.O. Box 3000 fax: 303-497-1333 | Climate Analysis Section | Climate & Global Dynamics Div. | National Center for Atmospheric Research | Boulder, CO 80307 | USA email: shea 'at' ucar.edu | ====================================================== _______________________________________________ ncl-talk mailing list ncl-talk_at_ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Sep 16 2008 - 10:27:20 MDT
This archive was generated by hypermail 2.2.0 : Wed Sep 17 2008 - 10:32:36 MDT