Preprocessor macro issue

Hi,
please help me to understand what is going on. I try to make work following fortran code:

      program macr
      implicit none

      double precision pi

      pi = 4.0d0 *  datan(1.0d0)
!DEC$   IF DEFINED (_TEST_)
           print *, "TEST"
!DEC$   ELSE
           print *, "NOT DEFINED"
!DEC$   ENDIF

#ifdef _TEST_
          print *, "TEST"
#else
          print *, "NOT DEFINED"
#endif
       end

in file macr.F
I use following command line:
pgf90 macr.F
and my output is:
TEST
NOT DEFINED
NOT DEFINED

now I use
pgf90 -D_TEST_ macr.F
which results in
TEST
NOT DEFINED
TEST

Question. Why FORTRAN preprocessor macroses doesn’t work? In MSFORTRAN everything is ok.
Thank you

Hi ar54,

Most Fortran compilers, including PGI, support C style (#ifdef) macro preprocessing. However, support for DEC directives is often more limited. PGI does support some DEC directives on Windows (See Chapter 6 of the PGI User’s Guide for a complete listing), however we do not currently support the “IF DEFINED” directive. If this is something you think we should add, please send a note to trs@pgroup.com with the feature request. For now though, you will need to limit preprocessor macros to the C-style.

Hope this helps,
Mat

Thank you for reply.
I’m fine with C style.