Re: Odd error from day_of_year

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 25 2011 - 18:39:13 MDT

I would not ignore this error. Does the line number in the error
message match the command line that you showed? Are there any
preceding errors?

You have an array expression. Can you subdivide the array, and
still get the error? Try a temporary explicit loop:

ntimes = dimsizes (datesobs(:,0))
do j = 0, ntimes-1
   print (j+" "+datesobs(j,0)+" "+datesobs(j,1)+" "+datesobs(j,2))
   doyobs = day_of_year (datesobs(j,0),datesobs(j,1), \
     datesobs(j,2)) - 1
   print (j+" "+doyobs)
end do

See if this also fails, and note exactly where, and for what inputs.
  HTH.

--Dave

Debug suggestion:

On 10/25/2011 4:35 PM, Bridget Thrasher wrote:
> I'm receiving an odd error that I've never seen before:
> "day_of_year: illegal month, -8"
>
> My command is: doyobs =
> day_of_year(datesobs(:,0),datesobs(:,1),datesobs(:,2)) - 1
>
> I thought it meant that the function was finding a value of -8 in
> the month slot, but using the commands below to look at both the
> inputs and the outputs show nothing unusual:
> print(datesobs(:,0)+" "+datesobs(:,1)+" "+datesobs(:,2))
> print(doyobs)
>
> Another weird thing is that I'm fairly certain it's only showing
> this when reading from leap years (I'm reading in 56 years of daily
> times, and I get the error 14 times), and it only happens with my
> original data files, not with the files containing regridded data
> that I made with linint2_Wrap.
>
> Any insight? Should I just ignore it and carry on?
> bridget$ ncl -V
> 5.2.0
>
> -Bridget
>
> --
> Bridget Thrasher, PhD
> Independent Contractor, Research Scientist
>
>
>
>
> _______________________________________________
> 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 Oct 25 18:39:24 2011

This archive was generated by hypermail 2.1.8 : Fri Oct 28 2011 - 10:52:03 MDT