Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of atan intrinsic function #324

Open
jedwards4b opened this issue Nov 21, 2024 · 4 comments
Open

Incorrect use of atan intrinsic function #324

jedwards4b opened this issue Nov 21, 2024 · 4 comments
Assignees

Comments

@jedwards4b
Copy link
Collaborator

the intrinsic function atan has only one argument, but it is used with two here. This is causing an error in the nvhpc compiler. I'm not sure why the other compilers do not complain?

@marshallward
Copy link

Hi Jim, the standard supports interfaces with both one and two arguments. This could be an Nvidia bug.

@marshallward
Copy link

I think changing this atan2 might be a safe option.

@jedwards4b
Copy link
Collaborator Author

@marshallward Thanks, I found a reference here. I'll try atan2 and also see if I can file an issue with nvidia.

@jedwards4b
Copy link
Collaborator Author

Using atan2 appears to work. This was tested with nvhpc/24.3 and nvhpc/24.9 using test:

program test_atan2
  real(4) :: x = 1.e0_4, y = 0.5e0_4
  real(4) :: z
  z = atan(y,x)
  print *,'atan(',y,',',x,') =',z 
  z = atan2(y,x)
  print *,'atan2(',y,',',x,') =',z
end program test_atan2

nvfortran test_atan.F90
/usr/bin/ld: /glade/derecho/scratch/cesmrt/tmp/nvfortranYcyvwwAdBk4T.o: in function MAIN_': /glade/u/home/cesmrt/test_atan.F90:4: undefined reference to atan_'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants