<div dir="ltr"><div class="gmail_default" style="font-size:small">Geeta,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I think your original email got cut from this thread, so I'm going based on another email from you that I had archived.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are talking about the situation where you were trying to open a file using "$NCARG_ROOT" as part of the path to the file, then this is where your problem is. $NCARG_ROOT is just a substitution for a directory path, which is the directory path where NCL is installed on your system. The "<a href="http://uv300.nc" target="_blank">uv300.nc</a>" file is included with the NCL installation and is found in the directory $NCARG_ROOT/lib/ncarg/data/cdf", so that's why the $NCARG_ROOT is showing up in your little test code.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I believe Kyle also responded to you and explained what $NCARG_ROOT was. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The NetCDF file that I think you want to open is *not* under the $NCARG_ROOT path, but rather under a directory called "<span style="font-size:12.8000001907349px">~/geeta/ncl/</span><span style="font-size:12.8000001907349px">myscripts_ncl". This is the directory you want to use when you call addfile:</span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><font face="monospace, monospace">a = addfile("</font></span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">~/geeta/ncl/</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">myscripts_ncl/</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px"><a href="http://fnl_20150423_12_00.nc" target="_blank">fnl_20150423_12_00.nc</a>"</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">,"r")</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">This will also work:</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace"><span style="font-size:12.8000001907349px">dir = "</span><span style="font-size:12.8000001907349px">~/geeta/ncl/</span><span style="font-size:12.8000001907349px">myscripts_ncl/"</span></font></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><font face="monospace, monospace">fname = "<a href="http://fnl_20150423_12_00.nc" target="_blank">fnl_20150423_12_00.nc</a>"</font></span></div><div class="gmail_default"><span style="font-size:12.8000001907349px"><font face="monospace, monospace">a = addfile(dir + fname,"r")</font></span></div></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px">If the NCL script is in the same directory as the "<a href="http://fnl_20150423_12_00.nc" target="_blank">fnl_20150423_12_00.nc</a>" file, then you don't need a directory path at all:</span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style><div class="gmail_default" style><div class="gmail_default" style="font-size:small"><span style="font-size:12.8000001907349px"><font face="monospace, monospace">a = addfile(</font></span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">"<a href="http://fnl_20150423_12_00.nc" target="_blank">fnl_20150423_12_00.nc</a>"</span><span style="font-family:monospace,monospace;font-size:12.8000001907349px">,"r")</span><br></div><div style="font-size:small"><span style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div style="font-size:small"><span style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">As you can see, there are many ways to do this. As Kyle suggested, you need to be trying to figure some of these issues out on your own. Please read the NCL documentation that he pointed you to. In particular, you can see some printed manuals here:</font></span></div><div style="font-size:small"><span style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div style><font face="arial, helvetica, sans-serif" style><a href="http://www.ncl.ucar.edu/Document/Manuals/">http://www.ncl.ucar.edu/Document/Manuals/</a><br></font></div><div style><font face="arial, helvetica, sans-serif" style><br></font></div><div style><font face="arial, helvetica, sans-serif" style>Good luck,</font></div><div style><font face="arial, helvetica, sans-serif" style><br></font></div><div style="font-size:small"><span style="font-size:12.8000001907349px"><font face="arial, helvetica, sans-serif">--Mary</font></span></div><div style="font-size:small"><span style="font-size:12.8000001907349px"><font face="monospace, monospace"><br></font></span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 12:54 PM, Geeta Geeta <span dir="ltr"><<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"><div><span>Thanks Mary for ur help. <br></span></div><div><span>But pls tell me why the data in my directory is NOT being read. </span></div><span class="HOEnZb"><font color="#888888"><div> </div><div><div>Geeta. </div></div></font></span><div><div class="h5"> <br><div><br><br></div><div style="display:block"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div dir="ltr"> <font face="Arial" size="2"> On Thursday, 28 May 2015 12:21 AM, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:<br> </font> </div> <br><br> <div><div><div><div dir="ltr"><div style="font-size:small">That's correct, you do *not* want the "end" statement if you don't have a "begin" statement, or you will get an error. Perhaps what you mean to use was "quit".</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">The "begin" and "end" statements are optional for the main NCL code, but not optional when you are defining procedures and functions.</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">--Mary</div><div style="font-size:small"><br clear="none"></div></div><div><br clear="none"><div>On Wed, May 27, 2015 at 12:27 PM, Alessandra Giannini <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:alesall@iri.columbia.edu" target="_blank">alesall@iri.columbia.edu</a>></span> wrote:<br clear="none"><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br clear="none">
Hi,<br clear="none">
<br clear="none">
I am not sure you need the<br clear="none">
<br clear="none">
end<br clear="none">
<br clear="none">
line when you copy and paste, and execute line by line, but if so, how come you have no<br clear="none">
<br clear="none">
begin<br clear="none">
<br clear="none">
?<br clear="none">
<br clear="none">
<br clear="none">
<br clear="none">
On May 27, 2015, at 2:23 PM, Geeta Geeta <<a rel="nofollow" shape="rect" href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>> wrote:<br clear="none">
<br clear="none">
> This is continuation of my mails.<br clear="none">
> The script given on the NCL site runs perfectly on my system. the ps file is created well.<br clear="none">
><br clear="none">
> aditya@agniilap:~/geeta/ncl/myscripts_ncl$ echo $NCARG_ROOT<br clear="none">
> /home/aditya/geeta/ncl<br clear="none">
> aditya@agniilap:~/geeta/ncl/myscripts_ncl$ ncl<br clear="none">
> Copyright (C) 1995-2014 - All Rights Reserved<br clear="none">
> University Corporation for Atmospheric Research<br clear="none">
> NCAR Command Language Version 6.2.1<br clear="none">
> The use of this software is governed by a License Agreement.<br clear="none">
> See <a rel="nofollow" shape="rect" href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br clear="none">
> ncl 0> a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/<a rel="nofollow" shape="rect" href="http://uv300.nc/" target="_blank">uv300.nc</a>","r")<br clear="none">
> ncl 1> u = a->U(1,:,:)<br clear="none">
> ncl 2> wks = gsn_open_wks("ps","ce")<br clear="none">
> ncl 3> plot = gsn_csm_contour_map_ce(wks,u,False)<br clear="none">
> ncl 4> end<br clear="none">
> fatal:syntax error: line 4 before or near end<br clear="none">
> end<br clear="none">
> --^<br clear="none">
><br clear="none">
> fatal:error in statement<br clear="none">
> ncl 5> quit<br clear="none">
> aditya@agniilap:~/geeta/ncl/myscripts_ncl$ ls -lrt<br clear="none">
> total 182900<br clear="none">
> -rw-rw-r-- 1 aditya aditya 18838952 May 27 22:27 fnl_20150423_12_00.grib2<br clear="none">
> -rw-rw-r-- 1 aditya aditya 83991480 May 27 22:29 <a rel="nofollow" shape="rect" href="http://fnl_20150423_12_00.nc/" target="_blank">fnl_20150423_12_00.nc</a><br clear="none">
> -rw-rw-r-- 1 aditya aditya 83991480 May 27 22:34 <a rel="nofollow" shape="rect" href="http://test.nc/" target="_blank">test.nc</a><br clear="none">
> -rw-rw-r-- 1 aditya aditya 542 May 27 23:41 test.ncl<br clear="none">
> -rw-rw-r-- 1 aditya aditya 451983 May 27 23:50 <a rel="nofollow" shape="rect" href="http://ce.ps/" target="_blank">ce.ps</a><br clear="none">
> aditya@agniilap:~/geeta/ncl/myscripts_ncl$<br clear="none">
><br clear="none">
> pls suggest<br clear="none">
> Geeta.<br clear="none">
> _______________________________________________<br clear="none">
> ncl-talk mailing list<br clear="none">
> List instructions, subscriber options, unsubscribe:<br clear="none">
> <a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><div><br clear="none">
<br clear="none">
<br clear="none">
<br clear="none">
_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">
</div></blockquote></div><div><br clear="none"></div></div></div></div><br><br></div> </div> </div> </div></div></div></div></div></blockquote></div><br></div>