/usr/share/viewmol/readgulp is in viewmol 2.4.1-24+b1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | #! /bin/sh
#*******************************************************************************
# *
# Viewmol *
# *
# R E A D G U L P *
# *
# Copyright (c) Joerg-R. Hill, October 2003 *
# *
#*******************************************************************************
#
# $Id: readgulp,v 1.6 2003/11/07 12:56:34 jrh Exp $
# $Log: readgulp,v $
# Revision 1.6 2003/11/07 12:56:34 jrh
# Release 2.4
#
# Revision 1.5 2000/12/10 15:15:31 jrh
# Release 2.3
#
# Revision 1.4 1999/05/24 01:27:18 jrh
# Release 2.2.1
#
# Revision 1.3 1999/02/07 21:55:52 jrh
# Release 2.2
#
# Revision 1.2 1998/01/26 00:49:17 jrh
# Release 2.1
#
# Revision 1.1 1996/12/10 18:46:30 jrh
# Initial revision
#
#
if [ ! -f "$1" ]
then
echo "\$error noFile 1 \"$1\""
echo "\$end"
exit 1
fi
case `uname -s` in
SunOS*) AWK=nawk
;;
IRIX*) AWK=nawk
;;
*) AWK=awk
;;
esac
export LANG="C"
$AWK 'BEGIN {eV2bohr=.001944673764445625802;
readcoord=0;
readgrad=0;
readfreq=0;
count=0;
nfreq=0;
i=1;}
/^ a =/ {a=$3;
alpha=$6;}
/^ b =/ {b=$3;
beta=$6;}
/^ c =/ {c=$3;
gamma=$6;
}
/^ a / {a=$2;}
/^ b / {b=$2;}
/^ c / {c=$2;}
/^ alpha/ {alpha=$2;}
/^ beta / {beta=$2;}
/^ gamma/ {gamma=$2;}
/^ Final asymmetric unit coordinates/ {readcoord=1;
printf("$coord fractional 1.0\n");
}
/^ Final fractional coordinates of atoms/ {readcoord=1;
printf("$coord fractional 1.0\n");
}
/^ Final cartesian coordinates of atoms/ {readcoord=1;
printf("$coord 1.0\n");
}
# /^ Final internal derivatives/ {readgrad=1;
# printf("$grad\n");
# printf(" cycle = 1 energy =%18.10f |dE/dxyz| =%10.6f\n", energy, gnorm);
# for (j=1; j<i; j++)
# {
# printf("%22.14f%22.14f%22.14f %s\n", coord[j,1], coord[j,2], coord[j,3], coord[j,4]);
# }
# }
/^ Final energy/ {energy=$4;}
/^ Final Gnorm/ {gnorm=$4;}
/^ Frequencies \(cm-1\) and Eigenvectors/ {readfreq=1;}
/^ Frequency/ {freqs[nfreq]=$2;
freqs[nfreq+1]=$3;
freqs[nfreq+2]=$4;
if (NF > 4) {
freqs[nfreq+3]=$5;
freqs[nfreq+4]=$6;
freqs[nfreq+5]=$7
}
}
/^ IR Intensity/ {ir[nfreq]=$3;
ir[nfreq+1]=$4;
ir[nfreq+2]=$5;
if (NF > 5) {
ir[nfreq+3]=$6;
ir[nfreq+4]=$7;
ir[nfreq+5]=$8
}
}
/^ Raman Intsty/ {raman[nfreq]=$3;
raman[nfreq+1]=$4;
raman[nfreq+2]=$5;
if (NF > 5) {
raman[nfreq+3]=$6;
raman[nfreq+4]=$7;
raman[nfreq+5]=$8
}
nfreq += NF-2;
total = 0;
}
/^ Real Imaginary/ {total=0;
nfreq+=3;}
/ *[1-9][0-9]* */ {if (readcoord == 1)
{
if ($3 == "c")
{
sub("[0-9][0-9]*", "", $2);
printf("%22.14f%22.14f%22.14f %s\n", $4, $5, $6, $2);
coord[i,1]=$4;
coord[i,2]=$5;
coord[i,3]=$6;
coord[i,4]=$2;
i++;
}
}
# if (readgrad == 1)
# {
# if ($3 == "c")
# {
# printf("%22.14f%22.14f%22.14f\n", eV2bohr*$4, eV2bohr*$5, eV2bohr*$6);
# }
# }
}
/^ *[0-9]* [xyz]/ {if (readfreq == 1)
{
if (NF <= 5 ) {
nm[nfreq-3,total]=$3;
nm[nfreq-2,total]=$4;
nm[nfreq-1,total]=$5;
} else {
nm[nfreq-3,total]=$3;
nm[nfreq-2,total]=$4;
nm[nfreq-1,total]=$5;
nm[nfreq-3,total]=$6;
nm[nfreq-2,total]=$7;
nm[nfreq-1,total]=$8;
}
total++;
}
}
/^-------/ {if (readcoord == 1 || readgrad == 1)
{
count++;
}
if (count == 3)
{
if (readcoord == 1)
{
readcoord=0;
count=0;
}
if (readgrad == 1)
{
readgrad=0;
count=0;
}
}
if (readfreq == 1)
{
readfreq=0;
printf("$vibrational spectrum\n");
for (j=0; j<nfreq; j++)
{
printf("A1 %10.2f %10.6f %10.6f\n", freqs[j], ir[j], raman[j]);
}
printf("$vibrational normal modes\n");
for (j=0; j<total; j++)
{
for (k=0; k<nfreq; k++)
{
if (k % 5 == 0)
{
if (k != 0) printf("\n");
printf("%d %d", j, j);
}
printf(" %10.6f", nm[k,j]);
}
printf("\n");
}
}
}
END {printf("$unitcell %f %f %f %f %f %f\n", a, b, c, alpha, beta, gamma);
printf("$end\n");}' "$1"
|