Re: busting sp datatypes



wim wrote:
(I wrote)

KIND(0) will be the appropriate KIND for default
(single precision) integer. (Though integer data is
not usually described as single and double precision.)

There may not be a standard way to generate a double
length integer variable.

what about using selected_int_kind?

$ cat int.f90
program int
implicit none
integer :: i
do i = 1,20
print *, i, selected_int_kind(i)
end do
end program int

This should show you what you need for a double length integer.
Here, it gives: 1,2,4, and 8. 4 is the one you get with a default
integer.

That shows you something longer than a default integer,
but doesn't guarantee it is twice as long. (A system
might have integers of 16, 32, and 48 bits, for example.)

C_SIZEOF(), when available, might be the only way to find
the actual amount of storage taken up by a variable
(including padding bits internal to the variable, or
that are necessary between such variables).

-- glen

.



Relevant Pages

  • Re: how to declare doubles in f95
    ... least an option to make single precision be 64 bits in order to ... I don't remember that option on the IBM compilers, ... IMPLICIT REAL*8 ...
    (comp.lang.fortran)
  • Re: how to declare doubles in f95
    ... least an option to make single precision be 64 bits in order to ... facilitate porting of such code. ... I don't remember that option on the IBM compilers, ... IMPLICIT REAL*8 ...
    (comp.lang.fortran)
  • Re: busting sp datatypes
    ... glen herrmannsfeldt wrote: ... There may not be a standard way to generate a double ... end program int ...
    (comp.lang.fortran)
  • Re: not able to use implicit none
    ... This code does not work if the implicit none line is uncommented. ... end program bessel ... IMPLICIT NONE is specified in the local scope, therefore an explicit type must be specified for function "BSJ0_". ... is single precision or double precision, and I can't recall off the top of my head what Absoft's kind values are, anyway. ...
    (comp.lang.fortran)
  • Re: Odd omp_get_wtime()
    ... Walter Spector wrote: ... IMPLICIT NONE, Fortran assumed it was a single precision value. ...
    (comp.lang.fortran)