********> bugfix.83, revised Author: Bill Ross Date: 2/6/97, revised 2/8/97 Programs: Carnal Severity: Moderate Problem: Problem reading STATIC sets when box is present Revision: First version also repeated bugfix.67 changes (thanks to Peter Slickers for pointing this out). Fix: Make the following changes to static.c: ---------------------------------------------------------------------------- *** OLD static.c --- NEW static.c *************** *** 72,91 **** } /* ! * see if ATOM &/or BOX stmt, determining size of crd array(s) */ for (;;) { if (!strcmp(tok, "ATOM")) { if (statptr->idunion.stat.natoms) inerr("STAT: 2 ATOM statements?", ""); statptr->idunion.stat.natoms = checkatoms(prm, 0); ! } else if (!strcmp(tok, "BOX")) { ! if (box) ! inerr("STAT: 2 BOX statements?", ""); ! box = prm->IfBox; ! if (!box) ! inerr("BOX, but no box in prmtop",""); gettok(); } else break; --- 73,91 ---- } /* ! * see if ATOM &/or NOBOX stmt, determining size of crd array(s) */ + if (prm->IfBox) + box = 1; for (;;) { if (!strcmp(tok, "ATOM")) { if (statptr->idunion.stat.natoms) inerr("STAT: 2 ATOM statements?", ""); statptr->idunion.stat.natoms = checkatoms(prm, 0); ! box = 0; ! } else if (!strcmp(tok, "NOBOX")) { ! box = 0; gettok(); } else break; *************** *** 165,171 **** exit(1); } } ! printf("stat: read in %d atoms\n", i); if (ifmt == RST || ifmt == PDB) break; if (i == 0) --- 165,175 ---- exit(1); } } ! if (box) ! printf("stat: read in %d atoms plus box\n", ! i-1); ! else ! printf("stat: read in %d atoms\n", i); if (ifmt == RST || ifmt == PDB) break; if (i == 0) ---------------------------------------------------------------------------- Temporary workarounds: Specifying prmtop: don't specify (use default prmtop). Box: no workaround. --