[ncl-talk] unable to run NCL on Ubuntu
Mary Haley
haley at ucar.edu
Wed May 27 22:20:05 MDT 2015
Geeta,
I think your original email got cut from this thread, so I'm going based on
another email from you that I had archived.
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 "
uv300.nc" 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.
I believe Kyle also responded to you and explained what $NCARG_ROOT was.
The NetCDF file that I think you want to open is *not* under the
$NCARG_ROOT path, but rather under a directory called
"~/geeta/ncl/myscripts_ncl".
This is the directory you want to use when you call addfile:
a = addfile("~/geeta/ncl/myscripts_ncl/fnl_20150423_12_00.nc","r")
This will also work:
dir = "~/geeta/ncl/myscripts_ncl/"
fname = "fnl_20150423_12_00.nc"
a = addfile(dir + fname,"r")
If the NCL script is in the same directory as the "fnl_20150423_12_00.nc"
file, then you don't need a directory path at all:
a = addfile("fnl_20150423_12_00.nc","r")
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:
http://www.ncl.ucar.edu/Document/Manuals/
Good luck,
--Mary
On Wed, May 27, 2015 at 12:54 PM, Geeta Geeta <geetag54 at yahoo.com> wrote:
> Thanks Mary for ur help.
> But pls tell me why the data in my directory is NOT being read.
>
> Geeta.
>
>
>
> On Thursday, 28 May 2015 12:21 AM, Mary Haley <haley at ucar.edu> wrote:
>
>
> 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".
>
> The "begin" and "end" statements are optional for the main NCL code, but
> not optional when you are defining procedures and functions.
>
>
> --Mary
>
>
> On Wed, May 27, 2015 at 12:27 PM, Alessandra Giannini <
> alesall at iri.columbia.edu> wrote:
>
>
> Hi,
>
> I am not sure you need the
>
> end
>
> line when you copy and paste, and execute line by line, but if so, how
> come you have no
>
> begin
>
> ?
>
>
>
> On May 27, 2015, at 2:23 PM, Geeta Geeta <geetag54 at yahoo.com> wrote:
>
> > This is continuation of my mails.
> > The script given on the NCL site runs perfectly on my system. the ps
> file is created well.
> >
> > aditya at agniilap:~/geeta/ncl/myscripts_ncl$ echo $NCARG_ROOT
> > /home/aditya/geeta/ncl
> > aditya at agniilap:~/geeta/ncl/myscripts_ncl$ ncl
> > Copyright (C) 1995-2014 - All Rights Reserved
> > University Corporation for Atmospheric Research
> > NCAR Command Language Version 6.2.1
> > The use of this software is governed by a License Agreement.
> > See http://www.ncl.ucar.edu/ for more details.
> > ncl 0> a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r")
> > ncl 1> u = a->U(1,:,:)
> > ncl 2> wks = gsn_open_wks("ps","ce")
> > ncl 3> plot = gsn_csm_contour_map_ce(wks,u,False)
> > ncl 4> end
> > fatal:syntax error: line 4 before or near end
> > end
> > --^
> >
> > fatal:error in statement
> > ncl 5> quit
> > aditya at agniilap:~/geeta/ncl/myscripts_ncl$ ls -lrt
> > total 182900
> > -rw-rw-r-- 1 aditya aditya 18838952 May 27 22:27 fnl_20150423_12_00.grib2
> > -rw-rw-r-- 1 aditya aditya 83991480 May 27 22:29 fnl_20150423_12_00.nc
> > -rw-rw-r-- 1 aditya aditya 83991480 May 27 22:34 test.nc
> > -rw-rw-r-- 1 aditya aditya 542 May 27 23:41 test.ncl
> > -rw-rw-r-- 1 aditya aditya 451983 May 27 23:50 ce.ps
> > aditya at agniilap:~/geeta/ncl/myscripts_ncl$
> >
> > pls suggest
> > Geeta.
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150527/cff0a4f3/attachment.html
More information about the ncl-talk
mailing list