Index: create_tarball.sh
===================================================================
--- create_tarball.sh	(revision a2e9de41663ac7ef6e5a44c759e9775b1128a61a)
+++ create_tarball.sh	(revision 941db7324e23e421ee6296cea9f102f061a10e57)
@@ -1,38 +1,58 @@
 #!/bin/bash
 
+echo CREATE A NEW FLEXPART DISTRIBUTION
+
 #define version number
-
 githash=$(git rev-parse --short --verify HEAD)
-
-
-version=10.3beta5_$githash
+echo githash $githash 
+
+version=10.3.1_$githash
+echo version $version  
 
 # define tarball name
 targetdir=../flexpart_distribution/
-tarball_tmp=${targetdir}flexpart_v$version 
+echo targetdir $targetdir
+
+distribution_name=flexpart_v$version
+
+tarball_tmp=${targetdir}flexpart_v$version
+echo tarball_tmp $tarball_tmp
+
 #tarball=${targetdir}flexpart_v$version.tar 
 tarball=${tarball_tmp}.tar 
+echo tarball $tarball
 
 # clean old package
 if [ -d $tarball_tmp ]; then
-  echo $tarball_tmp exists: move to $tarball_tmp.bk and exit  
-  mkdir $tarball_tmp.bk 
-  mv $tarball_tmp ${tarball_tmp}.bk/ 
-  mv $tarball ${tarball_tmp}.bk/ 
-  exit 
+  echo
+  echo clean old tarball
+  hora=$(date +"%Y-%m-%d_%H%M%S")
+  tarball_tmp_bk=$tarball_tmp$tarball_tmp_$hora
+  echo tarball_tmp=$tarball_tmp exists: move to tarball_tmp_bk=$tarball_tmp_bk #and exit  
+  mkdir $tarball_tmp_bk 
+  mv $tarball_tmp $tarball_tmp_bk/ 
+  mv $tarball $tarball_tmp_bk/ 
+  #exit 
+  echo old files moved to tarball_tmp_bk=$tarball_tmp_bk 
+  echo
 fi
 
 echo ---------------------------------------------------------
-echo ')' create basic dir structure
+echo ')' create basis dir $tarball_tmp
 mkdir $tarball_tmp
 echo ---------------------------------------------------------
-echo ---------------------------------------------------------
-##############################################################
-echo ')' pathnames 
+
+echo
+
+echo ---------------------------------------------------------
+echo ')' copy pathnames 
 #cp pathnames_distribution $tarball_tmp/pathnames
 cp pathnames $tarball_tmp/pathnames
 echo ---------------------------------------------------------
