<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 Lon Year Month Day Precipitation</div><div>26.875 85.125 2007 Jan 1 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><gradsusr-request@gradsusr.org></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 <gradsusr-request@gradsusr.org><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> <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> <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> <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> <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> 1. Re: Finding the maximum value of Ri in a single grid point<br> (Jeffrey Duda)<br> 2. Shp File Output (Andrew Revering)<br> 3. Re: time stamp on map (saeed bayat)<br> 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 <<a ymailto="mailto:jdduda@iastate.edu" href="/mc/compose?to=jdduda@iastate.edu">jdduda@iastate.edu</a>><br>Subject: Re: [gradsusr] Finding the maximum value of Ri in a single<br> grid point<br>To: GrADS Users
Forum <<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Message-ID:<br> <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>><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. They can't be handled the same way. You<br>can't use if statements using displayed fields. 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. 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. 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. 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. 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). Then you use
subwrd to nab the 4th word of the string variable<br>"line". When you do this, you'll have the fields you want as Grads<br>scripting variables. Then you can run if statements on them. 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. 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. Also note the (z-1) appended to the *2 variables to<br>represent the field one level below the current level. The whole quote<br>thing confuses some people, so that's understandable. Try this and see if<br>it works. Ask if you have any questions. Good luck.<br><br>Jeff Duda<br><br>On Thu, Nov 3, 2011 at 5:23 AM, Lippo Nester <<a ymailto="mailto:liikkuvattaakse@gmail.com" href="/mc/compose?to=liikkuvattaakse@gmail.com">liikkuvattaakse@gmail.com</a>>wrote:<br><br>> Hi!<br>><br>> I've been trying to create my very first GrADS-script. The script should<br>> compute values of the bulk Richardson number in a specific grid point<br>> between
predefined model levels and then find the minimum value of Ri and<br>> probably the model level associated with it.<br>><br>> I tried to do this using while and if loops, but for some reason it's not<br>> working as I expected. Maybe I can't understand handling variables in GrADS?<br>><br>> In this script the top and the bottom model layers are set to 40 and 50.<br>> Ri is computed and I get a list of the Ri at different levels, and they<br>> seem to be ok. However the variable "minri" gets always the value of ri at<br>> the lowest model level (here: ri at level 50). Variable "minlevel" is<br>> always the highest model level (here: level 40)!<br>><br>> When count is 40 at the first step of the while-loop, the value of ri<br>> should be saved into variable minri and the model level at minlev. After<br>> that, if ri < minri at lower levels (count > 40), values of minri and<br>> minlev should be varied by
the second if-loop...<br>><br>> Is there a more simple or more correct way to do this? I thought max()<br>> can't make it...<br>><br>> Any help is much appreciated!<br>><br>> Best regards, Lippo<br>><br>> (version of GrADS 2.0.a1)<br>><br>> 'set lat 50.00'<br>> 'set lon 10.00'<br>> botlevel=50<br>> toplevel=40<br>><br>> count=toplevel<br>><br>> while (count <= botlevel)<br>><br>> 'set lev 'count<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>> 'set lev 'count - 1<br>> 'define th2 = temp * (pow(100000 / press , (0.286)))'<br>> 'define u2 = u'<br>> 'define v2 = v'<br>> 'define z2 = geopot/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 *THIS
SEEMS TO WORK AS I GET 10 DIFFERENT VALUES OF RI<br>><br>> if (count = toplevel) *THESE IF-LOOPS AREN'T OKAY, BUT WHY?<br>> minri = ri<br>> minlevel = count<br>> endif<br>><br>> if (ri < minri)<br>> minri = ri<br>> minlevel = count<br>> endif<br>><br>> count = count+1<br>> endwhile<br>><br>> 'd 'minri<br>> say "Min Ri " result *ALWAYS THE VALUE OF RI AT LEVEL 50 (AT THE BOTTOM<br>> LEVEL)<br>> 'd 'minlevel<br>> say "Model level " result *ALWAYS LEVEL 40 (TOP LEVEL)<br>><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><br><br>-- <br>Jeff Duda<br>Iowa State
University<br>Meteorology Graduate Student<br>www.meteor.iastate.edu/~jdduda <<a href="http://www.meteor.iastate.edu/%7Ejdduda" target="_blank">http://www.meteor.iastate.edu/%7Ejdduda</a>><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 <<a ymailto="mailto:andy@f5data.com" href="/mc/compose?to=andy@f5data.com">andy@f5data.com</a>><br>Subject: [gradsusr] Shp File Output<br>To: GrADS User List <<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Message-ID:<br>
<CAHXC6utdKDzEXF_0B-fM1soXTeHrX7eOcs+mBWOopjK_=<a ymailto="mailto:sJFQg@mail.gmail.com" href="/mc/compose?to=sJFQg@mail.gmail.com">sJFQg@mail.gmail.com</a>><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 <<a ymailto="mailto:saeedbayat7276@gmail.com" href="/mc/compose?to=saeedbayat7276@gmail.com">saeedbayat7276@gmail.com</a>><br>Subject: Re: [gradsusr] time stamp on map<br>To: GrADS Users Forum <<a ymailto="mailto:gradsusr@gradsusr.org"
href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Message-ID:<br> <CAAVavjqtYo7a=VkXr9rzxLfuf=<a ymailto="mailto:rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com" href="/mc/compose?to=rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com">rWrKE6DJW3xW4Pn6u66eoanQ@mail.gmail.com</a>><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 <= 31<br>open your file and do whatever you want<br> 'q time'<br> res = subwrd(result,3)<br> basedate = substr(res,4,12)<br> basetime = substr(res,1,3)<br> res = subwrd(result,6)<br> baseday=substr(res,1,3)<br>draw title whatever you want-['basedate'-'basetime']'<br> 'printim whatever you want-'ti'-'basedate'-'basetime'.gif x1300 y1000<br>white'<br> 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 <<a ymailto="mailto:SKimball@usouthal.edu" href="/mc/compose?to=SKimball@usouthal.edu">SKimball@usouthal.edu</a>>wrote:<br><br>> All,<br>><br>> When drawing a map, does anyone know how to draw the date/time on it for<br>> which<br>> the map is valid (as defined in the .ctl file)?<br>><br>> Thanks in advance for your help,<br>> Sytske<br>><br>><br>><br>> Sytske (seets-kah) Kimball<br>> Professor of Meteorology<br>> Director, USA Mesonet<br>> Dept. of Earth Sciences<br>> University of South Alabama<br>> Mobile, AL<br>> phone (251) 460-7031<br>> or (251) 445-4294<br>> fax (251) 460-7886<br>>
email <a ymailto="mailto:skimball@usouthal.edu" href="/mc/compose?to=skimball@usouthal.edu">skimball@usouthal.edu</a><br>> web: <a href="http://chiliweb.southalabama.edu/" target="_blank">http://chiliweb.southalabama.edu/</a><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>-------------- 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 <<a ymailto="mailto:saeedbayat7276@gmail.com" href="/mc/compose?to=saeedbayat7276@gmail.com">saeedbayat7276@gmail.com</a>><br>Subject: Re: [gradsusr] time stamp on map<br>To: GrADS Users Forum <<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>Message-ID:<br> <<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>><br>Content-Type: text/plain; charset="iso-8859-1"<br><br>My opologize,<br>you should correct this line:<br>while ti <= 30<br><br><br><br>On Thu, Nov 3, 2011 at 7:23 PM, Sytske Kimball <<a ymailto="mailto:SKimball@usouthal.edu"
href="/mc/compose?to=SKimball@usouthal.edu">SKimball@usouthal.edu</a>>wrote:<br><br>> All,<br>><br>> When drawing a map, does anyone know how to draw the date/time on it for<br>> which<br>> the map is valid (as defined in the .ctl file)?<br>><br>> Thanks in advance for your help,<br>> Sytske<br>><br>><br>><br>> Sytske (seets-kah) Kimball<br>> Professor of Meteorology<br>> Director, USA Mesonet<br>> Dept. of Earth Sciences<br>> University of South Alabama<br>> Mobile, AL<br>> phone (251) 460-7031<br>> or (251) 445-4294<br>> fax (251) 460-7886<br>> email <a ymailto="mailto:skimball@usouthal.edu" href="/mc/compose?to=skimball@usouthal.edu">skimball@usouthal.edu</a><br>> web: <a href="http://chiliweb.southalabama.edu/" target="_blank">http://chiliweb.southalabama.edu/</a><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>-------------- 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>