<div dir="ltr">Hi, Bill<div><br></div><div>Sorry for my late reply. Your solution works very well. I can set the y tickmark to standard pressure now.</div><div><br></div><div>The latitude and longitude tickmark in the cross section are also hard to set, they are not in standard degree such as 5N,10N. Hopefully, NCL can improve the tickmark setting. </div><div><br></div><div>Thank you very much</div><div><br></div><div>Richard</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 27, 2017 at 4:16 PM, Bill Ladwig <span dir="ltr"><<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@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">Hi Richard,<div><br></div><div>An easy way to modify the routine without breaking your installation is to create a new file (e.g. myfile.ncl), then copy the wrf_user_intrp3d routine from WRFUserARW.ncl in to this file.  Modify your copy of wrf_user_intrp3d to set the levels that you want.  This will be around line 370, and the current code looks like:</div><div><br></div><div>







<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">;<span class="m_7384829417352235424gmail-Apple-converted-space">  </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">interp</span> to constant z grid<br><span class="m_7384829417352235424gmail-Apple-converted-space">     </span>if(var2dz(0,0) .<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">gt</span>. var2dz(1,0) ) then<span class="m_7384829417352235424gmail-Apple-converted-space">  </span>; monotonically decreasing coordinate<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_max = floor(max(z)/10)*10 <span class="m_7384829417352235424gmail-Apple-converted-space">    </span>; bottom value<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_min = <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">ceil</span>(<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">min</span>(z)/10)*10<span class="m_7384829417352235424gmail-Apple-converted-space">      </span>; top value<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz</span> = 10<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">nlevels</span> = <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">tointeger</span>( (z_max-z_min)/<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz</span>)<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_var2d = new( (/<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">nlevels</span>/), <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">typeof</span>(z))<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_var2d(0) = z_max<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz</span> = -<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz<br></span><span class="m_7384829417352235424gmail-Apple-converted-space">     </span>else<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_max = max(z)<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_min = 0.<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz</span> = 0.01 * z_max<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span><span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">nlevels</span> = <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">tointeger</span>( z_max/<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz</span> )<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_var2d = new( (/<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">nlevels</span>/), <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">typeof</span>(z))<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_var2d(0) = z_min<br><span class="m_7384829417352235424gmail-Apple-converted-space">     </span>end if<br><span class="m_7384829417352235424gmail-Apple-converted-space">  <br></span><span class="m_7384829417352235424gmail-Apple-converted-space">     </span>do i=1, <span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">nlevels</span>-1<br><span class="m_7384829417352235424gmail-Apple-converted-space">        </span>z_var2d(i) = z_var2d(0)+i*<span class="m_7384829417352235424gmail-s1" style="text-decoration:underline">dz<br></span><span class="m_7384829417352235424gmail-Apple-converted-space">     </span>end do</blockquote>



















</div><div><br></div><div>You'll want to set z_var2d to be the levels that you want, and comment out the rest.  Hopefully everything else will just work.  Finally, at the top of your plotting script, do:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">load "/path/to/myfile.ncl"</blockquote><div><br></div><div>where the "/path/to" is the path to where the myfile.ncl is located on your system.  As long as you have the "undef("wrf_user_intrp3d")" above your definition of wrf_user_intrp3d in myfile.ncl, this will clobber the WRFUserARW.ncl version.  Note that in recent versions of NCL, WRFUserARW.ncl is loaded by default, so you don't need load statements for it anymore.  The only load statement you should need is the one shown above.</div>







<div><br></div><div>The ability to set your own cross section levels will be coming in a future release.  Currently wrf-python supports this, but it needs to get ported back to NCL.  </div><div><br></div><div>Hope this helps,</div><div><br></div><div>Bill</div>







</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Nov 23, 2017 at 10:07 PM, music piano <span dir="ltr"><<a href="mailto:musicpianoljy@gmail.com" target="_blank">musicpianoljy@gmail.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 class="m_7384829417352235424HOEnZb"><div class="m_7384829417352235424h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_quote"><br><br><div dir="ltr">Hi, Everyone<div><br></div><div>Example is here</div><div><a href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/CROSS_SECTION/wrf_CrossSection3.htm" target="_blank">http://www2.mmm.ucar.edu/wrf/O<wbr>nLineTutorial/Graphics/NCL/Exa<wbr>mples/CROSS_SECTION/wrf_CrossS<wbr>ection3.htm</a><br></div><div><br></div><div>The tickmarks here are 1010, 960, 910...... But I want standard levels such as 1000, 950, 900.....</div><div><br></div><div>My analysis of the code is as follow: <br></div><div>(1)</div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">rh_plane = wrf_user_intrp3d(rh,p,"v",plan<wbr>e,0.,opts)</span><br></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">It interpolates the data into pressure coordinate. However, the pressure levels are not standard levels as I check the subroutine "</span><font color="#000000"><span style="white-space:pre-wrap">WRFUserARW.ncl"</span></font><span style="color:rgb(0,0,0);white-space:pre-wrap"> . It begins with the highest pressure from the bottom, not from 1000. Thus, the tickmark position represents nonstandard pressure</span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">(2) </span><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0);white-space:pre-wrap">opts_xy@tmYLMode                = "Explicit"</span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0);white-space:pre-wrap">opts_xy@tmYLValues              = fspan(0,zspan,nz)                    </span><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0);white-space:pre-wrap">opts_xy@tmYLLabels              = sprintf("%.0f",fspan(zmin,zmax<wbr>,nz)) </span></div><div><span style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">give labels to each tickmark position. Since the tickmark position is not in standard pressure, it shows 1010, 960.....</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap"> </span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">I have tried to use @ </span></font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;white-space:pre-wrap">tmYLMode  ="Manual" </span><span style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13.3333px"> </span><em style="margin:0px;padding:0px;text-decoration-line:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13.3333px"><a href="https://www.ncl.ucar.edu/Document/Graphics/Resources/tm.shtml#tmYLTickStartF" style="margin:0px;padding:0px;text-decoration-line:none;color:rgb(133,45,133);font-family:verdana,sans-serif;font-size:13.3333px" target="_blank">tmYLTickStartF</a> </em><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;white-space:pre-wrap">, or set </span><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">trXMaxF </span></font><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;white-space:pre-wrap">   , none of them works. They still plot tickmark position.</span></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;white-space:pre-wrap">I can possibly modify </span><span style="color:rgb(0,0,0);white-space:pre-wrap">"</span><font color="#000000"><span style="white-space:pre-wrap">WRFUserARW.ncl to let it interpolation to standard levels, but that may require reinstalling NCL in the machine, which is hard.</span></font></div><div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">Does anyone know how to produce tickmarks which specify the standard pressure value? </span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">Thank you very much</span></font></div><div><font color="#000000" face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">Richard </span></font></div></div>
</div><br></div>
</div><br></div>
</div></div><br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>