Re: two fold problem with runave_n and regline_stats

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 10 2014 - 10:55:29 MDT

(Sorry all for the second email but I can answer Michael's 2nd question.)

Hi Michael,
Running your script the full error message is this:

fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading y
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 14183 in
file /contrib/ncl/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:["Execute.c":8567]:Execute: Error occurred at or near line 34 in file
runave_regline_stats_MStone_7-9-2014.ncl

So NCL points to the line in your script that things fail (= line 34, the
call to regline_stats) along with the line number in contributed.ncl where
things fail (=14183). (Remember that you can look at the functions inside
contributed.ncl.) Looking at lines 14181-14183:

 if (any(ismissing(x)) .or. any(ismissing(y))) then
       ii = ind(.not.ismissing(x) .and. .not.ismissing(y))
       RC = reg_multlin_stats(y(ii),x(ii),False)

Line 14182 is returning a missing value as y is all missing thanks to
runave not calculating running means on missing data as described in my
last email. ii = a _FillValue and that is causing the third line to crash.

So, I think if you start using a dim_avg* function your second issue will
be resolved.
Adam




On Wed, Jul 9, 2014 at 3:45 PM, Michael Stone <mrstone@colorado.edu> wrote:

> Hi all,
>
> I have a time series of data with some missing values that I'm using
> runave_n to smooth and then fitting a regline to the smoothed data. I'm not
> sure I understand how runave_n handles missing values but when I use
> runave_n with increasing nave, the number of missing values in the data set
> continually increases, this seems odd to me. I know my _FillValues are set
> correctly as well. Is this intended behavior? If so, could someone maybe
> explain why?
>
> Finally, a part two to this question, when I feed the smoothed time series
> into regline_stats after doing the running average, I found out that when
> run_ave_n has filled the entire time series with missing values
> regline_stats throws a very cryptic error. It says:
>
> fatal:Subscript out of range, error in subscript #0
> fatal:An error occurred reading
>
> This is an odd way for the function to error handle that particular case
> and thought I should mention it.
>
> Relevant information:
>
> NCL version: 6.2.0
> Linux version: Linux 2.6.32-431.11.2.el6.i686 #1 SMP Mon Mar 3 13:33:00
> EST 2014 i686 i686 i386 GNU/Linux
>
> Attached you'll find my data file and a short script with the issue
> outlined.
>
> Thanks,
> Michael
>
>
> --------------------------------------------------------------------------------------------------
> Michael Stone (mrstone@colorado.edu)
> ATOC PhD Student
> CIRES Researcher
> Ekeley/CIRES Room S327
> University of Colorado <mrstone@colorado.edu>
>
> --------------------------------------------------------------------------------------------------
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Division, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>

Received on Thu Jul 10 04:56:05 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT