Former-commit-id: 4f96ea236a16837e94575a13b66618188c3f19e8
Bulk copied from 2dlattice.c + use gengetopts Former-commit-id: 27a21038f292dc10bfbb36f3dfd509f2d0871240