FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


CHANGE KINDS TO DATA SIZES

Syntax:

[DO NOT] CHANGE [DATA] KINDS TO [DATA] SIZES

Function:

All logical, integer, real and complex declarations with data kind specifications of the form, for example, INTEGER(KIND=4), INTEGER(4) or INTEGER(KIND=ki4) are re-written with data size specifications, of the form, for example, INTEGER*4. These declarations are non-standard, but are accepted by all Fortran compilers (Both Fortran 90 and extended Fortran 77) in widespread use.

The command CHANGE DATA SIZES TO KINDS systematically replaces data size specifications with kind specifications. For a discussion of the relative advantages of kind and data size specifications please see Whether to use kinds or data sizes.

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:

Declarations are not changed by default (Note that defaults may be changed in the configuration file).

Example:

The code fragment:

INTEGER,PARAMETER :: kl1=1 INTEGER,PARAMETER :: kl2=2 INTEGER,PARAMETER :: kl4=4 INTEGER,PARAMETER :: kl8=8 INTEGER,PARAMETER :: ki1=SELECTED_INT_KIND(2) INTEGER,PARAMETER :: ki2=SELECTED_INT_KIND(4) INTEGER,PARAMETER :: ki4=SELECTED_INT_KIND(9) INTEGER,PARAMETER :: ki8=SELECTED_INT_KIND(18) INTEGER,PARAMETER :: kr4=SELECTED_REAL_KIND(6,37) INTEGER,PARAMETER :: kr8=SELECTED_REAL_KIND(15,307) : LOGICAL(KIND=kl4)fl,lstat INTEGER(KIND=ki4)i,j,k,n_val,ie INTEGER(KIND=ki1)b REAL(KIND=kr4)dx,dh,ddx,ddh REAL(KIND=kr8)x,h,xic,hic COMPLEX(KIND=kr4)dphase COMPLEX(KIND=kr8)phase

is changed by the commands:

% suppress error 2255
% change kinds to sizes

to:

INTEGER*4,PARAMETER ::kl1=1 INTEGER*4,PARAMETER ::kl2=2 INTEGER*4,PARAMETER ::kl4=4 INTEGER*4,PARAMETER ::kl8=8 INTEGER*4,PARAMETER ::ki1=SELECTED_INT_KIND(2) INTEGER*4,PARAMETER ::ki2=SELECTED_INT_KIND(4) INTEGER*4,PARAMETER ::ki4=SELECTED_INT_KIND(9) INTEGER*4,PARAMETER ::ki8=SELECTED_INT_KIND(18) INTEGER*4,PARAMETER ::kr4=SELECTED_REAL_KIND(6,37) INTEGER*4,PARAMETER ::kr8=SELECTED_REAL_KIND(15,307) INTEGER*4,PARAMETER ::kr16=SELECTED_REAL_KIND(33,4931) ! LOGICAL*4 fl,lstat INTEGER*4 i,j,k,n_val,ie INTEGER*1 b REAL*4 dx,dh,ddx,ddh REAL*8 x,h,xic,hic COMPLEX*8 dphase COMPLEX*16 phase

Note that the diagnostic number 2255, which is used by fpt to mark the change, was suppressed by the SUPPRESS ERROR command.


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