Re: rcm2rgrid problem

From: IMRAN NADEEM <qphoton_at_nyahnyahspammersnyahnyah>
Date: Thu, 23 Oct 2008 17:58:03 +0200

Hi Dennis,

Thanks again. I cannot use rcm2points function because my destination grid
is described by two-dimensional lat/lon coordinate arrays (observed data
projected on Lambert conformal). whereas rcm2points accepts 1d arrays for
destination grid. I am looking for something like rcm2grid2d.

Regards
Imran

On Thu, Oct 23, 2008 at 5:20 PM, Dennis Shea <shea_at_ucar.edu> wrote:

> http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml
>
> or, if you want meta data,
>
> http://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml
>
>
> MRAN NADEEM wrote:
>
>> Hi Dennis,
>>
>> Thanks! It works now. Thanks a lot for your quick reply. In my
>> previous email, I forgot to ask my second question. How can I interpolate
>> model data to Observed data grid (we have gridded observation data projected
>> on lambert conformal grid and contains 2d lat/lon coordinates and precip
>> values). Any hint?
>>
>> Thanks in advance
>> Regards
>> Imran Nadeem
>>
>>
>>
>>
>>
>>
>> On Thu, Oct 23, 2008 at 4:38 PM, Dennis Shea <shea_at_ucar.edu <mailto:
>> shea_at_ucar.edu>> wrote:
>>
>> The rcm2rgrid assumes the latitudes are order south-to-north
>> like in the REGcm grid.
>>
>> The MM5 is ordered north-to-south. Try
>>
>> precip = f->precip ; (time,lat,lon)
>> lat2d = f->xlat ; lat order is S->N
>> lon2d = f->xlon
>>
>> lat2d = (/ lat2d(::-1,:) /) ; rearrange values only
>> precip = (/ precip(:,::-1,:) /)
>>
>>
>> The documentation has been updated to reflect this.o
>> Good luck
>>
>> IMRAN NADEEM wrote:
>>
>> Hi everybody,
>>
>> I have precipitation fields from RegCM3 and MM5 models. I
>> have written a script to interpolate from model grid to
>> regular grid. The script works fine for RegCM3 data
>> but produces only missing values for mm5 data. Both datasets
>> covers the same region and have almost same number of grid
>> points. The script is given below and few time
>> steps of both datasets are here (Size 600KB).
>>
>> http://homepage.boku.ac.at/imrannad/Precip_regcm.nc
>> http://homepage.boku.ac.at/imrannad/Precip_mm5.nc
>>
>>
>> Any Help/Suggestion is highly appreciated!
>>
>> Regards
>> Imran Nadeem
>> BOKU, Vienna
>>
>>
>>
>> ------------------------------
>>
>> ------------------------Rcm2rgrid.ncl----------------------------------------------
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>
>>
>> begin
>>
>> ; ---------Read input file--------------------
>> filein="Precip_regcm.nc" ; input file
>> data_file= addfile(filein,"r")
>>
>> precip = data_file->precip
>> lat2d = data_file->xlat
>> lon2d = data_file->xlon
>> time =data_file->time
>>
>> lat_g = latGlobeF(901, "lat", "latitude", "degrees_north")
>> ;0.20 degree spacing
>> lon_g = lonGlobeF(1800, "lon", "longitude", "degrees_east")
>> ;0.20 degree spacing
>>
>> newlon = lon_g({2:19})
>> newlat = lat_g({42:50})
>>
>> precip_rgrid = rcm2rgrid(lat2d,lon2d,precip,newlat,newlon,0)
>> ; Regridding
>>
>> ;---------------- assign named dimensions----------------
>> precip_rgrid!0 = "time"
>> precip_rgrid!1 = "lat"
>> precip_rgrid!2 = "lon"
>>
>> ;---------------- assign attributes----------------
>> precip_rgrid_at_long_name="Precipitation on Regular Grid"
>> precip_rgrid_at_units="mm/day"
>> precip_rgrid@_FillValue=-1.e+30
>>
>> ;---------------- assign coordinate variables----------------
>> precip_rgrid&lat = newlat
>> precip_rgrid&lon = newlon
>> precip_rgrid&time =time
>>
>> ;-----------create output file---------------
>> outfile_name = "Precip_regcm_rgrid.nc"
>> system(" 'rm' -f " + outfile_name)
>> outfile = addfile(outfile_name, "c")
>> filedimdef(outfile,"time",-1,True) ;
>> make time and record dimension.
>> outfile_at_title = "regcm precip on regular lat lon"
>>
>> ;------------write to output file---------------
>> outfile->precip = precip_rgrid
>> outfile->lon=newlon
>> outfile->lat=newlat
>>
>> end
>> <http://homepage.boku.ac.at/imrannad/Precip_mm5.nc>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> 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
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 23 2008 - 09:58:03 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 24 2008 - 14:07:49 MDT