Re: NCL won't work when calling from script

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 09 2012 - 13:06:54 MDT

Hi Walter,

It looks like you might have two versions of NCL installed on your system. The actual "ncl" you are running is V5.1.1. The $NCARG_ROOT environment variable, however, seems to be pointing to a location that is associated with NCL V5.2.0 or higher.

Can you type the following and send me the output:

    ncl -V
   which ncl
    env | grep NCARG

Sometimes, in the process of typing the above three commands, you'll see right away that NCARG_ROOT is pointing to the wrong location, or, you need to update your PATH environment variable so that $NCARG_ROOT/bin is on your path before wherever the 5.1.1 version resides.

--Mary

On Apr 9, 2012, at 10:19 AM, Walter Hannah wrote:

> I have a script that can be run from the terminal with no problems. However, when I try to run the NCL script from a bash shell script like this:
>
> #! /bin/bash
>
> ncl '~/analysis/plot.3D.ts.basic.ncl'
>
> I get this set of errors:
>
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:syntax error: line 3629 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near documentWorkstationClass
> cairo = create res_file documentWorkstationClass
> -------------------------------------------------------^
>
> fatal:syntax error: line 3630 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkFileName
> "wkFileName"
> ---------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3631 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkFormat
> "wkFormat"
> -------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3632 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkPDFResolution
> "wkPDFResolution"
> --------------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3633 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkPaperSize
> "wkPaperSize"
> ----------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3634 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkPaperWidthF
> "wkPaperWidthF"
> ------------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3635 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkPaperHeightF
> "wkPaperHeightF"
> -------------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3636 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near create
> end create
> -----------------^
>
> fatal:error in statement
> fatal:Syntax Error in block, block not executed
> fatal:error at line 3670 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
>
> fatal:syntax error: line 3691 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near xwdimageWorkstationClass
> image = create res_file xwdimageWorkstationClass
> -----------------------------------------------------^
>
> fatal:syntax error: line 3692 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkImageFileName
> "wkImageFileName"
> ------------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3693 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkImageFormat
> "wkImageFormat"
> ----------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3694 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkColorMap
> "wkColorMap"
> -------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3695 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkWidth
> "wkWidth"
> ----------------^
>
> fatal:error in statement
> fatal:syntax error: line 3696 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkHeight
> "wkHeight"
> -----------------^
>
> fatal:error in statement
> fatal:syntax error: line 3697 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near create
> end create
> ---------------^
>
> fatal:error in statement
> fatal:syntax error: line 3699 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near xwdimageWorkstationClass
> image = create res_file xwdimageWorkstationClass
> -----------------------------------------------------^
>
> fatal:syntax error: line 3700 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkImageFileName
> "wkImageFileName"
> ------------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3701 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkImageFormat
> "wkImageFormat"
> ----------------------^
>
> fatal:error in statement
> fatal:syntax error: line 3702 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkWidth
> "wkWidth"
> ----------------^
>
> fatal:error in statement
> fatal:syntax error: line 3703 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near "wkHeight
> "wkHeight"
> -----------------^
>
> fatal:error in statement
> fatal:syntax error: line 3704 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl before or near create
> end create
> ---------------^
>
> fatal:error in statement
> fatal:Syntax Error in block, block not executed
> fatal:error at line 3708 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
>
> I looked at the the lines specified in the error messages but they look very foreign to me. So why is calling NCL from a bash shell script different from calling ncl from the terminal with a bash shell?
>
> Thanks,
> Walter
>
> _______________________________________________
> 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
Received on Mon Apr 9 13:07:02 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT