[ncl-talk] How to get the result for each grid?

Atul Saini atulsainimail at gmail.com
Mon Sep 9 00:55:28 MDT 2019


Hi NCL Talk,
                    I am trying to calculate the value for each grid using
the function as explained in the script, but at the end the result is one
value only. I want the value at each grid point.
*Script is as follows and datafile is attached herewith.*
;begin
a=addfile("Data_File.nc","r")
x=a->tym(0:4,:,:)
y=a->rf(0:4,:,:)
v=a->tym(5:9,:,:)
w=a->rf(5:9,:,:)
A1=
((sum(y))*(sum(sqrt(x)))-(sum(x))*(sum(x*y)))/(5*(sum(sqrt(x)))-(sqrt(sum(x))))
B1= (5*(sum(x*y))-(sum(x)*sum(y))/(5*(sum(sqrt(x)))-(sqrt(sum(x)))))
A2=
((sum(w))*(sum(sqrt(v)))-(sum(v))*(sum(v*w)))/(5*(sum(sqrt(v)))-(sqrt(sum(v))))
B2= (5*(sum(v*w))-(sum(v)*sum(w))/(5*(sum(sqrt(v)))-(sqrt(sum(v)))))
chpOnset = ((A1-A2)/(B2-B1))
print(chpOnset)
*Please, help me to find out the mistake I am making. Your reply is very
important to me. Thanks in advance.*
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190909/f3e83012/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/20190909/f3e83012/attachment-0001.nc>


More information about the ncl-talk mailing list