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

Fix metadata2html.py, add some more documentation to ccpp_prebuild.py #438

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion scripts/ccpp_prebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def clean_files(config):
return success

def get_all_suites(suites_dir):
"""Assemble a list of all suite definition files in suites_dir"""
success = False
logging.info("No suites were given, compiling a list of all suites")
sdfs = []
Expand Down Expand Up @@ -209,7 +210,7 @@ def convert_local_name_from_new_metadata(metadata, standard_name, typedefs_new_m

# The local name (incl. the array reference) is in new metadata format
local_name = var.local_name
logging.info("Converting local name {0} of variable {1} from new to old metadata".format(local_name, standard_name))
logging.debug("Converting local name {0} of variable {1} from new to old metadata".format(local_name, standard_name))
if "(" in local_name:
(actual_var_name, array_reference) = split_var_name_and_array_reference(local_name)
indices = array_reference.lstrip('(').rstrip(')').split(',')
Expand Down
7 changes: 5 additions & 2 deletions scripts/mkdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,21 @@ def metadata_to_latex(metadata_define, metadata_request, model, filename):

var_names = sorted(list(set(list(metadata_define.keys()) + list(metadata_request.keys()))))

styledir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../doc/DevelopersGuide'))

latex = '''\\documentclass[12pt,letterpaper,oneside,landscape]{{scrbook}}

\\usepackage{{import}}
\\import{{../common/}}{{gmtb.sty}}
\\import{{{styledir}/}}{{gmtb.sty}}
\\renewcommand{{\\thesection}}{{\\arabic{{section}}}}
\\renewcommand{{\\thesubsection}}{{\\arabic{{section}}.\\arabic{{subsection}}}}

\\begin{{document}}

\\section{{CCPP variables provided by model {model} vs requested by pool of physics}}\\label{{sec_ccpp_variables}}
\\subsection{{List of variables}}
\\begin{{longtable}}{{l}}'''.format(model=model)
\\begin{{longtable}}{{l}}'''.format(model=model, styledir=styledir)

for var_name in var_names:
if var_name in metadata_define.keys():
Expand Down