[ncl-talk] Subscript out of range
Dennis Shea
shea at ucar.edu
Wed Jul 31 09:34:28 MDT 2019
The real source of the error is that location you are specifying is
* outside the lat and lon boundaries.*
99 lat = *-22.721949*
100 lon = *-65.695454*
(0) LATITUDE, SOUTH IS NEGATIVE (degree_north) : *min=-27.42
max=-24.0203*
(0) LONGITUDE, WEST IS NEGATIVE (degree_east) : *min=-65.6508
max=-62.762*
On Wed, Jul 31, 2019 at 8:27 AM Dennis Shea <shea at ucar.edu> wrote:
> netcdf wrfout_d01 {
> dimensions:
> Time = UNLIMITED ; // (97 currently)
> DateStrLen = 19 ;* west_east = 30 ;
> south_north = 39 ;*
> bottom_top = 34 ;
>
> ---
>
> The grid size is *(97,[34,] 39,30)*
>
> fatal:*Subscript out of range, error in subscript #1*
> fatal:An error occurred reading rain
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 165 in
> file meteo_abrapampa_b.ncl
>
> 1*65 arain_point = rain(:,locY,locX) ; subscript numbers 0,1,2*
>
> ---
> 99 lat = -22.721949
> 100 lon = -65.695454
> 101 llres = True
> 102 llres at ReturnInt = True ; Return integer values
> 103 locij = *wrf_user_ll_to_ij
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_ij.shtml>(*a,
> lon, lat, llres)
> 104 locij = locij - 1 ; array pointers in NCL space
> 105 locX = locij(0)
> 106 locY = locij(1)
> 107 print(locY)
> 108 print(locX)
>
> Variable: *locY*
> Type: integer
> [snip]
> (0) *53*
> * <== This value exceeds the Y grid dimension size of 39*
>
> The* wrf_user_ll_to_ij
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_ij.shtml>*
> function documentation states:
>
> "The return values will represent indexes in the WRF-ARW lon, lat model
> domain and will be *1-based*. This is different from *wrf_user_ll_to_xy*
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_xy.shtml>
> in which the index values are 0-based.
>
> Important note: if the index values from this function are later used as
> indexes in NCL scripts, then a value of 1 needs to be deducted from the
> values first"
>
> Even subtracting one: * locY-1=52* will exceed the Y grid size.
>
> Further, the *wrf_user_ll_to_xy*
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_xy.shtml>
> documentation states
>
> "*This function will be deprecated in NCL version 6.6.0**. *Use
> *wrf_user_ll_to_xy*
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_xy.shtml>
> instead."
>
>
> ===
>
> So use *wrf_user_ll_to_xy*
> <http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_ll_to_xy.shtml>
>
> These functions were not written by NCL developers. If this does not work
> matbe write to wrfhelp at ucar.edu
>
>
> Good luck
>
>
>
>
>
> .
>
> On Wed, Jul 31, 2019 at 6:44 AM Carina V. Barca via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hello I have trouble with ncl script.
>> I'm trying to draw a meteogram with rain
>>
>> *ncl -V*
>> 6.6.2
>>
>> *ncdump -h wrfout_d01.nc <http://wrfout_d01.nc/>* (attach file
>> ncdump.txt)
>> Attach file meteo_abrapampa_b.ncl
>>
>> The error I get is..
>>
>> Copyright (C) 1995-2019 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 6.6.2
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>>
>>
>> Variable: locY
>> Type: integer
>> Total Size: 4 bytes
>> 1 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [1]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : -2147483647
>> (0) 53
>>
>>
>> Variable: locX
>> Type: integer
>> Total Size: 4 bytes
>> 1 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [1]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : -2147483647
>> (0) 0
>> (0) LATITUDE, SOUTH IS NEGATIVE (degree_north) : min=-27.42
>> max=-24.0203
>> (0) LONGITUDE, WEST IS NEGATIVE (degree_east) : min=-65.6508
>> max=-62.762
>>
>>
>> Variable: temp
>> Type: integer
>> Total Size: 12 bytes
>> 3 values
>> Number of Dimensions: 1
>> Dimensions and sizes: [3]
>> Coordinates:
>> (0) 97
>> (1) 39
>> (2) 30
>>
>> Variable: t2
>> Type: float
>> Total Size: 453960 bytes
>> 113490 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [Time | 97] x [south_north | 39] x [west_east |
>> 30]
>> Coordinates:
>> Number Of Attributes: 6
>> FieldType : 104
>> MemoryOrder : XY
>> description : Temp.(C)
>> units : K
>> stagger :
>> coordinates : XLONG XLAT XTIME
>>
>> Variable: hr
>> Type: float
>> Total Size: 453960 bytes
>> 113490 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [Time | 97] x [south_north | 39] x [west_east |
>> 30]
>> Coordinates:
>> Number Of Attributes: 6
>> description : Hum. (%)
>> units : %
>> coordinates : XLONG XLAT XTIME
>> stagger :
>> MemoryOrder : XY
>> FieldType : 104
>> fatal:Subscript out of range, error in subscript #1
>> fatal:An error occurred reading rain
>> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 165 in
>> file meteo_abrapampa_b.ncl
>>
>> Someone can help me with this?
>> Best Regards
>>
>> Carina
>>
>>
>> Enviado desde Outlook <http://aka.ms/weboutlook>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190731/f7476282/attachment.html>
More information about the ncl-talk
mailing list