Modules cannot be used until they have been compiled. Normally you would place them in separate files; but they can be in the same file if they precede the code which uses them.
For example, the following code compiles under gfortran 4.7.2
real, parameter :: e = 2.71828182
use math, only : e
print*, "Euler's constant =", e