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

nvhpc 23/7 atan function error #16

Open
jedwards4b opened this issue Nov 22, 2023 · 4 comments
Open

nvhpc 23/7 atan function error #16

jedwards4b opened this issue Nov 22, 2023 · 4 comments
Assignees

Comments

@jedwards4b
Copy link

forces%omega_w2x(i,j) = atan(tauy_at_h(i,j), taux_at_h(i,j))

NVFORTRAN-S-0038-Symbol, atan, has not been explicitly declared (/glade/work/jedwards/sandboxes/cesm2_x_alpha2/components/mom/MOM6/config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90)                                 
  0 inform,   0 warnings,   1 severes, 0 fatal for convert_iob_to_forces          

atan should be an intrinsic and not generate an error.

@benkirk
Copy link

benkirk commented Nov 22, 2023

@jedwards4b that looks like it should be atan2(Y,X), no? AFAIK the standards compliant atan intrinsic would be the single argument one, right?

(https://fortranwiki.org/fortran/show/atan2)

@benkirk
Copy link

benkirk commented Nov 22, 2023

Ahh, Fortran 2008 overloads the atan to also have a 2-argument variant
https://fortranwiki.org/fortran/show/atan

Maybe some F08 flags are needed, hmm..

@benkirk
Copy link

benkirk commented Nov 22, 2023

Hmm, I think nvfortran 2008 support is known incomplete?:

... and many features of Fortran 2008...

FWIW, I can replicate here: /glade/work/benkirk/bugreports/compilers/nvhpc/atan_atan2

nvfortran(1)                                        General Commands Manual                                        nvfortran(1)

NAME
       nvfortran - The NVIDIA Fortran compiler

SYNOPSIS
       nvfortran [ -flag ]...  sourcefile...

DESCRIPTION
       nvfortran  is  a Fortran compilers for NVIDIA GPUs and AMD and Intel CPUs.  nvfortran supports ISO Fortran 2003 and many
       features of Fortran 2008, supports GPU parallel programming with OpenACC, and supports multicore  CPU  programming  with
       OpenACC and OpenMP.  nvfortran invokes the Fortran compiler, assembler, and linker with options derived from its command
       line arguments.

@jedwards4b
Copy link
Author

@benkirk thanks for researching - I will ask the developers if they can just use atan2 instead since it sounds like that should work.

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

2 participants