Create interface for global subroutines (fixes all warnings)

Also fix a forall warning. Now there are no more warning in gfortran.

More importantly, there are no implicit (undefined) calls to subroutines, so the compiler can always check the exact type.