Changes in create_tarball.sh [e4925fb:941db73] in flexpart.git


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • create_tarball.sh

    re4925fb r941db73  
    11#!/bin/bash
    2 # Ignacio Pisso, May 2017
    32
    43echo CREATE A NEW FLEXPART DISTRIBUTION
    54
    6 # get current commit hash
     5#define version number
    76githash=$(git rev-parse --short --verify HEAD)
    87echo githash $githash
    9 #define version number with hash
    10 version=10.4_$githash
     8
     9version=10.3.1_$githash
    1110echo version $version 
    1211
     
    1514echo targetdir $targetdir
    1615
    17 # name distribution version
    1816distribution_name=flexpart_v$version
    1917
    20 # name distribution temporary dir
    2118tarball_tmp=${targetdir}flexpart_v$version
    2219echo tarball_tmp $tarball_tmp
    2320
    24 # name distribution tarball file
    2521#tarball=${targetdir}flexpart_v$version.tar
    2622tarball=${tarball_tmp}.tar
    2723echo tarball $tarball
    2824
    29 # if needed clean old package
     25# clean old package
    3026if [ -d $tarball_tmp ]; then
    3127  echo
     
    4238fi
    4339
    44 # start packing
    45 
    46 
    47 ## needs in addition to the git repo ANCILLARY git repos
    48 # VERIFY THESE RESOURCES EXIST BEFORE PACKING DISTRIBUTION
    49 #1 OH file OH_variables.bin || OH_variables=../flexin/OH_FIELDS/OH_variables.bin
    50 #2 flex_extract || flex_extract=../flex_extract_v7.0.4/
    51 #3 flex_read_fortran from ../flex_read_matlab/export_basic  TODO: add functions to ../flex_read_matlab/export/
    52 #  flex_read_matlab_src=../flex_read_matlab/export_basic
    53 #4 tests/examples ../flex_tests_examples/examples3/*
    54 #5 
    55 #6
    56 
    57 
    58 
    59 
    60 # mkdir container
    6140echo ---------------------------------------------------------
    6241echo ')' create basis dir $tarball_tmp
     
    6645echo
    6746
    68 # patnames
    6947echo ---------------------------------------------------------
    7048echo ')' copy pathnames
     
    7553echo
    7654
    77 # fortran source files
    7855echo ---------------------------------------------------------
    7956echo ')' copy src/
     
    8562#cp src/makefile.gfs $tarball_tmp/src
    8663echo ---------------------------------------------------------
     64################################################################
    8765
    8866echo
    8967
    90 # options dir
    9168echo ---------------------------------------------------------
    9269echo ')' copy options/
    93 echo ---------------------------------------------------------
    9470# (for the distribution they work with the defult flex_ecmwf test winds)
    9571#cp -r options_flex_ecmwf_EA $tarball_tmp/options
    9672mkdir $tarball_tmp/options
     73
    9774user_input_files="AGECLASSES     COMMAND        IGBP_int1.dat  OUTGRID        OUTGRID_NEST   RECEPTORS      RELEASES       surfdata.t     surfdepo.t"
     75
    9876for i in $user_input_files
    9977do
     
    10280  #echo copy $i to $tarball_tmp/options
    10381done
     82
     83
    10484mkdir $tarball_tmp/options/SPECIES
    10585cp options/SPECIES/SPECIES* $tarball_tmp/options/SPECIES/
    10686cp options/SPECIES/specoverview.f90 $tarball_tmp/options/SPECIES/
    10787echo copy options/SPECIES/ to $tarball_tmp/options/SPECIES/
     88
    10889echo ---------------------------------------------------------
    10990
    11091echo
    11192
    112 # OH file
    113 echo ---------------------------------------------------------
    114 echo ')' copy OH_variables.bin to flexin
    115 mkdir $tarball_tmp/flexin
    116 OH_variables=../flexin/OH_FIELDS/OH_variables.bin
    117 cp $OH_variables $tarball_tmp/flexin/
    118 echo ---------------------------------------------------------
    119 
    120 echo
    121 
    122 # AVAILABLE
    12393echo ---------------------------------------------------------
    12494echo ')' copy AVAILABLE
     
    12999echo
    130100
    131 # output
    132101echo ---------------------------------------------------------
    133102echo  ')' create output/ #  mkdir $tarball_tmp/output
    134103mkdir $tarball_tmp/output
    135104echo ---------------------------------------------------------
    136 echo output reference?
    137 echo ---------------------------------------------------------
    138 
    139 echo
    140 
    141 # preprocess
     105################################################################
     106
     107echo
     108
    142109echo ---------------------------------------------------------
    143110echo ')' preprocess/
    144111mkdir $tarball_tmp/preprocess
     112
     113echo
     114
    145115echo -----------------flex_extract-------------------
    146116#echo '6)'  mkdir $tarball_tmp/flex_extract [a separate repository]
     
    148118#mkdir $tarball_tmp/preprocess/flex_ecmwf
    149119mkdir $tarball_tmp/preprocess/flex_extract
     120
    150121#echo '7)  add ECMWF retrieve routines (change EA wind files for latest source code)'
    151122#mkdir $tarball_tmp/preprocess/flex_extract
     
    154125#cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_extract/
    155126## cp -r flex_extract/work/EA* $tarball_tmp/preprocess/flex_extract/work   
     127
    156128flex_extract=../flex_extract_v7.0.4/
    157129echo include flex_extract v7.0.4 b7c1c04a204c91e53759ef590504bf52dfaece64
    158130echo from $flex_extract [use git modules?] IP 3/2018
     131
    159132cp $flex_extract/README.md $tarball_tmp/preprocess/flex_extract
    160133cp -r $flex_extract/docs $tarball_tmp/preprocess/flex_extract
     
    164137echo flex_extract copied
    165138echo ---------------------------------------------------------
    166 echo AVAILABLE generation scripts?
    167 echo ---------------------------------------------------------
     139
    168140
    169141#echo '10)' cp example generating scripts [a separate repository]
    170142#echo moved below
     143
    171144#mkdir $tarball_tmp/examples
    172145#cp -r examples/*.sh $tarball_tmp/examples/
     
    175148echo
    176149
    177 # postprocess
    178 echo ---------------------------------------------------------
     150echo ---------------------------------------------------------
     151################################################################
    179152echo ')' postprocess/
    180153
     
    182155mkdir $tarball_tmp/$postprocess
    183156echo -----------------flex_read_fortran-------------------
    184 flex_read_fortran_src=$postprocess/flex_read_fortran/
    185157#echo ')'  directory for reading routines
    186158#echo '12)'  add fortran reading routines [a separate repository]
     
    189161cp $postprocess/flex_read_fortran/*.f90 $tarball_tmp/$postprocess/flex_read_fortran
    190162cp $postprocess/flex_read_fortran/makefile $tarball_tmp/$postprocess/flex_read_fortran
    191 echo flex_read_fortran copied from $flex_read_fortran_src
     163echo flex_read_fortran copied
    192164
    193165echo -----------------flex_read_matlab-------------------
    194 flex_read_matlab_src=../flex_read_matlab/export_basic
    195 mkdir $tarball_tmp/$postprocess/flex_read_matlab
    196 cp -r $flex_read_matlab_src/* $tarball_tmp/$postprocess/flex_read_matlab
    197 echo flex_read_fortran from $flex_read_matlab_src  # NOT copied
     166echo flex_read_fortran NOT copied
     167
    198168# add matlab reading routines
    199169#mkdir $tarball_tmp/postprocess/flex_read_matlab
     
    208178#echo '13) tests'
    209179mkdir $tarball_tmp/tests
    210 #echo -----------------flex_read_fortran-------------------
     180echo -----------------flex_read_fortran-------------------
    211181#echo 'b) ./tests/flex_read_fortran/'
    212 #echo fixme
     182echo fixme
    213183#mkdir $tarball_tmp/tests/flex_read_fortran
    214184#cp tests/flex_read_fortran/test_read_default.sh  $tarball_tmp/tests/flex_read_fortran
     
    216186
    217187###############################################################
    218 echo ----------------- examples -------------------
     188echo -----------------examples-------------------
    219189
    220190#echo ') ./tests/examples/'
    221191mkdir $tarball_tmp/tests/examples
    222 #echo ') scripts'
    223 #cp -r ./tests/examples/*.sh $tarball_tmp/tests/examples/
    224 #echo ') makefile'
    225 #cp -r ./tests/examples/Makefile $tarball_tmp/tests/examples/
     192echo ') scripts'
     193cp -r ./tests/examples/*.sh $tarball_tmp/tests/examples/
     194echo ') makefile'
     195cp -r ./tests/examples/Makefile $tarball_tmp/tests/examples/
     196
    226197# echo USAGE: ~/repos/flexpart/tests/examples'$' make run
    227 cp -r ../flex_tests_examples/examples3/* $tarball_tmp/tests/examples/
    228 
    229 echo ----------------- examples_reference -------------------
    230 cp -r ./tests/examples_reference $tarball_tmp/tests/
    231 
    232 
    233 
    234 ###############################################################
    235 # echo -----------------postprocess examples-------------------
    236 echo -----------------read examples-------------------
     198
     199
     200###############################################################
     201echo -----------------postprocess examples-------------------
     202echo --read examples-------------------
    237203
    238204#echo '13 c) ./tests/read_examples/'
    239205mkdir $tarball_tmp/tests/read_examples
    240 
    241 cp tests/read_examples/declare_examples $tarball_tmp/tests/read_examples/
    242 cp tests/read_examples/display_examples.sh $tarball_tmp/tests/read_examples/
    243 cp tests/read_examples/examples_output.txt $tarball_tmp/tests/read_examples/
    244 cp tests/read_examples/read_examples.sh $tarball_tmp/tests/read_examples/
    245206cp tests/read_examples/read_grids.sh $tarball_tmp/tests/read_examples/
    246 cp tests/read_examples/read_parts.sh $tarball_tmp/tests/read_examples/
    247 cp tests/read_examples/set_examples_all $tarball_tmp/tests/read_examples/
    248 cp tests/read_examples/set_examples_3.sh $tarball_tmp/tests/read_examples/
    249207cp tests/read_examples/read_headers.sh $tarball_tmp/tests/read_examples/
    250 cp tests/read_examples/read_examples_output.txt $tarball_tmp/tests/ #read_examples/
     208
    251209# echo USAGE ~/repos/flexpart/tests/read_examples'$'./read_grids.sh
    252210
    253211###############################################################
    254 echo ------------compare examples-------------------
     212echo --compare examples-------------------
    255213#echo tests/compare_examples.sh
    256 mkdir $tarball_tmp/tests/compare_examples
    257 
    258214
    259215#mkdir $tarball_tmp/tests/compare_examples
    260216#cp tests/compare_examples/compare_grids.sh $tarball_tmp/tests/compare_examples
    261 #cp tests/compare_grids.sh $tarball_tmp/tests/
    262 cp tests/compare_examples/*.sh $tarball_tmp/tests/compare_examples
    263 cp tests/compare_examples/compare_grids_output.txt $tarball_tmp/tests/ #compare_examples
     217cp tests/compare_grids.sh $tarball_tmp/tests/
    264218# list of examples with units
    265 #cp tests/declare_examples $tarball_tmp/tests/
     219cp tests/declare_examples $tarball_tmp/tests/
    266220
    267221echo
     
    295249echo  tarball $tarball complete
    296250echo exported untarred files in $tarball_tmp
    297 
    298 echo cp -r preprocess/flex_extract/work $tarball_tmp/preprocess/flex_extract/
    299 echo cd $tarball_tmp/src
    300 echo $HOME/repos/flexpart/src/make_in_laptop.sh
    301 echo cd .. ';' ./src/FLEXPART
    302 echo cd postprocess/flex_read_fortran
    303 echo make test
    304 echo  max:  0.115784094     mean:   4.70877676E-05
    305 #echo cd $tarball_tmp/tests/examples ';'   make run
    306 echo cd ../../tests/examples ';'   make run
    307 #echo cd $tarball_tmp/tests/read_examples
    308 echo cd ../read_examples
    309 echo ./read_examples.sh
    310 echo ./read_examples.sh '>' ../read_examples_output.txt
    311 echo cd ../compare_examples
    312 echo ./compare_grids.sh
    313 echo ./compare_grids.sh '>' ../compare_grids_output.txt
    314 
    315 echo e.g. tar --append --file=$tarball_tmp/ ../compare_grids_output.txt ../read_examples_output.txt
    316  
    317  
    318 
    319 
    320251exit
    321252#return
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG