Hi Sven,
It is possible to save your roughness directly in the geometry file and it will be read by T2D at runtime. In this way you can avoid programming roughness assignment in a fortran subroutine. You can use polygons in Blue Kenue or Fudaa-prepro to do so.
Personally, I define my zones using more or less complex polygons in BlueKenue. I assign roughness values to each polygon and map it on the mesh which I then save as an slf. Your geometry file will then contain two data layers (FOND and FROTTEMENT in the french version). I do a test run in T2D and update the roughness value as necessary until I get expected results.
If drawing polygons becomes tedious (irregular channels), I work with an xyz roughness map and assign individual values to nodes using an AWK routine (any language will do). I then triangulate this data set in BlueKenue and map it to the mesh. Export this in the geometry slf and I'm ready to go.
See attached figure for an example of irregular roughness zone definition in Blue Kenue. The main channel roughness is in blue.
cheers
jeremie