Remove "implicit none" from f90 code.

Use the complier flag instead.
Fix style issue.
Add limit arguments to functions.