title: Pre-processing !DEC$ directives in gfortran
body: <p>I've got a large Fortran codebase that originally targeted Intel's compiler. I'm now gearing up to compile with gfortran. Unfortunately, the code is littered with Intel-style pre-processing directives like:</p>
  
  <pre><code>!DEC$ IF DEFINED (MYDIRECTIVE)
     REAL, DIMENSION(:,:,:), ALLOCATABLE :: my_real_var
  !DEC$ ENDIF
  </code></pre>
  
  <p>From what I can tell via googling and the gfortran docs, there is no internal gfortran support for anything besides C-style pre-processing, like:</p>
  
  <pre><code>#if defined MYDIRECTIVE
     REAL, DIMENSION(:,:,:), ALLOCATABLE :: my_real_var
  #endif
  </code></pre>
  
  <p>Has anyone else encountered this problem and come up with an elegant solution? Obviously, I could write a shell script which calls an external pre-processor before passing code to gfortran for compile, but this just doesn't seem like a terrific solution to me.</p>
  
  <p>Any thoughts? Thanks SO gurus!</p>