<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 "NC_CLOBBER" is set. If this is the case, tou can not over write ans existing netCDF file.<br>
<br>==== <br><div><br> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br><br>begin<br> in = addfile("<a href="http://wrfout_d01_000000.nc">wrfout_d01_000000.nc</a>","r")<br>
<br> diro = "./"<br> filo = "<a href="http://eth850_1.nc">eth850_1.nc</a>"<br> system("/bin.rm -f "+diro+filo) ; rm any preexisting file<br> out = addfile(diro+filo,"c")<br><br>
; First get the variables we will need<br><br> it = 1<br> lat = wrf_user_getvar(in,"lat",it) ; Equivalent PotentialTtemperature [K]<br> lon = wrf_user_getvar(in, "lon",it) ; total pressure<br> printVarSummary(lat)<br>
printVarSummary(lon)<br><br><br> eth = wrf_user_getvar(in,"eth",it) ; Equivalent PotentialTtemperature [K]<br> p = wrf_user_getvar(in, "pressure",it) ; total pressure<br><br> ; Horizontally interpolate to pressure coordinates ("p")<br>
pressure = 850. ; 850 hPa<br> eth_plane = wrf_user_intrp3d(eth,p,"h",pressure,0.,False)<br> printVarSummary(eth_plane)<br><br><br><br> out->lon = lon<br> out->lat = lat<br> out->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"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></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"><<a href="mailto:liqi123sh@qq.com" target="_blank">liqi123sh@qq.com</a>></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'd like to create a netCDF file with the selected variables read off WRF output data, but I can't make it.</div>
<div><br></div><div>Here's my code:</div><div><br></div><div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div>
<div><br></div><div>begin</div><div><span style="white-space:pre-wrap">        </span>in = addfile("<a href="http://wrfout_d03_2011-06-13_18_00_00.nc" target="_blank">wrfout_d03_2011-06-13_18_00_00.nc</a>","r")</div>
<div><span style="white-space:pre-wrap">        </span>out = addfile("<a href="http://eth850_1.nc" target="_blank">eth850_1.nc</a>","c")</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,"lat",it) ; Equivalent PotentialTtemperature [K] </div><div> lon = wrf_user_getvar(in, "lon",it) ; total pressure</div><div> </div><div><br>
</div><div> eth = wrf_user_getvar(in,"eth",it) ; Equivalent PotentialTtemperature [K] </div><div> p = wrf_user_getvar(in, "pressure",it) ; total pressure</div><div><br></div><div> ; Horizontally interpolate to pressure coordinates ("p")</div>
<div> pressure = 850. ; 850 hPa</div><div> eth_plane = wrf_user_intrp3d(eth,p,"h",pressure,0.,False) </div><div><br></div><div><br></div><div> </div><div><span style="white-space:pre-wrap">        </span>out->lon = lon</div>
<div><span style="white-space:pre-wrap">        </span>out->lat = lat</div><div><span style="white-space:pre-wrap">        </span>out->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>