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

Add error message if user_nl_blom includes hash comments #450

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cime_config/ocn_in_paramgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,22 @@ def append_user_nl_file(self, user_nl_file):
line = remove_user_nl_comment(line)
#End if

#Check if the first character on the line is a hash sign (#):
#This is no longer allowed as a first character, and may indicate
#the use of an old user_nl_blom file
if line.strip()[0] == "#":
emsg = f"Line number {line_num+1} in 'user_nl_blom'"
emsg += " starts with a hash sign (#). This may"
emsg += " indicate an outdated format of your"
emsg += "\nuser_nl_blom file. Current versions of"
emsg += " user_nl_blom file conform to the standard"
emsg += " Fortran namelist syntax, indicating comments"
emsg += "\nwith exclamation mark (!). Please check that"
emsg += " your user_nl_blom file conforms with the"
emsg += " current accepted file format."
raise OcnInParamGenError(emsg)
#End if

#Check if the first character on the line is a comma (,):
if line.strip()[0] == ",":
#Is this an array variable:
Expand Down
Loading