NCAR / spack-derecho

Spack production user software stack on the Derecho system
3 stars 0 forks source link

nvhpc 23/7 atan function error #16

Open jedwards4b opened 11 months ago

jedwards4b commented 11 months ago

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 commented 11 months ago

@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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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