<div dir="ltr">Hi Karin,<div><br></div><div>Yes, I know..that's why I am not sure how I can do it. If I have 24 files for one day, I just wanted to extract some variables and storage the daily values in one single file. </div><div>Is there any way? If I use system("rm -rf" +file_out) my file with previous value is removed...so I would have a new file with the current time, which I don't want.. any suggestion? </div><div><br></div><div>Thanks!</div><div>Noelia</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-19 13:30 GMT+01:00 Karin Meier-Fleischer via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Noelia,<br>
    <br>
    NCL can't create a new file when it already exits. You have to make
    sure that the file doesn't exist or delete it before using addfile.<br>
    <br>
    <font color="#3333ff"><tt>system("rm -rf "+file_out)</tt><span class=""><tt><br>
      </tt><tt>wrfpost = addfile(file_out,"c")</tt></span></font><br>
    <br>
    -Karin<br>
    <br>
    <div class="m_-3521044922961557663moz-cite-prefix">Am 19.01.18 um 13:15 schrieb Noelia
      otero via ncl-talk:<br>
    </div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div>I have hourly files from WRF and I wanted to create daily
          files (with the hourly outputs, Time=24). I was using
          addfile(, "c")....I know the error I got it is caused by "c",
          once the first file is created I can´t opened again..(If I am
          not wrong, right?) Is there any way to do it?</div>
        <div><br>
        </div>
        <div>
          <div>
            <div>print(file_in)</div>
            <div>; wrfout_d01_2010-01-01_00:00:<a href="http://00.nc" target="_blank"><wbr>00.nc</a></div>
            <div>wrfin = addfile(file_in,"r")</div>
            <div><br>
            </div>
            <div>; I want the output: file_out=<a href="http://met_wrfout_d01_2010-01-01.nc" target="_blank">met_wrfout_d01_2010-<wbr>01-01.nc</a> </div>
            <div>wrfpost = addfile(file_out,"c")    ;create new netCDF
              file<br>
            </div>
            <div><br>
            </div>
            <div>pres_pa = wrf_user_getvar(wrfin,"pres",-<wbr>1)</div>
            <div>t_k = wrf_user_getvar(wrfin,"tk",-1)</div>
          </div>
          <div><br>
          </div>
          <div>
            <div>wrfpost->t_k= t_k</div>
            <div>wrfpost->pres_pa= pres_pa</div>
          </div>
          <div>
            <div><br>
            </div>
            <div>Time = wrf_user_getvar(wrfin,"Times",<wbr>-1)</div>
            <div>lat = wrf_user_getvar(wrfin,"lat",-<wbr>1)</div>
            <div>lon = wrf_user_getvar(wrfin,"lon",-<wbr>1)</div>
            <div><br>
            </div>
            <div>wrfpost->time    = Time</div>
            <div>wrfpost->lat= lat</div>
            <div>wrfpost->lon= lon</div>
          </div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks in advance,</div>
        <div>Best</div>
        <div>Noelia</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="m_-3521044922961557663mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
ncl-talk mailing list
<a class="m_-3521044922961557663moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="m_-3521044922961557663moz-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>
    <pre class="m_-3521044922961557663moz-signature" cols="72">-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    <a href="tel:+49%2040%20460094126" value="+4940460094126" target="_blank">+49 (0)40 460094 126</a>
Fax:      <a href="tel:+49%2040%20460094270" value="+4940460094270" target="_blank">+49 (0)40 460094 270</a>
E-Mail:   <a class="m_-3521044922961557663moz-txt-link-abbreviated" href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>
URL:      <a class="m_-3521044922961557663moz-txt-link-abbreviated" href="http://www.dkrz.de" target="_blank">www.dkrz.de</a>

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
  </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>