Re: Error: Unidentified identifier

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 29 2013 - 13:45:16 MST

Hi,

It looks like you merely need to declare "precip_aave" as an array before referencing it. As "wgt_areaave()" returns a float or double, something like:

precip_aave = new((/ …SIZE… /), double)

where "SIZE" is a suitable length for your array.

Rick

On Jan 29, 2013, at 1:19 PM, "Vanessa Vincente" <vvincent@atmos.colostate.edu> wrote:

> Hello,
>
> I am running an NCL script to calculate the area average of precipitation
> using weights.
> I get the following error:
>
> fatal:Undefined identifier: (precip_aave) is undefined, can't continue
> fatal:["Execute.c":7556]:Execute: Error occurred at or near line 130 in
> file wrf_aaprecip_00-06h.ncl
>
> Can you please help? Below is the script I am using...
> Thank you in advance,
> Vanessa
>
> =================================
> ; Read in non-cumulus (rainnc), where RAINNC is (time, south_north,
> west_east)
>
> rain_resolved_end = a->RAINNC(it,:,:)
> rain_resolved_start = bb->RAINNC(it,:,:)
>
> rain_tot = rain_resolved_end - rain_resolved_start
> rain_tot@description = "Accumulated Precipitation - Previous 6 hr,
> Member "+ee
> rain_tot@units = "mm"
>
> ;;To do the area averaging, use something like this within one of the ;;
> scripts where you plot the 6-hourly (or total, or whatever) precip: ;;
> define the area to be averaged over
>
> latbox = (/ 36.5, 41.5 /)
> lonbox = (/ -110, -101.5 /)
> loc = wrf_user_ll_to_ij(a, lonbox, latbox, True)
>
> ; loc(0,;) is west-east (x) ; loc(1,:) is south-north (y)
> ; subtract one since we want to use it as an index in NCL
> x_start = loc(0,0) - 1
> x_end = loc(0,1) - 1
> y_start = loc(1,0) - 1
> y_end = loc(1,1) - 1
>
> ; longitude of midpoint of this:
> x_mid = round((x_start+x_end)/2,3)
>
> ;; get the latitude and longitude variables from the output variables
>
> lon = wrf_user_getvar(a, "lon", it) ;; longitude
> lat = wrf_user_getvar(a, "lat", it) ; latitude
>
> ;; do area averaging using cos(lat)
> rad = 4.0*atan(1.0)/180.0
> clat = cos(lat*rad)
>
> precip_aave(ee-1) = wgt_areaave(rain_tot(y_start:y_end,x_start:x_end),
> clat(y_start:y_end,x_mid), 1.0, 1)
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 29 13:45:25 2013

This archive was generated by hypermail 2.1.8 : Tue Jan 29 2013 - 22:44:26 MST