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

cam_chempp issue with usr_mech_infile when path to compiler is too long #160

Open
annlew opened this issue Aug 7, 2024 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@annlew
Copy link

annlew commented Aug 7, 2024

Issue Type

Infrastructure Update

Issue Description

When using user provided chemistry mechanism file for a case, the build fails if the path to cpp is longer than 64 characters. Character length is hardcoded in:

components/src/cam_chempp/mozpp.main.f

  `character(len=64)  :: cpp_dir, cpp_opts`

This turned out to be an issue on Tetralith after OS upgrade and updated compiler suite when using tag cam_cesm2_1_rel_05-Nor_v1.0.5.

This is easy to fix by increasing char length for cpp_dir and I can create a pull request to fix this. However, I'm not sure which branch this should go into in that case. Seems like the structure for the chemistry preprocessor has changed in more recent versions.

Will this change answers?

No

Will you be implementing this yourself?

Yes

@annlew annlew self-assigned this Aug 7, 2024
@gold2718 gold2718 added the bug Something isn't working label Aug 7, 2024
@gold2718
Copy link

gold2718 commented Aug 7, 2024

@annlew, Thanks for taking this on! I have a few notes / questions:

  • Are you targeting the noresm2_1_develop branch, the noresm2_3_develop branch, or both with this issue?
  • What length do we want to move towards?
    • One possibility is len=256 since that is a standard length we use in CAM for files (SHR_KIND_CL).
    • Another is len=320 since that seems to be used for some paths in the same program.
    • There are a lot of path-like variables. Should we create a parameter and use that for all of these variables?
  • The filepath in the preamble above does not seem right. I think <root>/components/cam/chem_proc/src/cam_chempp/mozpp.main.f or <root>/src/cam_chempp/mozpp.main.f would be more clear.
  • This will provide a fix NorESM2.1 (and/or NorESM2.3), however, we also need to add the fix to the chem preprocessor repo used by noresm_develop.

@annlew
Copy link
Author

annlew commented Aug 8, 2024

Thanks for the comments!

  • The issue would apply to all branches where the cam_chempp is present. Are the relevant branches for this update noresm2_1_develop and noresm2_3_develop? I could make pull requests for both. And for other branches/tags users can hopefully find the solution here if they happen to run into this issue. Is it correct that the chem_pp has been separated from cam recently (hadn't found the chem preprocessor repo before), so that future changes to the chempp go into that separate repo?
  • I think len=256 should be enough. Most other shorter chars seems to mostly be filenames and short relative paths, however, I wonder if
    character(len=80) :: iout(100)
    could close to being too short on certain systems. I haven't investigated though.
  • Yes, you're right, the path is /components/cam/chem_proc/src/cam_chempp/mozpp.main.f

@gold2718
Copy link

gold2718 commented Aug 8, 2024

Yes, please create PRs for noresm2_1_develop and noresm2_3_develop.

gold2718 added a commit that referenced this issue Aug 12, 2024
Increase the char length for path to compiler in chem_pp code

Contributors: @annlew, @sarambl
Reviewers: @gold2718
Purpose of changes: Avoid chemistry preprocessor failure at compilation when path to 
                                    compiler exceeds 64 characters

Github PR URL: #161

Changes made to build system: Only chemistry preprocessor when usr_mech_infile
                                                 is specified in env_build.xml 
Changes made to the namelist: None
Changes to the defaults for the boundary datasets: None
Substantial timing or memory changes: None
Change the char length for cpp path from 64 to 256 in chem_pp code. 

Test: SMS allactive test with grid = f19_tn14 and compset=NF2000climo with a testmod to run the chemistry preprocessor. Fails with current HEAD of noresm2_1_develop, passes with this PR branch.

Issues addressed by this PR: 
cam_chempp issue with usr_mech_infile when path to compiler is too long (#160)
@oyvindseland
Copy link

I have OKed the char length (no reviewers)
The last test should not bring any problems either? @dirk @gold2718

@gold2718
Copy link

The last test should not bring any problems either?

It modifies the source code so we need to adjust it (not trivial)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

3 participants