def write_pdb(ofile, c):
    """ Write the Crys in .pdb file format"""
    print(
        'CRYST1{0:>9.3f}{1:>9.3f}{2:>9.3f}{3:>7.2f}{4:>7.2f}{5:>7.2f} P 1           1'
        .format(c.length[0], c.length[1], c.length[2], c.angle_deg[0], c.
        angle_deg[1], c.angle_deg[2]), file=ofile)
    for i in range(c.natom):
        print(
            '%-6s%5d %4s%1s%3s %1s%4d%1s   %8.5f%8.5f%8.5f%6.2f%6.2f          %2s%2s'
             % ('ATOM', i + 1, c.atom_element[i], '', 'XXX', 'X', 1, '', c.
            atom_fract[i][0], c.atom_fract[i][1], c.atom_fract[i][2], 1.0, 
            0.0, c.atom_element[i], ''), file=ofile)
    return
