forked from NOAA-EMC/CDEPS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into jedwards/solar_zenith_angle_correction
- Loading branch information
Showing
11 changed files
with
168 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
build cime component model library. This buildlib script is used by all CDEPS components. | ||
""" | ||
|
||
import sys, os | ||
|
||
_CIMEROOT = os.environ.get("CIMEROOT") | ||
if _CIMEROOT is None: | ||
raise SystemExit("ERROR: must set CIMEROOT environment variable") | ||
sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools")) | ||
|
||
_LIBDIR = os.path.join(_CIMEROOT, "scripts", "lib") | ||
sys.path.append(_LIBDIR) | ||
|
||
from standard_script_setup import * | ||
from CIME.buildlib import parse_input | ||
from CIME.case import Case | ||
from CIME.utils import run_cmd, symlink_force, expect | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
def buildlib(bldroot, libroot, case, compname=None): | ||
if not compname: | ||
expect(bldroot.endswith("obj"), | ||
"It appears that buildlib_comps is being called for the main CDEPS build\n" | ||
"(the main CDEPS build should use buildlib, not buildlib_comps)") | ||
compname = os.path.basename(os.path.abspath(os.path.join(bldroot,os.pardir))) | ||
|
||
_, o, e = run_cmd("make d{}".format(compname), from_dir=bldroot, verbose=True) | ||
libname = "lib{}.a".format(compname) | ||
dlibname = "libd{}.a".format(compname) | ||
dlibpath = os.path.join(bldroot, dlibname) | ||
if os.path.exists(dlibpath): | ||
symlink_force(os.path.join(bldroot,dlibname), os.path.join(libroot,libname)) | ||
else: | ||
expect(False, "ERROR in {} build {} {}".format(compname,o,e)) | ||
|
||
def _main_func(args): | ||
caseroot, libroot, bldroot = parse_input(args) | ||
with Case(caseroot) as case: | ||
buildlib(bldroot, libroot, case) | ||
|
||
if __name__ == "__main__": | ||
_main_func(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../../cime_config/buildlib | ||
../../cime_config/buildlib_comps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters