Skip to content

Commit

Permalink
fixed indent
Browse files Browse the repository at this point in the history
  • Loading branch information
ctroupin committed Aug 31, 2018
1 parent 71d4f54 commit 4eaaeb0
Show file tree
Hide file tree
Showing 10 changed files with 953 additions and 715 deletions.
142 changes: 71 additions & 71 deletions DIVA3D/divastripped/divaanom
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
export LC_ALL=C
#
cd divawork
export LC_ALL=C
divarundir=$(pwd)
divaanomlog=$divarundir'/output/divaanom.log'
divalog=$divarundir'/output/diva.log'

divaanomlog='../output/divaanom.log'
cd divawork

echo 'divaanom: ' > $divaanomlog

Expand All @@ -12,88 +13,88 @@ LR=0
LD=1
if [ -f ../output/fieldatdatapoint.anl.ref ]
then
LD=$(cat ../input/data.dat | wc -l)
LR=$(cat ../output/fieldatdatapoint.anl.ref | wc -l)
echo ' data.dat & fieldatdatapoint.anl.ref ' $LD $LR
LD=$(cat ../input/data.dat | wc -l)
LR=$(cat ../output/fieldatdatapoint.anl.ref | wc -l)
echo ' data.dat & fieldatdatapoint.anl.ref ' $LD $LR
fi
if [ "$LD" -eq "$LR" ]
then
echo ' '
echo ===================================================================
echo There are already reference fields at data points. Will use them
echo Preparing data anomalies based on ./output/fieldatdatapoint.anl.ref
echo ===================================================================
echo ' '
echo ===================================================================
echo There are already reference fields at data points. Will use them
echo Preparing data anomalies based on ./output/fieldatdatapoint.anl.ref
echo ===================================================================

echo ' '
echo =================================================================== >> $divaanomlog
echo There are already reference fields at data points. Will use them >> $divaanomlog
echo Preparing data anomalies based on ./output/fieldatdatapoint.anl.ref >> $divaanomlog
echo =================================================================== >> $divaanomlog
echo ' '
echo =================================================================== >> $divaanomlog
echo There are already reference fields at data points. Will use them >> $divaanomlog
echo Preparing data anomalies based on ./output/fieldatdatapoint.anl.ref >> $divaanomlog
echo =================================================================== >> $divaanomlog

else

echo ' '
echo ===================================================================
echo !!!!! Will try to use gridded reference field by interpolation !!!!!
echo !!!!! Will also create reference field at valatxy.coord !!!!!!!!!!!!
echo ===================================================================
echo ' ' >> $divaanomlog
echo =================================================================== >> $divaanomlog
echo !!!!! Will try to use gridded reference field by interpolation !!!!! >> $divaanomlog
echo !!!!! Will also create reference field at valatxy.coord !!!!!!!!!!!! >> $divaanomlog
echo =================================================================== >> $divaanomlog
echo ' '
echo ===================================================================
echo !!!!! Will try to use gridded reference field by interpolation !!!!!
echo !!!!! Will also create reference field at valatxy.coord !!!!!!!!!!!!
echo ===================================================================
echo ' ' >> $divaanomlog
echo =================================================================== >> $divaanomlog
echo !!!!! Will try to use gridded reference field by interpolation !!!!! >> $divaanomlog
echo !!!!! Will also create reference field at valatxy.coord !!!!!!!!!!!! >> $divaanomlog
echo =================================================================== >> $divaanomlog

cp ../output/fieldgher.anl.ref fort.20
cp ../output/ghertonetcdf/GridInfo.dat fort.21
if [ -f ../input/valatxy.coord ]
then
cp ../input/valatxy.coord fort.45
else
echo no valatxy.coord
rm -f fort.45
fi
cp ../output/fieldgher.anl.ref fort.20
cp ../output/ghertonetcdf/GridInfo.dat fort.21
if [ -f ../input/valatxy.coord ]
then
cp ../input/valatxy.coord fort.45
else
echo no valatxy.coord
rm -f fort.45
fi

echo divaanom: ////////////////////////////////////////// >> ../output/diva.log
echo divaanom: interprefe >> ../output/diva.log
echo divaanom: ////////////////////////////////////////// >> ../output/diva.log
echo ' ' >> ../output/diva.log
echo divaanom: ////////////////////////////////////////// >> ../output/diva.log
echo divaanom: interprefe >> ../output/diva.log
echo divaanom: ////////////////////////////////////////// >> ../output/diva.log
echo ' ' >> ../output/diva.log

