I need to use a large array, where short integers would suffice.
I believe the correct form (in f90) would be something like this:
integer(kind=2) :: short(500,300)
But I can't recall seeing this ever used in code. Will this work across gfortran,
Intel, PGI whatever?
I need to use a large array, where short integers would suffice.
I believe the correct form (in f90) would be something like this:
integer(kind=2) :: short(500,300)
But I can't recall seeing this ever used in code. Will this work across gfortran,
Intel, PGI whatever?
I need to use a large array, where short integers would suffice..
I believe the correct form (in f90) would be something like this: integer(kind=2) :: short(500,300)
But I can't recall seeing this ever used in code. Will this work across gfortran,
Intel, PGI whatever?
I need to use a large array, where short integers would suffice.
I believe the correct form (in f90) would be something like this: integer(kind=2) :: short(500,300)
But I can't recall seeing this ever used in code. Will this work across gfortran,
Intel, PGI whatever?
On Wednesday, October 13, 2021 at 4:30:14 AM UTC-7, Pedro Valdez wrote:
I need to use a large array, where short integers would suffice.There are no guarantees in the standard about specific KIND values.
I believe the correct form (in f90) would be something like this: integer(kind=2) :: short(500,300)
But I can't recall seeing this ever used in code. Will this work across gfortran,
Intel, PGI whatever?
It is not unusual for it to be the number of bytes, (except for COMPLEX, where it is, then, half the number of bytes). There are also some that
number them sequentially.
In the latter case, you would likely get a reasonable sized small integer.
Mention of short might indicate that you are used to the short type
in C or Java, in which case the C interoperability KIND values would
be a good choice.
(As shown by others.) Also, they have been around
long enough to be supported by many compilers.
The ISO_Fortran_end values are newer, and may have less support
in older compilers.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 99:58:17 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,979 |