source: flexpart.git/create_tarball.sh

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file was 3d7eebf, checked in by Ignacio Pisso <ip@…>, 4 years ago

update source of examples: remove additional tabs chars from files

  • Property mode set to 100755
File size: 8.0 KB
Line 
1#!/bin/bash
2# Ignacio Pisso, May 2017
3# Changes 2018-2019
4
5echo CREATE A NEW FLEXPART DISTRIBUTION
6
7# get current commit hash
8githash=$(git rev-parse --short --verify HEAD)
9echo githash $githash 
10#define version number with hash
11version=10.4_$githash
12echo version $version 
13
14# define tarball name
15targetdir=../flexpart_distribution/
16echo targetdir $targetdir
17
18# name distribution version
19distribution_name=flexpart_v$version
20
21# name distribution temporary dir
22tarball_tmp=${targetdir}flexpart_v$version
23echo tarball_tmp $tarball_tmp
24
25# name distribution tarball file
26#tarball=${targetdir}flexpart_v$version.tar
27tarball=${tarball_tmp}.tar
28echo tarball $tarball
29
30# if needed clean old package
31if [ -d $tarball_tmp ]; then
32  echo
33  echo clean old tarball
34  hora=$(date +"%Y-%m-%d_%H%M%S")
35  tarball_tmp_bk=$tarball_tmp$tarball_tmp_$hora
36  echo tarball_tmp=$tarball_tmp exists: move to tarball_tmp_bk=$tarball_tmp_bk #and exit 
37  mkdir $tarball_tmp_bk 
38  mv $tarball_tmp $tarball_tmp_bk/
39  mv $tarball $tarball_tmp_bk/
40  #exit
41  echo old files moved to tarball_tmp_bk=$tarball_tmp_bk 
42  echo
43fi
44
45# start packing
46## needs in addition to the git repo ANCILLARY git repos
47# VERIFY THESE RESOURCES EXIST BEFORE PACKING DISTRIBUTION
48#1 OH file OH_variables.bin || OH_variables=../flexin/OH_FIELDS/OH_variables.bin
49#2 flex_extract || flex_extract=../flex_extract_v7.0.4/
50#3 flex_read_fortran from ../flex_read_matlab/export_basic  TODO: add functions to ../flex_read_matlab/export/
51#  flex_read_matlab_src=../flex_read_matlab/export_basic
52#4 tests/examples ../flex_tests_examples/examples/*
53
54
55
56
57# mkdir container
58echo ---------------------------------------------------------
59echo ')' create basis dir $tarball_tmp
60mkdir $tarball_tmp
61echo ---------------------------------------------------------
62
63echo
64
65# patnames
66echo ---------------------------------------------------------
67echo ')' copy pathnames
68cp pathnames $tarball_tmp/pathnames
69echo ---------------------------------------------------------
70
71echo 
72
73# fortran source files
74echo ---------------------------------------------------------
75echo ')' copy src/
76mkdir $tarball_tmp/src
77cp src/*.f90 $tarball_tmp/src
78cp -r src/gributils $tarball_tmp/src
79cp src/makefile $tarball_tmp/src
80echo ---------------------------------------------------------
81
82cp LICENSE $tarball_tmp/LICENSE_GPLv3
83cp src/flexpart_license.txt  $tarball_tmp/src
84
85echo
86
87# options dir
88echo ---------------------------------------------------------
89echo ')' copy options/
90echo ---------------------------------------------------------
91mkdir $tarball_tmp/options
92user_input_files="AGECLASSES     COMMAND        IGBP_int1.dat  OUTGRID        OUTGRID_NEST   RECEPTORS      RELEASES       surfdata.t     surfdepo.t"
93for i in $user_input_files
94do
95  echo $i
96  cp -r options/$i $tarball_tmp/options
97done
98mkdir $tarball_tmp/options/SPECIES
99cp options/SPECIES/SPECIES* $tarball_tmp/options/SPECIES/
100cp options/SPECIES/specoverview.f90 $tarball_tmp/options/SPECIES/
101echo copy options/SPECIES/ to $tarball_tmp/options/SPECIES/
102echo ---------------------------------------------------------
103
104echo
105
106# OH file
107echo ---------------------------------------------------------
108echo ')' copy OH_variables.bin to flexin
109mkdir $tarball_tmp/flexin
110OH_variables=../flexin/OH_FIELDS/OH_variables.bin
111cp $OH_variables $tarball_tmp/flexin/
112echo ---------------------------------------------------------
113
114echo
115
116# AVAILABLE
117echo ---------------------------------------------------------
118echo ')' copy AVAILABLE
119cp AVAILABLE $tarball_tmp/AVAILABLE
120echo ---------------------------------------------------------
121
122echo 
123
124# output
125echo ---------------------------------------------------------
126echo  ')' create output/ #  mkdir $tarball_tmp/output
127mkdir $tarball_tmp/output
128echo ---------------------------------------------------------
129echo output reference?
130echo ---------------------------------------------------------
131
132echo
133
134# preprocess
135echo ---------------------------------------------------------
136echo ')' preprocess/
137mkdir $tarball_tmp/preprocess
138echo -----------------flex_extract-------------------
139mkdir $tarball_tmp/preprocess/flex_extract
140flex_extract=../flex_extract_v7.0.4/
141echo include flex_extract v7.0.4 b7c1c04a204c91e53759ef590504bf52dfaece64
142echo from $flex_extract [use git modules?] IP 3/2018
143cp $flex_extract/README.md $tarball_tmp/preprocess/flex_extract
144cp -r $flex_extract/docs $tarball_tmp/preprocess/flex_extract
145cp -r $flex_extract/grib_templates $tarball_tmp/preprocess/flex_extract
146cp -r $flex_extract/python $tarball_tmp/preprocess/flex_extract
147cp -r $flex_extract/src $tarball_tmp/preprocess/flex_extract
148echo flex_extract copied
149echo ---------------------------------------------------------
150echo AVAILABLE generation scripts?
151echo ---------------------------------------------------------
152
153echo 
154
155# postprocess
156echo ---------------------------------------------------------
157echo ')' postprocess/
158
159postprocess=postprocess
160mkdir $tarball_tmp/$postprocess
161echo -----------------flex_read_fortran-------------------
162flex_read_fortran_src=$postprocess/flex_read_fortran/
163mkdir $tarball_tmp/$postprocess/flex_read_fortran
164cp $postprocess/flex_read_fortran/*.f $tarball_tmp/$postprocess/flex_read_fortran
165cp $postprocess/flex_read_fortran/*.f90 $tarball_tmp/$postprocess/flex_read_fortran
166cp $postprocess/flex_read_fortran/makefile $tarball_tmp/$postprocess/flex_read_fortran
167echo flex_read_fortran copied from $flex_read_fortran_src
168
169echo -----------------flex_read_matlab-------------------
170flex_read_matlab_src=../flex_read_matlab/export_basic
171mkdir $tarball_tmp/$postprocess/flex_read_matlab
172cp -r $flex_read_matlab_src/* $tarball_tmp/$postprocess/flex_read_matlab
173echo flex_read_fortran from $flex_read_matlab_src  # NOT copied
174echo ---------------------------------------------------------
175
176echo
177
178echo ---------------------------------------------------------
179echo ')' tests/
180#echo '13) tests'
181mkdir $tarball_tmp/tests
182echo ----------------- examples -------------------
183
184mkdir $tarball_tmp/tests/examples
185cp -r ../flex_tests_examples/examples/* $tarball_tmp/tests/examples/
186
187echo ----------------- examples_reference -------------------
188cp -r ./tests/examples_reference $tarball_tmp/tests/
189
190echo -----------------read examples-------------------
191
192mkdir $tarball_tmp/tests/read_examples
193
194cp tests/read_examples/declare_examples $tarball_tmp/tests/read_examples/
195cp tests/read_examples/display_examples.sh $tarball_tmp/tests/read_examples/
196cp tests/read_examples/examples_output.txt $tarball_tmp/tests/read_examples/
197cp tests/read_examples/read_examples.sh $tarball_tmp/tests/read_examples/
198cp tests/read_examples/read_grids.sh $tarball_tmp/tests/read_examples/
199cp tests/read_examples/read_parts.sh $tarball_tmp/tests/read_examples/
200cp tests/read_examples/set_examples_all $tarball_tmp/tests/read_examples/
201cp tests/read_examples/set_examples_3.sh $tarball_tmp/tests/read_examples/
202cp tests/read_examples/read_headers.sh $tarball_tmp/tests/read_examples/
203cp tests/read_examples/read_examples_output.txt $tarball_tmp/tests/ #read_examples/
204
205echo ------------compare examples-------------------
206mkdir $tarball_tmp/tests/compare_examples
207
208
209cp tests/compare_examples/*.sh $tarball_tmp/tests/compare_examples
210cp tests/compare_examples/compare_grids_output.txt $tarball_tmp/tests/ #compare_examples
211
212echo
213
214echo ---------------------------------------------------------
215echo create tarball
216
217cd $targetdir
218tar cf $distribution_name.tar $distribution_name 
219
220pwd
221
222echo  tarball $tarball complete
223echo exported untarred files in $tarball_tmp 
224
225echo verify:
226echo cp -r preprocess/flex_extract/work $tarball_tmp/preprocess/flex_extract/
227echo cd $tarball_tmp/src
228echo $HOME/repos/flexpart/src/make_in_laptop.sh
229echo cd .. ';' ./src/FLEXPART
230echo cd postprocess/flex_read_fortran
231echo make test
232echo e.g.: max:  0.115784094     mean:   4.70877676E-05
233echo cd ../../tests/examples ';'   make run
234echo cd ../read_examples
235echo ./read_examples.sh
236echo ./read_examples.sh '>' ../read_examples_output.txt
237echo cd ../compare_examples
238echo ./compare_grids.sh
239echo ./compare_grids.sh '>' ../compare_grids_output.txt
240
241echo e.g. tar --append --file=$tarball_tmp/ ../compare_grids_output.txt ../read_examples_output.txt
242 
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG