Skip to content

Commit abbb0b8

Browse files
Merge remote-tracking branch 'henry/feature/gwdev_issue_2129' into ss160
2 parents 4ad837e + 4529e8c commit abbb0b8

File tree

2 files changed

+24
-67
lines changed

2 files changed

+24
-67
lines changed

ush/load_fv3gfs_modules.sh

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fi
1010
ulimit_s=$( ulimit -S -s )
1111

1212
# Find module command and purge:
13+
source "${HOMEgfs}/ush/detect_machine.sh"
1314
source "${HOMEgfs}/ush/module-setup.sh"
1415

1516
# Source versions file for runtime
@@ -18,36 +19,14 @@ source "${HOMEgfs}/versions/run.ver"
1819
# Load our modules:
1920
module use "${HOMEgfs}/modulefiles"
2021

21-
if [[ -d /lfs/f1 ]]; then
22-
# We are on WCOSS2 (Cactus or Dogwood)
23-
module load module_base.wcoss2
24-
elif [[ -d /mnt/lfs1 ]] ; then
25-
# We are on NOAA Jet
26-
module load module_base.jet
27-
elif [[ -d /scratch1 ]] ; then
28-
# We are on NOAA Hera
29-
module load module_base.hera
30-
elif [[ -d /work ]] ; then
31-
# We are on MSU Orion or Hercules
32-
if [[ -d /apps/other ]] ; then
33-
# Hercules
34-
module load module_base.hercules
35-
else
36-
# Orion
37-
module load module_base.orion
38-
fi
39-
elif [[ -d /glade ]] ; then
40-
# We are on NCAR Yellowstone
41-
module load module_base.cheyenne
42-
elif [[ -d /lustre && -d /ncrc ]] ; then
43-
# We are on GAEA.
44-
module load module_base.gaea
45-
elif [[ -d /data/prod ]] ; then
46-
# We are on SSEC S4
47-
module load module_base.s4
48-
else
49-
echo WARNING: UNKNOWN PLATFORM
50-
fi
22+
case "${MACHINE_ID}" in
23+
"wcoss2" | "hera" | "orion" | "hercules" | "gaea" | "jet" | "s4")
24+
module load "module_base.${MACHINE_ID}"
25+
;;
26+
*)
27+
echo "WARNING: UNKNOWN PLATFORM"
28+
;;
29+
esac
5130

5231
module list
5332

ush/load_ufsda_modules.sh

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,48 +27,26 @@ fi
2727
ulimit_s=$( ulimit -S -s )
2828

2929
# Find module command and purge:
30+
source "${HOMEgfs}/ush/detect_machine.sh"
3031
source "${HOMEgfs}/ush/module-setup.sh"
3132

3233
# Load our modules:
3334
module use "${HOMEgfs}/sorc/gdas.cd/modulefiles"
3435

35-
if [[ -d /lfs/f1 ]]; then
36-
# We are on WCOSS2 (Cactus or Dogwood)
37-
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
38-
elif [[ -d /lfs3 ]] ; then
39-
# We are on NOAA Jet
40-
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
41-
elif [[ -d /scratch1 ]] ; then
42-
# We are on NOAA Hera
43-
module load "${MODS}/hera"
44-
# set NETCDF variable based on ncdump location
45-
NETCDF=$( which ncdump )
46-
export NETCDF
47-
elif [[ -d /work ]] ; then
48-
# We are on MSU Orion or Hercules
49-
if [[ -d /apps/other ]] ; then
50-
# Hercules
51-
module load "${MODS}/hercules"
52-
else
53-
# Orion
54-
module load "${MODS}/orion"
55-
fi
56-
# set NETCDF variable based on ncdump location
57-
ncdump=$( which ncdump )
58-
NETCDF=$( echo "${ncdump}" | cut -d " " -f 3 )
59-
export NETCDF
60-
elif [[ -d /glade ]] ; then
61-
# We are on NCAR Yellowstone
62-
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
63-
elif [[ -d /lustre && -d /ncrc ]] ; then
64-
# We are on GAEA.
65-
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
66-
elif [[ -d /data/prod ]] ; then
67-
# We are on SSEC S4
68-
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
69-
else
70-
echo WARNING: UNKNOWN PLATFORM
71-
fi
36+
case "${MACHINE_ID}" in
37+
("hera" | "orion" | "hercules")
38+
module load "${MODS}/${MACHINE_ID}"
39+
ncdump=$( command -v ncdump )
40+
NETCDF=$( echo "${ncdump}" | cut -d " " -f 3 )
41+
export NETCDF
42+
;;
43+
("wcoss2" | "acorn" | "jet" | "gaea" | "s4")
44+
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
45+
;;
46+
*)
47+
echo "WARNING: UNKNOWN PLATFORM"
48+
;;
49+
esac
7250

7351
module list
7452
pip list

0 commit comments

Comments
 (0)