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