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

Build error with AMD compiler in FatesLitterMod.F90 #6029

Closed
ndkeen opened this issue Oct 27, 2023 · 7 comments · Fixed by #6027
Closed

Build error with AMD compiler in FatesLitterMod.F90 #6029

ndkeen opened this issue Oct 27, 2023 · 7 comments · Fixed by #6027
Labels
AMD-compiler Issues related to AMD Compiler FATES

Comments

@ndkeen
Copy link
Contributor

ndkeen commented Oct 27, 2023

After updating AMD compiler version #6003 (which was necessary as previous version removed), for several tests, ie SMS_Ld30.f45_f45.IELMFATES.pm-cpu_amdclang.elm-fates_satphen, I see build error with AMD compiler:

F90-S-0155-Derived type has not been declared - integer (/global/cfs/cdirs/e3sm/ndk/repos/nexty-oct26/components/elm/src/external_models/fates/biogeochem/FatesLitterMod.F90: 450)
  0 inform,   0 warnings,   1 severes, 0 fatal for adjust_sf_cwd_frac
Target CMakeFiles/lnd.dir/__/__/elm/src/external_models/fates/biogeochem/FatesLitterMod.F90.o built in 0.107528 seconds
make[2]: *** [cmake/lnd/CMakeFiles/lnd.dir/build.make:3452: cmake/lnd/CMakeFiles/lnd.dir/__/__/elm/src/external_models/fates/biogeochem/FatesLitterMod.F90.o] Error 1

I can work-around by simply using integer type:
In components/elm/src/external_models/fates/biogeochem/FatesLitterMod.F90

     !ndk type(integer), intent(in)          :: ncwd !number of cwd pools                                                                                                                                                                                                                                   
     integer, intent(in)          :: ncwd !number of cwd pools                                                                                                                                                                                                                                              
@ndkeen ndkeen added FATES AMD-compiler Issues related to AMD Compiler labels Oct 27, 2023
@rgknox
Copy link
Contributor

rgknox commented Oct 31, 2023

Thanks for posting this @ndkeen , we'll work with you to get this fix in

@glemieux
Copy link
Contributor

glemieux commented Nov 1, 2023

Per our discussion yesterday, the current plan is to address this within #5555, by rolling it into fates PR NGEET/fates#1109.

@rgknox
Copy link
Contributor

rgknox commented Nov 17, 2023

Added a new PR with the changes, they did not make it into FATES: 1109, see 1121 linked above

@glemieux
Copy link
Contributor

@ndkeen I tested NGEET/fates#1121 and I'm not hitting this any more, but I'm getting the following error during build:

F90-F-0004-Unable to open MODULE file m_string.mod (/global/u1/g/glemieux/E3SM-project/e3sm-test/externals/mct/mct/m_MCTWorld.F90: 25) 
F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
gmake[1]: *** [Makefile:62: m_MCTWorld.o] Error 1
gmake: *** [/global/u1/g/glemieux/E3SM-project/e3sm-test/externals/mct/Makefile:10: subdirs] Error 2
ERROR: F90-F-0004-Unable to open MODULE file m_string.mod (/global/u1/g/glemieux/E3SM-project/e3sm-test/externals/mct/mct/m_MCTWorld.F90: 25)
F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
gmake[1]: *** [Makefile:62: m_MCTWorld.o] Error 1
gmake: *** [/global/u1/g/glemieux/E3SM-project/e3sm-test/externals/mct/Makefile:10: subdirs] Error 2

Are you hitting this as well?

@ndkeen
Copy link
Contributor Author

ndkeen commented Nov 17, 2023

When I checkout branch:

perlmutter-login32% git branch
* lnd/fates-api-readparams-refactor

I still see same build error:

/pscratch/sd/n/ndk/e3sm_scratch/pm-cpu/SMS_Ld30.f45_f45.IELMFATES.pm-cpu_amdclang.elm-fates_satphen.20231117_154451_s4ck84/bld/e3sm.bldlog.231117-154714

Ah maybe that's what you are saying -- need to get in 1121 -- I'm not sure how best to do that?

@glemieux
Copy link
Contributor

@ndkeen I realized I mislead you; I haven't been able to get to the e3sm build step as it's failing in the mct build step. I just attempted this with the current master commit 93ab10c and got a different MCT build failure:

F90-F-0004-Unable to open MODULE file m_sortingtools.mod (/global/u1/g/glemieux/E3SM-project/e3sm/externals/mct/mct/m_AttrVect.F90: 3341)
F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
gmake[1]: *** [Makefile:62: m_AttrVect.o] Error 1
gmake: *** [/global/u1/g/glemieux/E3SM-project/e3sm/externals/mct/Makefile:10: subdirs] Error 2
ERROR: F90-F-0004-Unable to open MODULE file m_sortingtools.mod (/global/u1/g/glemieux/E3SM-project/e3sm/externals/mct/mct/m_AttrVect.F90: 3341)
F90/x86-64 Linux Flang - 1.5 2017-05-01: compilation aborted
gmake[1]: *** [Makefile:62: m_AttrVect.o] Error 1
gmake: *** [/global/u1/g/glemieux/E3SM-project/e3sm/externals/mct/Makefile:10: subdirs] Error 2

Should I make this a new issue?

@glemieux
Copy link
Contributor

Ah maybe that's what you are saying -- need to get in 1121 -- I'm not sure how best to do that?

The way I do this is by adding the PR remote to the fates submodule (in this case [email protected]:rgknox/fates.git) and then checking out the branch directly. This is a bit complicated though as that PR branch is based on an e3sm-fates API update that's coming in with #6018.

peterdschwartz added a commit that referenced this issue Feb 6, 2024
…tor' into next (PR #6027)

This PR refactors the elm-fates interface to avoid having fates call elmfates_interfacemod.
FatesReadParameters has been moved from the aforementioned module into FATES and takes in an
HLM-provided fates_param_reader_type to read the parameters from disk.
The existing SetFatesGlobalElements1 method now takes in an optional fates_param_reader_type.

Upcoming PR's will modify the HLM's to construct and pass in instances of fates_param_reader_type
(which will basically call the HLM-side ParametersFromNetCDF method), and then remove the old code path.

This work is ported from ESCOMP/CTSM#2198 and is associated with NGEET/fates#1096

Fixes #6029

[BFB]
@github-project-automation github-project-automation bot moved this from ❕Todo to ✔ Done in FATES issue board Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMD-compiler Issues related to AMD Compiler FATES
Projects
None yet
3 participants