- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have compiled our code on an ItaniumII RedHat system, using the intel compilers. This code was originally compiled on 32 bit platforms (win/linux/etc). My question is this:
We use the LOC function, defined as Integer*4. What size will this be in 64 bit? Do I need to define anything differently, when using the Fortran ALLOCATE functions to take advantage of the 64 bit platform (>2GB arrays).
Getting a little confused, if anyone has any links to help it would be much appreciated!
Thanks
Ben
I have compiled our code on an ItaniumII RedHat system, using the intel compilers. This code was originally compiled on 32 bit platforms (win/linux/etc). My question is this:
We use the LOC function, defined as Integer*4. What size will this be in 64 bit? Do I need to define anything differently, when using the Fortran ALLOCATE functions to take advantage of the 64 bit platform (>2GB arrays).
Getting a little confused, if anyone has any links to help it would be much appreciated!
Thanks
Ben
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Fortran Language reference .pdf which comes with the compilers, it defines LOC as INTEGER(KIND=8) for IPF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel Fortran defines an intrinsic function INT_PTR_KIND which can be used in declarations for integer pointers to get the right "kind" for use with LOC. For example:
integer (kind=int_ptr_kind()) my_pointer
Addresses are 64-bits on Itanium-based systems as well as the new Intel EM64T-based systems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the quick replies. I am interested in the INT_PTR_KIND, but a little unsure how I could use this. My definitions are:
INTEGER(INT4),DIMENSION(:),POINTER :: MT
REAL (REAL8),DIMENSION(:),POINTER :: VR
Where INT4 and REAL8 are defined as:
INTEGER, PARAMETER :: INT4 = SELECTED_INT_KIND (6)
! FOR SINGLE PRECISION
INTEGER, PARAMETER :: REAL8 = SELECTED_REAL_KIND (6,30)
Can I use these intrinsic functions to get the correct kind to take advantage of th 64bit platforms?
Thanks again
Ben
INTEGER(INT4),DIMENSION(:),POINTER :: MT
REAL (REAL8),DIMENSION(:),POINTER :: VR
Where INT4 and REAL8 are defined as:
INTEGER, PARAMETER :: INT4 = SELECTED_INT_KIND (6)
! FOR SINGLE PRECISION
INTEGER, PARAMETER :: REAL8 = SELECTED_REAL_KIND (6,30)
Can I use these intrinsic functions to get the correct kind to take advantage of th 64bit platforms?
Thanks again
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are using the Fortran 90 POINTER feature, in which case the compiler handles this all for you automatically. The INT_PTR_KIND intrinsic would be useful when you want to store an address in an INTEGER variable, and therefore you need to declare the INTEGER variable as the right size. As long as you're not using LOC (or %LOC), or routines such as malloc and free, you typically don't need to know the address size.
Even if you are using LOC, if you used the "integer pointer extension", with syntax such as:
POINTER (P, V)
then the compiler properly declares P to be an integer of the correct size. You would want INT_PTR_KIND if you were storing an address in an array or derived type component - a context where theinteger pointerextension is not permitted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see, elsewhere we do use LOC, so I will make sure that it is defined with INT_PTR_KIND and not INT4.
Thanks!
Ben
Thanks!
Ben

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page