#!/bin/bash # # py_env_create -- setup the python environment in order to use CTSM python tools # # Simple bash script to setup the python environment for the user so they can run the CTSM # python tools using "conda". # dir=${0%/*} if [ "$dir" = "$0" ];then dir="." fi # Check if conda is in your path conda --help >& condahelp.txt error=$? if [ $error != 0 ]; then echo "conda is NOT in your path for the bash shell add it with modules or whatever is required on your system to get it in your path" echo "on Derecho/capser/etc use -- module load conda" echo "on izumi/CGD systems use -- module unload lang/python; module load lang/anaconda/23.11.0/base" echo "For notes on installing on a user system see: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html" echo "Error code was $error" cat condahelp.txt rm condahelp.txt exit -1 fi rm condahelp.txt ctsm_python=ctsm_pylib condadir="$dir/python" domain=`domainname` condafile="conda_env_ctsm_py.txt" #---------------------------------------------------------------------- # Usage subroutine usage() { echo "" echo "***********************************************************************" echo "usage:" echo "./py_env_create" echo "" echo "valid arguments: " echo "[-h|--help] " echo " Displays this help message" echo "[-v|--verbose] " echo " Run with verbose mode for the install so you see the progress bar" echo "[-f|--file ] " echo " Conda environment requirements text file to use (text format) in addition to the others" echo " Assumed to be under the directory: $condadir" echo " Default is: $condafile" echo "[--option