[Wien] Error in lapw1para_lapw script causing errors when running parallel lapw2
"Paweł Leśniak, IFMPAN"
lesniak at ifmpan.poznan.pl
Wed Jun 17 23:21:59 CEST 2009
W dniu 2009-06-17 22:34, Peter Blaha pisze:
> Of course I do have the "official" lapw1para_lapw.
>
> And it has a line 444 with minus signs:
>
> @ tail = $klist - $kold - 1 # here
>
> If I put an echo $tail,$klist,$kold
> after that line it gives on my tcs (and apparently on all other WIEN2k
> users so far:
> 3,45,45
>
> So, obviously the tcsh evaluates this "wrong" (in terms of mathematics),
> but "correct" (in terms what it should do).
> One can verify this on the commandline:
> set a=10
> set b=5
> @ c = $a - $b
> echo $c # will give 5
> @ c ? $a - $b - 1
> echo $c # gives 6 !!!!
>
> What is your Linux ? tcsh (csh ?) version.
x86_64 (and also x86 on other machine), arch linux, glibc-2.9, tcsh 6.16.00
$ ./a.tcsh
5
4
On other machines (x86, crux, tcsh 6.12.00; x86_64 with tcsh 6.14.00) I get:
$ ./a.tcsh
5
6
Anyways, I think this problem can be solved by changing:
@ c = $a - $b - 1
with
@ c = $a - ($b - 1)
This provides correct results in both situations (is correct
"mathematically" and does what was expected by the author, and is
"new_tcsh-safe").
And to discuss problem to the end - I've found reason of such different
behaviour in tcsh's manual:
"compat_expr (+)
If set, the shell will evaluate expressions right to left, like
the original csh."
Looks like it was changed in 6.15.01 version of tcsh (2007-09-29).
So this is rather change in tcsh's default behaviour than error in
wien2k, but it would be safer to change some expressions in wien2k's
scripts.
I'm still a bit amazed that I'm the only one who had this problem.
Best regards,
Pawel Lesniak
More information about the Wien
mailing list