Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

LOCFAR function equivalent

Jonas_T_2
Beginner
601 Views

It seems that the Powerstation 4.0 Compiler had a builtin function named integer*4 LOCFAR. It is defined as the "segmented address function" opposed to integer*2 LOCNEAR the "unsegmented address function". Is there an equivalent in Intel Visual Fortran?

0 Kudos
1 Solution
Steven_L_Intel1
Employee
601 Views

There is no "segmented addressing" anymore Maybe just use LOC.

View solution in original post

0 Kudos
6 Replies
Steven_L_Intel1
Employee
602 Views

There is no "segmented addressing" anymore Maybe just use LOC.

0 Kudos
jimdempseyatthecove
Honored Contributor III
601 Views

Also be mindful that LOC returns an integer who's width is that of the memory model (4 for 32-bit, 8 for 64-bit).

INTEGER (KIND=INT_PTR_KIND()) :: YOUR_POINTER_AS_INTEGER

Also consult the language reference under POINTER.

Jim Dempsey

 

0 Kudos
Steven_L_Intel1
Employee
601 Views

LOCNEAR and LOCFAR are holdovers from 16-bit Windows. I don't know what you'd even do with a 16-bit address on a 32-bit system!

0 Kudos
Jonas_T_2
Beginner
601 Views

Thank you both for the clarification and the pointer to the pointers.

That's probably why there are just uses of LOCFAR an none of LOCNEAR in the code. I'll just try LOC and will have to be mindful when a swithc to 64bit will occur. But hopefully most of that codebase will be reworked by then.

0 Kudos
mecej4
Honored Contributor III
601 Views

You could take things a step further and note/fix any instances of 2-byte integers in the old code. For example, GETTIM() took 2-byte integer arguments in 16-bit Fortran and, with USE IFPORT, in Intel Fortran. However, the default arguments to GETTIM are 4-byte integers.

0 Kudos
Jonas_T_2
Beginner
601 Views

Thanks, but there was a rework for INTEGER*4 instead of INTEGER*2 a few years ago. This rework will focus on dynamic allocation of memory or object oriented data structures... well as soon as i have it working with the new compiler. There are still a few pitfalls (multiple definitions, type checking shows wrong dimensions on arrays, etc.). But it compiled.

0 Kudos
Reply