Results 1 to 1 of 1
Dear Users
I m using a linux red har (f77) wish csh shell. currently I got my out put data from GAMESS-US program and I m trying to extract data ...
- 05-20-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 1
error; Illegal variable name
Dear Users
I m using a linux red har (f77) wish csh shell. currently I got my out put data from GAMESS-US program and I m trying to extract data from my output using the script below but when I m runinng the csh ./Run.csh I ve got this error; Illegal variable name.
but when I run the program under Root , I hv this error;
: Command not found.
: Command not found.
: Command not found.
: Command not found.
ERROR:- not enough arguments given.
USAGE:- Run.resp t80_2.dat 0
exit: Expression Syntax.
Could you please kindly help me to fix the problem. As I understood from this tread my script is in bash and I need to change it to csh. Can anybody help me how, I m very new in programming. So frustrating!...
my Run.csh is look like this;
#!/bin/csh -f
# THIS SCRIPT EXTRACTS ALL THE NECESSARY INFORMATION FROM A GAMESS *.DAT FILE,
# AND GENERATES THE NECESSARY INPUT FILES NEEDED TO RUN RESP
#
# ########################################### #
# USAGE: Run.resp dat_filename total_charge #
# ########################################### #
if ($#argv < 2) then
echo "ERROR:- not enough arguments given."
echo "USAGE:- Run.resp dat_filename total_charge"
exit(1)
endif
set title = TITLE
set gamess_datfile = $argv[1]
set charge = $argv[2]
# ################################################## ####### #
# EXTRACT COORDINATES, ESP AND NATOMS FROM GAMESS DATA FILE #
# ################################################## ####### #
cat << eof > awk.in
{
l[NR] = \$0
if (\$1 == "ELECTRIC") {s_pot = NR+1}
if (\$2 == "START") {f_pot = NR-1; startline = NR}
if (\$1 == "NATOMS=") {natoms = \$2; print natoms}
if (\$3 == "NKINDS=") {nkinds = \$4}
if (startline > 0) {
first = startline; first += 3; first += nkinds
last = first; last += natoms; last -= 1
if ((NR >= first) && (NR <= last)) print \$0
}
}
END {npot = f_pot - s_pot + 1; print npot
for (i=s_pot; i<=f_pot; i++) print l[i]}
eof
awk.in -f awk.in t80_2.dat > gamess_temp
# ############### #
# RESP INPUT FILE #
# ############### #
cat << eof > resp.in
$title
&cntrl nmol=1, ihfree=1
&end
1.0
$title
eof
cat << eof > awk.in
{
if (NR <= 1) {printf "%5d%5d\n", $charge, \$1}
}
eof
awk.in -f awk.in gamess_temp >> resp.in
cat << eof > awk.in
{
if (\$1 == "H") {printf "%5d%5d\n",1,0}
if (\$1 == "C") {printf "%5d%5d\n",6,0}
if (\$1 == "N") {printf "%5d%5d\n",7,0}
if (\$1 == "O") {printf "%5d%5d\n",8,0}
if (\$1 == "F") {printf "%5d%5d\n",9,0}
if (\$1 == "P") {printf "%5d%5d\n",15,0}
if (\$1 == "S") {printf "%5d%5d\n",16,0}
}
END {printf "\n\n\n\n"}
eof
awk.in -f awk.in gamess_temp >> resp.in
# ############## #
# ESP INPUT FILE #
# ############## #
cat << eof > awk.in
{
if (NR <= 1) natoms = \$1
if (NR == natoms+2) nesp = \$1
}
END {printf "%5d%5d%5d\n", natoms, nesp,0}
eof
awk.in -f awk.in gamess_temp > esp.in
cat << eof > awk.in
{
if (NR <= 1) natoms = \$1
if ((NR > 1) && (NR <= natoms+1)) {
\$2 *= 1.88972666
\$3 *= 1.88972666
\$4 *= 1.88972666
printf " %16.7E%16.7E%16.7E\n",\$2,\$3,\$4}
}
eof
awk.in -f awk.in gamess_temp >> esp.in
cat << eof > awk.in
{
if (NR <= 1) natoms = \$1
if (NR == natoms+2) nesp = \$1
if (NR > natoms+2) printf "%16.7E%16.7E%16.7E%16.7E\n", \$5,\$2,\$3,\$4
}
eof
awk.in -f awk.in gamess_temp >> esp.in
# ######## #
# RUN RESP #
# ######## #
/usr/local/amber8/src/resp -O \
-i resp.in \
-o resp.out \
-p resp.dat \
-e esp.in


Reply With Quote