<div dir="ltr"><div><div><div><div><div><div><div>[1]<br></div>If you are going to work with climate models, I *strongly suggest* that you become familiar with some tool that handles netCDF: NCL, GrADS, Python, Matlab, IDL, R, etc. <br><br></div><div>Whatever tool you decide to use, it is up to you to read the documentation of the language and the functions used. <br></div><div><br>[2] <br></div>While text (ASCII) files are human readable, they are the poorest way of storing and accessing data.<br><br>[3] <br></div>As mentioned by Karin, your script is rather confusing. <br><br>[4]<br></div>I have no idea what the source data file looks like. However, I speculate that the time, lat and lon coordinate variables are already on the file. There is no need for you to create them.<br><br></div>The golden rule of data processing is to **look at your data**.<br><br>[5] <br></div>Attached is an untested script. It produces one file per grid point.<br></div>I did this because it was simple for me to do so. You may wish to change it to suit your needs.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 20, 2016 at 4:11 AM, Karin Meier-Fleischer <span dir="ltr"><<a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi Maryam,<br>
<br>
I'm a little bit confused about your script. The AFR-44 data must
have time, lat and lon dimensions so the complete defining and
assigning of time, lat and lon to the variable pre is not needed.
You can read them directly <br>
<br>
<tt>time = f->time</tt><tt><br>
</tt><tt>lat = f->lat</tt><tt><br>
</tt><tt>lon = f->lon</tt><br>
<br>
After creating a contour plot of variable pre there is an exit call
and NCL will stop directly without executing the rest of your
script. But looking at the rest why are you overwriting your
variable pre with random data? You will use the random data to
define the new variable data!??<br>
<br>
By the way, if you are running NCL 6.3.0 you do not need to load the
gsn_code.ncl, gsn_csm.ncl and contributed.ncl libraries anymore.<br>
<br>
Bye,<br>
Karin<br>
<br>
<div>Am 20.07.16 um 05:57 schrieb
<a href="mailto:mkarimian59@yahoo.com" target="_blank">mkarimian59@yahoo.com</a>:<br>
</div>
<blockquote type="cite"><div><div class="h5">
<div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px">
<div><span>Dear All<br>
</span></div>
<div dir="ltr">I want
to write a script at NCL for convert nc file to ascii file.<br>
</div>
<span>I studied
ncl-talk and another example at NCL site. I get more
information but I have a problem.</span>
<div dir="ltr"><span>I want to write a
script that it can able to inform following task:</span></div>
<div dir="ltr"><span>1- open nc file
and read it</span></div>
<div dir="ltr"><span>2- extract data
below:</span></div>
<div dir="ltr"><span>lat lon pre</span></div>
<div dir="ltr">
<div><span>for example:
30 50 20</span></div>
<div><span>3- write these
information to inform of ascii file.<br>
</span></div>
</div>
<div dir="ltr"><span>I try to write a
script but I have a problem at run it. I send this script
for you.</span></div>
<div dir="ltr"><span>Please kindly see
this and guide me. <br>
</span></div>
<div dir="ltr"><span>Thanks in advance</span></div>
<div dir="ltr"><span>regard</span></div>
<span>maryam</span>
<div dir="ltr"><font color="#00407f" face="" size="2"><em><span style="BORDER-BOTTOM:medium none;BACKGROUND:none transparent scroll repeat 0% 0%"> </span></em></font></div>
<div>
<div dir="ltr"><span><br>
</span></div>
</div>
<div> </div>
<div>
<div>
<div><font color="#00407f" face="" size="2"><em>Maryam
Karimian<br>
<span style="BORDER-BOTTOM:medium none;BACKGROUND:none transparent scroll repeat 0% 0%"><span><span style="BORDER-BOTTOM:#366388 2px dotted;BACKGROUND:none transparent scroll repeat 0% 0%">Climate change</span></span></span>
and Climat modeling division<br>
<span style="BORDER-BOTTOM:medium none;BACKGROUND:none transparent scroll repeat 0% 0%">Climatological
Research Institute (CRI)<br>
</span></em></font></div>
<div><font color="#00407f" size="2"><em>Email:
<a rel="nofollow" href="http://us.mc320.mail.yahoo.com/mc/compose?to=r_modiriyan@yahoo.com" target="_blank"><font face=""><font color="#00407f">mkarimian59</font>@yahoo.com</font></a><br>
<font face="">Sento Highway, Next to Torogh Road-Police
Station<br>
Mashad 91735 - 676 , Islamic Republic of Iran</font></em></font></div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
ncl-talk mailing list
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL
Application Support
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany
Phone: <a href="tel:%2B49%20%280%2940%20460094%20126" value="+4940460094126" target="_blank">+49 (0)40 460094 126</a>
Fax: <a href="tel:%2B49%20%280%2940%20460094%20270" value="+4940460094270" target="_blank">+49 (0)40 460094 270</a>
E-Mail: <a href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>
URL: <a href="http://www.dkrz.de" target="_blank">www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784
</pre>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>