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't see any "set lev" 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 > 100)<br>...<br>...<br>...<br>zlev = zlev - dp*i (where dp is your pressure change between levels...hopefully it is constant. If it isn't there'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"><<a href="mailto:geeta124@hotmail.com">geeta124@hotmail.com</a>></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>'open test.ctl'<br>
*'set lev 1000 100'<br>'set t 1'<br> * while (lev< 100)<br>*zlev=1000<br>'set gxout fwrite'<br>'set fwrite test.dat'<br> zlev =1000<br>'define tvk=tk(lev='zlev')+0.61*QVAPOR(lev='zlev')*tk(lev='zlev')'<br>
'd tvrh2q(tvk(lev='zlev'),rh(lev='zlev'))'<br>************<br> zlev =950<br>'define tvk=tk(lev='zlev')+0.61*QVAPOR(lev='zlev')*tk(lev='zlev')'<br>'d tvrh2q(tvk(lev='zlev'),rh(lev='zlev'))' <br>
*'disable fwrite'<br>*****************<br> zlev =900<br>'define tvk=tk(lev='zlev')+0.61*QVAPOR(lev='zlev')*tk(lev='zlev')'<br>'d tvrh2q(tvk(lev='zlev'),rh(lev='zlev'))' <br>
'disable fwrite'<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>