Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

Integer Constant declaration

$
0
0

Quick question.   I know that for real constants, it is recommended to declare as (0.0_dp):

integer, public, parameter :: dp = selected_real_kind(p=15, r=307)
real(kind=dp) :: real_number = 0.0_dp

What about integer constants?  Assuming i4 has been defined as int32:

delta = b + 1  would become delta b + 1_i4

Should all integer constants be declared using the "integer_i4" format?   If so, does that include:

1. Do loops=>   do I=1_i4, 14_i4  ?

2. Array index =>   array(1_i4)?

3. Format statements =>  fmt='(10_i4f10.5)'?

Thanks....

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>