When you compile a FORTRAN file containing module declarations, the compiler generates a separate module file for each module declaration in the file. These files are created, by default, in the current directory and in OpenVMS their names consist of the module name followed by the extension F90$MOD.
Consider the following FORTRAN source file named hello_m.f90:
module hello
contains
subroutine say_hello()
write(,) "hello, world!"
end subroutine say_hello
end module hello
module goodbye
contains
subroutine say_goodbye()
write(,) "goodbye, world!"
end subroutine say_goodbye
end module goodbye
You can then compile this file using the command:
fortran hello_m.f90
The compiler will generate two new files named HELLO.F90$MOD and GOODBYE.F90$MOD on the current directory. In addition, it will also generate an object file named hello_m.obj. You can change the directory where this F90$MOD files are generated. To achieve this use the option /MODULE=path-to-module-files. The module files will be generated in the directory path-to-module-files. If all you need are the module files and are not interested in the object file, you can prevent their creation by using the option /NOOBJECT.
The following will compile the same file and create the module files in the directory MY_MODULES it will not generate an object file.
fortran /MODULE=USER$NOBODY:[MY_MODULES] /NOOBJECT hello_m.f90