Re: WRF data fro streamlines

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue, 23 Oct 2007 10:32:40 -0600

Erik,

In future emails if you can tell us which line of your code is specified
in the error messages you receive that would be helpful, otherwise we
are stuck counting... Also, using printVarSummary to print out summaries
of each of the variables from the the offending line is also a good
debugging method...

Anyway, the error message you are receiving is due to your nlatV =
dimV(2) line.. It should actually be nlatV = dimV(1)...

But more importantly, if the order of your script is indeed this:

u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
z = wrf_user_getvar(a, "z",it) ; grid point height
printVarSummary(u)
printVarSummary(v)

and the output from the printVarSummary's are this:

>> Variable: u
>> Type: float
>> Total Size: 1636308 bytes
>> 409077 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [27] x [109] x [139]
>> Coordinates:
>> Number Of Attributes: 2
>> description : u Velocity
>> units : m/s
>>
>>
>> Variable: v
>> Type: float
>> Total Size: 1636308 bytes
>> 409077 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [27] x [109] x [139]
>> Coordinates:
>> Number Of Attributes: 2
>> description : v Velocity
>> units : m/s

then u/v are likely on the same grid and you do not have to do the
         U = 0.5*(u(level,:,0:mlonU-2)+u(level,:,1:mlonU-1))
         V = 0.5*(v(level,0:nlatV-2,:)+v( level,1:nlatV-1,:))

coding. I would be surprised if this was the case because WRF by default
outputs the u/v variables on staggered grids.. Adam

Dennis Shea wrote:
> I f you look at the Example 7 carefully you will not that
> on the right hand sude the variable ar capitalized [U,V]
> while in the left they are small [u,v].
>
> Given that you are already using small u,v ... I would merely
> change the left hand side and plot the U,V
>
> U = 0.5*(u(level,:,0:mlonU-2)+u(level,:,1:mlonU-1))
> V = 0.5*(v(level,0:nlatV-2,:)+v( level,1:nlatV-1,:))
>
> copy_VarAtts (u,U)
> copy_varAtts (v,V)
>
> lat2d = a->XLAT(0,:,:)
> lon2d = a->XLONG(0,:,)
>
> U_at_lat2d = lat2d
> U_at_lon2d = lon2d
> V_at_lat2d = lat2d
> V_at_lon2d = lon2d
>
>
> Erik Noble wrote:
>> Hi. I rewrote the portion of the my code, following the the method
>> outlined in example 7 of the WRF lambert conformal page:
>>
>> http://www.ncl.ucar.edu/Applications/wrflc.shtml as follows:
>>
>> do it = 324,324 ;;;;;Time step you want!!!!
>> ;Variables
>> p = wrf_user_getvar(a, "pressure",it) ; pressure is our vertical
>> coordinate
>> u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
>> v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
>> z = wrf_user_getvar(a, "z",it) ; grid point height
>> dimU = dimsizes(u) ; demo "dimsizes"
>> mlonU = dimU(2) ; number of "west_east_stag"
>> longitudes
>> dimV = dimsizes(v)
>> nlatV = dimV(2)
>> printVarSummary(u)
>> printVarSummary(v)
>>
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> do level = 0,nlevels-1 ; LOOP OVER LEVELS
>>
>> pressure = pressure_levels(level)
>>
>> u = 0.5*(u(level,:,0:mlonU-2)+u(level,:,1:mlonU-1))
>> v = 0.5*(v(level,0:nlatV-2,:)+v( level,1:nlatV-1,:))
>>
>> And this is the error that I am getting;
>>
>> noble:/Volumes/Data_and_Models/ncl_scripts enoble$ ncl
>> wrf_Streamlines.ncl
>> Copyright (C) 1995-2007 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 4.3.1
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> (0) Working on time: 2006-09-10_12:00:00
>>
>>
>> Variable: u
>> Type: float
>> Total Size: 1636308 bytes
>> 409077 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [27] x [109] x [139]
>> Coordinates:
>> Number Of Attributes: 2
>> description : u Velocity
>> units : m/s
>>
>>
>> Variable: v
>> Type: float
>> Total Size: 1636308 bytes
>> 409077 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [27] x [109] x [139]
>> Coordinates:
>> Number Of Attributes: 2
>> description : v Velocity
>> units : m/s
>> fatal:Number of dimensions on right hand side do not match number of
>> dimension
>> n left hand side
>> fatal:Execute: Error occurred at or near line 70 in file
>> wrf_Streamlines.ncl
>>
>> noble:/Volumes/Data_and_Models/ncl_scripts enoble$
>>
>> How do I fix this?
>> -Erik
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 23 2007 - 10:32:40 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 24 2007 - 09:14:00 MDT