# Re: rcm2points

Date: Sat Jun 11 2011 - 00:44:02 MDT

Dear Agnes,

[1] I guess that you are trying to store the interpolated data in 3
dimensional array while your input is also three dimensional which causes
this error.
If your input is 3d array suppose x(lv_ISBL2, nx,ny) and you are
interpolating to the specified locations (m-number of points) using
rcm2points function, then your output should be two dimensional array
y(lv_ISBL2,m). Please check the example 1
(http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml)

[2] I believe that you are trying to interpolate from one curvilinear
grid (WRF) to another curvilinear grid (NAM). Please try following steps:

; convert NAM 2d lat, lon to 1d

lat1d_nam = ndtooned(lat2d_nam); dimension gridx_218 x gridy_218
lon1d_nam = ndtooned(lon2d_nam); dimension gridx_218 x gridy_218

; Preform the interpolation
ctrl_ghgt_wrf1d =rcm2points(lat2d,lon2d,ctrl_wrf_GHGT,lat1d_nam,lon1d_nam,2)

; output dimension should be (lv_ISBL2, m = gridx_218xgridy_218)
; Convert points to lat, lon

ctrl_ghgt_wrf = onedtond(ndtooned( ctrl_ghgt_wrf1d), (/lv_ISBL2,
gridx_218, gridy_218/))

printVarSummary(ctrl_ghgt_wrf)

Debasish

> Hi
>
> I am trying to interpolate the WRF grid to the NAM grid using rcm2point.
> rrcm2
> ; Horizontal interpolation of control run data to NAM resolution
> of 40km
> ctrl_ghgt_wrf=new((/lv_ISBL2, gridx_218, gridy_218/),"float")
> ctrl_ghgt_wrf@lat2d = lat2d_nam
> ctrl_ghgt_wrf@lon2d = lon2d_nam
> do i=0,gridx_218-1
> lat_nam=lat2d_nam(i,:)
> lon_nam=lon2d_nam(i,:)
> ctrl_ghgt_wrf(:,i,:) =
> rcm2points(lat2d,lon2d,ctrl_wrf_GHGT,lat_nam,lon_nam,2)
> end do
>
> I get the following error but could not find which array was wrong.
> fatal:Dimension size mismatch on subscript #0, left-hand and right-hand
> side dimensions do not match
> fatal:Execute: Error occurred at or near line 59 in file
> plot_forecast_analysis_diff_nam.ncl
>
> I printed the dimensions of the inputsVariable: lat2d
> Type: float
> Total Size: 891072 bytes
> 222768 values
> Number of Dimensions: 2
> Dimensions and sizes: [south_north | 357] x [west_east | 624]
> Coordinates:
> Number Of Attributes: 5
> FieldType : 104
> MemoryOrder : XY
> description : LATITUDE, SOUTH IS NEGATIVE
> units : degree_north
> stagger :
>
>
> Variable: lat2d_nam
> Type: float
> Total Size: 1051168 bytes
> 262792 values
> Number of Dimensions: 2
> Dimensions and sizes: [gridx_218 | 428] x [gridy_218 | 614]
> Coordinates:
> Number Of Attributes: 13
> corners : ( 12.19, 14.35541, 57.34082, 54.56082 )
> long_name : latitude
> grid_description : AWIPS grid over the Contiguous United States
> (used by the 12-km ETA Model) (Lambert Conformal)
> units : degrees_north
> mpLambertMeridianF : 265
> mpLambertParallel2F : 25
> mpLambertParallel1F : 25
> mpProjection : LAMBERTCONFORMAL
> Dy : 12190.58
> Dx : 12190.58
> Lov : 265
> Lo1 : 226.514
> La1 : 12.19
>
>
> Variable: ctrl_wrf_GHGT
> Type: float
> Total Size: 23167872 bytes
> 5791968 values
> Number of Dimensions: 3
> Dimensions and sizes: [26] x [357] x [624]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 1e+36
>
>
> Agnes
>
>
>
> _______________________________________________
> 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 Sat Jun 11 00:45:20 2011

This archive was generated by hypermail 2.1.8 : Mon Jun 13 2011 - 09:37:43 MDT