<div dir="ltr"><div><div><div><div><div>If you are having 'file problems', <b>always </b>include (attach) the output from 'ncdump -h' or, equivalently, 'ncl_filedump'<br>----<br><br>I think you have a 'typo':<br>   <font size="2" face="verdana, helvetica, sans-serif">"3B-DAY-<b><a href="http://L.MS">L.MS</a></b>.MRG.<wbr>3IMERG.201704*.nc"  <br><br></font></div><font size="2" face="verdana, helvetica, sans-serif">'<b><a href="http://L.MS">L.MS</a></b>' should be '<b>LMS</b>"    <br><br>This should be:<br><br>   </font><font size="2" face="verdana, helvetica, sans-serif">"3B-DAY-<b>LMS</b>.MRG.<wbr>3IMERG.201704*.nc"<br><br>====<br></font></div><font size="2" face="verdana, helvetica, sans-serif">If there is no <b>time</b> dimension (ie: <b>record</b> dimension)<br><br></font></div><font size="2" face="verdana, helvetica, sans-serif">Then, I think you should read the documentation for <br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml</a><br></font></div><div><font size="2" face="verdana, helvetica, sans-serif">(In particulare, the Examples)<br></font></div><font size="2" face="verdana, helvetica, sans-serif">and <br><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/ListSetType.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/ListSetType.shtml</a><br>====<br></font></div><font size="2" face="verdana, helvetica, sans-serif">I suggest *not* reordering when importing the data. This is very inefficient.,<br></font><br><div><div><br><font size="2" face="verdana, helvetica, sans-serif"><font size="2" face="verdana, helvetica, sans-serif">   diri  = "path/"   ; input directory</font></font><div><font size="2" face="verdana, helvetica, sans-serif">   files = <b>systemfunc</b>("cd "+diri+"; ls 3B-DAY-LMS.MRG.<wbr>3IMERG.201704*.nc") ; file paths<br></font><br></div><div><font size="2" face="verdana, helvetica, sans-serif">   f      = <b>addfiles</b>(diri+files,"r")</font><br><font size="2" face="verdana, helvetica, sans-serif"><strong>   ListSetType</strong> (f, "join")  <br></font></div><div><font size="2" face="verdana, helvetica, sans-serif">   prc = f[:]-></font><span style="font-size:small;font-family:verdana,helvetica,sans-serif">precipitationCal<br></span></div><div><span style="font-size:small;font-family:verdana,helvetica,sans-serif">   <b>printVarSummary</b>(prc)<br><br></span></div><div><span style="font-size:small;font-family:verdana,helvetica,sans-serif">Likely, you will have something like: </span><span style="font-size:small;font-family:verdana,helvetica,sans-serif"><br>  </span><br><pre>[<b>ncl_join</b> | ?] x [lon | 3480] x [lat | 61]<br><br></pre><pre>Now reorder, use the  <b>:=</b> 'overwrite' syntax<br><br></pre><pre>  prc <b>:=</b> prc(ncl_join|:, lat|:, lon|:)<br></pre><pre>  printVarSummary(prc)<br><br></pre><pre>If there is no 'time' within the file, then you will have to parse the 'files' variable to extract the yyyymm... information<br></pre><pre>str_get_cols or str_get_field<br><br></pre><pre>Good luck<br></pre><pre><br></pre><pre><br>   <br></pre><span style="font-size:small;font-family:verdana,helvetica,sans-serif"></span></div><div><span style="font-size:small;font-family:verdana,helvetica,sans-serif"><br><br></span></div><div><span style="font-size:small;font-family:verdana,helvetica,sans-serif"><br>   <br></span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 7, 2017 at 5:56 PM, Ehsan Taghizadeh <span dir="ltr"><<a href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div>Dear Karin</div><div>I think so, all files have the same dimensions and names.</div><div>I examined one by one files and all shows same output for following lines</div><div><font size="2">  prc2 = f->precipitationCal(lat | :, lon | :)<br>  printVarSummary(prc2)</font><br><br>Output is:<br></div><div><br></div><div><font size="2">Type: float<br>Total Size: 28304 bytes<br>            7076 values<br>Number of Dimensions: 2<br>Dimensions and sizes:   [lat | 61] x [lon | 116]<br>Coordinates:<br>            lat: [34.25..40.25]<br>            lon: [40.05..51.55]</font><br><br><br></div>
            <div><br></div><div>However if it helps I could attach these files.</div><div><br></div><div>Sincerely</div><span class="HOEnZb"><font color="#888888"><div>Ehsan<br></div></font></span><div><div class="h5">
            
            <div id="m_2171383976535622848yahoo_quoted_3205849993" class="m_2171383976535622848yahoo_quoted">
                <div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a">
                    
                    <div>
                        On Thursday, December 7, 2017, 2:22:35 PM GMT, Karin Meier-Fleischer <<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>> wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                    <div><div id="m_2171383976535622848yiv3037120654"><div>
    Hi Ehsan,<br clear="none">
    <br clear="none">
    the syntax for multiple files is correct<br clear="none">
    <br clear="none">
      prc = f[:]->precipitationCal(lat|:,<wbr>lon|:)<br clear="none">
    <br clear="none">
    Are you sure that all files have the same dimensions and names?<br clear="none">
    <br clear="none">
    -Karin<br clear="none">
    <br clear="none">
    <br clear="none">
    <div class="m_2171383976535622848yiv3037120654moz-cite-prefix">Am 07.12.17 um 14:53 schrieb Ehsan
      Taghizadeh:<br clear="none">
    </div>
    <blockquote type="cite">
      <div class="m_2171383976535622848yiv3037120654yqt9654632813" id="m_2171383976535622848yiv3037120654yqt29942"><div style="font-family:bookman old style,new york,times,serif;font-size:16px">
        <div>Dear Karin</div>
        <div>Thank you so much for your nice reply. However for</div>
        <div><span style="font-family:verdana,helvetica,sans-serif;font-size:small">  prc    = f[:]->precipitationCal</span><br clear="none">
        </div>
        <div><span style="font-family:verdana,helvetica,sans-serif;font-size:small"><span style="font-family:verdana,helvetica,sans-serif;font-size:small"> 
              printVarSummary(prc)</span><br clear="none">
          </span></div>
        <div><br clear="none">
        </div>
        <div>I got:</div>
        <div>
          <div> <font size="2">Copyright (C) 1995-2017 - All Rights
              Reserved</font></div>
          <div><font size="2"> University Corporation for Atmospheric
              Research</font></div>
          <div><font size="2"> NCAR Command Language Version 6.4.0</font></div>
          <div><font size="2"> The use of this software is governed by a
              License Agreement.</font></div>
          <div><font size="2"> See <a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-freetext" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more
              details.</font></div>
          <div><font size="2">warning:Aggregated dimension coordinate
              values are non-monotonic; check aggregated file ordering</font></div>
          <div><font size="2"><br clear="none">
            </font></div>
          <div><font size="2">Variable: prc</font></div>
          <div><font size="2">Type: float</font></div>
          <div><font size="2">Total Size: 849120 bytes</font></div>
          <div><font size="2">            212280 values</font></div>
          <div><font size="2">Number of Dimensions: 2</font></div>
          <div><font size="2">Dimensions and sizes:   [lon | 3480] x
              [lat | 61]</font></div>
          <div><font size="2">Coordinates:</font></div>
          <div><font size="2">            lon: [40.05..51.55]</font></div>
          <div><font size="2">            lat: [34.25..40.25]</font></div>
          <div><font size="2">Number Of Attributes: 6</font></div>
          <div><font size="2">  units :       mm</font></div>
          <div><font size="2">  long_name :   Daily accumulated
              precipitation (combined microwave-IR) estimate</font></div>
          <div><font size="2">  coordinates : lat lon</font></div>
          <div><font size="2">  _FillValue :  -9999.9</font></div>
          <div><font size="2">  origname :    precipitationCal</font></div>
          <div><font size="2">  fullnamepath :        /precipitationCal</font></div>
          <div><br clear="none">
          </div>
          <span style="color:rgb(0,0,0)">In fact for one file, I don't have any
            problem and following lines work correctly:</span><br clear="none">
        </div>
        <div><span style="color:rgb(0,0,0)">
            </span><div><font size="2">  f = addfile(filess,"r")</font></div>
            <div><font size="2">  prc =
                f->precipitationCal(lat | :, lon | :)</font><br clear="none">
            </div>
            <div style="font-size:16px"><br clear="none">
            </div>
            <div style="font-size:16px">however for multiple files I
              counter problem. I attached 3 files which I want to open.</div>
            <div style="font-size:16px">As Karin mentioned the problem
              is related to "Dimenstions and sizes". So how could I
              point to a variable and simultaneous reorder (lat, lon)
              dimension in case of multiple files?</div>
            <div style="font-size:16px">I mean what is the form of</div>
            <div>
              <div style="color:rgb(0,0,0)"><font size="2">  f = addfile(filess,"r")</font></div>
              <div style="color:rgb(0,0,0)"><font size="2">  prc =
                  f->precipitationCal(lat | :, lon | :)</font></div>
              for multiple files?</div>
            <div style="font-size:16px"><br clear="none">
            </div>
            <div style="font-size:16px">Again I'll be thankful for any
              help.</div>
            <div style="font-size:16px"><br clear="none">
            </div>
            <div style="font-size:16px">Sincerely</div>
            <div style="font-size:16px">Ehsan</div>
            <br clear="none">
          </div>
        <div class="m_2171383976535622848yiv3037120654yahoo_quoted" id="m_2171383976535622848yiv3037120654yahoo_quoted_3114448420">
          <div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a">
            <div> On Thursday, December 7, 2017, 4:51:40 PM GMT+3:30,
              Karin Meier-Fleischer <a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-rfc2396E" href="mailto:meier-fleischer@dkrz.de" target="_blank"><meier-fleischer@dkrz.de></a>
              wrote: </div>
            <div><br clear="none">
            </div>
            <div><br clear="none">
            </div>
            <div>
              <div id="m_2171383976535622848yiv3037120654">
                <div> Hi Ehsan,<br clear="none">
                  <br clear="none">
                  please, have a look at your data first. Do<br clear="none">
                  <br clear="none">
                  <span style="font-size:small;font-family:verdana,helvetica,sans-serif">  prc    =
                    f[:]->precipitationCal<br clear="none">
                      printVarSummary(prc)<br clear="none">
                  </span><span style="font-size:small;font-family:verdana,helvetica,sans-serif"><br clear="none">
                  </span>to see what dimension names precipitationCal
                  has.<br clear="none">
                  <br clear="none">
                  -Karin<br clear="none">
                  <br clear="none">
                  <div class="m_2171383976535622848yiv3037120654moz-cite-prefix">Am 07.12.17
                    um 12:18 schrieb Ehsan Taghizadeh:<br clear="none">
                  </div>
                  <blockquote type="cite">
                    <div class="m_2171383976535622848yiv3037120654yqt3443244067" id="m_2171383976535622848yiv3037120654yqt54149">
                      <div style="font-family:bookman old style,new york,times,serif;font-size:16px">
                        <div><font face="verdana, helvetica, sans-serif"><font size="2">Hi, I want to open multiple
                              netcdf files. Also I had to change
                              dimesion of variable (</font><span style="color:rgb(0,0,0);font-family:verdana,helvetica,sans-serif"><font size="1">precipitationCal(lat
                                | :, lon | :)</font></span><font size="2">), but I got an error
                              (fatal:(lat) is not a dimension name in
                              variable (lon), could not determine
                              dimension number). What should I do?</font></font></div>
                        <div><font face="verdana, helvetica, sans-serif"><font size="2">Following lines are simple code.</font></font></div>
                        <div><font size="2" face="verdana, helvetica, sans-serif"><br clear="none">
                          </font></div>
                        <div><font size="2" face="verdana, helvetica, sans-serif">   diri = "path/"   ; input
                            directory</font></div>
                        <div><font size="2" face="verdana, helvetica, sans-serif">   files = systemfunc("ls
                            "+diri+"3B-DAY-L.MS.MRG.<wbr>3IMERG.201704*.nc")
                            ; file paths</font></div>
                        <div><font size="2" face="verdana, helvetica, sans-serif">   f = addfiles(files,"r")</font></div>
                        <div><span style="font-size:small;font-family:verdana,helvetica,sans-serif">  prc    =
                            f[:]->precipitationCal(lat | :, lon | :) 
                                  ; read precipitation from all files</span><br clear="none">
                        </div>
                        <div><font size="1" face="verdana, helvetica, sans-serif"><br clear="none">
                          </font><br clear="none">
                        </div>
                        <div>Sincerely</div>
                        <div>Ehsan</div>
                      </div>
                    </div>
                    <br clear="none">
                    <fieldset class="m_2171383976535622848yiv3037120654mimeAttachmentHeader"></fieldset>
                    <br clear="none">
                    <pre>______________________________<wbr>_________________
ncl-talk mailing list
<a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a>
</pre>
                  </blockquote>
                  <br clear="none">
                </div>
              </div>
              <div class="m_2171383976535622848yiv3037120654yqt3443244067" id="m_2171383976535622848yiv3037120654yqt93428">______________________________<wbr>_________________<br clear="none">
                ncl-talk mailing list<br clear="none">
                <a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
                List instructions, subscriber options, unsubscribe:<br clear="none">
                <a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br clear="none">
              </div>
            </div>
          </div>
        </div>
      </div></div>
      <br clear="none">
      <fieldset class="m_2171383976535622848yiv3037120654mimeAttachmentHeader"></fieldset>
      <br clear="none">
      <pre>______________________________<wbr>_________________
ncl-talk mailing list
<a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a rel="nofollow" shape="rect" class="m_2171383976535622848yiv3037120654moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <br clear="none">
  </div></div><div class="m_2171383976535622848yqt9654632813" id="m_2171383976535622848yqt69007">______________________________<wbr>_________________<br clear="none">ncl-talk mailing list<br clear="none"><a shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">List instructions, subscriber options, unsubscribe:<br clear="none"><a shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br clear="none"></div></div>
                </div>
            </div></div></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>