<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dear sir/madam<div><br></div><div>I need to get the data for precip in txt or csv format on the basis of Lat, Lon and Time in the single file by using OpenGrads. I use fprintf command in OpenGrads.</div><div>The output must be like this; (for example)</div><div><br></div><div>Lat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Lon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Year &nbsp; &nbsp;Month &nbsp; &nbsp;Day &nbsp; &nbsp;Precipitation</div><div>26.875 &nbsp; &nbsp;85.125 &nbsp; &nbsp; &nbsp;2007 &nbsp; &nbsp; Jan &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp;0.00256</div><div><br></div><div><br></div><div><br></div><div>Please guide me ahead.<br><br>--- On <b>Thu, 11/3/11, gradsusr-request@gradsusr.org <i>&lt;gradsusr-request@gradsusr.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From:
 gradsusr-request@gradsusr.org &lt;gradsusr-request@gradsusr.org&gt;<br>Subject: gradsusr Digest, Vol 21, Issue 10<br>To: gradsusr@gradsusr.org<br>Date: Thursday, November 3, 2011, 8:33 PM<br><br><div class="plainMail">Send gradsusr mailing list submissions to<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>&nbsp;&nbsp;&nbsp; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>or, via email, send a message with subject or body 'help' to<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:gradsusr-request@gradsusr.org" href="/mc/compose?to=gradsusr-request@gradsusr.org">gradsusr-request@gradsusr.org</a><br><br>You can reach the person managing the list at<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:gradsusr-owner@gradsusr.org"
 href="/mc/compose?to=gradsusr-owner@gradsusr.org">gradsusr-owner@gradsusr.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of gradsusr digest..."<br><br><br>Today's Topics:<br><br>&nbsp;&nbsp;&nbsp;1. Re: Finding the maximum value of Ri in a single grid&nbsp;&nbsp;&nbsp; point<br>&nbsp; &nbsp; &nbsp; (Jeffrey Duda)<br>&nbsp;&nbsp;&nbsp;2. Shp File Output (Andrew Revering)<br>&nbsp;&nbsp;&nbsp;3. Re: time stamp on map (saeed bayat)<br>&nbsp;&nbsp;&nbsp;4. Re: time stamp on map (saeed bayat)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 3 Nov 2011 18:46:22 -0500<br>From: Jeffrey Duda &lt;<a ymailto="mailto:jdduda@iastate.edu" href="/mc/compose?to=jdduda@iastate.edu">jdduda@iastate.edu</a>&gt;<br>Subject: Re: [gradsusr] Finding the maximum value of Ri in a single<br>&nbsp;&nbsp;&nbsp; grid&nbsp;&nbsp;&nbsp; point<br>To: GrADS Users
 Forum &lt;<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;CAP9LQ-WwHhZo-40TvQRj8KJzTTAWuw+<a ymailto="mailto:ub9LVLoqnWmqsyKcT-g@mail.gmail.com" href="/mc/compose?to=ub9LVLoqnWmqsyKcT-g@mail.gmail.com">ub9LVLoqnWmqsyKcT-g@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset="iso-8859-1"<br><br>The problem is that there is a difference between grids that can be<br>displayed and script variables.&nbsp; They can't be handled the same way.&nbsp; You<br>can't use if statements using displayed fields.&nbsp; What you need to do is to<br>save the output of each computation in your script to a script variable<br>using the subwrd command.&nbsp; Here is an example:<br><br>'define th1 = temp * (pow(100000 / press , (0.286)))'<br>th1 = subwrd(result,4)<br><br>Hopefully you've noticed this before, but when you enter a display command<br>at the Grads
 prompt, there will be a small amount of text output.&nbsp; If you<br>display a variable with all of the dimensions in your environment fixed,<br>the text will include the value of the field you are displaying.&nbsp; What<br>subwrd does is grab the fourth word in the string variable "result".<br>"result" is automatically assigned each time a display command is run, so<br>that's why you don't see it being assigned anywhere else.&nbsp; NOTE: for some<br>data sets and for some environment settings, Grads will interpolate the<br>output before displaying, so the text output from the display command will<br>read<br><br>"Note: interpolating variable...<br>Result value: _____"<br><br>In that case you'll need to use the sublin command first:<br>line = sublin(result,2)<br>th1 = subwrd(line,4)<br>This tells Grads to nab the second line of the output from the result<br>variable (result includes all of the text output from the display<br>command).&nbsp; Then you use
 subwrd to nab the 4th word of the string variable<br>"line".&nbsp; When you do this, you'll have the fields you want as Grads<br>scripting variables.&nbsp; Then you can run if statements on them.&nbsp; To output<br>the value of a Grads script variable, use the say command:<br>say th1 OR<br>say "th1 = "th1<br><br>ON THE OTHER HAND, you can do this without using any scripting variables.<br>In this case use the max/min and maxloc/minloc functions.&nbsp; Then your script<br>would look something like this:<br><br>'set lev 'botlevel' 'toplevel<br><br> 'define th1 = temp * (pow(100000 / press , (0.286)))'<br>'define u1 = u'<br> 'define v1 = v'<br>'define z1 = geopot/9.81'<br><br> 'define th2 = temp(z-1) * (pow(100000 / press(z-1) , (0.286)))'<br>'define u2 = u(z-1)'<br> 'define v2 = v(z-1)'<br>'define z2 = geopot(z-1)/9.81'<br><br>'define<br>ri=9.81/(0.5*th1+th2)*(th2-th1)/(pow((u2-u1),2)+pow((v2-v1),2))*(z2-z1)'<br><br>'d ri'<br>say result<br><br>'d
 min(ri,lev='botlev',lev='toplev')'<br>'d minloc(ri,lev='botlev',lev='toplev')'<br>'d max(ri,lev='botlev',lev='toplev')'<br>'d maxloc(ri,lev='botlev',lev='toplev')'<br><br>Carefully follow the location of the single quotes and note that there is<br>no while loop here.&nbsp; Also note the (z-1) appended to the *2 variables to<br>represent the field one level below the current level.&nbsp; The whole quote<br>thing confuses some people, so that's understandable.&nbsp; Try this and see if<br>it works.&nbsp; Ask if you have any questions.&nbsp; Good luck.<br><br>Jeff Duda<br><br>On Thu, Nov 3, 2011 at 5:23 AM, Lippo Nester &lt;<a ymailto="mailto:liikkuvattaakse@gmail.com" href="/mc/compose?to=liikkuvattaakse@gmail.com">liikkuvattaakse@gmail.com</a>&gt;wrote:<br><br>&gt; Hi!<br>&gt;<br>&gt; I've been trying to create my very first GrADS-script. The script should<br>&gt; compute values of the bulk Richardson number in a specific grid point<br>&gt; between
 predefined model levels and then find the minimum value of Ri and<br>&gt; probably the model level associated with it.<br>&gt;<br>&gt; I tried to do this using while and if loops, but for some reason it's not<br>&gt; working as I expected. Maybe I can't understand handling variables in GrADS?<br>&gt;<br>&gt; In this script the top and the bottom model layers are set to 40 and 50.<br>&gt; Ri is computed and I get a list of the Ri at different levels, and they<br>&gt; seem to be ok. However the variable "minri" gets always the value of ri at<br>&gt; the lowest model level (here: ri at level 50). Variable "minlevel" is<br>&gt; always the highest model level (here: level 40)!<br>&gt;<br>&gt; When count is 40 at the first step of the while-loop, the value of ri<br>&gt; should be saved into variable minri and the model level at minlev. After<br>&gt; that, if ri &lt; minri at lower levels (count &gt; 40), values of minri and<br>&gt; minlev should be varied by
 the second if-loop...<br>&gt;<br>&gt; Is there a more simple or more correct way to do this? I thought max()<br>&gt; can't make it...<br>&gt;<br>&gt; Any help is much appreciated!<br>&gt;<br>&gt; Best regards, Lippo<br>&gt;<br>&gt; (version of GrADS 2.0.a1)<br>&gt;<br>&gt; 'set lat 50.00'<br>&gt; 'set lon 10.00'<br>&gt; botlevel=50<br>&gt; toplevel=40<br>&gt;<br>&gt; count=toplevel<br>&gt;<br>&gt; while (count &lt;= botlevel)<br>&gt;<br>&gt; 'set lev 'count<br>&gt;&nbsp; 'define th1 = temp * (pow(100000 / press , (0.286)))'<br>&gt; 'define u1 = u'<br>&gt;&nbsp; 'define v1 = v'<br>&gt; 'define z1 = geopot/9.81'<br>&gt;<br>&gt; 'set lev 'count - 1<br>&gt;&nbsp; 'define th2 = temp * (pow(100000 / press , (0.286)))'<br>&gt; 'define u2 = u'<br>&gt;&nbsp; 'define v2 = v'<br>&gt; 'define z2 = geopot/9.81'<br>&gt;<br>&gt; 'define<br>&gt; ri=9.81/(0.5*th1+th2)*(th2-th1)/(pow((u2-u1),2)+pow((v2-v1),2))*(z2-z1)'<br>&gt;<br>&gt; 'd 'ri<br>&gt; say result *THIS
 SEEMS TO WORK AS I GET 10 DIFFERENT VALUES OF RI<br>&gt;<br>&gt; if (count = toplevel) *THESE IF-LOOPS AREN'T OKAY, BUT WHY?<br>&gt; minri = ri<br>&gt;&nbsp; minlevel = count<br>&gt; endif<br>&gt;<br>&gt; if (ri &lt; minri)<br>&gt;&nbsp; minri = ri<br>&gt; minlevel = count<br>&gt; endif<br>&gt;<br>&gt; count = count+1<br>&gt; endwhile<br>&gt;<br>&gt; 'd 'minri<br>&gt; say "Min Ri " result *ALWAYS THE VALUE OF RI AT LEVEL 50 (AT THE BOTTOM<br>&gt; LEVEL)<br>&gt; 'd 'minlevel<br>&gt; say "Model level " result *ALWAYS LEVEL 40 (TOP LEVEL)<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; gradsusr mailing list<br>&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;<br>&gt;<br><br><br>-- <br>Jeff Duda<br>Iowa State
 University<br>Meteorology Graduate Student<br>www.meteor.iastate.edu/~jdduda &lt;<a href="http://www.meteor.iastate.edu/%7Ejdduda" target="_blank">http://www.meteor.iastate.edu/%7Ejdduda</a>&gt;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20111103/26251ce0/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20111103/26251ce0/attachment-0001.html</a> <br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 3 Nov 2011 22:09:18 -0500<br>From: Andrew Revering &lt;<a ymailto="mailto:andy@f5data.com" href="/mc/compose?to=andy@f5data.com">andy@f5data.com</a>&gt;<br>Subject: [gradsusr] Shp File Output<br>To: GrADS User List &lt;<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp;
 &lt;CAHXC6utdKDzEXF_0B-fM1soXTeHrX7eOcs+mBWOopjK_=<a ymailto="mailto:sJFQg@mail.gmail.com" href="/mc/compose?to=sJFQg@mail.gmail.com">sJFQg@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset="iso-8859-1"<br><br>Is it possible to adjust the amount of smoothing done to SHP output<br>polygons?<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20111103/7001c529/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20111103/7001c529/attachment-0001.html</a> <br><br>------------------------------<br><br>Message: 3<br>Date: Fri, 4 Nov 2011 11:17:54 +0330<br>From: saeed bayat &lt;<a ymailto="mailto:saeedbayat7276@gmail.com" href="/mc/compose?to=saeedbayat7276@gmail.com">saeedbayat7276@gmail.com</a>&gt;<br>Subject: Re: [gradsusr] time stamp on map<br>To: GrADS Users Forum &lt;<a ymailto="mailto:gradsusr@gradsusr.org"
 href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;CAAVavjqtYo7a=VkXr9rzxLfuf=<a ymailto="mailto:rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com" href="/mc/compose?to=rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com">rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset="iso-8859-1"<br><br>Dear Sytske,<br>Suppose you have a nc data for a month with 30 timestep(daily). Try like<br>this:<br>ti = 1<br>while ti &lt;= 31<br>open your file and do whatever you want<br> 'q time'<br>&nbsp; &nbsp; res = subwrd(result,3)<br>&nbsp; &nbsp; basedate = substr(res,4,12)<br>&nbsp; &nbsp; basetime = substr(res,1,3)<br>&nbsp; &nbsp; res = subwrd(result,6)<br>&nbsp; &nbsp; baseday=substr(res,1,3)<br>draw&nbsp; title whatever you want-['basedate'-'basetime']'<br> 'printim whatever you want-'ti'-'basedate'-'basetime'.gif x1300 y1000<br>white'<br>&nbsp; &nbsp; ti = ti +
 1<br>ENDWHILE<br>say<br><br>Good Luck<br><br>Saeed Bayat<br>M.A Student of Climatology<br>Department of Geography<br>Ferdowsi University of Mashhad(FUM) - Iran<br><br>On Thu, Nov 3, 2011 at 7:23 PM, Sytske Kimball &lt;<a ymailto="mailto:SKimball@usouthal.edu" href="/mc/compose?to=SKimball@usouthal.edu">SKimball@usouthal.edu</a>&gt;wrote:<br><br>&gt;&nbsp; All,<br>&gt;<br>&gt; When drawing a map, does anyone know how to draw the date/time on it for<br>&gt; which<br>&gt; the map is valid (as defined in the .ctl file)?<br>&gt;<br>&gt; Thanks in advance for your help,<br>&gt; Sytske<br>&gt;<br>&gt;<br>&gt;<br>&gt; Sytske (seets-kah) Kimball<br>&gt; Professor of Meteorology<br>&gt; Director, USA Mesonet<br>&gt; Dept. of Earth Sciences<br>&gt; University of South Alabama<br>&gt; Mobile, AL<br>&gt; phone (251) 460-7031<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; or (251) 445-4294<br>&gt; fax&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;(251) 460-7886<br>&gt;
 email&nbsp;&nbsp;&nbsp;<a ymailto="mailto:skimball@usouthal.edu" href="/mc/compose?to=skimball@usouthal.edu">skimball@usouthal.edu</a><br>&gt; web:&nbsp;&nbsp;&nbsp;<a href="http://chiliweb.southalabama.edu/" target="_blank">http://chiliweb.southalabama.edu/</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; gradsusr mailing list<br>&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;<br>&gt;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20111104/c3d676cd/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20111104/c3d676cd/attachment-0001.html</a>
 <br><br>------------------------------<br><br>Message: 4<br>Date: Fri, 4 Nov 2011 11:20:41 +0330<br>From: saeed bayat &lt;<a ymailto="mailto:saeedbayat7276@gmail.com" href="/mc/compose?to=saeedbayat7276@gmail.com">saeedbayat7276@gmail.com</a>&gt;<br>Subject: Re: [gradsusr] time stamp on map<br>To: GrADS Users Forum &lt;<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;<a ymailto="mailto:CAAVavjrV6U_USQb-U7o8_Tk0d67W_EQ2T90pDNgHcG4A3z-tsg@mail.gmail.com" href="/mc/compose?to=CAAVavjrV6U_USQb-U7o8_Tk0d67W_EQ2T90pDNgHcG4A3z-tsg@mail.gmail.com">CAAVavjrV6U_USQb-U7o8_Tk0d67W_EQ2T90pDNgHcG4A3z-tsg@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset="iso-8859-1"<br><br>My opologize,<br>you should correct this line:<br>while ti &lt;= 30<br><br><br><br>On Thu, Nov 3, 2011 at 7:23 PM, Sytske Kimball &lt;<a ymailto="mailto:SKimball@usouthal.edu"
 href="/mc/compose?to=SKimball@usouthal.edu">SKimball@usouthal.edu</a>&gt;wrote:<br><br>&gt;&nbsp; All,<br>&gt;<br>&gt; When drawing a map, does anyone know how to draw the date/time on it for<br>&gt; which<br>&gt; the map is valid (as defined in the .ctl file)?<br>&gt;<br>&gt; Thanks in advance for your help,<br>&gt; Sytske<br>&gt;<br>&gt;<br>&gt;<br>&gt; Sytske (seets-kah) Kimball<br>&gt; Professor of Meteorology<br>&gt; Director, USA Mesonet<br>&gt; Dept. of Earth Sciences<br>&gt; University of South Alabama<br>&gt; Mobile, AL<br>&gt; phone (251) 460-7031<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; or (251) 445-4294<br>&gt; fax&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;(251) 460-7886<br>&gt; email&nbsp;&nbsp;&nbsp;<a ymailto="mailto:skimball@usouthal.edu" href="/mc/compose?to=skimball@usouthal.edu">skimball@usouthal.edu</a><br>&gt; web:&nbsp;&nbsp;&nbsp;<a href="http://chiliweb.southalabama.edu/" target="_blank">http://chiliweb.southalabama.edu/</a><br>&gt;<br>&gt;
 _______________________________________________<br>&gt; gradsusr mailing list<br>&gt; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>&gt; <a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>&gt;<br>&gt;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20111104/a1137aad/attachment.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20111104/a1137aad/attachment.html</a> <br><br>------------------------------<br><br>_______________________________________________<br>gradsusr mailing list<br><a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=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><br>End of gradsusr Digest, Vol 21, Issue 10<br>****************************************<br></div></blockquote></div></td></tr></table>