How to restructure a code in IVF?

How to restructure a code in IVF?

Has Intel Visual Fortran a tool to restructure a code in the staircase style?
In the case of No - is it planned?
The following is an example:

      IF ( kon.NE.0 ) THEN
         IF ( mark(nmove).LT.0 ) THEN
            ibon = -5
         ELSE
            ibon = 5
         ENDIF
      ELSEIF ( nsq.NE.56 ) THEN
         IF ( nsq.NE.55 ) THEN
            IF ( lsq.EQ.32 ) THEN
               ibon = -5
            ELSEIF ( lsq.EQ.39 ) THEN
               ibon = -5
            ELSEIF ( lsq.EQ.35 ) THEN
               ibon = 10
            ELSEIF ( lsq.EQ.36 ) THEN
               ibon = 10
            ENDIF
         ELSEIF ( lsq.EQ.45 ) THEN
            ibon = 2
         ENDIF
      ELSEIF ( lsq.EQ.46 ) THEN
         ibon = 2
      ENDIF
      END

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

Is this really the same as what you asked in http://software.intel.com/en-us/forums/topic/401269 ?

Steve

No, it is not. That question was about minimizing IFs. This question is about style. How to make a code more readable. Am I writing unclear?

Steve Lionel (Intel)'s picture

The code you showed is in an acceptable style. Are you looking for something that converts other indentation styles to this? The VS code editor will do this as you type, though it won't reformat existing code.

There are tools that do this, such as plusFORT, but all the ones I know of are commercial (not free). Intel has no plans to create such a tool. Do a Google search for "fortran code formatter" or "fortran code beautifier".

Steve

Thank you, Steve! Your answer is that I was looking for.
It’s a pity that Intel has no plans to create such a tool.

Login to leave a comment.