| 66 |
module add slurm |
module add slurm |
| 67 |
module list >> $LOG_FIL 2>&1 |
module list >> $LOG_FIL 2>&1 |
| 68 |
|
|
| 69 |
#- method to acces CVS: |
#- method to access CVS: |
| 70 |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
| 71 |
#- and which GitHub repository to use: |
#- which GitHub repository to use and how to access it: |
| 72 |
git_repo='MITgcm'; git_code='MITgcm' |
git_repo='MITgcm'; git_code='MITgcm' |
| 73 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
| 74 |
|
#-- |
| 75 |
|
git_repo="https://github.com/$git_repo" |
| 76 |
|
#git_repo="git://github.com/$git_repo" |
| 77 |
|
#git_repo="git@github.com:$git_repo" |
| 78 |
|
|
| 79 |
checkOut=1 |
checkOut=1 |
| 80 |
addExp='' |
addExp='' |
| 81 |
updFile='updated_code' |
updFile='updated_code' |
| 82 |
|
|
| 83 |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
#-- Download/Update reference version of MITgcm code: |
|
| 84 |
if [ $checkOut -ge 1 ] ; then |
if [ $checkOut -ge 1 ] ; then |
| 85 |
|
#-- Download/Update reference version of MITgcm code: |
| 86 |
|
|
| 87 |
if test $srcDIR = $TST_DIR ; then |
if test $srcDIR = $TST_DIR ; then |
| 88 |
echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL |
echo "cd $TST_DISK ; pwd (x2)" | tee -a $LOG_FIL |
| 108 |
|
|
| 109 |
if [ $checkOut -eq 1 ] ; then |
if [ $checkOut -eq 1 ] ; then |
| 110 |
if test -e $git_code/.git/config ; then |
if test -e $git_code/.git/config ; then |
|
( cd $git_code ; git checkout master ) | tee -a $LOG_FIL |
|
| 111 |
echo -n "Updating current clone ( $git_code ) ..." | tee -a $LOG_FIL |
echo -n "Updating current clone ( $git_code ) ..." | tee -a $LOG_FIL |
| 112 |
echo '' >> $LOG_FIL |
echo '' >> $LOG_FIL |
| 113 |
( cd $git_code ; git pull ) >> $LOG_FIL 2>&1 |
( cd $git_code ; git pull ) >> $LOG_FIL 2>&1 |
| 117 |
exit |
exit |
| 118 |
else echo " done" | tee -a $LOG_FIL |
else echo " done" | tee -a $LOG_FIL |
| 119 |
fi |
fi |
| 120 |
|
echo " and checkout master:" | tee -a $LOG_FIL |
| 121 |
|
( cd $git_code ; git checkout master -- . ) | tee -a $LOG_FIL |
| 122 |
else |
else |
| 123 |
echo "missing file: $git_code/.git/config => try a new clone" | tee -a $LOG_FIL |
echo "missing file: $git_code/.git/config => try a new clone" | tee -a $LOG_FIL |
| 124 |
checkOut=2 |
checkOut=2 |
| 125 |
fi |
fi |
| 126 |
fi |
fi |
| 127 |
if [ $checkOut -eq 2 ] ; then |
if [ $checkOut -eq 2 ] ; then |
| 128 |
|
if test -e $git_code ; then |
| 129 |
|
echo -n " removing dir: $git_code ..." | tee -a $LOG_FIL |
| 130 |
|
rm -rf $git_code |
| 131 |
|
echo " done" | tee -a $LOG_FIL |
| 132 |
|
fi |
| 133 |
echo -n "Make a clone of $git_code from repo: $git_repo ..." | tee -a $LOG_FIL |
echo -n "Make a clone of $git_code from repo: $git_repo ..." | tee -a $LOG_FIL |
| 134 |
git clone https://github.com/$git_repo/${git_code}.git 2> $tmpFil |
git clone $git_repo/${git_code}.git 2> $tmpFil |
| 135 |
retVal=$? |
retVal=$? |
| 136 |
if test $retVal = 0 ; then |
if test $retVal = 0 ; then |
| 137 |
echo ' --> done!' | tee -a $LOG_FIL |
echo ' --> done!' | tee -a $LOG_FIL |
| 161 |
echo '' | tee -a $LOG_FIL |
echo '' | tee -a $LOG_FIL |
| 162 |
fi |
fi |
| 163 |
|
|
|
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
| 164 |
#-- Done with Download/Update of MITgcm code |
#-- Done with Download/Update of MITgcm code |
| 165 |
fi |
fi |
| 166 |
|
#---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 167 |
|
|
| 168 |
#-- leave srcDIR and go back to output dir |
#-- leave srcDIR and go back to output dir |
| 169 |
cd $OUT_DIR |
cd $OUT_DIR |