Thread: Sac101.6 unable to accept arguments

Started: 2013-08-01 17:26:28
Last activity: 2013-08-01 17:26:28
Topics: SAC Help
Sheila Peacock
2013-08-01 17:26:28
Dear all,

My colleague showed me a problem with our installation of
SAC 101.6: it does not accept command-line arguments
for substitution for "$1", etc.

The most trivial example is:

macro jj.mac contains

r $1 $2
p

It is invoked by:

sac1016c jj.mac 20130205_020000.EKB10.BHZ.sac 20130205_020000.EKB1.BHZ.sac

and gives the error message

ERROR 1014: Undefined variable in command: 1

This works OK with SAC 101.5c

It looks as if SAC 101.6, or the OS, has stripped off the leading $ signs from
the variables, because if you switch the order, i.e.

r $2$ $1$

you get:

ERROR 1014: Undefined variable in command: 2

I'm running Linux 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
i.e. CentOS5. I get this error message for both the precompiled
linux version of SAC 101.6 and our locally compiled version.
On SAC 101.5c both precompiled and locally compiled versions
behave correctly.


The example using keywords in the "Macros" page of the SAC manual
also fails. When the commands

$KEYS FILES VALUES
read $FILES
mul $VALUES
p

are put into macro file jjj.mac

invoked with "sac1016 jjj.mac FILES 20130205_020000.EKB1.BHZ.sac 20130205_020000.EKB10.BHZ.sac VALUES 2.0 2.5

it comes up with:

ERROR 1301: No data files read in.
ERROR interpreting command: mul $VALUES
ILLEGAL OPTION: ^

I get the same error message when I invoke the macro from within SAC, thus:

SAC> macro jjj.mac
ERROR 1301: No data files read in.
ERROR interpreting command: mul $VALUES
ILLEGAL OPTION: ^
ERROR 1016: Terminating execution of macro jjj.mac
Command line is: mul $VALUES

whereas if I run the macro from within SAC 101.5c, it works:

SAC> macro jjj.mac
FILES? 20130205_020000.EKB1.BHZ.sac 20130205_020000.EKB10.BHZ.sac
VALUES? 2.0 4.0
Waiting (plots appear on screen as expected)
SAC>


I am invoking SAC 101.6 with the following script:
#! /bin/csh -f
# run SAC v. 101.6 locally compiled compiled version 2013 64-bit
setenv SACHOME /sharedprograms/sac/v101.6/64c
setenv PATH ${PATH}:${SACHOME}/bin
setenv SACAUX ${SACHOME}/aux
setenv SAC_USE_DATABASE 0
setenv SAC_PPK_LARGE_CROSSHAIRS 0
setenv MALLOC_CHECK_ 0
/sharedprograms/sac/v101.6/64c/bin/sac $*

and an almost identical script for SAC 101.5c:
#! /bin/csh -f
# run SAC v. 101.5c locally compiled compiled version 2011 64-bit
setenv SACHOME /sharedprograms/sac/v101.5c/64c
setenv PATH ${PATH}:${SACHOME}/bin
setenv SACAUX ${SACHOME}/aux
setenv SAC_USE_DATABASE 0
setenv SAC_PPK_LARGE_CROSSHAIRS 0
setenv MALLOC_CHECK_ 0
/sharedprograms/sac/v101.5c/64c/bin/sac $*

I assume that the error is on my behalf, since such an obvious
problem would have been flagged by other users by now if not.

Regards,
Sheila Peacock
AWE Blacknest.


17:31:54 v.22510d55