| 27 |
cmdCVS='cvs -q -d :ext:jmc@mitgcm.org:/u/gcmpack' |
cmdCVS='cvs -q -d :ext:jmc@mitgcm.org:/u/gcmpack' |
| 28 |
|
|
| 29 |
#- which GitHub repository to use and how to access it: |
#- which GitHub repository to use and how to access it: |
| 30 |
git_repo='MITgcm'; git_code='MITgcm' |
git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other' |
| 31 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
| 32 |
#-- |
#-- |
| 33 |
git_repo="https://github.com/$git_repo" |
git_repo="https://github.com/$git_repo" |
| 97 |
|
|
| 98 |
#---- Making a new clone or updating existing one: |
#---- Making a new clone or updating existing one: |
| 99 |
if [ $checkOut -eq 2 ] ; then |
if [ $checkOut -eq 2 ] ; then |
| 100 |
if test -e MITgcm/.git/config ; then |
if test -e $git_code/.git/config ; then |
| 101 |
echo MITgcm/.git/config 'exist' |
echo $git_code/.git/config 'exist' |
| 102 |
else |
else |
| 103 |
echo -n MITgcm/.git/config 'missing ; ' |
echo -n $git_code/.git/config 'missing ; ' |
| 104 |
|
checkOut=3 |
| 105 |
|
echo "will get new clone ( checkOut=$checkOut )" |
| 106 |
|
fi |
| 107 |
|
if test -e $git_other/.git/config ; then |
| 108 |
|
echo $git_other/.git/config 'exist' |
| 109 |
|
else |
| 110 |
|
echo -n $git_other/.git/config 'missing ; ' |
| 111 |
checkOut=3 |
checkOut=3 |
| 112 |
echo "will get new clone ( checkOut=$checkOut )" |
echo "will get new clone ( checkOut=$checkOut )" |
| 113 |
fi |
fi |
| 114 |
fi |
fi |
| 115 |
if [ $checkOut -eq 3 ] ; then |
if [ $checkOut -eq 3 ] ; then |
| 116 |
test -e $git_code && rm -rf $git_code |
test -e $git_code && rm -rf $git_code |
| 117 |
echo -n "Make a clone of $git_code from repo: $git_repo ..." |
echo "Make a clone of $git_code from repo: $git_repo ..." |
| 118 |
git clone $git_repo/${git_code}.git 2> $tmpFil |
git clone $git_repo/${git_code}.git 2> $tmpFil |
| 119 |
retVal=$? |
retVal=$? |
| 120 |
if test $retVal = 0 ; then |
if test $retVal = 0 ; then |
| 126 |
rm -f $tmpFil |
rm -f $tmpFil |
| 127 |
exit 2 |
exit 2 |
| 128 |
fi |
fi |
| 129 |
|
test -e $git_other && rm -rf $git_other |
| 130 |
|
echo "Make a clone of $git_other from repo: $git_repo ..." |
| 131 |
|
git clone $git_repo/${git_other}.git 2> $tmpFil |
| 132 |
|
retVal=$? |
| 133 |
|
if test $retVal = 0 ; then |
| 134 |
|
echo ' --> done!' |
| 135 |
|
rm -f $tmpFil |
| 136 |
|
else |
| 137 |
|
echo " Error: 'git clone' returned: $retVal" |
| 138 |
|
cat $tmpFil |
| 139 |
|
rm -f $tmpFil |
| 140 |
|
exit 2 |
| 141 |
|
fi |
| 142 |
else |
else |
| 143 |
echo "Updating current clone ( $git_code ) ..." |
echo "Updating current clone ( $git_code ) ..." |
| 144 |
( cd $git_code ; git pull ) |
( cd $git_code ; git pull ) |
| 149 |
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
| 150 |
exit 3 |
exit 3 |
| 151 |
fi |
fi |
| 152 |
|
echo "Updating current clone ( $git_other ) ..." |
| 153 |
|
( cd $git_other ; git pull ) |
| 154 |
|
retVal=$? |
| 155 |
|
if test $retVal = 0 ; then |
| 156 |
|
echo ' --> done!' |
| 157 |
|
else |
| 158 |
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
| 159 |
|
exit 3 |
| 160 |
|
fi |
| 161 |
|
( cd $git_other ; git checkout master ) |
| 162 |
fi |
fi |
|
|
|
| 163 |
#---- making a new working copy: MITgcm_today |
#---- making a new working copy: MITgcm_today |
| 164 |
( cd $git_code ; git checkout master ) |
( cd $git_code ; git checkout master ) |
|
# mkdir MITgcm_today |
|
|
# cp -p -ra $git_code/* MITgcm_today |
|
| 165 |
rsync -a $git_code/ MITgcm_today --exclude '.git' |
rsync -a $git_code/ MITgcm_today --exclude '.git' |
| 166 |
|
if test $sepDir = 0 ; then |
| 167 |
|
echo -n " make a local copy of $git_other in MITgcm_today ..." | tee -a $tdir/output_$tt |
| 168 |
|
( cd MITgcm_today |
| 169 |
|
rsync -a ../$git_other/ $git_other --exclude '.git' ) |
| 170 |
|
echo " done" | tee -a $tdir/output_$tt |
| 171 |
|
fi |
| 172 |
#---- updating "other_input" dir |
#---- updating "other_input" dir |
| 173 |
if test -d other_input ; then |
if test -d other_input ; then |
| 174 |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
| 294 |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
| 295 |
continue |
continue |
| 296 |
fi |
fi |
| 297 |
#-- download additional experience from Contrib: |
if test "x$addExp" != x ; then |
| 298 |
|
echo -n " make a local copy of $git_other ..." | tee -a $tdir/output_$tt |
| 299 |
|
rsync -a $tdir/$git_other/ $git_other --exclude '.git' |
| 300 |
|
echo " done" | tee -a $tdir/output_$tt |
| 301 |
|
fi |
| 302 |
|
#-- add additional experience from $git_other |
| 303 |
for exp2add in $addExp ; do |
for exp2add in $addExp ; do |
| 304 |
echo " add dir: $exp2add (from Contrib:verification_other)" | tee -a $tdir/output_$tt |
echo " add link: $exp2add (from $git_other )" | tee -a $tdir/output_$tt |
| 305 |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
( cd verification ; ln -s ../$git_other/$exp2add . ) |
|
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
|
| 306 |
if test $exp2add = 'global_oce_cs32' ; then |
if test $exp2add = 'global_oce_cs32' ; then |
| 307 |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
| 308 |
( cd verification/${exp2add} |
( cd verification/${exp2add} |
| 309 |
ln -s ../../../other_input/core2_cnyf . ) |
ln -s ../../../other_input/core2_cnyf . ) |
| 310 |
fi |
fi |