Skip to content

Commit

Permalink
Merge pull request #45 from jedwards4b/share1.0.17_scamdev
Browse files Browse the repository at this point in the history
Share1.0.17 scamdev
  • Loading branch information
jedwards4b committed Mar 13, 2024
2 parents 3736a57 + 1f07844 commit 4b9dc48
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 253 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/srt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
PNETCDF_VERSION: pnetcdf-1.12.3
NETCDF_FORTRAN_VERSION: v4.6.0
MCT_VERSION: MCT_2.11.0
PARALLELIO_VERSION: pio2_5_10
PARALLELIO_VERSION: pio2_6_2
NETCDF_C_PATH: /usr
NETCDF_FORTRAN_PATH: ${HOME}/netcdf-fortran
PNETCDF_PATH: ${HOME}/pnetcdf
CIME_MODEL: cesm
CIME_DRIVER: mct
CIME_DRIVER: nuopc

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -63,11 +63,17 @@ jobs:
repository: ESCOMP/CESM_share
path: share

- name: cpl7 checkout
- name: cmeps checkout
uses: actions/checkout@v3
with:
repository: ESCOMP/CESM_CPL7andDataComps
path: components/cpl7
repository: ESCOMP/CMEPS
path: components/cmeps

- name: cdeps checkout
uses: actions/checkout@v3
with:
repository: ESCOMP/CDEPS
path: components/cdeps

- id: load-env
run: |
Expand Down
58 changes: 22 additions & 36 deletions buildlib.csm_share
Original file line number Diff line number Diff line change
Expand Up @@ -49,57 +49,43 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
def buildlib(bldroot, installpath, case):
###############################################################################
gmake_args = get_standard_makefile_args(case, shared_lib=True)
comp_interface = case.get_value("COMP_INTERFACE")
srcroot = case.get_value("SRCROOT")
caseroot = case.get_value("CASEROOT")
libroot = case.get_value("LIBROOT")

filepath = [os.path.join(caseroot,"SourceMods","src.share")]
# Append path for driver - currently only values of 'mct' and 'nuopc' are accepted
if comp_interface == "nuopc":
filepath.append(os.path.join(srcroot,"components","cmeps", "cesm", "nuopc_cap_share"))
filepath.append(os.path.join(srcroot,"components","cmeps", "cesm", "flux_atmocn"))

filepath.extend([os.path.join(srcroot,"share","src"),
filepath.extend([os.path.join(srcroot,"components","cmeps", "cesm", "nuopc_cap_share"),
os.path.join(srcroot,"components","cmeps", "cesm", "flux_atmocn"),
os.path.join(srcroot,"share","src"),
os.path.join(srcroot,"share","src","water_isotopes"),
os.path.join(srcroot,"share","RandNum","src"),
os.path.join(srcroot,"share","RandNum","src","dsfmt_f03"),
os.path.join(srcroot,"share","RandNum","src","kissvec"),
os.path.join(srcroot,"share","RandNum","src","mt19937"),
os.path.join(srcroot,"components","cpl7","mct_shr"),
os.path.join(srcroot,"components","cpl7","components","data_comps_mct","streams")])


if comp_interface == "nuopc":
#
# Provide an interface to the CrayLabs SmartSim tools, if the tools are not used
# then build a stub interface. See cime/tools/smartsim/README.md for details
#
if case.get_value("USE_SMARTSIM"):
smartredis_lib = os.getenv("SMARTREDIS_LIB")
expect(smartredis_lib," Expect path to SMARTREDIS in env variable SMARTREDIS_LIB - is the module loaded?")
fortran_src_path = os.getenv("SMARTREDIS_FSRC")
expect(fortran_src_path," Expect path to SMARTREDIS fortran source code in env variable SMARTREDIS_FSRC - is the module loaded?")
redis_include_path = os.getenv("SMARTREDIS_INCLUDE")
expect(os.path.isdir(redis_include_path), "Could not find or read directory {}".format(redis_include_path))
os.environ["USER_INCLDIR"] = "-I" + redis_include_path
gmake_args += " USE_SMARTSIM=TRUE "
else:
fortran_src_path = os.path.join(srcroot,"share","src","stubs","smartredis")

expect(os.path.isdir(fortran_src_path), "Could not find or read directory {}".format(fortran_src_path))
filepath.append(fortran_src_path)
os.path.join(srcroot,"share","RandNum","src","mt19937")])

elif comp_interface != "mct":
expect(False, "driver value of {} not supported".format(comp_interface))

if comp_interface == "nuopc" or case.get_value("USE_ESMF_LIB"):
use_esmf = "esmf"
#
# Provide an interface to the CrayLabs SmartSim tools, if the tools are not used
# then build a stub interface. See cime/tools/smartsim/README.md for details
#
if case.get_value("USE_SMARTSIM"):
smartredis_lib = os.getenv("SMARTREDIS_LIB")
expect(smartredis_lib," Expect path to SMARTREDIS in env variable SMARTREDIS_LIB - is the module loaded?")
fortran_src_path = os.getenv("SMARTREDIS_FSRC")
expect(fortran_src_path," Expect path to SMARTREDIS fortran source code in env variable SMARTREDIS_FSRC - is the module loaded?")
redis_include_path = os.getenv("SMARTREDIS_INCLUDE")
expect(os.path.isdir(redis_include_path), "Could not find or read directory {}".format(redis_include_path))
os.environ["USER_INCLDIR"] = "-I" + redis_include_path
gmake_args += " USE_SMARTSIM=TRUE "
else:
use_esmf = "noesmf"
filepath.append(os.path.join(srcroot,"share","src","esmf_wrf_timemgr"))
fortran_src_path = os.path.join(srcroot,"share","src","stubs","smartredis")

expect(os.path.isdir(fortran_src_path), "Could not find or read directory {}".format(fortran_src_path))
filepath.append(fortran_src_path)

use_esmf = "esmf"
comp_interface = "nuopc"
ninst_value = case.get_value("NINST_VALUE")
libdir = os.path.join(bldroot,comp_interface,use_esmf, ninst_value,"csm_share")
if not os.path.isdir(libdir):
Expand Down
Loading

0 comments on commit 4b9dc48

Please sign in to comment.