diff --git a/ush/load_fv3gfs_modules.sh b/ush/load_fv3gfs_modules.sh index 48885c62e43..ae0e381db43 100755 --- a/ush/load_fv3gfs_modules.sh +++ b/ush/load_fv3gfs_modules.sh @@ -10,6 +10,7 @@ fi ulimit_s=$( ulimit -S -s ) # Find module command and purge: +source "${HOMEgfs}/ush/detect_machine.sh" source "${HOMEgfs}/ush/module-setup.sh" # Source versions file for runtime @@ -18,36 +19,14 @@ source "${HOMEgfs}/versions/run.ver" # Load our modules: module use "${HOMEgfs}/modulefiles" -if [[ -d /lfs/f1 ]]; then - # We are on WCOSS2 (Cactus or Dogwood) - module load module_base.wcoss2 -elif [[ -d /mnt/lfs1 ]] ; then - # We are on NOAA Jet - module load module_base.jet -elif [[ -d /scratch1 ]] ; then - # We are on NOAA Hera - module load module_base.hera -elif [[ -d /work ]] ; then - # We are on MSU Orion or Hercules - if [[ -d /apps/other ]] ; then - # Hercules - module load module_base.hercules - else - # Orion - module load module_base.orion - fi -elif [[ -d /glade ]] ; then - # We are on NCAR Yellowstone - module load module_base.cheyenne -elif [[ -d /lustre && -d /ncrc ]] ; then - # We are on GAEA. - module load module_base.gaea -elif [[ -d /data/prod ]] ; then - # We are on SSEC S4 - module load module_base.s4 -else - echo WARNING: UNKNOWN PLATFORM -fi +case "${MACHINE_ID}" in + "wcoss2" | "hera" | "orion" | "hercules" | "gaea" | "jet" | "s4") + module load "module_base.${MACHINE_ID}" + ;; + *) + echo "WARNING: UNKNOWN PLATFORM" + ;; +esac module list diff --git a/ush/load_ufsda_modules.sh b/ush/load_ufsda_modules.sh index f15ae5666c6..e8e72b8fbe1 100755 --- a/ush/load_ufsda_modules.sh +++ b/ush/load_ufsda_modules.sh @@ -27,48 +27,26 @@ fi ulimit_s=$( ulimit -S -s ) # Find module command and purge: +source "${HOMEgfs}/ush/detect_machine.sh" source "${HOMEgfs}/ush/module-setup.sh" # Load our modules: module use "${HOMEgfs}/sorc/gdas.cd/modulefiles" -if [[ -d /lfs/f1 ]]; then - # We are on WCOSS2 (Cactus or Dogwood) - echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM -elif [[ -d /lfs3 ]] ; then - # We are on NOAA Jet - echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM -elif [[ -d /scratch1 ]] ; then - # We are on NOAA Hera - module load "${MODS}/hera" - # set NETCDF variable based on ncdump location - NETCDF=$( which ncdump ) - export NETCDF -elif [[ -d /work ]] ; then - # We are on MSU Orion or Hercules - if [[ -d /apps/other ]] ; then - # Hercules - module load "${MODS}/hercules" - else - # Orion - module load "${MODS}/orion" - fi - # set NETCDF variable based on ncdump location - ncdump=$( which ncdump ) - NETCDF=$( echo "${ncdump}" | cut -d " " -f 3 ) - export NETCDF -elif [[ -d /glade ]] ; then - # We are on NCAR Yellowstone - echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM -elif [[ -d /lustre && -d /ncrc ]] ; then - # We are on GAEA. - echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM -elif [[ -d /data/prod ]] ; then - # We are on SSEC S4 - echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM -else - echo WARNING: UNKNOWN PLATFORM -fi +case "${MACHINE_ID}" in + ("hera" | "orion" | "hercules") + module load "${MODS}/${MACHINE_ID}" + ncdump=$( command -v ncdump ) + NETCDF=$( echo "${ncdump}" | cut -d " " -f 3 ) + export NETCDF + ;; + ("wcoss2" | "acorn" | "jet" | "gaea" | "s4") + echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM + ;; + *) + echo "WARNING: UNKNOWN PLATFORM" + ;; +esac module list pip list