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
Received on Mon Mar 21 20:42:39 2011
This archive was generated by hypermail 2.1.8 : Wed Mar 23 2011 - 16:15:59 MDT