fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
@ Character
Syntax:
@ <interactive_command_file>
Function:
The @ character introduces an interactive command file. Commands are written in an interactive command file in the same way as to the interactive FPT> prompt. The handling differs from the processing of a specification (fsp) file in that:
Interactive command files have the default file name extension ".int".
Interactive command files may invoke other interactive include files in turn to a maximum nesting depth of 10.
Where to Use this Command
Operating system command line | No |
Configuration file, config.fsp | No |
Specification (fsp) files, *.fsp | Yes |
Interactively, to FPT> prompt | Yes |
Interactive command files | Yes |
Embedded in the Fortran code | No |
Note that interactive command files may be invoked from FSP files only after the command % START INTERACT.
Examples
The following interactive command file reformats Gould-SEL Fortran code for compilation on a PC under gfortran:
! sel2pc.int 12-Sep-08 John Christopherson edit symbol names: replace ":" by "_d_" lower case sym free form write continuation character in col 1 no column form declarations ! End of sel2pc.int
fpt is run on the subroutine shown below:
C Handle attempt to fly outside the visual database SUBROUTINE VDB_LIMIT C COMMON /DATAPOOL/ VDB:H, VDB:X, VDB:Y, CART:X, CART:Y, CART:Z REAL*8 VDB:H, VDB:X, VDB:Y, CART:X, CART:Y, CART:Z C IF ((CART:Z .GT. VDB:H) .OR. 1 (ABS(CART:X) .GT. VDB:X) .OR. 1 (ABS(CART:Y) .GT. VDB:Y)) THEN CALL ALARM(5,"Moving outside visual database") CALL LOW_GAIN ENDIF C RETURN END
Note the colon characters which are legal alphabetic characters in Gould-SEL Fortran 77.
The code is displayed interactively under fpt, the command file is invoked, and it is displayed again:
FPT> FPT> type 1 C Handle attempt to fly outside the visual database 2 SUBROUTINE VDB_LIMIT 3 C 4 COMMON /DATAPOOL/VDB:H,VDB:X,VDB:Y,CART:X,CART:Y,CART:Z 5 REAL*8 VDB:H,VDB:X,VDB:Y,CART:X,CART:Y,CART:Z 6 C 8 >> IF ((CART:Z .GT. VDB:H) .OR. 9 1 (ABS(CART:X) .GT. VDB:X) .OR. 9 1 (ABS(CART:Y) .GT. VDB:Y)) THEN 10 CALL ALARM(5,"Moving outside visual database") 11 CALL LOW_GAIN 12 ENDIF 13 C 14 RETURN 15 END 16 C ****** <EOF> ****** FPT> FPT> @sel2pc ******************************************************************************* Editing Symbol Names ==================== CART:X to CART_D_X CART:Y to CART_D_Y CART:Z to CART_D_Z VDB:H to VDB_D_H VDB:X to VDB_D_X VDB:Y to VDB_D_Y ******************************************************************************* FPT> t 1 ! Handle attempt to fly outside the visual database 2 SUBROUTINE vdb_limit 3 ! 4 COMMON /datapool/vdb_d_h,vdb_d_x,vdb_d_y,cart_d_x,cart_d_y, & 4 cart_d_z 5 REAL*8 vdb_d_h,vdb_d_x,vdb_d_y,cart_d_x,cart_d_y,cart_d_z 6 ! 8 >> IF ((cart_d_z .GT. vdb_d_h) .OR. & 9 (ABS(cart_d_x) .GT. vdb_d_x) .OR. & 9 (ABS(cart_d_y) .GT. vdb_d_y)) THEN 10 CALL alarm(5,"Moving outside visual database") 11 CALL low_gain 12 ENDIF 13 ! 14 RETURN 15 END 16 ! ****** <EOF> ****** FPT>
Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.