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

help!!!, very simple code works on linux but not windows

geotarget
Beginner
769 Views

Following code work perfect on Linux but crashed windows

it seems like windows version of compiler does not like POINTER.

How do I fix this problem? I feel really frustrated with this problem....

how do I pass TEMP to another subrountine as argument. it seems windows

version has different requirement....

mark

//////////////////////////////////////////////////////////////////////////////////////

SUBROUTINE

XFG(..................)

REAL TEMP

POINTER (WKTEMP , TEMP (1))

......................................

NMAX = MAX(N1,N2)

ITEM = 2 * ISZ * NMAX

CALL GALLOC (WKTEMP , ITEM, IERR, IABORT)

DO I2=1,N2

DO I1=1,N1

TEMP(I1)=CDATA(I1,I2)

END DO

.....................

0 Kudos
4 Replies
TimP
Honored Contributor III
769 Views
This code is not so simple; it uses Cray pointer extension, which many popular compilers don't support.
Could it be a problem on the C side? Maybe you didn't take into account the difference in default linkage symbols for Cray pointers between linux and Microsoft C compatible Windows Fortran, or maybe you have switched between 32- and 64-bit modes. If you want ifort -Qlowercase -us in Windows, you must specify it. More common usage with Cray pointers is to make the C code agree with the default of the Fortran in use. If you want greater portability, use standard Fortran facilities, either Fortran pointers or f2003 C interoperability. If you are using a compiler which requires a special option to support Cray pointers, read up on it. If you don't know which compilers you are using, you are sure to get lost, and we are sure not to guess the answer.
0 Kudos
geotarget
Beginner
769 Views

Thanks for your quick reply. I am new to intel fortran. my compiler is intelvisual fortran.

how do I specify options tosupport cray pointers inside the windows. I tried the

"-Qlowercase -us" and I, now, have difficulty to link it and it always complaining C library can not found this fortran routine. Yes, I am using C/C++ to call fortran...

Thanks.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
769 Views
Cray pointers work just fine under Windows. Can you be more specific what is the error message?

The code you show us lacks the DIMENSION attribute for the (judging on the usage) array TEMP. Please show us some more code.
0 Kudos
geotarget
Beginner
769 Views

thanks , here is one

SUBROUTINE CFFT2D(CDATA,N1,N2,SIGN,LDA,

1 INIT, TAB1, TAB2, IERR)

C

IMPLICIT NONE

C

INTEGER N1,N2,LDA

INTEGER I1,I2

INTEGER SIGN, INIT, IERR, ISZ, NMAX, IABORT, ITEM

C

REAL TAB1(*), TAB2(*)

COMPLEX CDATA(LDA,N2)

c COMPLEX TEMP

REAL TEMP(MAX(N1,N2))

c POINTER (WKTEMP , TEMP (1))

C

IERR = 0

IABORT = 0

C CALL SIZEFLOAT (ISZ)

ISZ = 4;

NMAX = MAX(N1,N2)

ITEM = 2 * ISZ * NMAX

c CALL GALLOC (WKTEMP , ITEM, IERR, IABORT)

DO I2=1,N2

DO I1=1,N1

TEMP(I1)=CDATA(I1,I2)

END DO

C

C CALL CEFFTP(TEMP,N1,SIGN)

CALL CFFTX (TEMP, 2, N1, SIGN, INIT, TAB1, IERR)

C

C NOW STUFF IT BACK

C

DO I1=1,N1

CDATA(I1,I2)=TEMP(I1)

END DO

C

END DO

C

C NOW THE 2 AXIS

C

DO I1=1,N1

DO I2=1,N2

TEMP(I2)=CDATA(I1,I2)

END DO

C

C CALL CEFFTP(TEMP,N2,SIGN)

CALL CFFTX (TEMP, 2, N2, SIGN, INIT, TAB2, IERR)

C

C NOW STUFF IT BACK

C

DO I2=1,N2

CDATA(I1,I2)=TEMP(I2)

END DO

C

END DO

C

C ALL DONE

C

c CALL GFREE (WKTEMP)

RETURN

END

0 Kudos
Reply