[gradsusr] it works

Lee Byerle lbyerle at yahoo.com
Sun Mar 10 10:26:50 EDT 2013


Hi Kai,
I'm glad to hear the script is working.  Regarding your question, you currently have the expression:

'set prnopts %10.3e 5 1'

which will print 5 records to file.  To get all of the records for the 47 times, use:

'set prnopts %10.3e 47 1'

Lee





On Mar 10, 2013, at 1:07 AM, kombo kai wrote:

> 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
> rgds
> kai
> 
> --- On Sat, 3/9/13, gradsusr-request at gradsusr.org <gradsusr-request at gradsusr.org> wrote:
> 
> From: gradsusr-request at gradsusr.org <gradsusr-request at gradsusr.org>
> Subject: gradsusr Digest, Vol 37, Issue 20
> To: gradsusr at gradsusr.org
> Date: Saturday, March 9, 2013, 8:18 AM
> 
> Send gradsusr mailing list submissions to
>     gradsusr at gradsusr.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://gradsusr.org/mailman/listinfo/gradsusr
> or, via email, send a message with subject or body 'help' to
>     gradsusr-request at gradsusr.org
> 
> You can reach the person managing the list at
>     gradsusr-owner at gradsusr.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gradsusr digest..."
> 
> 
> Today's Topics:
> 
>    1. text file (kombo kai)
>    2. Re: text file (Lee Byerle)
>    3. FW: How to generate .ctl from a .grb file in a grads under
>       windows (T. haghroosta)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 9 Mar 2013 06:00:42 -0800 (PST)
> From: kombo kai <kaikombo at yahoo.com>
> Subject: [gradsusr] text file
> To: gradsusr at gradsusr.org
> Message-ID:
>     <1362837642.67317.YahooMailClassic at web164005.mail.gq1.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi Grads users
> 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
> 'reinit'
> 'c'
> 'open d:/vorticity/data2_extraction.ctl'
> 'set lon 0 360'
> 'set lat? -90 90'
> 'set t 1 47'
> 'set z 3'
> 'define vort=hcurl(uwnd1,vwnd2)'
> 'set lon 40'
> 'set lat -22.5'
> 'set z 3'
> 'set t 1 47'
> *defining the area average vorticity
> 'define avvort=aave(vort,lon=40,lon=70,lat=-22.5,lat=-5)'
> *dining time average vorticiy va
> 'define mvort=ave(vort,t=1,t=47)'
> * printing and writing the the text files of the out puts
> 'set gxout print'
> 'set prnopts %10.3e 5 1'
> *'set prnopts %g 1 1'
> 'd avvort'
> 'd mvort'
> 'retcode1=write('d;/avvort.txt', avvort, 0)'
> 'retcode2=write('d;/mvort.txt', mvort,0)'
> 'retcode1=close(avort.txt)'
> 'retcode2=close(mvort.txt)'
> but when I run the script I get error in line whcih defines the recode1.
> I tried several options bur i havent get the output writen to the file I want 
> please any one can help this 
> regards
> kaikombo
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130309/4d0f4fe1/attachment-0001.html 
> 
> ------------------------------
> 
> Message: 2
> Date: Sat, 9 Mar 2013 10:15:39 -0600
> From: Lee Byerle <lbyerle at yahoo.com>
> Subject: Re: [gradsusr] text file
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Message-ID: <8948EDC2-C1B6-4CF3-9057-C1938ACB6E61 at yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> Kaikombo,
> 
> I was able to run your script after a few modifications.  After displaying avvort and mvort, you can define the output using sublin(result,2).  Also, I did not use quotes for the write statements.
> 
> .
> .
> .
> 'set gxout print'
> 'set prnopts %10.3e 5 1'
> 'd avvort'
> var1=sublin(result,2)
> 'd mvort'
> var2=sublin(result,2)
> retcode1=write(avvort.txt, var1, 0)
> retcode2=close(avvort.txt)
> 
> retcode2=write(mvort.txt, var2 ,0)
> retcode2=close(mvort.txt)
> 
> good luck,
> Lee
> 
> On Mar 9, 2013, at 8:00 AM, kombo kai wrote:
> 
> > Hi Grads users
> > 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
> > 'reinit'
> > 'c'
> > 'open d:/vorticity/data2_extraction.ctl'
> > 'set lon 0 360'
> > 'set lat  -90 90'
> > 'set t 1 47'
> > 'set z 3'
> > 'define vort=hcurl(uwnd1,vwnd2)'
> > 'set lon 40'
> > 'set lat -22.5'
> > 'set z 3'
> > 'set t 1 47'
> > *defining the area average vorticity
> > 'define avvort=aave(vort,lon=40,lon=70,lat=-22.5,lat=-5)'
> > *dining time average vorticiy va
> > 'define mvort=ave(vort,t=1,t=47)'
> > * printing and writing the the text files of the out puts
> > 'set gxout print'
> > 'set prnopts %10.3e 5 1'
> > *'set prnopts %g 1 1'
> > 'd avvort'
> > 'd mvort'
> > 'retcode1=write('d;/avvort.txt', avvort, 0)'
> > 'retcode2=write('d;/mvort.txt', mvort,0)'
> > 'retcode1=close(avort.txt)'
> > 'retcode2=close(mvort.txt)'
> > but when I run the script I get error in line whcih defines the recode1.
> > I tried several options bur i havent get the output writen to the file I want 
> > please any one can help this 
> > regards
> > kaikombo
> > 
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130309/b88c6b7e/attachment-0001.html 
> 
> ------------------------------
> 
> Message: 3
> Date: Sat, 9 Mar 2013 16:18:26 +0000
> From: "T. haghroosta" <haghroosta at hotmail.com>
> Subject: [gradsusr] FW: How to generate .ctl from a .grb file in a
>     grads under windows
> To: <spc_meteor at yahoo.com.br>, <gradsusr at gradsusr.org>
> Message-ID: <DUB121-W15E723083A32C5EF157DC7DDE70 at phx.gbl>
> Content-Type: text/plain; charset="windows-1256"
> 
> 
> Dear Saulo, My problem was solved. No need to reply. I just did the job again. Thank you  Regards, T.
> From: haghroosta at hotmail.com
> To: spc_meteor at yahoo.com.br; gradsusr at gradsusr.org
> Subject: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
> Date: Sat, 9 Mar 2013 05:22:04 +0000
> 
> 
> 
> 
> 
> Dear Saulo,
> 
> 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.
> 
> I have attached both cases to the email. 
> 
> I am looking forward to hearing from side of you.
> 
> Regards,
> 
> Tahereh
> 
> Date: Thu, 7 Mar 2013 09:15:59 -0800
> From: spc_meteor at yahoo.com.br
> Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
> To: haghroosta at hotmail.com
> 
> You're welcome, T.Great it worked fine. Regards ________________________________________
> Saulo Carvalho
> 
>         De: T. haghroosta <haghroosta at hotmail.com>
> Para: spc_meteor at yahoo.com.br; gradsusr at gradsusr.org 
> 
> Enviadas: Quinta-feira, 7 de Mar?o de 2013 14:08
> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
>    
> 
> 
> 
> 
> Dear Saulo,
> 
> Thank you very much, it is working. Thank for your help again.
> 
> Best regards,
> 
> T.
> 
> Date: Thu, 7 Mar 2013 06:02:35 -0800
> From: spc_meteor at yahoo.com.br
> Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
> To: haghroosta at hotmail.com
> 
> Dear T. Ok, let's do it! - Paste script g2ctl.pl in unit c:. After that, paste grib2 file. - Click "Start>Run>cmd" or
> open "Windows Prompt". - change directory to c:\ - Type "perl g2ctl.pl 'file'.grib2 >'file'.ctl" (That's not on GRADS, it's on prompt)> A file called 'file'.ctl will be created. - Run Grads and type "!gribmap -iv 'file'.ctl"> 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
> later. Regards ________________________________________
> Saulo Carvalho
> 
>         De: T. haghroosta <haghroosta at hotmail.com>
> Para: spc_meteor at yahoo.com.br 
> Enviadas: Quinta-feira, 7 de Mar?o de 2013 10:26
> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
>   
> 
> 
> 
> 
> 
> Dear Saulo,
> 
> 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.
> 
> Regards,
> 
> T.
> 
> Date: Thu, 7 Mar 2013 05:12:56 -0800
> From: spc_meteor at yahoo.com.br
> Subject: Re: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
> To: haghroosta at hotmail.com; gradsusr at gradsusr.org
> 
> Dear T., The script g2ctl.pl (or
> grib2ctl) and grib file must be in the same folder. In case of drive c:\, run command prompt, then you can make: C:\> perl g2ctl.pl file.grib2 >file.ctl .ctl file will be in unit c: I'm using strawberry perl on a windows 7 Regards, ________________________________________
> Saulo Carvalho
> 
>         De: T. haghroosta
> <haghroosta at hotmail.com>
> Para: spc_meteor at yahoo.com.br; gradsusr at gradsusr.org 
> Enviadas: Quinta-feira, 7 de Mar?o de 2013 9:59
> Assunto: RE: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
>    
> 
> 
> 
> 
> Dear Saulo,
> 
> 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.
> 
> Again I am working in windows system.
> 
> Regards,
> 
> T.
> 
> Date: Thu, 7 Mar 2013 03:43:04 -0800
> From: spc_meteor at yahoo.com.br
> Subject: Enc: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
> To: gradsusr at gradsusr.org; haghroosta at hotmail.com
> 
> Dear T. All you have to do
> 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 >file.ctl;5- Use !gribmap (on GrADS) to make .idx file. Best Regards, ________________________________________
> Saulo Carvalho
> 
>       ----- Mensagem encaminhada -----
>   De: T. haghroosta <haghroosta at hotmail.com>
> Para: gradsusr at gradsusr.org 
> Enviadas: Quinta-feira, 7 de Mar?o de 2013 3:27
> Assunto: [gradsusr] How to generate .ctl from a .grb file in a grads under windows
>    
> 
> 
> 
> 
> 
> 
> 
> Dear All,
> 
> I have a .grb (grib 1) file, I would like to generate a .ctl file and after that .idx file.
> 
> I did grib2ctl.pl filename.grb > filename.ctl, but I got this error : unknown command
> 
> I also used this command : g2ctl but I got the error again. How can I do that in windows system?
> 
> Regards,
> 
> T.
>                           
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
>                                
> 
> 
>                                
> 
> 
>                                
> 
> 
>                                                           
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130309/28fba7cf/attachment.html 
> 
> ------------------------------
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> 
> End of gradsusr Digest, Vol 37, Issue 20
> ****************************************
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130310/9c8a627b/attachment-0003.html 


More information about the gradsusr mailing list