Skip to content

Commit

Permalink
update cime submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jan 16, 2024
1 parent c44896f commit f28bb09
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
path = cime
url = https://github.com/jedwards4b/cime
fxrequired = T:T
fxtag = cime6.0.198_rme02
fxtag = cime6.0.198_rme04

[submodule "cmeps"]
path = components/cmeps
Expand Down
2 changes: 1 addition & 1 deletion cime
Submodule cime updated 3 files
+1 −0 .gitmodules
+1 −1 CIME/non_py/cprnc
+8 −6 CIME/utils.py
87 changes: 33 additions & 54 deletions install
Original file line number Diff line number Diff line change
@@ -1,64 +1,43 @@
#!/bin/bash
# Script to fetch submodules for CTSM
# if argument -internal-only is supplied then only checkout CTSM internal submodules, otherwise checkout everything needed for
# CTSM as a top level repository
#
# Script to fetch submodules for NCAR EARTH SYSTEM MODELS
#
set -e
script="install"
function usage {
echo -e "\nusage: $script [-i/--internal-only]\n"
}
# Set default arguments
internal_only=0

# Process arguments
while [ "$1" != "" ];
do
case $1 in
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }

# Only checkout CISM internal submodules
-i | -internal-only | --internal-only)
internal_only=1
;;

*)
echo "$script: illegal option $1"
usage
exit 1
;;
esac
shift
done
# Function to install git-fleximod (uncomment only one option)
function install_git_fleximod() {
# -- Option 1: Install from PyPI using pip
pip install fleximod
# -- Option 2: Install from conda-forge using conda
# conda install -c conda-forge git-fleximod
# -- Option 3: Install from GitHub (adjust URL and path if needed)
# git clone https://github.com/jedwards4b/git-fleximod.git
# cd git-fleximod
# pip install
}

########################

submodules=('src/fates')

for mod in "${submodules[@]}"
do
echo "Initializing $mod"
git submodule update --init $mod
done

if [ ${internal_only} -eq 1 ]
then
exit 0
dir=$(git rev-parse --show-toplevel)

# Check if git-fleximod is in the path and get its version
if command -v git-fleximod >/dev/null 2>&1; then
gfversion=$(git-fleximod --version)
echo "git-fleximod version: $version"
# Check if the version is acceptable (adjust the logic as needed)

if [ $(version $gfversion) -ge $(version "0.1.7") ]; then
echo "git-fleximod is already installed and at an acceptable version."
else
echo "Installed git-fleximod version is too old. Updating..."
install_git_fleximod # Call the install function
fi
else
echo "git-fleximod is not installed. Installing..."
install_git_fleximod # Call the install function
fi


extra_submodules=('cime' 'components/rtm' 'components/mosart' \
'components/mizuRoute' 'ccs_config' 'components/cmeps' \
'components/cdeps' 'components/cpl7' 'share' 'libraries/mct' \
'libraries/parallelio' 'doc/doc-builder')

for mod in "${extra_submodules[@]}"
do
echo "Initializing $mod"
git submodule update --init --recursive $mod
done

# cism needs special handling
git submodule update --init components/cism
pushd components/cism 1>/dev/null
./install -internal-only
pushd ${dir} 1>/dev/null
git fleximod install "$@"
popd 1>/dev/null

0 comments on commit f28bb09

Please sign in to comment.