Avoid build errors when building with NAG

NAG was not building the library successfully because one of the tidal mixing
routines was using nlev [an intent(in)] as a dimension length, and NAG wants
nlev to be declared above the other variables in that case. Also got rid of
some "unused variables / modules" warnings.