Geeta,<br>The documentation on the tvrh2q function says that it will assume it is at the pressure level of the current dimension environment.  I don&#39;t see any &quot;set lev&quot; commands that are uncommented, so one of the reasons you are not getting the data is probably because your pressure level is not set correctly.  Nonetheless, I should think the while loop should work just fine, but you need to be careful how you set your limits.  If you want to go from low levels to upper levels, your while statement should look something like<br>
<br>i = 1 ; zlev = 1000<br>while (zlev &gt; 100)<br>...<br>...<br>...<br>zlev = zlev - dp*i    (where dp is your pressure change between levels...hopefully it is constant.  If it isn&#39;t there&#39;s another way to do this)<br>
i = i + 1<br>endwhile<br><br>Try that and see if it works.<br><br>Jeff Duda<br><br><div class="gmail_quote">On Mon, Oct 25, 2010 at 3:53 AM, Geeta Geeta <span dir="ltr">&lt;<a href="mailto:geeta124@hotmail.com">geeta124@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div>
Dear All, <br>I am trying to extract the SPECIFIC HUMIDITY for all the levels in vertical (19 Levels from 1000 to 100hPa) from the Model. <br>So I am Using tvrh2q function of Grads. Following is the ctl file. <br><br>&#39;open test.ctl&#39;<br>
*&#39;set lev 1000 100&#39;<br>&#39;set t 1&#39;<br> * while (lev&lt; 100)<br>*zlev=1000<br>&#39;set gxout fwrite&#39;<br>&#39;set fwrite test.dat&#39;<br> zlev =1000<br>&#39;define tvk=tk(lev=&#39;zlev&#39;)+0.61*QVAPOR(lev=&#39;zlev&#39;)*tk(lev=&#39;zlev&#39;)&#39;<br>
&#39;d tvrh2q(tvk(lev=&#39;zlev&#39;),rh(lev=&#39;zlev&#39;))&#39;<br>************<br> zlev =950<br>&#39;define tvk=tk(lev=&#39;zlev&#39;)+0.61*QVAPOR(lev=&#39;zlev&#39;)*tk(lev=&#39;zlev&#39;)&#39;<br>&#39;d tvrh2q(tvk(lev=&#39;zlev&#39;),rh(lev=&#39;zlev&#39;))&#39; <br>
*&#39;disable fwrite&#39;<br>*****************<br> zlev =900<br>&#39;define tvk=tk(lev=&#39;zlev&#39;)+0.61*QVAPOR(lev=&#39;zlev&#39;)*tk(lev=&#39;zlev&#39;)&#39;<br>&#39;d tvrh2q(tvk(lev=&#39;zlev&#39;),rh(lev=&#39;zlev&#39;))&#39; <br>
&#39;disable fwrite&#39;<br>***********************<br><br>* endwhile<br><br>I am Unable to Extract the data Using the While Statement in Grads, so I am defining the Zlev separately . <br><br>Kindly Suggest. <br>geeta<br>
<br>                                               </div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>