RE: [ncl-install] ncl_convert2nc reports 'Badly placed ()'s'

From: Comiskey, Glenn <g.comiskey_at_nyahnyahspammersnyahnyah>
Date: Thu Jun 23 2011 - 04:54:11 MDT

Thanks for the feedback, Dave & Mary.
My Cygwin/X setup reports "/bin/csh -> tcsh" which is what is used by
ncl_convert2nc, i.e. #! /bin/csh -f
Similarly: /usr/bin/csh -> tcsh
Having added -v -x to the hash-bang command in ncl_convert2nc it
echo "Processing file: $ifiles_r[$n]..." if ( $?vars ) then
Badly placed ()'s
A grep of ncl_convert2nc and subsequent testing reveals this to be line
1573 of the script.
Get the same result if call using "csh $NCARG_ROOT/bin/ncl_convert2nc
<data file>" or set current shell to csh (default is bash).
Haven't solved the problem, but currently nolonger have a need to
convert files so will forgo any further investigation.


From: Mary Haley []
Sent: 23 June 2011 06:22
To: Comiskey, Glenn
Cc: ncl-install
Subject: Re: ncl_convert2nc reports 'Badly placed ()'s'

Hi Glenn,

Dave's right about this likely being a missing csh issue.
Please see these cygwin notes about csh:

If you have "tcsh", then you may be able to create a soft-link as
described in the above URL.

On Jun 22, 2011, at 12:29 PM, David Brown wrote:

        Hi Glenn,
        Just as a bit of background: ncl_convert2nc is a csh (C-shell)
script that creates a temporary NCL script and then executes it with
parameters derived from the command line. I am not sure exactly what is
wrong but I suspect it is something to do the shell. The script is
looking for /bin/csh. If you execute 'which csh', does it find /bin/csh?
        If I explicitly use another shell to execute the script (on my
mac - I don't have access to a Cygwin system at the moment), e.g.:
        bash $NCARG_ROOT/bin/ncl_convert2nc <some data file>
        I get an error that seems related to what you are seeing:
        ncl_convert2nc: line 63: onintr: command not found
        ncl_convert2nc: line 75: syntax error near unexpected token `('
        ncl_convert2nc: line 75: `set idirs = ()'
        If I instead run it using csh:
        csh $NCARG_ROOT/bin/ncl_convert2nc <some data file>
        I get no error. Maybe that will shed some light on your problem.

        On Jun 22, 2011, at 9:33 AM, Comiskey, Glenn wrote:

                Have just installed Cygwin/X and NCL Version 6.0.0
(CYGWIN), and setup the environment as per the instructions for
installing and running NCL under Cygwin/X (Windows)
(, but when running
ncl_convert2nc it reports 'Badly placed ()'s':
                $ ncl -V
                $ ncl xy04n.ncl
                 Copyright (C) 1995-2011 - All Rights Reserved
                 University Corporation for Atmospheric Research
                 NCAR Command Language Version 6.0.0
                 The use of this software is governed by a License
                 See <>
for more details.
                $ ncl_convert2nc nmww3.t00z.grb #Note: This is a GRIB
v2 file.
                Badly placed ()'s.
                $ ncl_convert2nc CentralAtlantic.wind.grib #Note: This
is a GRIB v1 file.
                Badly placed ()'s.
                $ ncl_convert2nc akw.t12z.grib.grib2 #Note: This is a
GRIB v2 file.
                Badly placed ()'s.
                Haven't been able to find anything in mail archives or
on the Internet to explain what the fault is.
                Kind regards,
                Glenn Comiskey
                Data System Administrator
                Fugro Global Environment & Ocean Sciences
                Fugro House, Hithercroft Road
                Wallingford, Oxfordshire OX10 9RB, UK
                Registration No: 2985431 / VAT No: GB 655475606
                Tel: +44 (0) 1491 820500 (Switchboard) / Tel: +44 (0)
1491 820559 (Direct) / Fax: +44 (0) 1491 820599
<> / Website:
                Please note:

                        The information contained in this message is
privileged and confidential and intended only for the use of the
addresses. If you are not the intended recipient you should not read,
copy, distribute or otherwise use the information;
                        Fugro Global Environment & Ocean Sciences
accepts no responsibility for loss or damage of any kind arising from
the use of this message;
                        If you have received this message in error,
please note the sender immediately and delete the message.


                ncl-install mailing list
                List instructions, subscriber options, unsubscribe:

        ncl-install mailing list
        List instructions, subscriber options, unsubscribe:
Received on Thu Jun 23 04:54:21 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 30 2011 - 12:54:57 MDT