Skip to content

Commit

Permalink
Update SDF searching to look in 'suites' before 'test_suites',
Browse files Browse the repository at this point in the history
and to only look under 'schemes` for metadata files and source code.
  • Loading branch information
nusbaume committed Oct 2, 2024
1 parent fe8a499 commit a5f24f2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cime_config/cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,23 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
if not os.path.exists(physics_blddir):
os.makedirs(physics_blddir)
# End if
# Collect all source directories
atm_phys_src_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
source_search = [source_mods_dir, atm_phys_src_dir]
# Find all metadata files, organize by scheme name
# Set top-level CCPP physics directory
atm_phys_top_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
# Collect all possible Suite Definition File (SDF) locations
atm_suites_path = os.path.join(atm_phys_top_dir, "suites")
atm_test_suites_path = os.path.join(atm_phys_top_dir, "test", "test_suites")
suite_search = [source_mods_dir, atm_suites_path, atm_test_suites_path]
# Find all scheme metadata files, organized by scheme name
atm_schemes_path = os.path.join(atm_phys_top_dir, "schemes")
source_search = [source_mods_dir, atm_schemes_path]
all_scheme_files = _find_metadata_files(source_search, find_scheme_names)

# Find the SDFs specified for this model build
sdfs = []
scheme_files = []
xml_files = {} # key is scheme, value is xml file path
for sdf in phys_suites_str.split(';'):
sdf_path = _find_file(f"suite_{sdf}.xml", source_search)
sdf_path = _find_file(f"suite_{sdf}.xml", suite_search)
if not sdf_path:
emsg = f"ERROR: Unable to find SDF for suite '{sdf}'"
raise CamAutoGenError(emsg)
Expand Down Expand Up @@ -587,7 +592,7 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
# there to the bld directory:
if do_gen_ccpp:
# Set CCPP physics "utilities" path
atm_phys_util_dir = os.path.join(atm_phys_src_dir, "utilities")
atm_phys_util_dir = os.path.join(atm_schemes_path, "utilities")

# Check that directory exists
if not os.path.isdir(atm_phys_util_dir):
Expand Down

0 comments on commit a5f24f2

Please sign in to comment.