[ncl-talk] fatal:divide: Division by 0, Can't continue

Atul Saini atulsainimail at gmail.com
Mon Sep 9 23:57:37 MDT 2019


*Hi NCL,*

*While running the following code-*

a=addfile("Data_File.nc","r")
x=a->tym(0:4,:,:)
X=sqrt(x)
y=a->rf(0:4,:,:)
Y=sqrt(y)
v=a->tym(5:9,:,:)
V=sqrt(v)
w=a->rf(5:9,:,:)
W=sqrt(w)
A1=((dim_sum_n(y,0))*(dim_sum_n(X,0)))-(dim_sum_n(x,0))*(dim_sum_n(x*y,0))/(100*(dim_sum_n(X,0))-(sqrt(dim_sum_n(x,0))))

A2=((dim_sum_n(w,0))*(dim_sum_n(V,0)))-(dim_sum_n(v,0))*(dim_sum_n(v*w,0))/(100*(dim_sum_n(V,0))-(sqrt(dim_sum_n(v,0))))

B1=
(100*(dim_sum_n(x*y,0)))-(dim_sum_n(y,0))/(100*(dim_sum_n(X,0))-(sqrt(dim_sum_n(x,0))))

B2=
(100*(dim_sum_n(v*w,0)))-(dim_sum_n(w,0))/(100*(dim_sum_n(V,0))-(sqrt(dim_sum_n(v,0))))

chpOnset = ((A1-A2)/(B2-B1))
print(chpOnset)

*I am receiving the following error-*
fatal:divide: Division by 0, Can't continue
fatal:Div: operator failed, can't continue

Please help, what should be done here?

Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190910/9b5feb64/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Data_File.nc
Type: application/x-netcdf
Size: 1396932 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190910/9b5feb64/attachment-0001.nc>


More information about the ncl-talk mailing list