Index: create_tarball.sh
===================================================================
--- create_tarball.sh	(revision 6616daf0246246b3973996962eaa1b848c76db39)
+++ create_tarball.sh	(revision a816416efbe37c2603b5f0b62c029f89c8af8ac0)
@@ -2,69 +2,182 @@
 
 #define version number
-version=10.3beta 
+version=10.3beta5
 
 # define tarball name
-tarball_tmp=flexpart_v$version 
+targetdir=../flexpart_distribution/
+tarball_tmp=${targetdir}flexpart_v$version 
 
 # clean old package
-rm -r $tarball_tmp
+if [ -d $tarball_tmp ]; then
+  echo $tarball_tmp exists: move to $tarball_tmp.bk   
+  mv $tarball_tmp ${tarball_tmp}.bk 
+  exit 
+fi
 
-# create basic dir structure
+echo ---------------------------------------------------------
+echo ')' create basic dir structure
 mkdir $tarball_tmp
+echo ---------------------------------------------------------
+echo ---------------------------------------------------------
+##############################################################
+echo ')' pathnames 
+#cp pathnames_distribution $tarball_tmp/pathnames
+cp pathnames $tarball_tmp/pathnames
+echo ---------------------------------------------------------
+##############################################################
+echo ')' src/
 mkdir $tarball_tmp/src
