Re: rcm2points

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 12 Jun 2008 15:42:17 -0600

There have been no changes to rcm2points in a long time.
Unless tlat(nlat,mlon) and tlon(nlat,mlon) are (1,1) ....

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
>
>
>
>

-- 
======================================================
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-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 12 2008 - 15:42:17 MDT

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