<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div id="yiv1840507268"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"><div id="yiv1840507268yui_3_16_0_5_1407868603433_4"><span></span></div> <div class="yiv1840507268qtdSeparateBR" id="yiv1840507268yui_3_16_0_1_1407868603433_4569">Hi All,<br><br>I haven't personally tried this before, but another option for calculating geostrophic wind from WRF output may be use the Unified Post Processor to calculate the Geostrophic streamfunction (Psi). From there, it should be possible to derive the geostrophic wind, i.e. ug = -d(Psi)/dy , vg = +d(Psi)/dx ; where dy and dx are your grid spacing in meters. The result (I presume), would be grid relative; so geostrophic winds may need to be rotated to
 earth coordinates.<br><br>Dave. <br clear="none"><br clear="none"></div><div class="yiv1840507268yqt8413730283" id="yiv1840507268yqt57782"><div class="yiv1840507268yahoo_quoted" id="yiv1840507268yui_3_16_0_5_1407868603433_7" style="display: block;"> <div class="yiv1840507268yui_3_16_0_1_1407868603433_4295" id="yiv1840507268yui_3_16_0_1_1407868603433_4564" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="yiv1840507268yui_3_16_0_1_1407868603433_4296" id="yiv1840507268yui_3_16_0_1_1407868603433_4563" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr" id="yiv1840507268yui_3_16_0_1_1407868603433_4568"> <font id="yiv1840507268yui_3_16_0_1_1407868603433_4567" face="Arial" size="2"> On Tuesday, August 12, 2014 8:00:11 PM, "ncl-talk-request@ucar.edu"
 &lt;ncl-talk-request@ucar.edu&gt; wrote:<br clear="none"> </font> </div>  <br clear="none"><div class="yiv1840507268y_msg_container" id="yiv1840507268yui_3_16_0_1_1407868603433_4562">----------------------------------------------------------------------<br clear="none"><br clear="none">Message: 1<br clear="none">Date: Tue, 12 Aug 2014 08:40:21 -0600<br clear="none">From: Dennis Shea &lt;<a rel="nofollow" shape="rect" ymailto="mailto:shea@ucar.edu" target="_blank" href="mailto:shea@ucar.edu">shea@ucar.edu</a>&gt;<br clear="none">Subject: Re: [ncl-talk] Calculating Geostrophic Winds in the WRF using<br clear="none">&nbsp;&nbsp;&nbsp; NCL<br clear="none">To: "brianjs @iastate.edu" &lt;<a rel="nofollow" shape="rect" id="yiv1840507268yui_3_16_0_1_1407868603433_4582" ymailto="mailto:brianjs@iastate.edu" target="_blank" href="mailto:brianjs@iastate.edu">brianjs@iastate.edu</a>&gt;<br clear="none">Cc: "<a rel="nofollow" shape="rect"
 ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>" &lt;<a rel="nofollow" shape="rect" id="yiv1840507268yui_3_16_0_1_1407868603433_4574" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;,&nbsp;&nbsp;&nbsp; "<a rel="nofollow" shape="rect" id="yiv1840507268yui_3_16_0_1_1407868603433_4581" ymailto="mailto:wrfhelp@ucar.edu" target="_blank" href="mailto:wrfhelp@ucar.edu">wrfhelp@ucar.edu</a>"<br clear="none">&nbsp;&nbsp;&nbsp; &lt;<a rel="nofollow" shape="rect" ymailto="mailto:wrfhelp@ucar.edu" target="_blank" href="mailto:wrfhelp@ucar.edu">wrfhelp@ucar.edu</a>&gt;<br clear="none">Message-ID:<br clear="none">&nbsp;&nbsp;&nbsp; &lt;CAOF1d_6qe3mMyK=<a rel="nofollow" shape="rect" ymailto="mailto:p_62sMYgmvnmqmCBS7hGXX9nZwLWGAhR7OQ@mail.gmail.com" target="_blank"
 href="mailto:p_62sMYgmvnmqmCBS7hGXX9nZwLWGAhR7OQ@mail.gmail.com">p_62sMYgmvnmqmCBS7hGXX9nZwLWGAhR7OQ@mail.gmail.com</a>&gt;<br clear="none">Content-Type: text/plain; charset="utf-8"<br clear="none"><br clear="none">Brian,<br clear="none"><br clear="none">wrfhelp is being cc'd. They are the WRF experts and may know how to compute<br clear="none">geostrophic winds.<br clear="none"><br clear="none">===<br clear="none"><br clear="none">You have obviously put a lot of work into trying to derive
 geostrophic<br clear="none">winds from WRF variables. Unfortunately, the steps you have used will not<br clear="none">return the results you wish. A few comments:<br clear="none"><br clear="none">[0]<br clear="none">The ftp area was 100% full. Thus, your files could not be accommodated. The<br clear="none">IT people have cleaned up the ftp file system. That said, transmitting 9GB<br clear="none">file(s) is not commonly done for ncl-talk related questions. You should use<br clear="none">tools (say, netCDF operators or NCL) to subset the data. For example, only<br clear="none">one time step.<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ncks -O -d Time,0 WrfBigFile.nc&nbsp; WrfLittleFile.nc<br clear="none"><br clear="none">[1]<br clear="none">z2geos works *only* for rectilinear grids with variables on isobaric<br clear="none">levels. The documentation has been changed to make this more explicit.<br clear="none"><br
 clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/z2geouv.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/z2geouv.shtml</a><br clear="none"><br clear="none">**Generally,** WRF grids are
 curvilinear. The following operation does<br clear="none">*not* make make a curvilinear grid and rectilinear grid<br clear="none"><br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lat&nbsp; = f-&gt;XLAT(0,:,0)&nbsp; &nbsp; &nbsp; &nbsp; ; lat(south_north)<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lon&nbsp; = f-&gt;XLONG(0,0,:)&nbsp; &nbsp; ; lon(west_east)<br clear="none"><br clear="none">Yes, lat and lon are one-dimensional BUT they do not represent a<br clear="none">rectilinear grid orientation.<br clear="none">Use of the above lat &amp; lon would be erroneous. You will get numbers but<br clear="none">they are not the correct numbers.<br clear="none"><br clear="none">[2]<br clear="none">Using, say, the ESMF regridding to interpolate the WRF curvilinear gridded<br clear="none">data to a rectilinear grid is a possibility *if* working with data on a<br clear="none">rectilinear grid is
 adequate for the problem you wish to address.<br clear="none"><br clear="none">[a] Attached is a simple (*untested*) function that will interpolate a WRF<br clear="none">(mass) variable on eta levels to user specified
 isobaric levels;.<br clear="none"><br clear="none">&nbsp; &nbsp;  function eta2isop_wrf(fwrf, varName[1]:string, prs_iso[*]:numeric \<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ,itime:integer, linlog[1]:integer,<br clear="none">opt[1]:logical)<br clear="none">&nbsp; Usage:<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; f = addfile(...)&nbsp; &nbsp; , or,&nbsp;  f = addfiles(...)<br clear="none"><br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; plev = (/ 1000,925,850,700,600,500,400,300,250 \&nbsp;  ; integer,<br clear="none">float, double<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,&nbsp; 200,150,100,70,50/)<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; plev!0&nbsp; &nbsp;  = "plev"<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; <a rel="nofollow" shape="rect" ymailto="mailto:plev@units" target="_blank"
 href="mailto:plev@units">plev@units</a> = "hPa"<br clear="none"><br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; linlog = 0<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; itime&nbsp; = -1<br clear="none">&nbsp; &nbsp; &nbsp; &nbsp; z_iso = eta2isop_wrf(f, "geopotential",
 plev, itime, linlog, False)<br clear="none"><br clear="none">[b] You could now use z2geouv to calculate the geostrophic components<br clear="none"><br clear="none">[c] Unfortunately, reinterpolating the components [b] back to the WRF grid<br clear="none">will not yield geostrophic winds.<br clear="none"><br clear="none">===<br clear="none">Hopefully, wrfhelp can provide some information or talk with your advisor.<br clear="none"><br clear="none">Good Luck<br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none"><br clear="none">On Mon, Aug 11, 2014 at 8:55 PM, brianjs @iastate.edu &lt;<a rel="nofollow" shape="rect" ymailto="mailto:brianjs@iastate.edu" target="_blank" href="mailto:brianjs@iastate.edu">brianjs@iastate.edu</a>&gt;<br clear="none">wrote:<br clear="none"><br clear="none">&gt; Good Evening,<br clear="none">&gt;<br clear="none">&gt; I am attempting to calculate both the u and v components of the<br
 clear="none">&gt; geostrophic winds in the WRF.<br clear="none">&gt;<br clear="none">&gt; The function z2geouv (which calculates both components using the<br clear="none">&gt; geopotential height, as well as the latitude and longitude of gridded data)<br clear="none">&gt; must utilize the geopotential height on a constant pressure surface. WRF<br clear="none">&gt; data however, is on constant eta
 levels/terrain following coordinates, and<br clear="none">&gt; as such, this function applied to WRF data could only work if data is<br clear="none">&gt; converted to a constant pressure surface from its original eta coordinate<br clear="none">&gt; system.<br clear="none">&gt;<br clear="none">&gt; Attached is the WRF code with issues. I have attempted to calculate the<br clear="none">&gt; geostrophic wind components (ug and vg) by using the z2geouv with a height<br clear="none">&gt; variable that has been interpolated on to a constant pressure coordinate<br clear="none">&gt; (z_const_p). I first attempted to interpolate z_const_p with a geopotential<br clear="none">&gt; height variable that was not terrain following (z_model). When I do this, I<br clear="none">&gt; get realistic values for the geostrophic wind components, but I obviously<br clear="none">&gt; would not get the lower levels (below 1000 generally) to be interpolated. I<br clear="none">&gt;
 also interpolated z_const_p with an original terrain following geostrophic<br clear="none">&gt; height or geostrophic height above ground level (AGLheight_model), but
 then<br clear="none">&gt; unrealistic answers followed.<br clear="none">&gt;<br clear="none">&gt; I have also taken a similar approach by calculating the ug and vg<br clear="none">&gt; components separately without using z2geouv, but I am still getting<br clear="none">&gt; unrealistic answers.<br clear="none">&gt;<br clear="none">&gt; I wish to implement this routine in order to plot the geostrophic winds on<br clear="none">&gt; maps of constant height (above ground level) hence the ug/vg interpolations<br clear="none">&gt; thereafter to constant height levels<br clear="none">&gt;<br clear="none">&gt; For reference, I sent the used RUC and WRF output to the ncl-talk FTP<br clear="none">&gt; account given their large size. I did get the message "451 Failure writing<br clear="none">&gt; to local file" so I am not sure if they made it over there successfully.<br clear="none">&gt; The wrf file is rather large (approximately 9 GB) so maybe the account<br
 clear="none">&gt; could not hold it?<br clear="none">&gt;<br clear="none">&gt; I was wondering if someone could guide me to improve this code to get<br clear="none">&gt; geostrophic winds interpolated on constant height fields from an
 original<br clear="none">&gt; terrain following (eta) coordinate system (i.e. 200-2000 m at 100 m<br clear="none">&gt; intervals), or if someone could assist by making a recommendation for an<br clear="none">&gt; alternate approach?&nbsp; I have also attached my RUC code for plotting RUC<br clear="none">&gt; Analysis geostrophic winds along with some sample images of what I believe<br clear="none">&gt; the WRF profile should look generally like (as the RUC data is already on<br clear="none">&gt; constant pressure surface).<br clear="none">&gt;<br clear="none">&gt; Any suggestions would be greatly appreciated!<br clear="none">&gt;<br clear="none">&gt; Brian Squitieri<br clear="none">&gt; Graduate Research Assistant<br clear="none">&gt; Iowa State University<br clear="none">&gt;<br clear="none">&gt; _______________________________________________<br clear="none">&gt; ncl-talk mailing list<br clear="none">&gt; List instructions, subscriber options,
 unsubscribe:<br clear="none">&gt; <a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">&gt;<br clear="none">&gt;<br clear="none">-------------- next part --------------<br clear="none">An
 HTML attachment was scrubbed...<br clear="none">URL: <a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140812/55e862dc/attachment-0001.html">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140812/55e862dc/attachment-0001.html </a><br clear="none">-------------- next part --------------<br clear="none">A non-text attachment was scrubbed...<br clear="none">Name: eta2iso_wrf.ncl<br clear="none">Type: application/octet-stream<br clear="none">Size: 1638 bytes<br clear="none">Desc: not available<br clear="none">Url : <a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140812/55e862dc/attachment-0001.obj">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140812/55e862dc/attachment-0001.obj </a><br clear="none"><br clear="none"></div>  </div> </div>  </div></div> </div></div></div></div></body></html>