Re: Question of dspnt2

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 23 2011 - 09:03:35 MDT

Dear Wei-Chih,

Without being able to run your script, it is hard to determine what the problem is. I don't know what the sizes of your arrays are.

The error is telling you what the problem is. The rightmost dimension of "val" must be the same size as the length of x_WRF and y_WRF.

Please read the dspnt2 documentation carefully. It explains what the dimension sizes of your input arrays must be:

http://www.ncl.ucar.edu/Document/Functions/Built-in/dspnt2.shtml

--Mary

On Mar 21, 2011, at 8:42 PM, wei chih chen wrote:

> Hi users,
> I try to use dspnt2 to interpolate the GCM data. However, I got the error said :
> "fatal:dspnt2: the rightmost dimension of z must be the same as the dimension of x and y
> fatal:Execute: Error occurred at or near line 55 in file voronoipoint_interpolateGCM_rev1.ncl"
> How should I revise the code? Thank you.
> Here attached my code below.
>
> 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/shea_util.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
> ;------open files and read in precip/ts
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> SUNTANS_Grid_Data = asciiread("GCM_locations.dat",(/12,2/),"float");variable grid
> SUNTANS_Grid_DataT = transpose(SUNTANS_Grid_Data)
>
> ;WRF GRID DATA
> WRF_Grid_Data = asciiread("NARR_U_For_Triple2grid.dat",(/161,3/),"float")
> WRF_Grid_DataT = transpose(WRF_Grid_Data)
>
> x_WRF = WRF_Grid_DataT(0,:)
> y_WRF = WRF_Grid_DataT(1,:)
>
> y_SUNTANS_Grid = SUNTANS_Grid_DataT(1,:) ;voronoi points' y
> x_SUNTANS_Grid = SUNTANS_Grid_DataT(0,:) ;voronoi points' x
>
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> year = stringtoint(getenv("YEARNARR"))
> begmon = stringtoint(getenv("MONBEGGCM"))
> endmon = stringtoint(getenv("MONENDGCM"))
>
> ;interval = stringtoint(getenv("NARR_OUTPUT_INTERVAL"))
>
> outputfilenames = (/"2mT" /)
>
> do i=0,2399,1
> count=i
> flcont = 1300 + i
> do count=0,(dimsizes(outputfilenames)-1),1
> filename= outputfilenames+"_"+flcont+".txt"
>
> variable = asciiread(filename,(/12,3/),"float")
> variableT = transpose(variable)
>
> lat = variableT(0,:)
> lon = variableT(1,:)
> val = variableT(2,:)
>
>
>
>
> ;namepart = 1000*3*i/24 + 1000*begday
>
> filename ="/GCM_interpolation/"+outputfilenames+"_v_"+flcont+".txt"
>
> print(filename)
>
> interp_val = dspnt2(x_WRF,y_WRF,val,x_SUNTANS_Grid,y_SUNTANS_Grid)
>
> asciiwrite(filename,interp_val)
>
> end do
> end do
>
> end
> --
> Best regards
> Wei-Chih
>
> _______________________________________________
> 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 Wed Mar 23 09:03:40 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT