babel-1.6
|
Makefile,
README.1ST,
addh.c,
addh2.c,
aromatic.c,
assbnd.c,
asstypes.c,
babel.h,
bblmacs.h,
bblmast.h,
bbltyp.h,
block.c,
bndord.c,
bo.c,
buildct.c,
combine.c,
convert.c,
delatms.c,
delh2o.c,
element.lis,
filesrch.c,
fileutil.c,
gastchg.c,
gauss.hdr,
htoend.c,
int2cart.c,
intcart.c,
menus.c,
miniums.c,
molwt.c,
new.lis,
nodummy.c,
orient.c,
precip.c,
printbad.c,
progress.c,
psgvb.hdr,
quanta.lis,
rdalch.c,
rdampout.c,
rdbalst.c,
rdbgf.c,
rdboogie.c,
rdc3d.c,
rdcacao.c,
rdcadpac.c,
rdcharmm.c,
rdcsd.c,
rddock.c,
rddpdb.c,
rdelmnts.c,
rdfdat.c,
rdfeat.c,
rdfract.c,
rdg96.c,
rdgamout.c,
rdgauout.c,
rdgzmat.c,
rdhin.c,
rdinsite.c,
rdint.c,
rdirc.c,
rdisis.c,
rdm3d.c,
rdmacmod.c,
rdmacmol.c,
rdmdl.c,
rdmicro.c,
rdmm2.c,
rdmm2in.c,
rdmm3.c,
rdmolen.c,
rdmopac.c,
rdmopcrt.c,
rdpcmod.c,
rdpdb.c,
rdprep.c,
rdpsgout.c,
rdpsgvin.c,
rdquanta.c,
rdschak.c,
rdshelx.c,
rdsmiles.c,
rdspart.c,
rdspmm.c,
rdspsemi.c,
rdsybmol.c,
rdsybyl.c,
rdtypes.c,
rdunichm.c,
rdwiz.c,
rdxed.c,
rdxyz.c,
renum.c,
report.c,
rings.c,
ringutil.c,
sets.c,
smilesto.c,
spline.c,
strngutl.c,
tokenst.c,
tosmiles.c,
tree.c,
typbybo.c,
types.lis,
umslist.c,
utils.c,
vectors.c,
wralch.c,
wrbalst.c,
wrbgf.c,
wrbmin.c,
wrbox.c,
wrc3d.c,
wrcacao.c,
wrcache.c,
wrcacint.c,
wrchdrw.c,
wrcontmp.c,
wrcsr.c,
wrcssr.c,
wrdock.c,
wrdpdb.c,
wrfeat.c,
wrfh.c,
wrg96.c,
wrgamess.c,
wrgau.c,
wrgaucrt.c,
wrhin.c,
wricon.c,
wrint.c,
wrisis.c,
wrm3d.c,
wrmaccs.c,
wrmacmod.c,
wrmcmol.c,
wrmdl.c,
wrmicro.c,
wrmimic.c,
wrmiv.c,
wrmm2.c,
wrmm3.c,
wrmopac.c,
wrpcmod.c,
wrpdb.c,
wrpsgv.c,
wrpsgvz.c,
wrsmiles.c,
wrspart.c,
wrsybmol.c,
wrsybyl.c,
wrtinker.c,
wrtorlst.c,
wrunichm.c,
wrwiz.c,
wrxed.c,
wrxyz.c
|
|
|
#define MX_ELEM 105
#include "bbltyp.h"
void get_atomic_weights(ums_type *mol)
{
int i;
for (i = 1; i <= Atoms; i++)
{
Double(i) = atnum2mass(Atomic_number(i));
}
}
double calc_molecular_weight(ums_type *mol)
{
int i;
double amw = 0.0;
for (i = 1; i <= Atoms; i++)
{
amw += atnum2mass(Atomic_number(i));
}
return(amw);
}
double atnum2mass(int atnum)
{
static double aaw[MX_ELEM + 1] =
{
0.000, 1.008, 4.0026, 6.94, 9.01218, 10.81, 12.011, 14.0067, 15.9994,
18.99846, 20.17, 22.98977, 24.305, 26.9815, 28.086, 30.9738, 32.06,
35.453, 39.948, 39.1, 40.08, 44.9559, 47.9, 50.941, 51.996, 54.938,
55.847, 58.9332, 58.71, 63.543, 65.38, 69.72, 72.59, 74.9216, 78.96,
79.904, 83.8, 85.467, 87.62, 88.9059, 91.22, 92.9064, 95.94, 98.9062,
101.07, 102.9055, 106.4, 107.868, 112.4, 114.82, 118.69, 121.75, 127.6,
126.9045, 131.3, 132.9055, 137.34, 138.9055, 140.12, 140.9077, 144.24,
145., 150.4, 151.96, 157.25, 158.9254, 162.5, 164.9303, 167.26, 168.9342,
173.04, 174.97, 178.49, 180.947, 183.85, 186.2, 190.2, 192.22, 195.09,
196.9665, 200.59, 204.37, 207.2, 208.9806, 209., 210., 222., 223., 226.,
227., 232.0381, 231.0359, 238.029, 237.0408, 244., 243., 247., 247.,
251., 254.09, 257.08, 258.098, 259.10, 260.1, 261.1, 262.11
};
if ((atnum < 1) || (atnum > MX_ELEM)) {
fprintf(stderr, "ERROR: Unknown atom number --> %d\n", atnum);
return (0);
}
else
return(aaw[atnum]);
}
|