Skip to content

Commit a5f24f2

Browse files
committed
Update SDF searching to look in 'suites' before 'test_suites',
and to only look under 'schemes` for metadata files and source code.
1 parent fe8a499 commit a5f24f2

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

cime_config/cam_autogen.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,18 +435,23 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
435435
if not os.path.exists(physics_blddir):
436436
os.makedirs(physics_blddir)
437437
# End if
438-
# Collect all source directories
439-
atm_phys_src_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
440-
source_search = [source_mods_dir, atm_phys_src_dir]
441-
# Find all metadata files, organize by scheme name
438+
# Set top-level CCPP physics directory
439+
atm_phys_top_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
440+
# Collect all possible Suite Definition File (SDF) locations
441+
atm_suites_path = os.path.join(atm_phys_top_dir, "suites")
442+
atm_test_suites_path = os.path.join(atm_phys_top_dir, "test", "test_suites")
443+
suite_search = [source_mods_dir, atm_suites_path, atm_test_suites_path]
444+
# Find all scheme metadata files, organized by scheme name
445+
atm_schemes_path = os.path.join(atm_phys_top_dir, "schemes")
446+
source_search = [source_mods_dir, atm_schemes_path]
442447
all_scheme_files = _find_metadata_files(source_search, find_scheme_names)
443448

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

592597
# Check that directory exists
593598
if not os.path.isdir(atm_phys_util_dir):

0 commit comments

Comments
 (0)