[gradsusr] Convert .dat file to netcdf

Andrew Friedman andfried at gmail.com
Fri Oct 24 05:26:28 EDT 2014


I’m not sure why those lines aren’t working - someone more familiar with scripting may be able to answer.
In the meantime, how about trying the simpler example script (1) above it on the webpage? Does that work?
-Andrew

On Oct 24, 2014, at 5:33 AM, T. haghroosta <haghroosta at hotmail.com> wrote:

> Hi Andrew,
>  
> Thanks for your reply, I used this script as you led, but unfortunately  these two commands gor error: outfile='my_ascii_file.txt'
> '!/bin/rm -f 'outfile
>  
> the grads said for first command:
>  
>  invalid expression
> syntax error: expected operand or '<'
>  
> and for the second command said:
> cannot remove '-f'
> cannot remove 'outfile'
> not such a file or directory.
>  
> could you please tell me where is my problem, because by other commands in the follow script I saw the data in the display window but I cannot have them in a text file
> Regards,
> T.
>  
> 'open /data/grib/model/model.ctl'
> 'set x 1 72'
> outfile='my_ascii_file.txt'
> '!/bin/rm -f 'outfile
> 'set gxout print'
> 'set prnopts %g, 72 0'
> 'd ts-273.15'
> i=1
> while (1)
>   line = sublin(result,i)
>   if (line = ''); break; endif
>   if (i>1)
>     rc = write(outfile,line,append)
>   endif
>   i=i+1
> endwhile
>  
>  
>  
> 
>  
> > From: gradsusr-request at gradsusr.org
> > Subject: gradsusr Digest, Vol 56, Issue 40
> > To: gradsusr at gradsusr.org
> > Date: Wed, 22 Oct 2014 12:00:01 -0400
> > 
> > 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. Re: Convert .dat file to netcdf (Andrew Friedman)
> > 
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Wed, 22 Oct 2014 14:15:28 +0200
> > From: Andrew Friedman <andfried at gmail.com>
> > Subject: Re: [gradsusr] Convert .dat file to netcdf
> > To: GrADS Users Forum <gradsusr at gradsusr.org>
> > Message-ID: <31C71C86-50FA-43BE-AAD8-9F1BD3484D33 at gmail.com>
> > Content-Type: text/plain; charset=windows-1256
> > 
> > Hi T. Haghroosta,
> > 
> > You can save to a .csv file using the instructions for ASCII data:
> > http://www.iges.org/grads/gadoc/ascii.html
> > The instructions are related to the OpenGrADS recipe for saving to a text file:
> > http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file
> > 
> > Andrew
> > 
> > On Oct 21, 2014, at 8:43 AM, T. haghroosta <haghroosta at hotmail.com> wrote:
> > 
> > > Dear All,
> > > 
> > > Is there any way to convert a .dat file from WRF to a netcdf or .mat (matlab file) or .csv file?
> > > 
> > > I am looking forward to hearing from side of you.
> > > 
> > > Ragards.
> > > T.
> >
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr




More information about the gradsusr mailing list