Re: Division by zero?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 18 2013 - 15:43:10 MST

http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml

As noted, the 'true_value' and 'false_value' expression get executed.

     x1 = sim->snow_liq_gb(:,0,0)
     x2 = sim->snow_mass_gb(:,0,0)
     x2 = where(x2.gt.0.01, x2, x2@_FillValue)
     ssnow = where(x2.gt.0.01, x1/x2, x2@_FillValue)

On 2/18/13 3:00 PM, Yang Yang wrote:
> Dear All:
>
> I have a NCL script contains the following:
>
> sim = addfile("Mt_Cook.day_38102.nc","r")
> x1 = sim->snow_liq_gb(:,0,0)
> x2 = sim->snow_mass_gb(:,0,0)
> ssnow = where(x2.gt.0.01, x1/x2, -999.)
>
> When I ran it, I had the following errors:
> fatal:divide: Division by 0, Can't continue
> fatal:Div: operator failed, can't continue
> fatal:Execute: Error occurred at or near line 19 in file snow_sim_mass_1_ratio.ncl
>
> Line 19 is: ssnow = where(x2.gt.0.01, x1/x2, -999.)
>
> I cannot figure out why "where" cannnot work here? Any help is appreciated. Thanks!
>
> Ed
> _______________________________________________
> 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 Mon Feb 18 15:43:08 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2013 - 11:26:43 MST