../../bin/interprefe.a
if [ $? -ne 0 ];then
echo ' '
echo --------------------------------------------
echo A problem was encountered during execution !
echo divaanom: interprefe.a
echo Check execution track
echo --------------------------------------------
echo ' ' >> $divaanomlog
echo -------------------------------------------- >> $divaanomlog
echo A problem was encountered during execution ! >> $divaanomlog
echo divaanom: interprefe.a >> $divaanomlog
echo Check execution track >> $divaanomlog
echo -------------------------------------------- >> $divaanomlog
echo ' ' >> ../output/diva.log
echo -------------------------------------------- >> ../output/diva.log
echo A problem was encountered during execution ! >> ../output/diva.log
echo divaanom: interprefe.a >> ../output/diva.log
echo Check execution track >> ../output/diva.log
echo -------------------------------------------- >> ../output/diva.log
fi
cp -v fort.81 ../output/fieldatdatapoint.anl.ref
cp -v fort.82 ../output/valatxyascii.anl.ref
rm fort.45
rm fort.20
rm fort.21
rm fort.81
rm fort.82
# keep fort.44
../../bin/interprefe.a
if [ $? -ne 0 ];then
echo ' '
echo --------------------------------------------
echo A problem was encountered during execution !
echo divaanom: interprefe.a
echo Check execution track
echo --------------------------------------------
echo ' ' >> $divaanomlog
echo -------------------------------------------- >> $divaanomlog
echo A problem was encountered during execution ! >> $divaanomlog
echo divaanom: interprefe.a >> $divaanomlog
echo Check execution track >> $divaanomlog
echo -------------------------------------------- >> $divaanomlog
echo ' ' >> ../output/diva.log
echo -------------------------------------------- >> ../output/diva.log
echo A problem was encountered during execution ! >> ../output/diva.log
echo divaanom: interprefe.a >> ../output/diva.log
echo Check execution track >> ../output/diva.log
echo -------------------------------------------- >> ../output/diva.log
fi
cp -v fort.81 ../output/fieldatdatapoint.anl.ref
cp -v fort.82 ../output/valatxyascii.anl.ref
rm fort.45
rm fort.20
rm fort.21
rm fort.81
rm fort.82
# keep fort.44
fi
echo ============================ >> $divaanomlog
echo Now anomalies >> $divaanomlog
echo ============================ >> $divaanomlog
head -22 ../input/param.par | tail -1 > coucou
{
read valex
read valex
} < coucou
rm coucou
paste ../output/fieldatdatapoint.anl.ref ../input/data.dat > bidon
Expand All @@ -107,4 +108,3 @@ echo =================================================================== >> $div
echo ' ' >> $divaanomlog

cd ..

66 changes: 33 additions & 33 deletions DIVA3D/divastripped/divabestguess
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ echo Full parameter estimation
echo ========================================
if [ "$ndata" -le "$small" ]
then
echo ===============
echo Small data set
echo ===============
divafit -r
else
if [ "$ndata" -le "$medium" ]
then
echo ===============
echo Medium data set
echo Small data set
echo ===============
divafit -r
else
echo ==============
echo Large data set
echo ==============
divafit $medium -r
else
if [ "$ndata" -le "$medium" ]
then
echo ===============
echo Medium data set
echo ===============
divafit -r
else
echo ==============
echo Large data set
echo ==============
divafit $medium -r
fi
fi
# OK, so now we have a first guess on L
Expand All @@ -42,30 +42,30 @@ echo $(echo $FIRSTL | awk '{print ($1*5.0)}') >> ./input/gcvsamplingL.dat
echo ==========
if [ -f ./output/gcvL.dat ]
then
echo Erasing old gcvL.dat
rm ./output/gcvL.dat
echo Erasing old gcvL.dat
rm ./output/gcvL.dat
fi
for Lgcv in `cat ./input/gcvsamplingL.dat`
do
echo Working with length scale $Lgcv
# Prepare adapted param.par
cp -v ./input/param.par ./input/param.par.oriL
head -1 ./input/param.par.oriL > ./input/param.par
echo $Lgcv >> ./input/param.par
head -26 ./input/param.par.oriL | tail -24 >> ./input/param.par
if [ "$ndata" -le "$small" ]
then
divacv -r
else
if [ "$ndata" -le "$medium" ]
echo Working with length scale $Lgcv
# Prepare adapted param.par
cp -v ./input/param.par ./input/param.par.oriL
head -1 ./input/param.par.oriL > ./input/param.par
echo $Lgcv >> ./input/param.par
head -26 ./input/param.par.oriL | tail -24 >> ./input/param.par
if [ "$ndata" -le "$small" ]
then
divagcv -r
divacv -r
else
let nsamp=$(($ndata/20))
divacvrand $nsamp 2 -r
if [ "$ndata" -le "$medium" ]
then
divagcv -r
else
let nsamp=$(($ndata/20))
divacvrand $nsamp 2 -r
fi
fi
fi
# restore param.par
cp -v ./input/param.par.oriL ./input/param.par
cat ./output/gcv.dat >> ./output/gcvL.dat
# restore param.par
cp -v ./input/param.par.oriL ./input/param.par
cat ./output/gcv.dat >> ./output/gcvL.dat
done
9 changes: 3 additions & 6 deletions DIVA3D/divastripped/divabigtest
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

if [ "$#" == "1" ]
then
ndata=$1
ndata=$1
else
ndata='1500000'
ndata='1500000'
fi


Expand Down Expand Up @@ -64,7 +64,7 @@ echo '0' >> ${paramfile}
echo '# xori' >> ${paramfile}
echo '-1' >> ${paramfile}
echo '# yori' >> ${paramfile}
echo '-1' >> ${paramfile}
echo '-1' >> ${paramfile}
echo '# dx' >> ${paramfile}
echo '0.02' >> ${paramfile}
echo '# dy' >> ${paramfile}
Expand Down Expand Up @@ -103,6 +103,3 @@ timerun=$(echo ${timeend} ${timeinit} | awk '{print ($1-$2)}')
echo 'Time for mesh creation: ' $timemesh ' s'
echo 'Time for calculation: ' $timecalc ' s'
echo 'Total time for analysis: ' $timerun ' s'



Loading

0 comments on commit 4eaaeb0

Please sign in to comment.