Why bother with binary file problems instead of using a PDB file from NAMD?
Another issue may be the reading of "n" from the file:
fread(&n, sizeof(INT), 1, fp);
This may differ for 32- and 64-bit CHARMM installations, but presumably NAMD has already made a decision here?
IMHO: The simple solution is to just use CHARMM - your time is certainly much more valuable than computer time (at about $100/core/year)! Not only is CHARMM orders of magnitude more versatile than all other codes (combined?), but it is also significantly faster in serial mode, which is very important since enhanced sampling is most efficiently obtained by running multiple independent simulations, be it REMD or just 20x 50 ns instead of a single 1µs simulation.