fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

EXPAND INTERNAL SUBPROGRAMS INLINE

Syntax:

[DO NOT] EXPAND INTERNAL SUB[-]PROGRAMS INLINE

Function:

Internal sub-programs are expanded in-line. Declarations in the internal sub-program are moved to the containing sub-program, and the objects declared are renamed if necessary to avoid name clashes. This command may be used to convert Gould-SEL (Encore) internal sub-programs, which have a different syntax, to standard Fortran. It may also be used for standard Fortran sub-programs.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt Yes
Interactive command files Yes
Embedded in the Fortran code Yes

Default

Internal sub-programs are not expanded by default (Note that defaults may be changed in the configuration file).

Examples

The code fragment:

DO I=1,7 IF (A(1,I+1) .LT. A(1,I)) THEN DO J=1,8 CALL SWAP ENDDO ENDIF ENDDO RETURN : INTERNAL SUBROUTINE SWAP ITEMP=A(J,I) A(J,I)=A(J,I+1) A(J,I+1)=ITEMP RETURN END INTERNAL

is changed by the command:

% expand internal sub-programs inline

to:

INTEGER*4 itemp REAL*8 a(8,8) INTEGER i,j ! DO i=1,7 IF (a(1,i+1) .LT. a(1,i)) THEN DO j=1,8 ! **************************************************************************** ! ! fpt CALL swap ! itemp=a(j,i) a(j,i)=a(j,i+1) a(j,i+1)=itemp ! fpt RETURN swap ! ! **************************************************************************** ENDDO ENDIF ENDDO RETURN ! ! fpt INTERNAL SUBROUTINE swap ! fpt itemp=a(j,i) ! fpt a(j,i)=a(j,i+1) ! fpt a(j,i+1)=itemp ! fpt RETURN ! fpt END INTERNAL

Note that the code of the internal sub-program is commented-out.

Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.