Re: WRF data fro streamlines

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Wed, 24 Oct 2007 10:47:23 -0400

Dear Mary,
Thank you for this correction.

Dear Adam,
Thank you for this.
I only needed the first set:
>> u_plane_at_lat2D = a->XLAT(0,:,:)
>> u_plane_at_lon2D = a->XLONG(0,:,:)
>> v_plane_at_lat2D = a->XLAT(0,:,:)
>> v_plane_at_lon2D = a->XLONG(0,:,:)

Mary's correction helped solve the problem.
The code works now (below). You can see that both plots display the
regional data as it should be.
Hopefully others will find this exchange useful, too.
Again thank you for the help.
-Erik

On Oct 24, 2007, at 9:43 AM, Mary Haley wrote:

> A minor correction: the "lat2d" and "lon2d" should be lower case.
> Below, the "d" is uppercase, "lat2D". NCL will not recognize lat2D
> and lon2D.
>
> --Mary
>
> On Oct 23, 2007, at 4:46 PM, Adam Phillips wrote:
>
>> Erik,
>>
>> The printVarSummary of XLAT shows that it is of the same dimension
>> sizes as u_plane (while XLAT_U is not), did you try setting the
>> following:
>>
>> u_plane_at_lat2D = a->XLAT(0,:,:)
>> u_plane_at_lon2D = a->XLONG(0,:,:)
>> v_plane_at_lat2D = a->XLAT(0,:,:)
>> v_plane_at_lon2D = a->XLONG(0,:,:)
>>
>> in lieu of this?:
>>
>> u_plane_at_lat2D = a->XLAT_U(0,:,:)
>> u_plane_at_lon2D = a->XLONG_U(0,:,:)
>> v_plane_at_lat2D = a->XLAT_V(0,:,:)
>> v_plane_at_lon2D = a->XLONG_V(0,:,:)
>> Adam
>>
>> Erik Noble wrote:
>>> Hi. Thank you.
>>> Here is my code "Test-File-WRF-Streamlines.ncl" (attached as well).
>>> Below are my errors, too (attached as well).
>>> -Erik
>>> *******************************************************
>>> 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/wrf/WRFUserARW.ncl"
>>> begin
>>> a=addfile("/Volumes/Data_and_Models/Model-Output/Athena/WRF-SOP3-
>>> Athena_Phys-3-1-1-1.nc","r")
>>> times = wrf_user_list_times(a)
>>> do it = 324,324 ;;;;;Time step you want!!!!
>>> print("Working on time: " + times(it) )
>>> u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
>>> v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
>>> p = wrf_user_getvar(a, "pressure",it) ; pressure
>>> pressure = 700.
>>> u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
>>> v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
>>> u_plane_at_lat2D = a->XLAT_U(0,:,:) ; do you need XLAT_U, or XLAT?
>>> u_plane_at_lon2D = a->XLONG_U(0,:,:) ; do you need XLONG_U, or XLONG?
>>> v_plane_at_lat2D = a->XLAT_V(0,:,:) ; do you need XLAT_V, or XLAT?
>>> v_plane_at_lon2D = a->XLONG_V ; do you need XLONG_V, or XLONG?
>>> printVarSummary(u)
>>> printVarSummary(u_plane)
>>> printVarSummary(a->XLAT_U)
>>> printVarSummary(a->XLAT)
>>> wks = gsn_open_wks("ps","test")
>>> mpres = True ; Create map background
>>> mpres_at_gsnMaximize = True
>>> mpres_at_tiMainString = "Streamlines" ; some title
>>> mpres_at_mpGeophysicalLineThicknessF = 3.0
>>> mpres_at_gsnAddCyclic = False
>>> plot = gsn_csm_streamline_map(wks,u_plane,v_plane,mpres)
>>> mpres_at_mpMinLatF = -30.
>>> mpres_at_mpMaxLatF = 20.
>>> mpres_at_mpMinLonF = -40.
>>> mpres_at_mpMaxLonF = 40.
>>> plot2 = gsn_csm_streamline_map(wks,u_plane,v_plane,mpres)
>>> end do
>>> end
>>> *******************************
>>> here are my errors:
>>> 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.
>>
>>> 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: u_plane
>>> Type: float
>>> Total Size: 60604 bytes
>>> 15151 values
>>> Number of Dimensions: 2
>>> Dimensions and sizes: [109] x [139]
>>> Coordinates: Number Of Attributes: 6
>>> lon2D : <ARRAY of 15260 elements>
>>> lat2D : <ARRAY of 15260 elements>
>>> description : u Velocity
>>> units : m/s
>>> _FillValue : -999999
>>> PlotLevelID : 700 hPa
>>> Variable: XLAT_U (file variable)
>>> Type: float
>>> Total Size: 29726480 bytes
>>> 7431620 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes: [Time | 487] x [south_north | 109] x
>>> [west_east_stag | 140]
>>> Coordinates: Number Of Attributes: 6
>>> FieldType : 104
>>> MemoryOrder : XY description : LATITUDE, SOUTH IS NEGATIVE
>>> units : degree_north
>>> stagger : X
>>> coordinates : XLONG_U XLAT_U
>>> Variable: XLAT (file variable)
>>> Type: float
>>> Total Size: 29514148 bytes
>>> 7378537 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes: [Time | 487] x [south_north | 109] x
>>> [west_east | 139]
>>> Coordinates: Number Of Attributes: 5
>>> FieldType : 104
>>> MemoryOrder : XY description : LATITUDE, SOUTH IS NEGATIVE
>>> units : degree_north
>>> stagger :
>>> (0) check_for_y_lat_coord: Warning: Data either does not contain
>>> a valid latitude coordinate array or doesn't contain one at all.
>>> (0) A valid latitude coordinate array should have a 'units'
>>> attribute equal to one of the following values: (0)
>>> 'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
>>> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg
>>> north'
>>> (0) check_for_lon_coord: Warning: Data either does not contain a
>>> valid longitude coordinate array or doesn't contain one at all.
>>> (0) A valid longitude coordinate array should have a 'units'
>>> attribute equal to one of the following values: (0)
>>> 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
>>> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg
>>> east'
>>> (0) check_for_y_lat_coord: Warning: Data either does not contain
>>> a valid latitude coordinate array or doesn't contain one at all.
>>> (0) A valid latitude coordinate array should have a 'units'
>>> attribute equal to one of the following values: (0)
>>> 'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
>>> 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg
>>> north'
>>> (0) check_for_lon_coord: Warning: Data either does not contain a
>>> valid longitude coordinate array or doesn't contain one at all.
>>> (0) A valid longitude coordinate array should have a 'units'
>>> attribute equal to one of the following values: (0)
>>> 'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
>>> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg
>>> east'
>>> =
>>> --------------------------------------------------------------------
>>> ----
>>> --------------------------------------------------------------------
>>> ----
>>> On Oct 23, 2007, at 5:28 PM, Adam Phillips wrote:
>>>> 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/wrf/WRFUserARW.ncl"
>>>>
>>>>
>>>> begin
>>>>
>>>> a=addfile("/Volumes/Data_and_Models/Model-Output/Athena/WRF-SOP3-
>>>> Athena_Phys-3-1-1-1.nc","r")
>>>>
>>>> u = wrf_user_getvar(a,"ua",it) ; u averaged to mass points
>>>>
>>>> v = wrf_user_getvar(a,"va",it) ; v averaged to mass points
>>>>
>>>> p = wrf_user_getvar(a, "pressure",it) ; pressure
>>>>
>>>> pressure = 700.
>>>>
>>>> u_plane = wrf_user_intrp3d( u,p,"h",pressure,0.,False)
>>>>
>>>> v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
>>>>
>>>> u_plane_at_lat2D = a->XLAT_U(0,:,:) ; do you need XLAT_U, or XLAT?
>>>>
>>>> u_plane_at_lon2D = a->XLONG_U(0,:,:) ; do you need XLONG_U, or
>>>> XLONG?
>>>>
>>>> v_plane_at_lat2D = a->XLAT_V(0,:,:) ; do you need XLAT_V, or XLAT?
>>>>
>>>> v_plane_at_lon2D = a->XLONG_V ; do you need XLONG_V, or
>>>> XLONG?
>>>>
>>>>
>>>> printVarSummary(u)
>>>>
>>>> printVarSummary(u_plane)
>>>>
>>>> printVarSummary(a->XLAT_U)
>>>>
>>>> printVarSummary(a->XLAT)
>>>>
>>>>
>>>> wks = gsn_open_wks("ps","test")
>>>>
>>>> mpres = True ; Create map background
>>>>
>>>> mpres_at_gsnMaximize = True
>>>>
>>>> mpres_at_tiMainString = "Streamlines" ; some tit
>>>>
>>>> mpres_at_mpGeophysicalLineThicknessF = 3.0
>>>>
>>>> mpres_at_gsnAddCyclic = False
>>>>
>>>> plot = gsn_csm_streamline_map(wks,u_plane,v_plane,mpres)
>>>>
>>>> mpres_at_mpMinLatF = -30.
>>>>
>>>> mpres_at_mpMaxLatF = 20.
>>>>
>>>> mpres_at_mpMinLonF = -40.
>>>>
>>>> mpres_at_mpMaxLonF = 40.
>>>>
>>>> plot2 = gsn_csm_streamline_map(wks,u_plane,v_plane,mpres)
>>>>
>>>> end
>>>>
>>> =
>>> --------------------------------------------------------------------
>>> ----
>>> _______________________________________________
>>> 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 Wed Oct 24 2007 - 08:47:23 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 26 2007 - 09:29:31 MDT