Skip to content

[release/gfs.v17] Fix NCO fix-now compiler warnings in GDASApp and JEDI submodules - #2254

Open
guillaumevernieres wants to merge 9 commits into
release/gfs.v17from
hotfix/warnings-508c40a4
Open

guillaumevernieres wants to merge 9 commits into
release/gfs.v17from
hotfix/warnings-508c40a4

Conversation

@guillaumevernieres

Copy link
Copy Markdown
Contributor

Description

Fixes NCO "fix-now" compiler warnings flagged against release/gfs.v17, in
GDASApp itself and in the JEDI submodules it builds.

GDASApp changes

  • utils/obsprep/Ghrsst2Ioda.h, Smap2Ioda.h, Viirsaod2Ioda.h: replace
    runtime-sized stack arrays (float lat[dim0][dim1], etc. — non-standard
    C++ VLAs) with std::vector buffers read via .data(), indexing with
    i*ncol+j. Same values, same loop order; the NOLINT markers that were
    hiding the VLA lint go away with them.
  • utils/soca/coupled/gdas_soca_to_fv3.h, utils/soca/diagb/gdas_soca_diagb.h,
    utils/soca/diagnostics/gdas_soca_diagnostics.cc: add missing override
    on execute() / appname().

Submodule bumps

Each submodule is pointed at a hotfix/warnings-<base-sha> branch cut from
the exact commit release/gfs.v17 currently uses, containing only the
warning fixes for that repo:

Submodule Base Hotfix branch Companion PR
sorc/fv3-jedi f467912c hotfix/warnings-777c784b
sorc/fv3-jedi-lm 5994c385 hotfix/warnings-d1826a7
sorc/ioda 724af19e hotfix/warnings-release-211
sorc/saber c8e0e3c3 hotfix/warnings-c8e0e3c3
sorc/soca c9a94cb5 hotfix/warnings-c9a94cb
sorc/ufo bb78f475 hotfix/warnings-bb78f475

Two of the submodule fixes are behavior changes rather than pure warning
suppression and deserve a closer look on the UFO side (see the UFO PR):
a comma-operator loop bound in filters/Variables.cc that could read past
oopsvars.size(), and a missing GroupBy::RECORD_ID case in
filters/ObsAccessor.cc that made record-number grouping a no-op.

