Skip to content

Commit

Permalink
Add error message if user_nl_blom includes hash comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTorsvik committed Dec 12, 2024
1 parent 41db980 commit 4e053b5
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 4e053b5

Please sign in to comment.