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

Correct GDASApp paths #2435

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# Add UFSDA to PYTHONPATH
ufsdaPATH="${HOMEgfs}/sorc/gdas.cd/ush/"
pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python3.7/"
pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/"
WalterKolczynski-NOAA marked this conversation as resolved.
Fixed
Show resolved Hide resolved
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${ufsdaPATH}:${pyiodaPATH}"
export PYTHONPATH

Expand Down
4 changes: 2 additions & 2 deletions jobs/rocoto/prepatmiodaobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
###############################################################
# setup python path for workflow and ioda utilities
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYIODALIB="${HOMEgfs}/sorc/gdas.cd/build/lib/python3.7"
PYTHONPATH="${PYIODALIB}:${wxflowPATH}:${PYTHONPATH}"
pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/"
WalterKolczynski-NOAA marked this conversation as resolved.
Fixed
Show resolved Hide resolved
PYTHONPATH="${pyiodaPATH}:${wxflowPATH}:${PYTHONPATH}"
export PYTHONPATH

###############################################################
Expand Down
3 changes: 2 additions & 1 deletion jobs/rocoto/prepsnowobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
###############################################################
# setup python path for workflow utilities and tasks
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
gdasappPATH="${HOMEgfs}/sorc/gdas.cd/iodaconv/src:${HOMEgfs}/sorc/gdas.cd/build/lib/python3.7"
pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/"
WalterKolczynski-NOAA marked this conversation as resolved.
Fixed
Show resolved Hide resolved
gdasappPATH="${HOMEgfs}/sorc/gdas.cd/sorc/iodaconv/src:${pyiodaPATH}"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}:${gdasappPATH}"
export PYTHONPATH

Expand Down
16 changes: 16 additions & 0 deletions ush/preamble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ function generate_com() {
# shellcheck disable=
declare -xf generate_com

function detect_py_ver() {
#
# Returns the major.minor version of the currently active python executable
#
regex="[0-9]+\.[0-9]+"
# shellcheck disable=SC2312
if [[ $(python --version) =~ ${regex} ]]; then
echo "${BASH_REMATCH[0]}"
else
echo "FATAL ERROR: Could not detect the python version"
exit 1
fi
}
# shellcheck disable=
declare -xf detect_py

# Turn on our settings
set_strict
set_trace
Loading