Reproducible production of nanoporous carbon membranes