Skip to content

Commit

Permalink
Merge branch 'master' into update-mvk-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonb5 committed Jun 13, 2024
2 parents 6aaf589 + f903115 commit 6f56fe1
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 137 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
contents: write # for git push
name: Cleanup branch previews
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -35,18 +35,26 @@ jobs:
run: |
pushd $GITHUB_WORKSPACE/gh-pages
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
fi
done
if [[ -e "$GITHUB_WORKSPACE/gh-pages/branch" ]]; then
ls -la "$GITHUB_WORKSPACE/gh-pages/branch"
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
for name in `ls branch/`
do
if [[ -z "$(git show-ref --quiet ${name})" ]]
then
git rm -rf branch/${name}
echo "Removed $GITHUB_WORKSPACE/gh-pages/branch/${name}"
fi
done
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git commit -m "Clean up branch previews"
git push
fi
echo "Done cleaning branches"
build-and-deploy:
permissions:
contents: write # for peaceiris/actions-gh-pages to push
Expand Down
2 changes: 1 addition & 1 deletion CIME/ParamGen/xml_schema/entry_id_pg.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- simple types -->
<xs:simpleType name="identifier_type">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z][A-Za-z0-9_]{0,63}"/>
<xs:pattern value="[A-Za-z][A-Za-z0-9_]*"/>
</xs:restriction>
</xs:simpleType>

Expand Down
31 changes: 27 additions & 4 deletions CIME/Tools/xmlchange
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def parse_command_line(args, description):


def xmlchange_single_value(
case, xmlid, xmlval, subgroup, append, force, dryrun, env_test
case, xmlid, xmlval, subgroup, append, force, dryrun, env_test, caseroot, xmlfile
):
if xmlid in [
"THREAD_COUNT",
Expand Down Expand Up @@ -227,7 +227,12 @@ def xmlchange_single_value(

expect(result is not None, 'No variable "%s" found' % xmlid)

check_lockedfiles(case, skip=["env_case"])
if xmlfile is not None:
xmlfile = [xmlfile]
# Pass caseroot, in cases where --file is used and case does not have access to env_case.xml
check_lockedfiles(
case, skip=["env_case"], quiet=True, caseroot=caseroot, whitelist=xmlfile
)
else:
logger.warning("'%s' = '%s'", xmlid, xmlval)

Expand Down Expand Up @@ -283,11 +288,29 @@ def xmlchange(
)
(xmlid, xmlval) = pair
xmlchange_single_value(
case, xmlid, xmlval, subgroup, append, force, dryrun, env_test
case,
xmlid,
xmlval,
subgroup,
append,
force,
dryrun,
env_test,
caseroot,
xmlfile,
)
else:
xmlchange_single_value(
case, xmlid, xmlval, subgroup, append, force, dryrun, env_test
case,
xmlid,
xmlval,
subgroup,
append,
force,
dryrun,
env_test,
caseroot,
xmlfile,
)

if not noecho:
Expand Down
9 changes: 1 addition & 8 deletions CIME/XML/archive_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ def get_all_hist_files(self, casename, model, from_dir, suffix="", ref_case=None
# remove when component name is changed
if model == "fv3gfs":
model = "fv3"
if model == "cice5":
model = "cice"
if model == "ww3dev":
model = "ww3"

hist_files = []
extensions = self.get_hist_file_extensions(self.get_entry(dmodel))
Expand Down Expand Up @@ -237,10 +233,7 @@ def _get_extension(model, filepath, ext_regexes):
# Remove with component namechange
if model == "fv3gfs":
model = "fv3"
if model == "cice5":
model = "cice"
if model == "ww3dev":
model = "ww3"

basename = os.path.basename(filepath)
m = None
if ext_regexes is None:
Expand Down
6 changes: 4 additions & 2 deletions CIME/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def _build_model(
thread_bad_results = []
libroot = os.path.join(exeroot, "lib")
bldroot = None
bld_threads = []
for model, comp, nthrds, _, config_dir in complist:
if buildlist is not None and model.lower() not in buildlist:
continue
Expand Down Expand Up @@ -391,12 +392,13 @@ def _build_model(
),
)
t.start()
bld_threads.append(t)

logs.append(file_build)

# Wait for threads to finish
while threading.active_count() > 1:
time.sleep(1)
for bld_thread in bld_threads:
bld_thread.join()

expect(not thread_bad_results, "\n".join(thread_bad_results))

Expand Down
4 changes: 0 additions & 4 deletions CIME/case/case_st_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,6 @@ def _archive_restarts_date_comp(
# the compname is drv but the files are named cpl
if compname == "drv":
compname = "cpl"
if compname == "cice5":
compname = "cice"
if compname == "ww3dev":
compname = "ww3"

# get file_extension suffixes
for suffix in archive.get_rest_file_extensions(archive_entry):
Expand Down
Loading

0 comments on commit 6f56fe1

Please sign in to comment.