E3SM-Project / E3SM

Energy Exascale Earth System Model source code. NOTE: use "maint" branches for your work. Head of master is not validated.
https://docs.e3sm.org/E3SM
Other
336 stars 338 forks source link

build error with nvidia compiler -- local variable lsize has a conflict from a module #6332

Closed ndkeen closed 2 months ago

ndkeen commented 2 months ago

We are seeing build fails with nvidia on pm-cpu (reported on cdash). When I try one of the tests (say ERS.f19_g16_rx1.A.pm-cpu_nvidia), I can reproduce.

In on routine, the integer variable lsize has a conflict from an module that is "use"'d.

NVFORTRAN-S-0155-lsize is use associated and cannot be redeclared (/global/cfs/cdirs/e3sm/ndk/repos/m23-apr4/components/data_comps/docn/src/docn_comp_mod.F90: 164)
  0 inform,   0 warnings,   1 severes, 0 fatal for docn_comp_init

In components/data_comps/docn/src/docn_comp_mod.F90, I can either add this only, or even just remove the line altogether to get build to complete.

use mct_mod    , only : mct_aVect

I didn't check to see if the routine actually needs anything in mct_mod (assuming not) or might want it there to be consistent with other routines, etc.

ndkeen commented 2 months ago

Note that I verified same issue with an even more recent version of nvidia compiler. With 23.9, still see same build error, and my suggested work-around seem to also work.