.gitmodules note: the hotfix branches for saber, ioda, ufo,
fv3-jedi-lm, and fv3-jedi live in the jcsda-internal forks, so the
submodule URLs are switched from jcsda/* to jcsda-internal/*. This is
intentional so the pinned SHAs are fetchable, but reviewers should decide
whether that's acceptable for the release branch or whether the fixes need
to land in the public jcsda/* repos first and the URLs reverted.

No change of answers is expected from this PR.

Companion PRs

  • NOAA-EMC/soca: hotfix/warnings-c9a94cb
  • JCSDA-internal/ufo: hotfix/warnings-bb78f475
  • JCSDA-internal/ioda: hotfix/warnings-release-211
  • JCSDA-internal/saber: hotfix/warnings-c8e0e3c3
  • JCSDA-internal/fv3-jedi: hotfix/warnings-777c784b
  • JCSDA-internal/fv3-jedi-linearmodel: hotfix/warnings-d1826a7

Issues

Refs NOAA-EMC/global-workflow#6178

Automated CI tests to run in Global Workflow

  • atm_jjob
  • C96C48_ufs_hybatmDA
  • C96C48_hybatmsnowDA
  • C96_gcafs_cycled
  • C48mx500_3DVarAOWCDA
  • C48mx500_hybAOWCDA
  • C96C48_hybatmDA
  • C96C48_ufsgsi_hybatmDA

@RussTreadon-NOAA

Copy link
Copy Markdown
Contributor

Conduct the following test on WCOSS2 Cactus

  • clone g-w dev/gfs.v17 at e271e9e
  • checkout hotfix/warnings-508c40a4 at df6e3d0 in sorc/gdas.cd
  • follow the instructions in docs/Release_Notes.md to build GFS v17

The build ran to completion.

A check of sorc/build_gdas.log finds 51 lines containing : remark and 920 lines containing : warning. Of the 920 warning lines,

  • 677 are warning #858: type qualifier on return type is meaningless from ioda, saber, and oops
  • 200 are /apps/prod/eckit/install-1.28.0/include/eckit/exception/Exceptions.h(189): warning #2651: attribute does not apply to any entity
  • 22 are warning #6178: The return value of this FUNCTION has not been defined.

These warnings may not be on NCO's fix now list.

@CatherineThomas-NOAA

Copy link
Copy Markdown
Collaborator

Thanks for the PR @guillaumevernieres and thanks for testing @RussTreadon-NOAA. From the remaining warnings listed, here's how it compares to NCO's list:

  • warning#858: Can be addressed later
  • warning #2651: Not on the list at all?
  • warning #6178: Fix now - but @guillaumevernieres indicated that these are likely a false positive results

@guillaumevernieres

Copy link
Copy Markdown
Contributor Author

The 22 #6178 warnings ("return value of this FUNCTION has not been defined") are not bugs in our code. 8 are a confirmed Intel ifort false positive; the other 14 come from a pre-built dependency. Recommend documenting as a known false positive rather than changing source.

Build: WCOSS2, ifort 19.1.3.304, RelWithDebInfo (-O2 -g -DNDEBUG -heap-arrays 32), 0 errors.

[CSTR_PTR] × 8: false positive

All 8 trace to f_string_to_c_dup in ioda/src/engines/ioda/fortran/f_c_string_mod.f90:44. Its result cstr_ptr is assigned unconditionally on the first executable statement (cstr_ptr = c_null_ptr) and again via c_alloc, so no path leaves it undefined. There are exactly 8 files that use f_c_string_mod: ifort reports the warning once per caller, with no line number.

[CPTR] × 14: in a dependency

No function with a cptr result exists in any bundled repo. The warnings land in saber, ufo, soca, fv3-jedi and oops, whose only common modules are fckit and atlas (pre-built installs). To pin it down on a 19.1.3 toolchain, compile a one-line use <module> probe per fckit/atlas module with the build flags and see which one emits #6178 ... [CPTR].

The diagnostic is compiler-version dependent

The same source with ifort 2021.13 emits zero #6178 (no -diag-disable involved; #5462 still fires in both builds). Public reports show the opposite pattern (clean on 2021.5, warns on 2021.6), and Intel forum threads on the identical #6178 [CPTR] warning conclude the diagnostic is wrong:

No official Intel erratum found.

@RussTreadon-NOAA

Copy link
Copy Markdown
Contributor

Not sure GDASApp CI works with the release/gfs.v17 branch. Let's try and see what happens.

@emcbot

emcbot commented Sep 29, 2026

Copy link
Copy Markdown

Automated GW-GDASApp Testing Results:
Machine: gaeac6

Start: Tue Sep 29 11:02:03 AM EDT 2026 on gaea68
---------------------------------------------------
Build:                                  *FAILED*
Build: Failed at Tue Sep 29 11:20:11 AM EDT 2026
Build: see output at /gpfs/f6/ira-sti/scratch/role.jedipara/CI/gaeac6/GDASApp/workflow/PR/2254/global-workflow/sorc/log.build

@RussTreadon-NOAA

Copy link
Copy Markdown
Contributor

Build failures

The build of hotfix/warnings-508c40a4 at ced8066 failed on Gaea C6 with the error:

/gpfs/f6/ira-sti/scratch/role.jedipara/CI/gaeac6/GDASApp/workflow/PR/2254/global-workflow/sorc/gdas.cd/bundle/gdas/mains/gdas.cc:12:10: fatal erro\
r: 'ufo/instantiateObsErrorFactory.h' file not found
   12 | #include "ufo/instantiateObsErrorFactory.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [gdas/mains/CMakeFiles/gdas.x.dir/build.make:76: gdas/mains/CMakeFiles/gdas.x.dir/gdas.cc.o] Error 1

git status in sorc/gdas.cd shows that clone of hotfix/warnings-508c40a4 is not complete.

        modified:   parm/jcb-algorithms (new commits, modified content)
        modified:   parm/jcb-gdas (new commits, modified content)
        modified:   sorc/bufr-query (new commits, modified content)
        modified:   sorc/da-utils (new commits, modified content)
        modified:   sorc/gsw (modified content)
        modified:   sorc/jcb (new commits, modified content)
        modified:   sorc/jedicmake (modified content)
        modified:   sorc/land-jediincr (new commits, modified content)
        modified:   sorc/oops (new commits, modified content)
        modified:   sorc/soca (new commits, modified content)
        modified:   sorc/spoc (new commits)
        modified:   sorc/vader (new commits, modified content)

Label-based CI runs from role.jedipara on Gaea C6. Account role.jedipara can not access jscsda-internal repositories.

Change gears and attempt to clone and build as russ.treadon on Cactus. Do the following on Cactus:

  1. cd /lfs/h2/emc/ptmp/russ.treadon
  2. mkdir pr2254
  3. cd pr2254
  4. git clone -b hotfix/warnings-508c40a4 --recursive https://github.com/noaa-emc/gdasapp.git .

Branch hotfix/warnings-508c40a4 was successfully cloned.

russ.treadon@clogin07:/lfs/h2/emc/ptmp/russ.treadon/pr2254> git branch
* hotfix/warnings-508c40a4
russ.treadon@clogin07:/lfs/h2/emc/ptmp/russ.treadon/pr2254> git status
On branch hotfix/warnings-508c40a4
Your branch is up to date with 'origin/hotfix/warnings-508c40a4'.

nothing to commit, working tree clean
russ.treadon@clogin07:/lfs/h2/emc/ptmp/russ.treadon/pr2254> git log --oneline | head -1
ced8066e Merge branch 'release/gfs.v17' into hotfix/warnings-508c40a4

However, the Cactus build fails

russ.treadon@clogin07:/lfs/h2/emc/ptmp/russ.treadon/pr2254> ./build.sh -v -f 
Start ... Tue Sep 29 15:43:28 UTC 2026
Building GDASApp on wcoss2
Resetting modules to system default. Reseting $MODULEPATH back to system default. All extra directories will be removed from $MODULEPATH.

Currently Loaded Modules:
  1) craype-x86-rome    (H)   7) craype/2.7.17      13) pnetcdf-D/1.12.2  19) sp/2.4.0       25) nco/5.2.4      31) fckit/0.13.1
  2) libfabric/1.20.1         8) cray-pals/1.3.2    14) netcdf-D/4.9.2    20) python/3.12.0  26) gsl/2.7        32) atlas/0.39.0
  3) craype-network-ofi (H)   9) git/2.29.0         15) udunits/2.2.28    21) pio-D/2.5.10   27) bufr/12.3.0    33) GDAS/wcoss2.intel
  4) envvar/1.0              10) intel/19.1.3.304   16) eigen/3.4.0       22) ve/gfs/17.0    28) fms-D/2024.01
  5) PrgEnv-intel/8.5.0      11) cray-mpich/8.1.19  17) boost/1.79.0      23) ecbuild/3.7.2  29) esmf-D/8.8.0
  6) cmake/3.27.9            12) hdf5-D/1.14.0      18) gsl-lite/v0.40.0  24) qhull/2020.2   30) eckit/1.28.0

  Where:
   H:  Hidden Module

 

Cloning into '/lfs/h2/emc/ptmp/russ.treadon/pr2254/sorc/soca'...
fatal: unable to access 'https://github.com/jcsda/soca/': SSL certificate problem: unable to get local issuer certificate

@guillaumevernieres : How do you build hotfix/warnings-508c40a4 on Cactus?

@guillaumevernieres

Copy link
Copy Markdown
Contributor Author

Appologies @RussTreadon-NOAA , I'm pointing to jcsda-internal for all the jedi branches. I'll push to the NOAA-EMC fork and change the url again.

@guillaumevernieres

Copy link
Copy Markdown
Contributor Author

I just pushed to my fork of the g-w with the correct submodule commits:

 git clone --recursive --branch feature/ee2-warnings-gv https://github.com/guillaumevernieres/global-workflow.git

I just tested on Ursa and the above builds.

@AndrewEichmann-NOAA AndrewEichmann-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing obviously wrong by inspection

@RussTreadon-NOAA

Copy link
Copy Markdown
Contributor

WCOSS2 build test

Did the following on Cactus:

  1. Clone g-w dev/gfs.v17 in /lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0
  2. cd sorc/gdas.cd
  3. git checkout hotfix/warnings-508c40a4
  4. git pull
  5. git submodule update --init --recursive
  6. cd ..
  7. ./build_all.sh gfs gdas gsi > log.build 2>&1 &

The gfs, gdas, and gsi builds successfully completed.

Examine sorc/logs/build_gdas.log. Exclude warnings 858, 2651, and 6178. The following warning messages remain in build_gdas.log.

russ.treadon@clogin06:/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/logs> grep ": warning" build_gdas.log  | grep -v "warning #858" | grep -v "warning #2651" | grep -v "warning #6178"
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/jediincr.dir/sorc/NoahMPdisag_module.f90.o: warning: relocation against `noahmpdisag_module._' in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
: warning: relocation in read-only section `                 from /lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/mpi/mpi.cc(11):
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/bufr_query.dir/src/bufr/DataContainer.cpp.o: warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/util/Stacktrace.cc(43): warning #2196: routine is both "inline" and "noinline"
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/util/Stacktrace.cc(43): warning #2196: routine is both "inline" and "noinline"
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/bufr_python.dir/DataObjectFunctions.cpp.o: warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /apps/prod/hpc-stack/i-19.1.3.304__m-8.1.19__h-1.14.0__n-4.9.2__p-2.5.10__e-8.8.0_pnetcdf/intel-19.1.3.304/cray-mpich-8.1.19/fms/2024.01/lib/libfms_r8.a(fms_string_utils_binding.c.o): warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/ioda_engines.dir/src/ioda/Attribute.cpp.o: warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/_ioda_python.dir/py_ioda.cpp.o: warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/ioda.dir/ObsSpace.cc.o: warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/ufo/src/ufo/operators/scatwind/NeutralMetOffice/ufo_scatwind_neutralmetoffice_tlad_mod.F90: warning #5462: Global name too long, shortened from: ufo_scatwind_neutralmetoffice_tlad_mod_mp_ufo_scatwind_neutralmetoffice_tlad_settraj_$blk.var$876 to: fo_scatwind_neutralmetoffice_tlad_mod_mp_ufo_scatwind_neutralmetoffice_tlad_settraj_$blk.var$876
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /apps/prod/hpc-stack/i-19.1.3.304__m-8.1.19__h-1.14.0__n-4.9.2__p-2.5.10__e-8.8.0_pnetcdf/intel-19.1.3.304/cray-mpich-8.1.19/fms/2024.01/lib/libfms_r8.a(fms_string_utils_binding.c.o): warning: relocation in read-only section `.trace'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: warning: creating DT_TEXTREL in a shared object

Most of these warnings are from the linker (/bin/ld). The non-linker warnings are

: warning: relocation in read-only section `                 from /lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/mpi/mpi.cc(11):
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/util/Stacktrace.cc(43): warning #2196: routine is both "inline" and "noinline"
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/oops/src/oops/util/Stacktrace.cc(43): warning #2196: routine is both "inline" and "noinline"
/lfs/h2/emc/ptmp/russ.treadon/gfs.v17.0.0/sorc/gdas.cd/bundle/ufo/src/ufo/operators/scatwind/NeutralMetOffice/ufo_scatwind_neutralmetoffice_tlad_mod.F90: warning #5462: Global name too long, shortened from: ufo_scatwind_neutralmetoffice_tlad_mod_mp_ufo_scatwind_neutralmetoffice_tlad_settraj_$blk.var$876 to: fo_scatwind_neutralmetoffice_tlad_mod_mp_ufo_scatwind_neutralmetoffice_tlad_settraj_$blk.var$876

These remaining warning messages may not be on NCO's fix-now compiler warning list.

@CatherineThomas-NOAA

Copy link
Copy Markdown
Collaborator

Thanks for the hash updates @guillaumevernieres and for that test and checking the logs @RussTreadon-NOAA.

Of the warnings Russ listed and how they compare to NCO's list:
warning #2196: routine is both "inline" and "noinline" --> Can be addressed later
warning #5462: Global name too long --> Can be addressed later

Seems we're in pretty good shape. I've also confirmed that I'm able to clone/build this branch properly now with the NOAA-EMC hashes. I'm running g-w CI to make sure results reproduce, but I'm pretty sure that they will given Russ's previous test results.

@apchoiCMD

Copy link
Copy Markdown
Collaborator

For this GDASApp PR

mindo.choi@clogin09:/lfs/h2/emc/da/noscrub/mindo.choi/expts> gw_cistat -r C96C48mx500_S2SW_cyc_gfs/
####################### C96C48mx500_S2SW_cyc_gfs #######################
   CYCLE         STATE           ACTIVATED              DEACTIVATED     
202112201200        Done    Sep 30 2026 19:10:37    Sep 30 2026 19:30:32
202112201800        Done    Sep 30 2026 19:10:37    Sep 30 2026 22:11:02
202112210000        Done    Sep 30 2026 19:10:37    Sep 30 2026 22:35:50
202112211800        Done    Sep 30 2026 19:35:42    Sep 30 2026 22:45:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants