directives / f95

directives / f95

We are using CVF6.6A and have the f95 flag set. This type of thing no longer works:

!DEC$ IF .NOT. DEFINED (PARAMETERS)
... parameter declarations ...
!DEC$ DEFINE PARAMETERS
!DEC$ ENDIF

Please let me know what functionality has replaced this in F95. I have to imagine that conditional compilation in this fashion still is allowed, otherwise when include files are called twice, you will receive many errors. If this functionality is not possible in f95, then how can I keep the compiler from dying when it sees a redeclartion from a .FD file included twice? We have parameters that are used across multiple files and in some cases this results in calling 2 times. to get around it i was going to use the conditional compilation directives....

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

How does it "not work"? It works for me. As I said in an earlier thread, directives are extensions and are flagged as such if you ask for standards checking. They still work, though.

Standard Fortran does not have conditional compilation (not yet, anyway - there have been proposals to add it in a way incompatible with all previous implementations.)

Steve

Retired 12/31/2016

well, when i say it doesn't work, i make all warnings repspond as errors because as far as i am concerned, warnings are errors, so i don't distinguish warnings from errors and when i do this, i can't compile.

thanks for the info, though...

one other thing is that my fortran project is huge with hundreds of files in it, when i start a rebuild-all and i see gobs and gobs of errors/info/warnings come in, i usually stop it because there is a major problem.

If you are enabling standards checking and forcing warnings to errors, then you can't use directives - period. For conditional compilation, an alternative is to use cpp-style conditionals (#ifdef, etc.) and check "Use FPP" under Settings..Fortran..Preprocessor. That won't trip standards warnings.

Steve

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today