<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body 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><tt><br>
</tt><tt>wrfpost = addfile(file_out,"c")</tt></font><br>
<br>
-Karin<br>
<br>
<div class="moz-cite-prefix">Am 19.01.18 um 13:15 schrieb Noelia
otero via ncl-talk:<br>
</div>
<blockquote type="cite"
cite="mid:CAG7o=LvgLFkojUU=WiPBfGD5zWBkPM6PhWxgKjJn4G_r_bjLyw@mail.gmail.com">
<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"
moz-do-not-send="true">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"
moz-do-not-send="true">met_wrfout_d01_2010-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",-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",-1)</div>
<div>lat = wrf_user_getvar(wrfin,"lat",-1)</div>
<div>lon = wrf_user_getvar(wrfin,"lon",-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="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO
Application Support
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany
Phone: +49 (0)40 460094 126
Fax: +49 (0)40 460094 270
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a>
URL: <a class="moz-txt-link-abbreviated" href="http://www.dkrz.de">www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
</body>
</html>