<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thaks lee for your help, now the script works but it does not put all the records of the parameter, how can i do to put all the records of the displayed parameters<br>rgds<br>kai<br><br>--- On <b>Sat, 3/9/13, 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 37, Issue 20<br>To: gradsusr@gradsusr.org<br>Date: Saturday, March 9, 2013, 8:18 AM<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. text file (kombo kai)<br>&nbsp;&nbsp;&nbsp;2. Re: text file (Lee Byerle)<br>&nbsp;&nbsp;&nbsp;3. FW: How to generate .ctl from a .grb file in a grads under<br>&nbsp; &nbsp; &nbsp; windows (T.
 haghroosta)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Sat, 9 Mar 2013 06:00:42 -0800 (PST)<br>From: kombo kai &lt;<a ymailto="mailto:kaikombo@yahoo.com" href="/mc/compose?to=kaikombo@yahoo.com">kaikombo@yahoo.com</a>&gt;<br>Subject: [gradsusr] text file<br>To: <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;<a ymailto="mailto:1362837642.67317.YahooMailClassic@web164005.mail.gq1.yahoo.com" href="/mc/compose?to=1362837642.67317.YahooMailClassic@web164005.mail.gq1.yahoo.com">1362837642.67317.YahooMailClassic@web164005.mail.gq1.yahoo.com</a>&gt;<br>Content-Type: text/plain; charset="iso-8859-1"<br><br>Hi Grads users<br>I have calculated the area and time average of my variables, noe I want to write the out put results in output.txt my codes are as follows<br>'reinit'<br>'c'<br>'open
 d:/vorticity/data2_extraction.ctl'<br>'set lon 0 360'<br>'set lat? -90 90'<br>'set t 1 47'<br>'set z 3'<br>'define vort=hcurl(uwnd1,vwnd2)'<br>'set lon 40'<br>'set lat -22.5'<br>'set z 3'<br>'set t 1 47'<br>*defining the area average vorticity<br>'define avvort=aave(vort,lon=40,lon=70,lat=-22.5,lat=-5)'<br>*dining time average vorticiy va<br>'define mvort=ave(vort,t=1,t=47)'<br>* printing and writing the the text files of the out puts<br>'set gxout print'<br>'set prnopts %10.3e 5 1'<br>*'set prnopts %g 1 1'<br>'d avvort'<br>'d mvort'<br>'retcode1=write('d;/avvort.txt', avvort, 0)'<br>'retcode2=write('d;/mvort.txt', mvort,0)'<br>'retcode1=close(avort.txt)'<br>'retcode2=close(mvort.txt)'<br>but when I run the script I get error in line whcih defines the recode1.<br>I tried several options bur i havent get the output writen to the file I want <br>please any one can help this <br>regards<br>kaikombo<br><br>-------------- next part --------------<br>An HTML
 attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20130309/4d0f4fe1/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20130309/4d0f4fe1/attachment-0001.html</a> <br><br>------------------------------<br><br>Message: 2<br>Date: Sat, 9 Mar 2013 10:15:39 -0600<br>From: Lee Byerle &lt;<a ymailto="mailto:lbyerle@yahoo.com" href="/mc/compose?to=lbyerle@yahoo.com">lbyerle@yahoo.com</a>&gt;<br>Subject: Re: [gradsusr] text file<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: &lt;<a ymailto="mailto:8948EDC2-C1B6-4CF3-9057-C1938ACB6E61@yahoo.com" href="/mc/compose?to=8948EDC2-C1B6-4CF3-9057-C1938ACB6E61@yahoo.com">8948EDC2-C1B6-4CF3-9057-C1938ACB6E61@yahoo.com</a>&gt;<br>Content-Type: text/plain; charset="us-ascii"<br><br>Kaikombo,<br><br>I was able to run your script
 after a few modifications.&nbsp; After displaying avvort and mvort, you can define the output using sublin(result,2).&nbsp; Also, I did not use quotes for the write statements.<br><br>.<br>.<br>.<br>'set gxout print'<br>'set prnopts %10.3e 5 1'<br>'d avvort'<br>var1=sublin(result,2)<br>'d mvort'<br>var2=sublin(result,2)<br>retcode1=write(avvort.txt, var1, 0)<br>retcode2=close(avvort.txt)<br><br>retcode2=write(mvort.txt, var2 ,0)<br>retcode2=close(mvort.txt)<br><br>good luck,<br>Lee<br><br>On Mar 9, 2013, at 8:00 AM, kombo kai wrote:<br><br>&gt; Hi Grads users<br>&gt; I have calculated the area and time average of my variables, noe I want to write the out put results in output.txt my codes are as follows<br>&gt; 'reinit'<br>&gt; 'c'<br>&gt; 'open d:/vorticity/data2_extraction.ctl'<br>&gt; 'set lon 0 360'<br>&gt; 'set lat&nbsp; -90 90'<br>&gt; 'set t 1 47'<br>&gt; 'set z 3'<br>&gt; 'define vort=hcurl(uwnd1,vwnd2)'<br>&gt; 'set lon 40'<br>&gt; 'set lat
 -22.5'<br>&gt; 'set z 3'<br>&gt; 'set t 1 47'<br>&gt; *defining the area average vorticity<br>&gt; 'define avvort=aave(vort,lon=40,lon=70,lat=-22.5,lat=-5)'<br>&gt; *dining time average vorticiy va<br>&gt; 'define mvort=ave(vort,t=1,t=47)'<br>&gt; * printing and writing the the text files of the out puts<br>&gt; 'set gxout print'<br>&gt; 'set prnopts %10.3e 5 1'<br>&gt; *'set prnopts %g 1 1'<br>&gt; 'd avvort'<br>&gt; 'd mvort'<br>&gt; 'retcode1=write('d;/avvort.txt', avvort, 0)'<br>&gt; 'retcode2=write('d;/mvort.txt', mvort,0)'<br>&gt; 'retcode1=close(avort.txt)'<br>&gt; 'retcode2=close(mvort.txt)'<br>&gt; but when I run the script I get error in line whcih defines the recode1.<br>&gt; I tried several options bur i havent get the output writen to the file I want <br>&gt; please any one can help this <br>&gt; regards<br>&gt; kaikombo<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><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20130309/b88c6b7e/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20130309/b88c6b7e/attachment-0001.html</a> <br><br>------------------------------<br><br>Message: 3<br>Date: Sat, 9 Mar 2013 16:18:26 +0000<br>From: "T. haghroosta" &lt;<a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>&gt;<br>Subject: [gradsusr] FW: How to generate .ctl from a .grb file in a<br>&nbsp;&nbsp;&nbsp; grads under windows<br>To: &lt;<a ymailto="mailto:spc_meteor@yahoo.com.br"
 href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a>&gt;, &lt;<a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>&gt;<br>Message-ID: &lt;<a ymailto="mailto:DUB121-W15E723083A32C5EF157DC7DDE70@phx.gbl" href="/mc/compose?to=DUB121-W15E723083A32C5EF157DC7DDE70@phx.gbl">DUB121-W15E723083A32C5EF157DC7DDE70@phx.gbl</a>&gt;<br>Content-Type: text/plain; charset="windows-1256"<br><br><br>Dear Saulo, My problem was solved. No need to reply. I just did the job again. Thank you&nbsp; Regards, T.<br> From: <a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a><br>To: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a>; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>Subject: RE: [gradsusr] How to
 generate .ctl from a .grb file in a grads under windows<br>Date: Sat, 9 Mar 2013 05:22:04 +0000<br><br><br><br><br><br>Dear Saulo,<br> <br>Sorry to get your time. I don't know what happened to my files. At first when I used "q file" command I saw 145 variables in the file, but right now, I just see 95 variables! Could you please tell me what happened and what should I do to solve this problem? Because I lost exactly the variables that I would like to study.<br> <br>I have attached both cases to the email. <br> <br>I am looking forward to hearing from side of you.<br> <br>Regards,<br> <br>Tahereh<br> <br>Date: Thu, 7 Mar 2013 09:15:59 -0800<br>From: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a><br>Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>To: <a ymailto="mailto:haghroosta@hotmail.com"
 href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a><br><br>You're welcome, T.Great it worked fine. Regards ________________________________________<br>Saulo Carvalho<br><br>&nbsp; &nbsp; &nbsp; &nbsp; De: T. haghroosta &lt;<a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>&gt;<br> Para: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a>; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <br><br> Enviadas: Quinta-feira, 7 de Mar?o de 2013 14:08<br> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>&nbsp;&nbsp;&nbsp;<br><br><br><br><br>Dear Saulo,<br> <br>Thank you very much, it is working. Thank for your help again.<br> <br>Best regards,<br> <br>T.<br> <br>Date: Thu, 7 Mar 2013 06:02:35 -0800<br>From: <a
 ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a><br>Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>To: <a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a><br><br>Dear T. Ok, let's do it! - Paste script g2ctl.pl in unit c:. After that, paste grib2 file. - Click "Start&gt;Run&gt;cmd" or<br> open "Windows Prompt". - change directory to c:\ - Type "perl g2ctl.pl 'file'.grib2 &gt;'file'.ctl" (That's not on GRADS, it's on prompt)&gt; A file called 'file'.ctl will be created. - Run Grads and type "!gribmap -iv 'file'.ctl"&gt; A file 'file'.idx will be created *Inside .ctl file, lines "dset" and "index" must be in the proper path. Try it and reply me<br> later. Regards ________________________________________<br>Saulo Carvalho<br><br>&nbsp; &nbsp; &nbsp; &nbsp; De: T. haghroosta &lt;<a
 ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>&gt;<br> Para: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a> <br> Enviadas: Quinta-feira, 7 de Mar?o de 2013 10:26<br> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>&nbsp; <br> <br><br><br><br><br>Dear Saulo,<br> <br>I also have Strawberry. In fact, I don't know in which window I should write the commends, in Grads, or other window. Could you please lead me? How can I start from the first step, I got confused completely.<br> <br>Regards,<br> <br>T.<br> <br>Date: Thu, 7 Mar 2013 05:12:56 -0800<br>From: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a><br>Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>To: <a
 ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>; <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><br>Dear T., The script g2ctl.pl (or<br> grib2ctl) and grib file must be in the same folder. In case of drive c:\, run command prompt, then you can make: C:\&gt; perl g2ctl.pl file.grib2 &gt;file.ctl .ctl file will be in unit c: I'm using strawberry perl on a windows 7 Regards, ________________________________________<br>Saulo Carvalho<br><br>&nbsp; &nbsp; &nbsp; &nbsp; De: T. haghroosta<br> &lt;<a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>&gt;<br> Para: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a>; <a ymailto="mailto:gradsusr@gradsusr.org"
 href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <br> Enviadas: Quinta-feira, 7 de Mar?o de 2013 9:59<br> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>&nbsp;&nbsp;&nbsp;<br><br><br><br><br>Dear Saulo,<br> <br>I did it but I just got some errors such as, unknown command, while I have the perl in drive C, I don't know how can I solve my problem.<br> <br>Again I am working in windows system.<br> <br>Regards,<br> <br>T.<br> <br>Date: Thu, 7 Mar 2013 03:43:04 -0800<br>From: <a ymailto="mailto:spc_meteor@yahoo.com.br" href="/mc/compose?to=spc_meteor@yahoo.com.br">spc_meteor@yahoo.com.br</a><br>Subject: Enc: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>To: <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>; <a ymailto="mailto:haghroosta@hotmail.com"
 href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a><br><br>Dear T. All you have to do<br> is: 1- Download and install perl language program;2- Download the grib2 file of your interest;3- Put grib2ctl.pl or g2ctl.pl in a folder, or c:\;4- Type perl grib2ctl.pl filename.grib2 &gt;file.ctl;5- Use !gribmap (on GrADS) to make .idx file. Best Regards, ________________________________________<br>Saulo Carvalho<br><br>&nbsp; &nbsp; &nbsp; ----- Mensagem encaminhada -----<br>&nbsp; De: T. haghroosta &lt;<a ymailto="mailto:haghroosta@hotmail.com" href="/mc/compose?to=haghroosta@hotmail.com">haghroosta@hotmail.com</a>&gt;<br> Para: <a ymailto="mailto:gradsusr@gradsusr.org" href="/mc/compose?to=gradsusr@gradsusr.org">gradsusr@gradsusr.org</a> <br> Enviadas: Quinta-feira, 7 de Mar?o de 2013 3:27<br> Assunto: [gradsusr] How to generate .ctl from a .grb file in a grads under windows<br>&nbsp;&nbsp;&nbsp;<br><br><br><br><br><br><br><br>Dear All,<br>
 <br>I have a .grb (grib 1) file, I would like to generate a .ctl file and after that .idx file.<br> <br>I did grib2ctl.pl filename.grb &gt; filename.ctl, but I got this error : unknown command<br> <br>I also used this command : g2ctl but I got the error again. How can I do that in windows system?<br> <br>Regards,<br> <br>T.<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <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>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br><br><br>&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br><br><br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br><br><br>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20130309/28fba7cf/attachment.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20130309/28fba7cf/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 37, Issue 20<br>****************************************<br></div></blockquote></td></tr></table>