# Re: Speeding up rcm2rgrid?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 04 2013 - 22:33:54 MDT

Hi Bridgit,

'rcm2rgrid' is not particularly efficient. In fact, since the
introduction of the ESMF regridding functions, I'd say that
'rcm2rgrid' should not be used.

There are basically 2 steps:

[1] Generate the weights (Can be slow but is done once)
Save the netCDF)
[2] apply the weights (Read weights; regrid; Very fast)

There are numerous examples. EG Ex 5, 6, 7, 8, 15

Regards
D

On 4/4/13 10:19 PM, Bridget Thrasher wrote:
> I have a very large grid (4823 x 5268) that I'm trying to change from curvilinear to rectilinear. I'm trying to use rcm2rgrid, but it's sitting for hours without returning. I don't have a sense for how long this function should take since I've never used it before. Am I doing something wrong? Or is the grid size grinding it to a halt? If the latter, is there anything I can do to speed it up?
>
> -Bridget
>
> ls_obs = systemfunc("ls pr*.nc")
> lat2d = fin->lat(::-1,:)
> lon2d = fin->lon
>
> olats = new((/dimsizes(fin->y)/),double,1e20)
> olons = new((/dimsizes(fin->x)/),double,1e20)
> olats_stride = (max(lat2d)-min(lat2d))/int2dble(dimsizes(fin->y)-1)
> olons_stride = (max(lon2d)-min(lon2d))/int2dble(dimsizes(fin->x)-1)
> olats(0) = min(lat2d)
> olons(0) = min(lon2d)
>
> do y = 1,dimsizes(fin->y)-1
> olats(y) = olats(y-1) + olats_stride
> end do
> do x = 1,dimsizes(fin->x)-1
> olons(x) = olons(x-1) + olons_stride
> end do
>
> dat = rcm2rgrid(lat2d,lon2d,fin->pr(:,::-1,:),olats,olons,1)
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 4 22:33:42 2013

This archive was generated by hypermail 2.1.8 : Sun Apr 07 2013 - 21:13:30 MDT