-##############################################################
-echo ')' src/
+
+echo 
+
+echo ---------------------------------------------------------
+echo ')' copy src/
 mkdir $tarball_tmp/src
 cp src/*.f90 $tarball_tmp/src
@@ -43,5 +63,9 @@
 echo ---------------------------------------------------------
 ################################################################
-echo ')' options 
+
+echo
+
+echo ---------------------------------------------------------
+echo ')' copy options/ 
 # (for the distribution they work with the defult flex_ecmwf test winds)
 #cp -r options_flex_ecmwf_EA $tarball_tmp/options
@@ -54,4 +78,5 @@
   echo $i
   cp -r options/$i $tarball_tmp/options
+  #echo copy $i to $tarball_tmp/options
 done
 
@@ -60,19 +85,32 @@
 cp options/SPECIES/SPECIES* $tarball_tmp/options/SPECIES/
 cp options/SPECIES/specoverview.f90 $tarball_tmp/options/SPECIES/
-echo ---------------------------------------------------------
-################################################################
-echo ')' AVAILABLE
+echo copy options/SPECIES/ to $tarball_tmp/options/SPECIES/
+
+echo ---------------------------------------------------------
+
+echo
+
+echo ---------------------------------------------------------
+echo ')' copy AVAILABLE
 #cp AVAILABLE_flex_ecmwf_EA $tarball_tmp/AVAILABLE
 cp AVAILABLE $tarball_tmp/AVAILABLE
-
+echo ---------------------------------------------------------
+
+echo 
+
+echo ---------------------------------------------------------
+echo  ')' create output/ #  mkdir $tarball_tmp/output
+mkdir $tarball_tmp/output
 echo ---------------------------------------------------------
 ################################################################
-echo  ')' output / #  mkdir $tarball_tmp/output
-mkdir $tarball_tmp/output
-echo ---------------------------------------------------------
-################################################################
+
+echo 
+
+echo ---------------------------------------------------------
 echo ')' preprocess/
 mkdir $tarball_tmp/preprocess
-#############################
+
+echo 
+
 echo -----------------flex_extract-------------------
 #echo '6)'  mkdir $tarball_tmp/flex_extract [a separate repository]
@@ -88,6 +126,8 @@
 ## cp -r flex_extract/work/EA* $tarball_tmp/preprocess/flex_extract/work   
 
+flex_extract=../flex_extract_v7.0.4/
 echo include flex_extract v7.0.4 b7c1c04a204c91e53759ef590504bf52dfaece64
-flex_extract=../flex_extract_v7.0.4/
+echo from $flex_extract [use git modules?] IP 3/2018 
+
 cp $flex_extract/README.md $tarball_tmp/preprocess/flex_extract
 cp -r $flex_extract/docs $tarball_tmp/preprocess/flex_extract
@@ -95,7 +135,6 @@
 cp -r $flex_extract/python $tarball_tmp/preprocess/flex_extract
 cp -r $flex_extract/src $tarball_tmp/preprocess/flex_extract
-
-
-
+echo flex_extract copied
+echo ---------------------------------------------------------
 
 
@@ -106,7 +145,10 @@
 #cp -r examples/*.sh $tarball_tmp/examples/ 
 #cp -r examples/Makefile $tarball_tmp/examples/ 
+
+echo 
+
 echo ---------------------------------------------------------
 ################################################################
-echo postprocess/
+echo ')' postprocess/
 
 postprocess=postprocess
@@ -119,26 +161,27 @@
 cp $postprocess/flex_read_fortran/*.f90 $tarball_tmp/$postprocess/flex_read_fortran
 cp $postprocess/flex_read_fortran/makefile $tarball_tmp/$postprocess/flex_read_fortran
+echo flex_read_fortran copied
 
 echo -----------------flex_read_matlab-------------------
+echo flex_read_fortran NOT copied
 
 # add matlab reading routines
 #mkdir $tarball_tmp/postprocess/flex_read_matlab
 #cp postprocess/flex_read_matlab/*.m $tarball_tmp/postprocess/flex_read_matlab
-
-###############################################################
-
-echo ---------------------------------------------------------
-echo tests/
-
+echo ---------------------------------------------------------
+
+echo
+
+echo ---------------------------------------------------------
+echo ')' tests/
+###############################################################
 #echo '13) tests' 
 mkdir $tarball_tmp/tests
-
-###############################################################
 echo -----------------flex_read_fortran-------------------
-
 #echo 'b) ./tests/flex_read_fortran/' 
 echo fixme
 #mkdir $tarball_tmp/tests/flex_read_fortran
 #cp tests/flex_read_fortran/test_read_default.sh  $tarball_tmp/tests/flex_read_fortran
+
 
 ###############################################################
@@ -176,5 +219,5 @@
 cp tests/declare_examples $tarball_tmp/tests/
 
-
+echo 
 
 # ~/repos/flexpart/tests$./compare_grids.sh 
@@ -182,17 +225,27 @@
 #echo mkdir $tarball_tmp/tests/examples2/
 #echo cp tests/examples2/setup.sh $tarball_tmp/tests/examples2/
-echo --repeat examples-------------------
-#echo FIXME 
-
-###############################################################
-echo -----------------ctbto-------------------
-mkdir $tarball_tmp/tests/ctbto
+# echo --repeat examples-------------------
+# echo FIXME 
+
+###############################################################
+#echo -----------------ctbto-------------------
+# mkdir $tarball_tmp/tests/ctbto
 
 # cp -r tests/NILU/test_1 $tarball_tmp/tests/
 # cp -r tests/default_cases $tarball_tmp/tests/
 
-tar cvf  $tarball  $tarball_tmp  
-
-echo  $tarball complete
+echo ---------------------------------------------------------
+echo create tarball
+#tar cvf $tarball  $tarball_tmp  
+#tar cf $tarball  $tarball_tmp  
+#cd 
+
+cd $targetdir
+tar cf $distribution_name.tar $distribution_name 
+
+pwd
+
+
+echo  tarball $tarball complete
 echo exported untarred files in $tarball_tmp 
 exit
@@ -200,4 +253,61 @@
 ###############################################################
 
-
-
+# obtain $FLEXHOME (and set)
+#1 cd $FLEXHOME/src 
+
+#2 compile
+#
+#[laptop] source /Users/ignacio/repos/flexpart/src/make_in_laptop.sh 
+# [njord] make
+# ->created executable (FLEXPART)
+
+#3 execute in src (absolute paths)
+#
+#[laptop] cp  /Users/ignacio/repos/flexpart/src/pathnames .
+#[njord] FIXME
+#
+# mkdir output
+# ./FLEXPART
+# ->created output in output/
+
+#4 read output
+# cd  $FLEXHOME/postprocess/flex_read_fortran/
+# make
+# -> printheader* printgrid* flex_read_compare2*
+#/postprocess/flex_read_fortran$./printheader ../../src/output/
+#/postprocess/flex_read_fortran$./printgrid ../../src/output/ conc
+# -> output in stdout (max:   11122924.0     sum:   90330784.0)
+
+#5 execute in $FLEXHOME
+# cd $FLEXHOME
+# get winds
+#[laptop] cp -r ~/repos/flex_winds/work/ ./preprocess/flex_extract/ 
+#[njord] curl https://folk.nilu.no/~ignacio/FLEXPART/EA120101.tar --output EA120101.tar ; tar -xvf EA120101.tar ; mv flex_extract/work preprocess/flex_extract/ ; rmdir flex_extract
+
+# src/FLEXPART
+# -> output in $FLEXHOME/output/
+
+#6 read output
+# postprocess/flex_read_fortran/printheader output/
+# postprocess/flex_read_fortran/printgrid output/ conc
+# -> output in stdout ( max:   11578738.0     sum:   104058720.)
+
+#7 gnererate examples
+# cd $FLEXHOME/tests/examples
+
+#make run
+
+#make examples
+#make batch
+#./run_batch_cl.sh
+
+#make (set_default_example.sh)
+#tests/examples$../../src/FLEXPART
+#output
+
+#8 read examples:
+#cd $FLEXHOME/tests/read_examples  
+# ./read_headers.sh
+# ./read_grids.sh 
+
+#9 compare examples with reference
