Re: rcm2points

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 12 Jun 2008 16:45:39 -0600 (MDT)

This was fixed about a year ago, so if you download the latest NCL, it
should work fine. There was an annoying error check that wouldn't
allow a single point to be input.

You can also juts use the work-around that Andrea recommends.

--Mary

On Thu, 12 Jun 2008, Andrea Hahmann wrote:

> Dear Ed
>
> I had the same problem a couple of weeks ago... (I think it is a bug). To get
> around it I set
>
> lat = (/xlat,xlat/)
> lon = (/xlon,xlon/)
>
> and then use the first element of the interpolated vector. It you only have
> a few time periods it does not take very long.
>
> Andrea
>
> Yang Yang wrote:
>> Hi Dennis:
>> Thank you very much for your help! It is quite odd. For the information
>> shown below, I used Version 4.2.0.a033. If I set lat = (/-22.3,-22.31/)
>> and lon = (/166.4,166.41/), it works. If I set lat = (/-22.3/) and lon =
>> (/166.4/), it has the following error infor.. Actually, I tested this with
>> two different ncl scripts and data. The results are the same. Could this be
>> a lower version problem? Thanks!
>> Regards
>> Ed
>> Copyright (C) 1995-2006 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 4.2.0.a033
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>> fatal:rcm2points: The input lat/lon grids must have at least 2 elements,
>> and the output lat/lon arrays 1 element
>> fatal:Execute: Error occurred at or near line 64 in file yytest.ncl
>>
>> In my script, ; lat = (/-22.3,-22.31/) ; works
>> ; lon = (/166.4,166.41/) ; works
>> lat = (/-22.3/) ; does not work
>> lon = (/166.4/) ; does not work
>> ..........
>> ul = rcm2points (tlat, tlon, u, lat, lon, 1) ; line 64
>> .......................................
>>
>>
>>
>> ----- Original Message ----
>> From: Dennis Shea <shea_at_ucar.edu>
>> To: Yang Yang <yang123yang_at_yahoo.com>
>> Cc: ncl-talk_at_ucar.edu
>> Sent: Friday, June 13, 2008 2:33:13 AM
>> Subject: Re: rcm2points
>>
>> Yang Yang wrote:
>>
>>> Hello:
>>> I ran rcm2points by setting lat and lon with 2 or more elements without
>>> any problem.
>>> However, if I set lat and lon with only one element, the ncl script failed
>>> with the following error information:
>>>
>>> fatal:rcm2points: The input lat/lon grids must have at least 2 elements,
>>> and the output lat/lon arrays 1 element
>>>
>>> How to solve this problem? Thanks!
>>> Regards
>>> Ed
>>>
>> The following simple test script works fine.
>> =================================
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> begin
>> nt = 0
>> kl = 20
>>
>> a =
>> addfile("/project/cas/shea/WRF/wrfout_d01_2003-07-13_12:00:00.nc","r")
>> x = a->T(nt,kl,:,:)
>>
>> lat2d = a->XLAT(nt,:,:) ; min= 16.789 max= 34.542
>> lon2d = a->XLONG(nt,:,:) ; min=-105.153 max=-82.847
>>
>> latPts = (/22., 29./)
>> lonPts = (/-100., -93./)
>> xNew = rcm2points(lat2d, lon2d, x, latPts, lonPts, 1)
>> print(xNew)
>>
>> ; Test Ed's ncl-talk question
>>
>> yPts = (/22./)
>> xPts = (/-100./)
>> xTst = rcm2points(lat2d, lon2d, x, yPts, xPts, 1)
>> print(xTst)
>> end
>>
>> ==================
>>
>> Variable: xNew
>> Dimensions and sizes: [2]
>> Coordinates:
>> 0) 39.80119
>> (1) 39.21795
>> ==================
>> Variable: xTst
>> Dimensions and sizes: [1]
>> (0) 39.80119
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> --
> ----------------------------------------------------------------
> Andrea N. Hahmann, Ph.D.
> Research Applications Laboratory
> Natl. Center for Atmospheric Research Phone: 1-303-497-8383
> PO BOX 3000 Fax: 1-303-497-8401
> Boulder, CO 80301 hahmann_at_ucar.edu
> ----------------------------------------------------------------
>
>
> _______________________________________________
> 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 Thu Jun 12 2008 - 16:45:39 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 13 2008 - 16:48:10 MDT