-
-# copy fortran source files
 cp src/*.f90 $tarball_tmp/src
 cp -r src/gributils $tarball_tmp/src 
-
-# copy makefile
+# echo '3)' copy makefile
 cp src/makefile $tarball_tmp/src
 #cp src/makefile.gfs $tarball_tmp/src
+echo ---------------------------------------------------------
+################################################################
+echo ')' options 
+# (for the distribution they work with the defult flex_ecmwf test winds)
+#cp -r options_flex_ecmwf_EA $tarball_tmp/options
+mkdir $tarball_tmp/options
 
-# copy default options (for the distribution they work with the defult flex_ecmwf test winds)
-# cp -r options $tarball_tmp
-cp -r options_flex_ecmwf_EA $tarball_tmp/options
+user_input_files="AGECLASSES     COMMAND        IGBP_int1.dat  OUTGRID        OUTGRID_NEST   RECEPTORS      RELEASES       surfdata.t     surfdepo.t"
 
-# copy default pathnames 
-cp pathnames_distribution $tarball_tmp/pathnames
+for i in $user_input_files
+do
+  echo $i
+  cp -r options/$i $tarball_tmp/options
+done
 
 
-# add ECMWF retrieve routines
+mkdir $tarball_tmp/options/SPECIES
+cp options/SPECIES/SPECIES* $tarball_tmp/options/SPECIES/
+cp options/SPECIES/specoverview.f90 $tarball_tmp/options/SPECIES/
+echo ---------------------------------------------------------
+################################################################
+echo ')' AVAILABLE
+#cp AVAILABLE_flex_ecmwf_EA $tarball_tmp/AVAILABLE
+cp AVAILABLE $tarball_tmp/AVAILABLE
+
+echo ---------------------------------------------------------
+################################################################
+echo  ')' output / #  mkdir $tarball_tmp/output
+mkdir $tarball_tmp/output
+echo ---------------------------------------------------------
+################################################################
+echo ')' preprocess/
 mkdir $tarball_tmp/preprocess
+#############################
+echo -----------------flex_extract-------------------
+#echo '6)'  mkdir $tarball_tmp/flex_extract [a separate repository]
+#mkdir $tarball_tmp/preprocess
 #mkdir $tarball_tmp/preprocess/flex_ecmwf
 mkdir $tarball_tmp/preprocess/flex_extract
+
+#echo '7)  add ECMWF retrieve routines (change EA wind files for latest source code)'
+#mkdir $tarball_tmp/preprocess/flex_extract
+#mkdir $tarball_tmp/preprocess/flex_extract/work
 #cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_ecmwf/
-cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_extract/
-
-# copy default AVAILABLE
-cp AVAILABLE_flex_ecmwf_EA $tarball_tmp/AVAILABLE
+#cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_extract/
+## cp -r flex_extract/work/EA* $tarball_tmp/preprocess/flex_extract/work   
 
 
-# directory for reading routines
-mkdir $tarball_tmp/postprocess
 
-# add fortran reading routines
-mkdir $tarball_tmp/postprocess/flex_read_fortran
-cp postprocess/flex_read_fortran/*.f $tarball_tmp/postprocess/flex_read_fortran
-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 '10)' cp example generating scripts [a separate repository]
+#echo moved below
+
+#mkdir $tarball_tmp/examples
+#cp -r examples/*.sh $tarball_tmp/examples/ 
+#cp -r examples/Makefile $tarball_tmp/examples/ 
+echo ---------------------------------------------------------
+################################################################
+echo postprocess/
+
+postprocess=postprocess
+mkdir $tarball_tmp/$postprocess
+echo -----------------flex_read_fortran-------------------
+#echo ')'  directory for reading routines
+#echo '12)'  add fortran reading routines [a separate repository]
+mkdir $tarball_tmp/$postprocess/flex_read_fortran
+cp $postprocess/flex_read_fortran/*.f $tarball_tmp/$postprocess/flex_read_fortran
+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_matlab-------------------
 
 # add matlab reading routines
-mkdir $tarball_tmp/postprocess/flex_read_matlab
-cp postprocess/flex_read_matlab/*.m $tarball_tmp/postprocess/flex_read_matlab
+#mkdir $tarball_tmp/postprocess/flex_read_matlab
+#cp postprocess/flex_read_matlab/*.m $tarball_tmp/postprocess/flex_read_matlab
 
-# examples
-cp -r examples $tarball_tmp/ 
+###############################################################
+
+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
+
+###############################################################
+echo -----------------examples-------------------
+
+#echo ') ./tests/examples/' 
+mkdir $tarball_tmp/tests/examples
+echo ') scripts' 
+cp -r ./tests/examples/*.sh $tarball_tmp/tests/examples/ 
+echo ') makefile' 
+cp -r ./tests/examples/Makefile $tarball_tmp/tests/examples/ 
+
+# echo USAGE: ~/repos/flexpart/tests/examples'$' make run
 
 
-mkdir $tarball_tmp/tests
+###############################################################
+echo -----------------postprocess examples-------------------
+echo --read examples-------------------
 
-cp -r tests/NILU/test_1 $tarball_tmp/tests/
-cp -r tests/flex_gen_cases $tarball_tmp/tests/
+#echo '13 c) ./tests/read_examples/' 
+mkdir $tarball_tmp/tests/read_examples
+cp tests/read_examples/read_grids.sh $tarball_tmp/tests/read_examples/
+cp tests/read_examples/read_headers.sh $tarball_tmp/tests/read_examples/
+
+# echo USAGE ~/repos/flexpart/tests/read_examples'$'./read_grids.sh
+
+###############################################################
+echo --compare examples-------------------
+#echo tests/compare_examples.sh
+
+#mkdir $tarball_tmp/tests/compare_examples
+#cp tests/compare_examples/compare_grids.sh $tarball_tmp/tests/compare_examples
+cp tests/compare_grids.sh $tarball_tmp/tests/
+# list of examples with units
+cp tests/declare_examples $tarball_tmp/tests/
 
 
+
+# ~/repos/flexpart/tests$./compare_grids.sh 
+
+#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
+
+# cp -r tests/NILU/test_1 $tarball_tmp/tests/
+# cp -r tests/default_cases $tarball_tmp/tests/
+
+
+exit
 #return
+###############################################################
 
-#tar -cvf flexpart$version.tar $tarball_tmp/*
-echo now can run:  "tar -cvf $tarball_tmp.tar $tarball_tmp/*"
-echo preliminary: scp flexpart_v10.3beta.tar njord:public_html/FLEXPART
+
+
