<div dir="ltr"><div>Why there are no values for min and max of x variable?<br></div><div>I suspect that there is something wrong with your data file, however, you should do some more checking... e.g. <br></div><div><br></div><div>printVarSummary(x)</div><div>printVarSummary(X)<br></div><div></div><div><br></div><div>print(x@_FillValue)</div><div>print(X@_FillValue)</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 1:11 PM Atul Saini <<a href="mailto:atulsainimail@gmail.com">atulsainimail@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Rashed sir,</div><div> It gives the following answer-</div><div><br></div><div><b>ncl 4> printMinMax(x,True)<br>(0) <br>(0) GRIDDED RAINFALL<br>ncl 5> printMinMax(X,True)<br>(0) <br>(0) min=5050 max=5050</b></div><div><br></div><div><div><div dir="ltr" class="gmail-m_-8636779149036519467gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><font size="4">Regards,</font></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1flpEpH50fxgPRxFvuyiLu2A70K0UoFx-&revid=0Byj9ykpbAx3od3R4N016WWh0MnlGQ1JHUTg4Nk5HVmVMS2ZNPQ" width="304" height="116"><br></div><div> <br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 4:38 PM Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I do not see any problem with the lines you just posted. <br></div><div>Can you add following in the above code you wrote and let me know:</div><div><br></div><div>printMinMax(x,True)</div><div>printMinMax(X,True)</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 12:18 PM Atul Saini <<a href="mailto:atulsainimail@gmail.com" target="_blank">atulsainimail@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello Rashed Sir,</div><div> I used dim_sum_n but it could not yield the required result at each grid point. I want to get the sum of the variable through time for all the grid points and therefore I used -</div><div><br></div><div><b>a=addfile("RFIM_1901_1902_days_rf_tym.nc","r")<br>x=a->tym(0:99,:,:)<br>X=dim_sum_n(x,0)</b></div><div><b>print(X)</b></div><div><b><br></b></div><div>Printing X doesn't provide the correct result. Please guide. Your reply is highly appreciated.<br></div><div><b></b></div><div><b><br></b></div><div><br></div><div><br></div><div><div><div dir="ltr" class="gmail-m_-8636779149036519467gmail-m_587892381589848607gmail-m_-3604341541627214952gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><font size="4">Regards,</font></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1flpEpH50fxgPRxFvuyiLu2A70K0UoFx-&revid=0Byj9ykpbAx3od3R4N016WWh0MnlGQ1JHUTg4Nk5HVmVMS2ZNPQ" width="304" height="116"><br></div><div> <br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 2:58 PM Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I think you want to use dim_sum_n_wrap() or dim_sum_n() functions instead of using "sum". "sum" would result in total of everything for a variable. See the docs at the following link:<br></div><div><br></div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum_n.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_sum_n.shtml</a></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 9, 2019 at 8:55 AM Atul Saini via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi NCL Talk,</div><div> 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.<span style="background-color:rgb(111,168,220)"><b><span style="background-color:rgb(252,229,205)"><span style="color:rgb(0,0,0)"></span></span></b></span></div><div><font size="2"><span style="color:rgb(255,0,0)"><b>Script is as follows and datafile is attached herewith.</b></span></font></div><div><span style="color:rgb(0,0,255)">;begin<br>a=addfile("Data_File.nc","r")<br>x=a->tym(0:4,:,:)<br>y=a->rf(0:4,:,:)<br>v=a->tym(5:9,:,:)<br>w=a->rf(5:9,:,:)<br>A1= ((sum(y))*(sum(sqrt(x)))-(sum(x))*(sum(x*y)))/(5*(sum(sqrt(x)))-(sqrt(sum(x))))<br>B1= (5*(sum(x*y))-(sum(x)*sum(y))/(5*(sum(sqrt(x)))-(sqrt(sum(x)))))<br>A2= ((sum(w))*(sum(sqrt(v)))-(sum(v))*(sum(v*w)))/(5*(sum(sqrt(v)))-(sqrt(sum(v))))<br>B2= (5*(sum(v*w))-(sum(v)*sum(w))/(5*(sum(sqrt(v)))-(sqrt(sum(v)))))<br>chpOnset = ((A1-A2)/(B2-B1))<br>print(chpOnset)</span></div><div><span style="color:rgb(0,0,255)"><font size="2"><span style="background-color:rgb(217,234,211)"><span style="color:rgb(255,0,0)"><b>Please, help me to find out the mistake I am making. Your reply is very important to me. Thanks in advance.</b></span></span></font></span></div><div><div dir="ltr" class="gmail-m_-8636779149036519467gmail-m_587892381589848607gmail-m_-3604341541627214952gmail-m_-6323195963944661163gmail-m_-1285333165725487570gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><font size="4">Regards,</font></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=1flpEpH50fxgPRxFvuyiLu2A70K0UoFx-&revid=0Byj9ykpbAx3od3R4N016WWh0MnlGQ1JHUTg4Nk5HVmVMS2ZNPQ" width="304" height="116"><br></div><div> <br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>