I never actually used the code snippet above. I'm lazy, what I actually did is "abuse" the existing field "rdrag2" (which is actually the quadratic bottom drag coefficient) in set_vbc.F and initialized it with manning_n values.
This is dangerous and can go very wrong, because the "rdrag2" variable could be used in other parts of the code (not just set_vbc.F) which expect it to be indeed a quadratic bottom friction coefficient, and the application could break. Don't do it.
The bottom line is that unfortunately I don't have a working code file to give you. Sorry.
If you want to implement it correctly, you could try to do the following, and then check with one of the ROMS developers if it's right.
Look up where in the code the drag coefficients (e.g. rdrag2) are defined and used, and add a new one called "manning_n". For reading/writing I would look at least into
*) mod_grid.F
*) get_grid.F
*) wrt_info.F
or if you want analytical values and not read from the grid
*) ana_drag.h
Instead of having e.g this code:
Code: Select all
# elif defined UV_QDRAG
real(r8), intent(out) :: rdrag2(LBi:,LBj:)
# endif
you would have to write something like this:
Code: Select all
# elif defined UV_QDRAG
real(r8), intent(out) :: rdrag2(LBi:,LBj:)
# elif defined MANNING
real(r8), intent(out) :: manning_n(LBi:,LBj:)
# endif
where you introduce a preprocessor variable "MANNING". In most cases (all the input/output boiler plate) it will be pure copy/pasting/replacing text. Except of course in set_vbc.F (and possibly other places) where actual physics code is.
If you have a forward-only application, you might get away with ignoring all the files starting with "ad_*" "rp_*" or "tl_*".