<div dir="ltr"><div>The following script works just fine on our local systems.<br></div>Did you remove the file before creating it. On some systems, an environment variable  &quot;NC_CLOBBER&quot; is set. If this is the case, tou can not over write ans existing netCDF file.<br>
<br>====  <br><div><br>  load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>  load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br><br>begin<br>  in = addfile(&quot;<a href="http://wrfout_d01_000000.nc">wrfout_d01_000000.nc</a>&quot;,&quot;r&quot;)<br>
<br>  diro = &quot;./&quot;<br>  filo = &quot;<a href="http://eth850_1.nc">eth850_1.nc</a>&quot;<br>  system(&quot;/bin.rm -f &quot;+diro+filo)  ; rm any preexisting file<br>  out  = addfile(diro+filo,&quot;c&quot;)<br><br>
; First get the variables we will need<br><br>  it = 1<br>  lat = wrf_user_getvar(in,&quot;lat&quot;,it) ; Equivalent PotentialTtemperature [K]<br>  lon = wrf_user_getvar(in, &quot;lon&quot;,it) ; total pressure<br>  printVarSummary(lat)<br>
  printVarSummary(lon)<br><br><br>  eth = wrf_user_getvar(in,&quot;eth&quot;,it) ; Equivalent PotentialTtemperature [K]<br>  p   = wrf_user_getvar(in, &quot;pressure&quot;,it) ; total pressure<br><br>  ; Horizontally interpolate to pressure coordinates (&quot;p&quot;)<br>
  pressure = 850.   ; 850 hPa<br>  eth_plane = wrf_user_intrp3d(eth,p,&quot;h&quot;,pressure,0.,False)<br>  printVarSummary(eth_plane)<br><br><br><br>  out-&gt;lon = lon<br>  out-&gt;lat = lat<br>  out-&gt;eth850 = eth_plane<br>
end<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 24, 2014 at 9:39 PM, Mary Haley <span dir="ltr">&lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">You need to be more specific about what the problem is.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">
Are you getting an error/warning, or a bad NetCDF file, or something else?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are getting an error/warning, please include the exact message.</div>

<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">

<br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sat, Aug 23, 2014 at 7:21 PM, Li Qi <span dir="ltr">&lt;<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>Dear all, </div><div><br></div><div>I&#39;d like to create a netCDF file with the selected variables read off WRF output data, but I can&#39;t make it.</div>

<div><br></div><div>Here&#39;s my code:</div><div><br></div><div><div>  load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div><div>  load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;</div>

<div><br></div><div>begin</div><div><span style="white-space:pre-wrap">        </span>in = addfile(&quot;<a href="http://wrfout_d03_2011-06-13_18_00_00.nc" target="_blank">wrfout_d03_2011-06-13_18_00_00.nc</a>&quot;,&quot;r&quot;)</div>

<div><span style="white-space:pre-wrap">        </span>out = addfile(&quot;<a href="http://eth850_1.nc" target="_blank">eth850_1.nc</a>&quot;,&quot;c&quot;)</div><div>  </div><div>; First get the variables we will need  </div><div>

<br></div><div>  it = 1</div><div>  lat = wrf_user_getvar(in,&quot;lat&quot;,it) ; Equivalent PotentialTtemperature [K] </div><div>  lon = wrf_user_getvar(in, &quot;lon&quot;,it) ; total pressure</div><div>  </div><div><br>

</div><div>  eth = wrf_user_getvar(in,&quot;eth&quot;,it) ; Equivalent PotentialTtemperature [K] </div><div>  p = wrf_user_getvar(in, &quot;pressure&quot;,it) ; total pressure</div><div><br></div><div>  ; Horizontally interpolate to pressure coordinates (&quot;p&quot;)</div>

<div>  pressure = 850.   ; 850 hPa</div><div>  eth_plane = wrf_user_intrp3d(eth,p,&quot;h&quot;,pressure,0.,False) </div><div><br></div><div><br></div><div>  </div><div><span style="white-space:pre-wrap">        </span>out-&gt;lon = lon</div>

<div><span style="white-space:pre-wrap">        </span>out-&gt;lat = lat</div><div><span style="white-space:pre-wrap">        </span>out-&gt;eth850 = eth_plane</div><div><span style="white-space:pre-wrap">        </span></div><div>end<span style="line-height:0px">‍</span></div>

</div><div><br></div><div><br></div><br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>