When I use library functions such as ‘eoshift’ and ‘isnan’ in PVF, errors occured. But in intel fortran compiler, no errors occured.

PVF does not support these library functions ?

When I use library functions such as ‘eoshift’ and ‘isnan’ in PVF, errors occured. But in intel fortran compiler, no errors occured.

PVF does not support these library functions ?

Hi HuWei39533,

“isnan” is a C99 external routine and not part of Fortran. I would highly recommend using the standard F2003 method of using the “ieee_arithmetic” module, and then calling the routine “ieee_is_nan”.

The “eoshift” intrinsic is part of the F95 standard and is supported by PVF. What error are you getting? Can you post a simple reproducing example?

Thanks,

Mat

here is my code:

program MAIN

IMPLICIT NONE

DOUBLE PRECISION :: AX(5)

INTEGER :: ADD

AX=(/1.0d0,1.0d0,1.0d0,1.0d0,1.0d0/)

ADD=0

PRINT *, ’ AX ', Ax(1),Ax(2),Ax(3),Ax(4),Ax(5),ADD

PAUSE

AX( 1:5 )=EOSHIFT( AX(1:5 ),-ADD)

PRINT *, ’ AX ', Ax(1),Ax(2),Ax(3),Ax(4),Ax(5)

PAUSE

end program

when ADD/=0, the result is correct, when ADD=0, the values in AX would all be 0.0d0

This is what I get.

```
PGI$ pgf90 test_eoshift.f90 -V13.6
PGI$ test_eoshift.exe
AX 1.000000000000000 1.000000000000000
1.000000000000000 1.000000000000000 1.000000000000000
0
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>
AX 0.000000000000000 0.000000000000000
0.000000000000000 0.000000000000000 0.000000000000000
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>
```

What compiler version are you using? Many years ago we had a problem with negative zero, but that’s been long fixed.

- Mat

The compiler version I am using is 12.10.

I’ve tried a variety of compielr versions and optimization levels, but still get the same answers. What flags are you passing to the compiler?

- Mat

```
PGI$ pgf90 -V12.10 eoshift.f90 -O2
PGI$ eoshift.exe
AX 1.000000000000000 1.000000000000000
1.000000000000000 1.000000000000000 1.000000000000000
0
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>
AX 0.000000000000000 0.000000000000000
0.000000000000000 0.000000000000000 0.000000000000000
FORTRAN PAUSE: enter <return> or <ctrl>d to continue>
```