[ncl-talk] script containing loadscript not working from the Linux prompt
Rick Brownrigg
brownrig at ucar.edu
Thu Apr 27 19:33:12 MDT 2017
Hi Gus,
In your reporting above, you have a typo in the non-interactive version:
"loadcript". Is that the issue, or did this creep in in this email?
On Thursday, April 27, 2017, Gus Correa <gus at ldeo.columbia.edu
<javascript:_e(%7B%7D,'cvml','gus at ldeo.columbia.edu');>> wrote:
> Dear NCL experts
>
> I've been banging my head on this, tried several variants
> to no avail.
>
> I have an NCL script that I need to execute from the Linux prompt.
> Like this:
>
> $ ncl MITgcmDiag2nc.ncl
>
> The very first command in MITgcmDiag2nc.ncl loads another script,
> which has just a very large number of NCL variable assignments.
>
> scriptname="./MITgcmparms.ncl"
> loadcript(scriptname)
>
> The assignments in the lower script MITgcmparms.ncl
> will vary (across jobs), and the whole lower script MITgcmparms.ncl
> is generated on the fly by yet another shell script,
> hence I cannot make them part of the upper script
> MITgcmDiag2nc.ncl (which doesn't vary).
> I could of course concatenate both scripts, then run the whole thing,
> but that is not the ideal solution (and very ugly!).
>
> Although the spelling is correct, and both scripts do
> exist in the work directory, I get this error message:
>
> ************************************************************
> ****************
> [gus at master nconcl]$ ncl MITgcmDiag2nc.ncl
> Copyright (C) 1995-2017 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.4.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:syntax error: line 15 in file MITgcmDiag2nc.ncl before or near \n
> loadcript(scriptname)
> ---------------------^
>
> fatal:syntax error: possibly an undefined procedure
> ************************************************************
> ****************
>
> What is really strange is that if I start ncl interactively,
> I can do the pair of NCL commands above without a problem:
>
> ************************************************************
> *****************
> [gus at master nconcl]$ ncl
> Copyright (C) 1995-2017 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.4.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> ncl 0> scriptname="./MITgcmparms.ncl"
> ncl 1> loadscript(scriptname)
> ncl 3>
> ************************************************************
> *****************
>
> However, I cannot run them interactively.
> I really need to run them from the Linux command line.
> These scripts are meant to run in batch mode,
> as part of an ocean model integration job.
> A job that runs on a remote node via job queue system,
> without any manual/human assistance.
>
> I tried many variants, such as to use the script name string
> directly in loadscript, to enclose the loadscript command in
> begin/end block delimiters, etc, to no avail.
> I read and re-read the appropriate sections in the NCL Reference Guide,
> but I could not find any clue on why something that works interactively
> in NCL can fail so miserably from the Linux prompt.
> I tried it on tcsh and on bash with the same exact error.
>
> As shown above, I am using NCL 6.4.0, downloaded from ESG.
>
> Any help is appreciated.
>
> Thank you,
> Gus Correa
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> 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/20170427/1bc6abfc/attachment.html
More information about the ncl-talk
mailing list