NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
184 stars 139 forks source link

bug: advance_cymdh does not compile with nvhpc or cce #594

Closed hkershaw-brown closed 5 months ago

hkershaw-brown commented 7 months ago

:bug: :snail: Your bug may already be reported!

Describe the bug

  1. on Derecho:
    module load nvhpc
    cd /DART/models/wrf/work/ 
    ./quickbuild.sh WRF_DART_utilities/advance_cymdh
  2. success
  3. failure:
    NVFORTRAN-S-0038-Symbol, iargc, has not been explicitly declared (/glade/derecho/scratch/hkershaw/build_everything/nvhpc.2023-12-11T0702/DART/models/wrf/WRF_DART_utilities/advance_cymdh.f90: 7)
    0 inform,   0 warnings,   1 severes, 0 fatal for advance_cymdh
    make: *** [Makefile:72: advance_cymdh.o] Error 2

Which model(s) are you working with?

wrf

Version of DART

v10.9.2

Have you modified the DART code?

No

Build information

Please describe:

  1. Derecho
  2. nvhpc nvfortran 23.1-0
mjs2369 commented 7 months ago

Solution options:

1) Simply add integer, external :: iargc to WRF_DART_utilities/advance_cymdh.f90

2) Replace iargc() with the F2003 “COMMAND_ARGUMENT_COUNT” intrinsic function instead for better portability https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gfortran/ https://gcc.gnu.org/onlinedocs/gfortran/COMMAND_005fARGUMENT_005fCOUNT.html

Here are some comments in the code for the NCEP obs_converter about machines not supporting iargc()

Here we write our own function for COMMAND_ARGUMENT_COUNT() that calls iargc() instead of using the intrinsic? https://github.com/NCAR/DART/blob/74b4221e5f4e41e4de2980fc9ff8697ba4540a8b/models/wrf/WRF_DART_utilities/f2kcli.f90#L78C1-L97C42

mjs2369 commented 5 months ago

Closed as completed via #619