Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Multiline support in the result of a Preprocess Definition

$
0
0

I have a program that has the following fixed formatted code appearing in most of the subroutines.

      CHARACTER(5),PARAMETER,DIMENSION(6)::KEYWORDLIST=
     + ['ABS','EXP','LOG','L10','NEG','SQRT'] 

Since this keyword list is likely to grow over time, I would like to use a macro at the beginning of the source file to have the keyword list be located in one spot and be replicated in the code (this is a shorten version).

#define   KEYPARAM   CHARACTER(5),PARAMETER,DIMENSION(4)::KEYWORDLIST=
     + ['ABS','EXP','LOG','SQRT'] 

The main problem is that I am not able to capture the multiple lines and it is too long to fit on one line.

I can not use the #include and have an extra file, nor compile with extended column support flag. 

Making it a global variable is possible, but I was concerned that it would result in a speed penalty and not be available in the ELEMENTAL/PURE subroutines. This array is used in all the subroutines for matching the keywords in loops and flag checks such as:

      LOGICAL:: KEY
       KEY=ANY(WORD==KEYWORDLIST)
!or
       FOUND=0
       DO I=1, NLIST
         DO J=1, NKEY
            IF( INDEX( LIST(I),TRIM(KEYWORDLIST(J)) ) >0 ) THEN
               FOUND(I)=J
               EXIT
            END IF
         END DO
       END DO

 

Any advice on this would be greatly appreciated.


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>