# quelques scripts de tri

# color  0 "white"     color  1 "black"    color   2  "red"    color  3    "green"      color 4 "blue"
# color  5 "yellow"    color  6 "brown"    color   7  "grey"   color  8    "violet"     color 9 "cyan"
# color 10 "magenta"   color 11 "orange"   color  12  "indigo" color 13    "maroon"
# color 14 "turquoise"                     color  15   "green4"


Bmeshelf

#1 2  3      4                 5         6           7           8          9  
#i,j,grd,typeshelf(i,j),   bmelt(i,j),bmgrz(i,j),bmshelf(i,j),hdot(i,j),dist_talu(i,j)
#awk '{ if ($8 != 0 && $3 != 0) { if ($7 == 0) print $1,$2,"2",$3; else if ($7 > 0) print $1,$2,"3",$3; else if ($7 <0)  print $1,$2,"4",$3 }  }' graph-Mat > graph-i1j1


# $4 est l'ice shelf $3 est grdline(1) ou pas (0)

awk '{ if ($4 == 1 && $3 == 0)  print $3,$4,$5,$5+$8}' bmelt-test |awk '{Som=$4+Som; nb=nb+1; print $3,$4,Som,nb,Som/nb}' > toto.dat




#  la somme d'une colonne

#awk '{A=$1+A; print A}' test

# Pour remplimat


# vert : surdiagonales , rouge : diagonales , bleu sous-diagonales. Seulement pour les points ou Tu!=0

awk '{ if ($8 != 0 && $3 != 0) { if ($7 == 0) print $1,$2,"2",$3; else if ($7 > 0) print $1,$2,"3",$3; else if ($7 <0)  print $1,$2,"4",$3 }  }' graph-Mat > graph-i1j1



# Pour tagger une ligne de tuij, enlever les noeuds imx=0

awk '{ if ($5 == 71)   print $1,$2,"2",$3; else if ($8 !=0) print $1,$2,"4",$3   }' graph-Mat > graph-i1j1