Skip to content

Commit

Permalink
New const_get_index logic without cam_ccpp_cap dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Oct 25, 2024
1 parent e13e7ea commit 0d16be9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cime_config/cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions src/physics/utils/cam_constituents.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, <name>.
! Setting optional <abort> argument to .false. returns control to
Expand All @@ -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

Expand Down

0 comments on commit 0d16be9

Please sign in to comment.