Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link staged GSI fix files instead of cloning them from gerrit #1132

Merged
merged 4 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions sorc/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Usage: ${BASH_SOURCE[0]} [-c][-h][-m ufs_hash][-o]
Check out this UFS hash instead of the default
-o:
Check out operational-only code (GTG and WAFS)
-g:
-g:
Check out GSI for GSI-based DA
-u:
Check out GDASApp for UFS-based DA
Expand Down Expand Up @@ -50,6 +50,7 @@ function checkout() {
dir="$1"
remote="$2"
version="$3"
recursive=${4:-"YES"}

name=$(echo "${dir}" | cut -d '.' -f 1)
echo "Performing checkout of ${name}"
Expand Down Expand Up @@ -89,13 +90,15 @@ function checkout() {
echo
return "${status}"
fi
git submodule update --init --recursive >> "${logfile}" 2>&1
echo "|-- Updating submodules (if any)"
status=$?
if ((status > 0)); then
echo " WARNING: Error while updating submodules of ${name}"
echo
return "${status}"
if [[ "${recursive}" == "YES" ]]; then
git submodule update --init --recursive >> "${logfile}" 2>&1
echo "|-- Updating submodules (if any)"
status=$?
if ((status > 0)); then
echo " WARNING: Error while updating submodules of ${name}"
echo
return "${status}"
fi
fi
echo
return 0
Expand Down Expand Up @@ -158,7 +161,7 @@ checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git"
checkout "verif-global.fd" "https://github.com/NOAA-EMC/EMC_verif-global.git" "c267780" ; errs=$((errs + $?))

if [[ ${checkout_gsi} == "YES" ]]; then
checkout "gsi_enkf.fd" "https://github.com/NOAA-EMC/GSI.git" "48d8676"; errs=$((errs + $?))
checkout "gsi_enkf.fd" "https://github.com/NOAA-EMC/GSI.git" "48d8676" "NO"; errs=$((errs + $?))
aerorahul marked this conversation as resolved.
Show resolved Hide resolved
fi

if [[ ${checkout_gdas} == "YES" ]]; then
Expand Down
13 changes: 3 additions & 10 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ OPTIND=1
while getopts ":ho" option; do
case "${option}" in
h) usage ;;
o)
o)
echo "-o option received, configuring for NCO"
RUN_ENVIR="nco";;
:)
Expand Down Expand Up @@ -91,6 +91,7 @@ for dir in aer \
cpl \
datm \
gldas \
gsi \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we handle the case that a developer does NOT want to use the staged GSI fix files? This question actually applies to all the staged fix files. One answer is that we assume the developer knows what (s)he wants to do and manually makes the required changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all that is being done is creating symlinks, it is a simple matter to replace one of them with a location of your choice manually afterwards.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It is simple to replace one link with another. Does the g-w wiki capture this detail? Not everyone understands what these scripts do or how they work.

lut \
mom6 \
orog \
Expand All @@ -108,6 +109,7 @@ for dir in aer \
${LINK} "${FIX_DIR}/${dir}/${!fix_ver}" "${dir}"
done


if [[ -d "${script_dir}/ufs_utils.fd" ]]; then
cd "${script_dir}/ufs_utils.fd/fix" || exit 1
./link_fixdirs.sh "${RUN_ENVIR}" "${machine}" 2> /dev/null
Expand Down Expand Up @@ -163,15 +165,6 @@ if [[ -d "${script_dir}/gfs_wafs.fd" ]]; then
fi


#------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above. What happens when a developer does NOT want to use staged GSI fix files? It may be too cumbersome to have the checkout and link script cover all possibilities. Perhaps it is sufficient to update the g-w wiki to explain options.

#--add GSI fix directory
#------------------------------
if [[ -d "${script_dir}/gsi_enkf.fd" ]]; then
cd "${top_dir}/fix" || exit 1
[[ -d gsi ]] && rm -rf gsi
${LINK} "${script_dir}/gsi_enkf.fd/fix" gsi
fi

#------------------------------
#--add GDASApp fix directory
#------------------------------
Expand Down
1 change: 1 addition & 0 deletions versions/fix.ver
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export gdas_fv3jedi_ver=20220805
export gdas_gsibec_ver=20221031
export gldas_ver=20220920
export glwu_ver=20220805
export gsi_ver=20221128
export lut_ver=20220805
export mom6_ver=20220805
export orog_ver=20220805
Expand Down