Re: Coordinate scripting for

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Wed, 12 Dec 2007 10:57:37 -0500

Ok. Lat is acquired by adding the following near the top of the code.

lat=a->XLAT(0,:,:)
lon=a->XLONG(0,:,:)

I am now getting the error:
fatal:Coordinate variables must have one dimension only
fatal:No coordinate variable exists for dimension (lat) in variable (v_plane)
Bus error

i thought i was using "standard sub-scripting.

To repeat the earlier post:
> >> [3] To repeat earlier responses: coordinate subscripting
> >> can not be used for your data. *Only
> >> standard subscripting can be used.*

Am I not using standard subscripting here? The reference pages are pretty clear:
Thank you for all of your help.

On Dec 12, 2007 10:34 AM, Michael Notaro <mnotaro_at_wisc.edu> wrote:
> Looks to me that you are using lat but never acquired it
> from the data file so NCL doesn't know what lat is.
>
> Mike
>
>
> On Dec 12, 2007, at 9:26 AM, Erik Noble wrote:
>
> > Dear Dr. Shea,
> > According to your referenced pages and recommendation for "standard
> > subscripting," the part of my code should read:
> > v_plane = wrf_user_intrp3d( v,p,"h",pressure,0.,False)
> > printVarSummary(v_plane)
> > v_plane!0 = "lat"
> > v_plane!1 = "lon"
> > v_plane&lat = lat ; line 39
> > v_plane&lon = lon
> > V = v_plane({lat|37:55},{lon|11:89})
> >
> > Now i have another error:
> > fatal:Variable (lat) is undefined
> > fatal:Execute: Error occurred at or near line 39 in file
> > NCL_ascii_V700.ncl
> >
> > Why?
> > -Erik
> >
> > On Dec 11, 2007 3:13 PM, Dennis Shea <shea_at_ucar.edu> wrote:
> >> I am not sure what to say any more.
> >>
> >> [1] In my earlier post [Response 1b] I said that by netCDF
> >> rule **coordinate variables must be one dimensional**
> >>
> >> [2] The results of the following are **two dimensional**
> >>
> >> if (rank.eq.3) then
> >> lat = a->XLAT(0,:,:) ; opt could bt "nt" f->XLAT(opt,:,:)
> >> lon = a->XLONG(0,:,:)
> >> else
> >> if (rank.eq.2) then
> >> lat = a->XLAT
> >> lon = a->XLONG
> >> [snip]
> >>
> >> ===
> >> [3] To repeat earlier responses: coordinate subscripting
> >> can not be used for your data. *Only
> >> standard subscripting can be used.*
> >>
> >> ===================================================
> >>
> >>
> >>
> >> Erik Noble wrote:
> >>> Attached code.
> >>> On Dec 11, 2007 2:26 PM, Erik Noble <enoble_at_giss.nasa.gov> wrote:
> >>>
> >>>> Hi Soyoung Ha.
> >>>> Thank you.
> >>>> This helps.
> >>>>
> >>>> Now I have a different error (Below):
> >>>> fatal:Coordinate variables must have one dimension only
> >>>> fatal:No coordinate variable exists for dimension (lat) in
> >>>> variable (v_plane)
> >>>> Bus error
> >>>>
> >>>> This is all WRF data. My inquiry is related to the earlier inquiry
> >>>> addressing interpolating WRF pressure-level data.
> >>>> I interpolated pressure level data using the WRF_user_interp3d
> >>>> command. The result of using the WRF_NCL code presents the
> >>>> pressure-level data in 109 rows and 139 columns; It used to have
> >>>> coordinates before using the ncl WRF_user_interp3d command.
> >>>> Variable: v_plane
> >>>> Type: float
> >>>> Total Size: 60604 bytes
> >>>> Number of Dimensions: 2
> >>>> Dimensions and sizes: [109] x [139]
> >>>> Coordinates:
> >>>>
> >>>> I am simply trying to extract a smaller subset from a larger set of
> >>>> data. Since ncl WRF_user_interp3d command took away coordinates, I
> >>>> just want data in between rows 37-55 and columns 11-89.
> >>>>
> >>>> My code keeps getting longer and longer. Yet with these errors,
> >>>> I am
> >>>> having to resort to converting the large [109] x [139] files to
> >>>> ascii
> >>>> and creating the the [37-55] x [11-89] subsets through Microsoft
> >>>> Excel, which takes a while.
> >>>> Any suggestions here?
> >>>> -Erik
> >>>>
> >>>>
> >>>> On Dec 11, 2007 1:57 PM, Soyoung Ha <syha_at_ucar.edu> wrote:
> >>>>
> >>>>>
> >>
> >>>>>> Thank you Dr. Shea,
> >>>>>> M variable has 109 rows and 139 columns.
> >>>>>> Does that change things?
> >>>>>>
> >>>>>> i tried the suggestions from the two pages you gave below by
> >>>>>> adding
> >>>>>>
> >>>>>> v_plane = wrf_user_intrp3d( v,p,"h",pressure,
> >>>>>> 0.,False)
> >>>>>> printVarSummary(v_plane)
> >>>>>> v_plane!0 = "lat"
> >>>>>> v_plane!1 = "lon"
> >>>>>> v_plane&lat = lat
> >>>>>> v_plane&lon = lon
> >>>>>> V = v_plane({5:15},{-30:10})
> >>>>>> printVarSummary(V)
> >>>>>>
> >>>>>>
> >>>>>> I am now getting a different error:
> >>>>>>
> >>>>>> Variable: v_plane
> >>>>>> Type: float
> >>>>>> Total Size: 60604 bytes
> >>>>>> 15151 values
> >>>>>> Number of Dimensions: 2
> >>>>>> Dimensions and sizes: [109] x [139]
> >>>>>> Coordinates:
> >>>>>> Number Of Attributes: 4
> >>>>>> description : v Velocity
> >>>>>> units : m/s
> >>>>>> _FillValue : -999999
> >>>>>> PlotLevelID : 850 hPa
> >>>>>> fatal:Variable (lat) is undefined
> >>>>>> fatal:Execute: Error occurred at or near line 39 in file
> >>>>>> NCL_ascii_V700.ncl
> >>>>>>
> >>>>>> On Dec 11, 2007 1:13 PM, Dennis Shea <shea_at_ucar.edu> wrote:
> >>>>>>
> >>>>>>
> >>>>>>> [1] To use "coordinate subscripting" two conditions must be
> >>>>>>> present:
> >>>>>>> [a] the dimensions must be named. The arrays below do
> >>>>>>> not have
> >>>>>>> named dimensions.
> >>>>>>> [b] The named dimensions must have 1D [not 2D]
> >>>>>>> monotonically
> >>>>>>> {in/de}creasing coordinates associated with each
> >>>>>>> named
> >>>>>>> dimension.
> >>>>>>>
> >>>>>>> Note: These are netCDF rules and NCL adheres to the netCDF
> >>>>>>> variable model.
> >>>>>>> [2] If you have variables that have 2d variable arrays that
> >>>>>>> contain
> >>>>>>> coordinates (like WRF XLAT and XLONG variables] you
> >>>>>>> can not use coordinate subscripting [See 1b above ]
> >>>>>>>
> >>>>>>> [3] Pls read
> >>>>>>> http://www.ncl.ucar.edu/Document/Language/cv.shtml
> >>>>>>> http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/
> >>>>>>> NclVariables.shtml
> >>>>>>>
> >>>>>>> Erik Noble wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>> Hi.
> >>>>>>>> I added a printVarSummary(v_plane) to the code to see the
> >>>>>>>> error more clearly.
> >>>>>>>> The error still remains (below).
> >>>>>>>>
> >>>>>>>> any suggestions?
> >>>>>>>> -erik
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Variable: v_plane
> >>>>>>>> Type: float
> >>>>>>>> Total Size: 60604 bytes
> >>>>>>>> 15151 values
> >>>>>>>> Number of Dimensions: 2
> >>>>>>>> Dimensions and sizes: [109] x [139]
> >>>>>>>> Coordinates:
> >>>>>>>> Number Of Attributes: 4
> >>>>>>>> description : v Velocity
> >>>>>>>> units : m/s
> >>>>>>>> _FillValue : -999999
> >>>>>>>> PlotLevelID : 850 hPa
> >>>>>>>> fatal:Dimension (1) of (v_plane) is not named and therefore
> >>>>>>>> doesn't
> >>>>>>>> have an associated coordinate variable
> >>>>>>>> fatal:Execute: Error occurred at or near line 37 in file
> >>>>>>>> NCL_ascii_V700.ncl
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Dec 11, 2007 12:31 PM, Erik Noble <enoble_at_giss.nasa.gov>
> >>>>>>>> wrote:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> Dear NCL,
> >>>>>>>>> I am trying to use coordinate subscripting to pull data
> >>>>>>>>> from an array:
> >>>>>>>>> V = v_plane({5:15},{-30:10})
> >>>>>>>>> I am getting the error below.
> >>>>>>>>> My code is attached.
> >>>>>>>>> My I have some help?
> >>>>>>>>> Thank you for your help.
> >>>>>>>>> -Erik
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Erik_at_noble:/Volumes/Data_and_Models/ncl_scripts:ncl
> >>>>>>>>> NCL_ascii_V700.ncl
> >>>>>>>>> Copyright (C) 1995-2007 - All Rights Reserved
> >>>>>>>>> University Corporation for Atmospheric Research
> >>>>>>>>> NCAR Command Language Version 5.0.0
> >>>>>>>>> The use of this software is governed by a License Agreement.
> >>>>>>>>> See http://www.ncl.ucar.edu/ for more details.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Variable: times
> >>>>>>>>> Type: string
> >>>>>>>>> Total Size: 1948 bytes
> >>>>>>>>> 487 values
> >>>>>>>>> Number of Dimensions: 1
> >>>>>>>>> Dimensions and sizes: [487]
> >>>>>>>>> Coordinates:
> >>>>>>>>> Number Of Attributes: 2
> >>>>>>>>> description : times in file
> >>>>>>>>> _FillValue : missing
> >>>>>>>>>
> >>>>>>>>> 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
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> 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
> >>>>>>>>> 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
> >>>>>>>>> fatal:Dimension (1) of (v_plane) is not named and therefore
> >>>>>>>>> doesn't have an
> >>>>>>>>> associated coordinate variable
> >>>>>>>>> fatal:Execute: Error occurred at or near line 37 in file
> >>>>>>>>> NCL_ascii_V700.ncl
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Erik_at_noble:/Volumes/Data_and_Models/ncl_scripts:
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>
> >>>>>>> ----------------------------------------------------------------
> >>>>>>> --------
> >>>>>>>
> >>>>>>> _______________________________________________
> >>>>>>> ncl-talk mailing list
> >>>>>>> ncl-talk_at_ucar.edu
> >>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>
> >>
> >> --
> >> ======================================================
> >> Dennis J. Shea tel: 303-497-1361 |
> >> P.O. Box 3000 fax: 303-497-1333 |
> >> Climate Analysis Section |
> >> Climate & Global Dynamics Div. |
> >> National Center for Atmospheric Research |
> >> Boulder, CO 80307 |
> >> USA email: shea 'at' ucar.edu |
> >> ======================================================
> >>
> >>
> >>
> >> <NCL_ascii_V700.ncl>
>
> > _______________________________________________
> > 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

Received on Wed Dec 12 2007 - 08:57:37 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 12 2007 - 16:19:09 MST