title: gfortran: how to control output directory for .mod files
body: <p>Is there is a way to put .mod files, generated by gfortran (GCC), into a separate output directory? I know how to place object files or other output with the -o flag as in:</p>
  
  <pre><code>gfortran -c test.f03 -o /path/to/output/dir/test.o
  </code></pre>
  
  <p>But the .mod files (which are generated by the above call) are not affected by the -o flag and placed in the current directory. Some commercial compilers have a flag like -qmoddir, but I cannot find something similar for gfortran. </p>
  
  <p>If there's no such flag, is it possible to generate the .mod files in an extra step to get the -o flag to work?</p>