Re: correlation error (WRF vs. Obs)

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Fri, 2 Nov 2007 15:56:41 -0400

Hi. Thank you to both.

Now I am getting this error which is a bit confusing.

fatal:esccr: the rightmost dimension of x and y must be the same
fatal:Execute: Error occurred at or near line 60 in file Test_Correlation.ncl

Aren't my y and x variables the same already for this correlation?

My error log is attached and my code is below.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This creates a 3x1 Panel plot of Zonal wind, Meridionla wind and Streamlines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

a=addfile("../../WRF-SOP3_Athena_3_1_2.nc","r")
 ; Which times and how many time steps are in this data set?
     times = wrf_user_list_times(a) ; get times in the file
     ntimes = dimsizes(times) ; number of times in the file
        
lonW = -35.
lonE = 35.
latN = 35.
latS = -20.

pressure = 700.

times = wrf_user_list_times(a)
do it = 328,328 ;;;;;Time step you want!!!!
print("Working on time: " + times(it) )

v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
p = wrf_user_getvar(a, "pressure",it) ; pressure

v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
v_plane_at_lat2d = a->XLAT(0,:,:) ; do you need XLAT_V, or XLAT?
v_plane_at_lon2d = a->XLONG(0,:,:) ; do you need XLONG_V, or XLONG?

printVarSummary(v)
printVarSummary(v_plane)

;;;;;;;;;;;;;;;;;;;;;; 2nd file
                b=addfile("../../Boundary_Data/FNL_SOP3/FNL_09_grb/fnl_060913_00_00.grb","r")
                ;FILES = systemfunc ("csh -c ' ls "+ "FNL*.nc'") ; root of data
file you want to plot
                ;numFILES = dimsizes(FILES)
                ;do ifil = 0, numFILES-1 ; BIG FILES LOOP ; NEW file loop
                ;b = addfile(FILES(ifil)+".nc","r")

        ; First get the variables we will need
                v2 = b->V_GRD_3_ISBL_10 ; V_Wind
                printVarSummary( v2 ) ; before lonFlip
                v2 = lonFlip( v2 )
                lon2d_Flip=v2&lon_3
                printVarSummary( v2 ) ; after lonFlip
                
                
;************************************************
; calculate cross correlations
;************************************************
  maxlag = 25 ; set lag
; note, the max lag should not be more than N/4

  ccr = esccr(v_plane,v2({700},{latN:latS},{lonE:lonW}),maxlag)
           ; calc cross cor
  x = ispan(0,maxlag-1,1) ; define x axi
  printVarSummary( x )
;************************************************
; plot the correlations
;************************************************
  wks = gsn_open_wks("x11","corel") ; open a ps plot
  res = True ; make plot mods
  res_at_tiMainString = "37.7N 180E vs 23.72S 149W" ; title
  res_at_tiXAxisString = "LAG" ; x-axis label

  plot = gsn_xy(wks,x,ccr,res) ; plot correlation
;************************************************
end do
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Nov 02 2007 - 13:56:41 MDT

This archive was generated by hypermail 2.2.0 : Mon Nov 05 2007 - 12:07:45 MST