[ncl-talk] unable to run NCL on Ubuntu.

Kyle Griffin ksgriffin2 at wisc.edu
Wed May 27 13:55:09 MDT 2015


Geeta,

You do realize that a variable in a shell environment is NOT the same as a
variable in NCL, right?

$NCARG_ROOT is exactly as your wrote it in NCL. If you want to retrieve
that variable (which is properly set in your shell environment, as you
echoed it successfully), you would need something like

ncarg_root = systemfunc("echo $NCARG_ROOT")

and then

a=addfile(ncarg_root+"/myscipts_ncl/test.nc","r")

inside your script, as this is how NCL references variables. The reference
to the shell variable *only* works inside load statements.

Let the list know if you have other issues on this topic.

Also, in the future, please try to put a bit more thought into the emails
you send to the list. Combining the info from your 3 emails about the same
topic into one will make it MUCH, MUCH more likely that you'll get a faster
answer and that people will actually read and understand your questions.
Sending multiple emails like the three you sent inside just NINE minutes is
poor form, as many people will take more time than that to compose their
emails to this list.


Kyle



----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
Room 1421
1225 W Dayton St, Madison, WI 53706
Email: ksgriffin2 at wisc.edu

On Wed, May 27, 2015 at 1:14 PM, Geeta Geeta <geetag54 at yahoo.com> wrote:

> Hi.
> I have loaded the pre-compiled binaries on Ubuntu by following the
> procedure on the Web.
> I could successfully run
> ng4ex gsun01n -clean                           and the window opened with
> a sinusodial wave plot.
>
>
> I was trying out a small script and got the following error.
> ;;;;;;Error................................
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$ ncl test.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.
> fatal:["FileSupport.c":3605]:_NclFindFileExt: Requested file
> <$NCARG_ROOT/myscipts_ncl/test.nc> or <$NCARG_ROOT/myscipts_ncl/test>
> does not exist
>
> fatal:["FileSupport.c":3973]:($NCARG_ROOT/myscipts_ncl/test.nc) has no
> file extension, can't determine type of file to open
> fatal:file (a) isn't defined
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 11 in
> file test.ncl
>
> ;;;;;;;;;;;;;;;;;;;;;;All my files exist in the
> Directory..........aditya at agniilap:~/geeta/ncl/myscripts_ncl$ ls -l
> total 182456
> -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      528 May 27 22:44 test.ncl
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$
>
> ;;;;;;;;;;;;;;;;;test.nc has valid
> data;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$ ncdump -h test.nc | egrep
> "HGT_P0_L100"
>     float HGT_P0_L100_GLL0(lv_ISBL0, lat_0, lon_0) ;
>         HGT_P0_L100_GLL0:initial_time = "04/23/2015 (12:00)" ;
>         HGT_P0_L100_GLL0:forecast_time_units = "hours" ;
>         HGT_P0_L100_GLL0:forecast_time = 0 ;
>         HGT_P0_L100_GLL0:level_type = "Isobaric surface (Pa)" ;
>         HGT_P0_L100_GLL0:parameter_template_discipline_category_number =
> 0, 0, 3, 5 ;
>         HGT_P0_L100_GLL0:parameter_discipline_and_category =
> "Meteorological products, Mass" ;
>         HGT_P0_L100_GLL0:grid_type = "Latitude/longitude" ;
>         HGT_P0_L100_GLL0:_FillValue = 1.e+20f ;
>         HGT_P0_L100_GLL0:units = "gpm" ;
>         HGT_P0_L100_GLL0:long_name = "Geopotential height" ;
>         HGT_P0_L100_GLL0:production_status = "Operational products" ;
>         HGT_P0_L100_GLL0:center = "US National Weather Service - NCEP
> (WMC)" ;
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$
>
> ;;;;;;;;;;;;Following is the script;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> begin
> a=addfile("$NCARG_ROOT/myscipts_ncl/test.nc","r")
> GPM850=a->HGT_P0_L100_GLL0(20,:,:)
> printVarSummary(a)
> wks = gsn_open_wks("png","ce")                  ; open a png file
>   plot = gsn_csm_contour_map_ce(wks,GPM850,False)     ; create a default
> plot
> end
>
> ;;;;;;;;;;;;Environment variable setting
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$ echo $NCARG_ROOT
> /home/aditya/geeta/ncl
> aditya at agniilap:~/geeta/ncl/myscripts_ncl$
>
> I am unable to sort out this Error. Pls help.
>
> Geeta.
>
> _______________________________________________
> 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/c84cfcc1/attachment.html 


More information about the ncl-talk mailing list