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

f03 standard

roddur
Beginner
1,279 Views
when i tried compiling my code with -stand f03 on, i get these warnning message

warning #7410: Fortran 2003 does not allow this keyword. [AUTOMATIC]
real(8),automatic,dimension(lorbit) :: p2,p3,p4
here lorbit is a parameter defined in another module and "use"d

warning #6477: Fortran 2003 does not allow this statement or directive.
!$OMP PARALLEL
this warnning is issued for all !$OMP declaration

So what is the wayout? specially what is the replacement for AUTOMATIC attribute?




0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,279 Views
For AUTOMATIC, remove that keyword and add RECURSIVE to the routine. When you're using OpenMP this is the default anyway.

We decided that directives were the equivalent of statements and issue standards warnings for them.
0 Kudos
roddur
Beginner
1,279 Views
For AUTOMATIC, remove that keyword and add RECURSIVE to the routine. When you're using OpenMP this is the default anyway.

We decided that directives were the equivalent of statements and issue standards warnings for them.
Steve,one idiotic question....being to lazy to check.

is the way you suggest are supposed to have same effect or i SHOULD check? and there is one automatic in main routine. what to do with that?
0 Kudos
Steven_L_Intel1
Employee
1,279 Views
RECURSIVE will make all local variables automatic (except for those with initialization or SAVE.

The AUTOMATIC in the main routine could just be removed.
0 Kudos
roddur
Beginner
1,279 Views
RECURSIVE will make all local variables automatic (except for those with initialization or SAVE.

The AUTOMATIC in the main routine could just be removed.
few days ago Jim Dempsey was kind enough to comment on the code that:
! use automatic to place on stack
! otherwise may get placed in static storage (SAVE)
! depending on compile time options

I am just using the commadline argument ifort -c -O3 -static -openmp -stand f03

hope this will not affect!right?
0 Kudos
roddur
Beginner
1,279 Views
Dear Steve,
Since you are watching, one more idiotic question:
f03 standard seems not to accept generic function like dabs/dfloat etc.
do it take the precision depending upon the precision of the result?i.eif i say,
xx=float(yy)
so float will be as precision declared for xx or what?
0 Kudos
TimP
Honored Contributor III
1,279 Views
Quoting - roddur
few days ago Jim Dempsey was kind enough to comment on the code that:
! use automatic to place on stack
! otherwise may get placed in static storage (SAVE)
! depending on compile time options

I am just using the commadline argument ifort -c -O3 -static -openmp -stand f03
Jim Dempsey nearly always gives good advice. This is one point where I would advise you to take Steve Lionel's advice.
ifort doesn't default to SAVE status for scalars unless you request it specifically. Default SAVE status for arrays can be prevented by taking Steve's advice. As you and Steve said, -openmp on the compile command line also avoids any default SAVE problems.
-static refers to library linkage. It has been years since I saw a compiler where it referred to default SAVE.
0 Kudos
roddur
Beginner
1,279 Views
Quoting - tim18
Jim Dempsey nearly always gives good advice. This is one point where I would advise you to take Steve Lionel's advice.
ifort doesn't default to SAVE status for scalars unless you request it specifically. Default SAVE status for arrays can be prevented by taking Steve's advice. As you and Steve said, -openmp on the compile command line also avoids any default SAVE problems.
-static refers to library linkage. It has been years since I saw a compiler where it referred to default SAVE.
Not only advice, Jim that time did much more then that...but rightnow he is invisible here, or atleast for me.
0 Kudos
Steven_L_Intel1
Employee
1,279 Views
Quoting - roddur
Dear Steve,
Since you are watching, one more idiotic question:
f03 standard seems not to accept generic function like dabs/dfloat etc.
do it take the precision depending upon the precision of the result?i.eif i say,
xx=float(yy)
so float will be as precision declared for xx or what?
DABS is a standard specific function - it is not generic. DFLOAT is an extension.

I recommend using generics. In the case of ABS, if you say xx=ABS(yy), the result will be the kind of yy, so if yy is a double, ABS(yy) will be double.

The standard way of saying DFLOAT is DBLE. You can also say REAL(yy,kind=KIND(0.0D0)).
0 Kudos
Reply