Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Intel Fortran macros

Ben136KBC
Novice
579 Views

*I am attempting to define a macro iidatac which is defined to be "iidata," (note the comma at the end) or in some cases "" (blank, nothing).

So on the command line I add:

    /define:"iidatac=iidata,"

But then in the code I get this:

..\BlenderUnitOperation\krs_fortran_code\IsCacheableAssay.f90(1): error #5082: Syntax error, found IDENTIFIER 'IASSAYNUMBER' when expecting one of: ) ,
logical function IsCacheableAssay (iidatac iAssayNumber)
--------------------------------------------------^

Why? I expect the line "logical function IsCacheableAssay (iidatac iAssayNumber)" to become "logical function IsCacheableAssay (iidata, iAssayNumber)"

The manual does not contain much explanation of these subtleties...

Please help!

 

0 Kudos
4 Replies
Ben136KBC
Novice
569 Views

Hmm if a preprocess it with /E, then I see the correct substitution. So why is the compiler complaining then?

I also need to use this macro:

/define:"iidatap=iidata%"

But when I preprocess the file, the % seems to disappear?

0 Kudos
Ben136KBC
Novice
563 Views

I am using:

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.5.281 Build 20190815
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.

0 Kudos
Ben136KBC
Novice
553 Views

Ok, it looks like you need /fpp to get it to process the macros.

0 Kudos
Ben136KBC
Novice
550 Views

And for the % to work, you need %%% if it is inside a makefile. I am not a fan of macros, but in some cases they are necessary.

0 Kudos
Reply