<div dir="ltr"><div dir="ltr">Is there any function that makes 3 dimensions to 2 dimensions array like <span style="background-color:rgb(0,255,0)">ndtooned</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 1, 2019 at 11:23 AM Md. Jalal Uddin <<a href="mailto:dmjalal90@gmail.com">dmjalal90@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"><span style="background-color:rgb(243,243,243)">What is it you really intend here -- a sum over time, or an average?</span> <div><br></div><div>I don't want to sum or average. I want to take the whole temporal value at each lat and lon and make a two dimensions Rain from three dimensions TRMM.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 1, 2019 at 11:17 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@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 dir="ltr"><div>Well, there are still two problems with that innermost nested loop:</div><div><br></div><div>i) What is the value of the 1st (zero-th) index value into TRMM on the first iteration of that loop?<br></div><div><span class="gmail-m_-113709569745563801gmail-m_-7097420099516142985gmail-im"><div><span style="white-space:pre-wrap"> </span>do nt=0,ntim-1</div></span><div><span style="white-space:pre-wrap"> </span>Rain(nl,ml) = TRMM(nt-1,nl,ml) ; <span style="background-color:rgb(255,0,0)">Subscript out of range, error in subscript #0</span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(243,243,243)"><span>ii) again, this loop is overwriting the value of Rain(nl,ml) repeatedly, for "ntim" times, only to end up with Rain(nl,ml) containing the value TRMM(ntim-1,nl,ml) by the time the innermost loop exits. What is it you really intend here -- a sum over time, or an average?</span></span><br></span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span>I really don't know at all about the second set of errors from copy_VarMeta -- it seems like some dimensionality requirement between copy_from and copy_to is getting violated, but I don't have the full picture. See the docs for discussion on requirements on the "leftmost dimensions"</span></span>:</span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><a href="http://ncl.ucar.edu/Document/Functions/Contributed/copy_VarMeta.shtml" target="_blank">http://ncl.ucar.edu/Document/Functions/Contributed/copy_VarMeta.shtml</a></span><br></span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span>Perhaps get that inner loop correct and the rest may sort itself out....</span></span></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span><br></span></span></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span>Rick</span></span></span></div><div><span style="background-color:rgb(255,0,0)"><span style="background-color:rgb(255,255,255)"><span></span></span><br></span></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 8:42 PM Md. Jalal Uddin <<a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Rick,<div>Now, I am getting the following errors (Highlight in red color). </div><div><br></div><div><div> f = addfile("<a href="http://bob_vscs.nc" target="_blank">bob_vscs.nc</a>","r")</div><div> time =f->time</div><div> lat =f->latitude</div><div> lon =f->longitude</div><div> ntim = dimsizes(time)</div><div> nlat = dimsizes(lat)</div><div> nlon = dimsizes(lon)</div><div> TRMM = f->pcp(:,{0:30},{75:100}) ;TRMM(time, latitude, longitude) </div><div><br></div><div> Rain =new((/nlat,nlon/),"float")</div><div> </div><div> do nl=0,nlat-1 </div><div> do ml=0,nlon-1</div><div><span style="white-space:pre-wrap"> </span>do nt=0,ntim-1</div><div><span style="white-space:pre-wrap"> </span>Rain(nl,ml) = TRMM(nt-1,nl,ml) ; <span style="background-color:rgb(255,0,0)">Subscript out of range, error in subscript #0</span></div><div><span style="white-space:pre-wrap"> </span>end do</div><div><span style="white-space:pre-wrap"> </span> end do<span style="white-space:pre-wrap"> </span></div><div> end do</div><div> copy_VarMeta(TRMM(0,:,:),Rain) <span style="background-color:rgb(255,0,0)">; fatal:Coordinate variables must be the same dimension as their dimension fatal:No coordinate variable exists for dimension (longitude) in variable (var_to)</span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><span style="background-color:rgb(255,0,0)"><div>Variable: TRMM</div><div>Type: float</div><div>Total Size: 18720000 bytes</div><div> 4680000 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [time | 390] x [latitude | 120] x [longitude | 100]</div><div>Coordinates:</div><div> time: [ 0..119208]</div><div> latitude: [0.125..29.875]</div><div> longitude: [75.125..99.875]</div><div>Number Of Attributes: 7</div><div> long_name : precipitation (mm/hr)</div><div> _FillValue : -9999.9</div><div> missing_value : -9999.9</div><div><br></div></span></div><div><span style="background-color:rgb(255,0,0)"><br></span></div><div><br></div><div> </div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 8:48 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@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,</div><div><br></div><div>It looks like there may be several problems going here:</div><div><br></div><div>i) I speculate you mean something more like this:</div><div><div> time =f->time</div><div> lat =f->latitude</div><div> lon =f->longitude</div><div> ntim = dimsizes(time)</div><div> nlat = dimsizes(lat)</div><div> nlon = dimsizes(lon)</div><div><br></div></div><div>ii) I'm not sure the intent here:</div><div><br></div><div> <span style="white-space:pre-wrap"></span>Rain(nl,ml) = TRMM(nt,nl,ml)</div><div><br></div><div>Each time through the inner loop, it will (re)assign the one by one "nt" values of TRMM to the same element of Rain(nl, ml), exiting the loop with it set to the "nt-1"th value. Its equivalent to foregoing the entire inner loop and just saying Rain(nl,ml) = TRMM(nt-1,nl,ml)</div><div><br></div><div>Hope that helps,</div><div>Rick<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 4:00 AM Md. Jalal Uddin <<a href="mailto:dmjalal90@gmail.com" target="_blank">dmjalal90@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 dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>I have tried to take all rainfall data
<span style="color:rgb(51,51,51);font-family:verdana,sans-serif;font-size:13.3333px">for each latitude and longitude point and made 2 dimensions from 3 dimensions. I am getting the following errors.</span></div><div><div>fatal:_NclBuildArray: each element of a literal array must have the same dimension sizes, at least one item doesn't</div></div><div><br></div><div>The main code:</div><div><br></div><div><div>f = addfile("<a href="http://bob_vscs.nc" target="_blank">bob_vscs.nc</a>","r")</div><div> ntim =f->time</div><div> nlat =f->latitude</div><div> nlon =f->longitude</div><div> TRMM = f->pcp(:,{0:30},{75:100}) ;TRMM(time 390, latitude 120, longitude 100) </div><div> </div><div> Rain =new((/nlat,nlon/),"float")</div><div> </div><div> do nl=0,nlat-1 </div><div> do ml=0,nlon-1</div><div><span style="white-space:pre-wrap"> </span>do nt=0,ntim-1</div><div><span style="white-space:pre-wrap"> </span>Rain(nl,ml) = TRMM(nt,nl,ml)</div><div><span style="white-space:pre-wrap"> </span>end do</div><div><span style="white-space:pre-wrap"> </span> end do<span style="white-space:pre-wrap"> </span></div><div> end do</div></div><div> </div><div>Could you help me to solve the problem, please?</div><div><br></div><div>Best Regards,</div><div>Jalal<br>-- <br><div dir="ltr" class="gmail-m_-113709569745563801gmail-m_-7097420099516142985gmail-m_-2799084074200030432gmail-m_7136274446960644311gmail-m_-941832099391251933gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2" color="#000000"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr"><span style="letter-spacing:0.2px">B.Sc. in Disaster Management (Hons.) </span><br></div><div dir="ltr"><span style="letter-spacing:0.2px">Patuakhali Science and Technology University, Bangladesh.</span></div><div dir="ltr">Cell: +8613260859092, <span style="letter-spacing:0.2px">+8801792052662</span></div><div dir="ltr"><font size="2">Web: <a href="http://www.dmjalal90.weebly.com" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><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></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><br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-113709569745563801gmail-m_-7097420099516142985gmail-m_-2799084074200030432gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font size="2" color="#000000"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr"><span style="letter-spacing:0.2px">B.Sc. in Disaster Management (Hons.) </span><br></div><div dir="ltr"><span style="letter-spacing:0.2px">Patuakhali Science and Technology University, Bangladesh.</span></div><div dir="ltr">Cell: +8613260859092, <span style="letter-spacing:0.2px">+8801792052662</span></div><div dir="ltr"><font size="2">Web: <a href="http://www.dmjalal90.weebly.com" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><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>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-113709569745563801gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font color="#000000" size="2"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr"><span style="letter-spacing:0.2px">B.Sc. in Disaster Management (Hons.) </span><br></div><div dir="ltr"><span style="letter-spacing:0.2px">Patuakhali Science and Technology University, Bangladesh.</span></div><div dir="ltr">Cell: +8613260859092, <span style="letter-spacing:0.2px">+8801792052662</span></div><div dir="ltr"><font size="2">Web: <a href="http://www.dmjalal90.weebly.com" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font color="#000000" size="2"><b>Md. Jalal Uddin</b></font></div><div dir="ltr">MSc in Applied Meteorology (English Language)<br>Nanjing University of Information, Science and Technology, China</div><div dir="ltr"><span style="letter-spacing:0.2px">B.Sc. in Disaster Management (Hons.) </span><br></div><div dir="ltr"><span style="letter-spacing:0.2px">Patuakhali Science and Technology University, Bangladesh.</span></div><div dir="ltr">Cell: +8613260859092, <span style="letter-spacing:0.2px">+8801792052662</span></div><div dir="ltr"><font size="2">Web: <a href="http://www.dmjalal90.weebly.com" target="_blank">www.dmjalal90.weebly.com</a> <br>Facebook: jalal.hossen.39 <br>LinkedIn: <a href="https://bd.linkedin.com/in/md-jalal-uddin-80a026b0" target="_blank">https://bd.linkedin.com/in/md-jalal-uddin-80a026b0</a> <br>Twitter: dmjalal90 <br>Skype: dmjalal90</font><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>