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

[BUG/ISSUE] Parsing HEMCO_Config.rc emissions switches is not robust #150

Closed
lizziel opened this issue Jun 16, 2022 · 1 comment
Closed
Assignees
Labels
category: Bug Something isn't working topic: Configuration Files Related to HEMCO configuration files
Milestone

Comments

@lizziel
Copy link
Contributor

lizziel commented Jun 16, 2022

Investigation of a GCHP bug (geoschem/GCHP#225) revealed that emissions are not used if the HEMCO switch in config file HEMCO_Config.rc contains tabs.

For example, the following line:
--> HTAPv3 : true # 2000-2018
is interpreted as HTAPv3 true only if all of the whitespace is spaces. Replacing it with tabs makes it be interpreted as false.

A few months ago I also noticed that including true or false after the comment character (#) can interfere with correct interpretation of the line.

We need to revisit how these lines in the config file are parsed to make them more robust.

@lizziel lizziel added the category: Bug Something isn't working label Jun 16, 2022
@yantosca yantosca self-assigned this Jun 22, 2022
@yantosca yantosca added the topic: Configuration Files Related to HEMCO configuration files label Jun 22, 2022
@yantosca yantosca modified the milestone: 3.5.0 Jun 24, 2022
yantosca added a commit that referenced this issue Jun 24, 2022
src/Core/hco_chartools_mod.F90
- Call string routine CSTRIP (with KeepSpaces=T).  This will remove any
  non-printing characters (but preserve spaces) from each line that is
  read in from HEMCO_Config.rc.
- Also check each line read from HEMCO_Config.rc for the position of
  the comment character.  If a comment character is found in column 1,
  do nothing (as this is a commment line).  But if a comment character
  is found elsewhere in the line, then ignore all characters at or after
  the position of the comment character.

This commit should fix the issue raised in geoschem/HEMCO #150.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@msulprizio
Copy link
Contributor

This should now be resolved by PR #151.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working topic: Configuration Files Related to HEMCO configuration files
Projects
None yet
Development

No branches or pull requests

3 participants