From 0d16be936ddfbb1e0c3a223671fadf15e8c955cd Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Tue, 15 Oct 2024 17:45:09 -0400 Subject: [PATCH] New const_get_index logic without cam_ccpp_cap dependency --- cime_config/cam_autogen.py | 10 ++++++++++ src/physics/utils/cam_constituents.F90 | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/cime_config/cam_autogen.py b/cime_config/cam_autogen.py index 3d5ed312..f5467a6a 100644 --- a/cime_config/cam_autogen.py +++ b/cime_config/cam_autogen.py @@ -614,6 +614,7 @@ def generate_physics_suites(build_cache, preproc_defs, host_name, # Copy to_be_ccppized utility modules to the build directory, # as SIMA cam_constituents depends on them. +<<<<<<< HEAD # Note: to_be_ccppized utility modules to be removed once functionality is migrated # to SIMA or CCPPized in atmospheric_physics. atm_phys_to_be_ccppized_dir = os.path.join(atm_phys_top_dir, "to_be_ccppized") @@ -630,6 +631,15 @@ def generate_physics_suites(build_cache, preproc_defs, host_name, for to_be_ccppized_file in atm_phys_to_be_ccppized_files: shutil.copy(to_be_ccppized_file, physics_blddir) # end for +======= + atm_phys_to_be_ccppized_dir = os.path.join(atm_phys_top_dir, "to_be_ccppized") + + # Check that the directory exists and copy to build directory + if os.path.isdir(atm_phys_to_be_ccppized_dir): + atm_phys_to_be_ccppized_files = glob.glob(os.path.join(atm_phys_to_be_ccppized_dir, "*.F90")) + for to_be_ccppized_file in atm_phys_to_be_ccppized_files: + shutil.copy(to_be_ccppized_file, physics_blddir) +>>>>>>> aa86287 (New const_get_index logic without cam_ccpp_cap dependency) # end if if do_gen_ccpp or do_gen_nl: diff --git a/src/physics/utils/cam_constituents.F90 b/src/physics/utils/cam_constituents.F90 index 19329153..3883aba5 100644 --- a/src/physics/utils/cam_constituents.F90 +++ b/src/physics/utils/cam_constituents.F90 @@ -292,7 +292,11 @@ subroutine const_get_index(name, cindex, abort, warning, caller) use cam_abortutils, only: endrun use cam_logfile, only: iulog use phys_vars_init_check, only: std_name_len +<<<<<<< HEAD use string_utils, only: stringify +======= + use string_utils, only: to_str +>>>>>>> aa86287 (New const_get_index logic without cam_ccpp_cap dependency) ! Get the index of a constituent with standard name, . ! Setting optional argument to .false. returns control to @@ -319,7 +323,11 @@ subroutine const_get_index(name, cindex, abort, warning, caller) call ccpp_const_get_idx(const_props, name, cindex, errmsg, errcode) if (errcode /= 0) then +<<<<<<< HEAD call endrun(subname//"Error "//stringify((/errcode/))//": "// & +======= + call endrun(subname//"Error "//to_str(errcode)//": "// & +>>>>>>> aa86287 (New const_get_index logic without cam_ccpp_cap dependency) trim(errmsg), file=__FILE__, line=__LINE__) endif