Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29281 Discussions

Interesting Observation with Intel Fortran and VS 2019

JohnNichols
Valued Contributor III
806 Views

The automatic formatting in VS has a problem if there is a do statement in an if block.  The following statements give an example: 

 

if(RCA(M, Zi) .eq. 0) then

    else

        allocate (YPLOTA(P,RCA(M, Zi)), STAT = astat)
        if(astat == 0) then
            write(*,*)"Allocated matrix RCA(K,K)"
        else
            stop "Failed to allocate matrix RCA(K,K)"
        end if
        do 400 i = 1,51
            if(zi .eq. Z(i)) then

                YPLOTA(:,count) = X(:,i)
                count = count + 1
            endif
400 end do


    YMAX = maxval(YPLOTA)

 

 

Line 17 and line 20 are incorrectly placed if you are following the intent of the algorithm for setting out the code.  This is pulled from a few hundred lines, all the lines after 20 are incorrectly placed. 

I do not know if there is a fix?

 

0 Kudos
2 Replies
andrew_4619
Honored Contributor III
791 Views

The numbers mess thing up, why have those at all?

 

0 Kudos
DavidWhite
Valued Contributor II
765 Views

I think that using the do numbering confuses the formatting between free format and fixed formatting.

 

When DO / END DO is used without numbers, the indentation normally works for me.

0 Kudos
Reply