[gradsusr] Convert .dat file to netcdf
T. haghroosta
haghroosta at hotmail.com
Thu Oct 23 23:33:48 EDT 2014
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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20141024/d163d6f4/attachment.html
More information about the gradsusr
mailing list