Hello,
I am not able to answer all your questions (my BAW colleagues will probably explain how they generated the file in the Donau example, anyway I do not like very much this formatted file that raises problems in parallel, with the loop on the original global number of points, it would probably be better it it were a Selafin file that would be split in parallel) but to answer one of your questions the code number is quite arbitrary.
If you have a simple definition of your zones that can be written in Fortran it is not necessary to read a file. If you are able to add your code number as a variable given in the geometry file, like what is done with bathymetry and friction, it should not be too difficult to read it, like what is done in subroutine FONSTR in library bief, with subroutine FIND_IN_SEL, so you can consider these two options.
Regards,
Jean-Michel Hervouet