source: flexpart.git/create_tarball.sh @ adead08

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

current state for create_tarball.sh: add OH fields.bin to the tarball

cleaned the distribution and included reference runs and comparisons

flexpart 10.4 prerelease, added read and compare output .txt files and
modified the manuscript

  • Property mode set to 100755
File size: 12.6 KB
Line 
1#!/bin/bash
2# Ignacio Pisso, May 2017
3
4echo CREATE A NEW FLEXPART DISTRIBUTION
5
6# get current commit hash
7githash=$(git rev-parse --short --verify HEAD)
8echo githash $githash 
9#define version number with hash
10version=10.4_$githash
11echo version $version 
12
13# define tarball name
14targetdir=../flexpart_distribution/
15echo targetdir $targetdir
16
17# name distribution version
18distribution_name=flexpart_v$version
19
20# name distribution temporary dir
21tarball_tmp=${targetdir}flexpart_v$version
22echo tarball_tmp $tarball_tmp
23
24# name distribution tarball file
25#tarball=${targetdir}flexpart_v$version.tar
26tarball=${tarball_tmp}.tar
27echo tarball $tarball
28
29# if needed clean old package
30if [ -d $tarball_tmp ]; then
31  echo
32  echo clean old tarball
33  hora=$(date +"%Y-%m-%d_%H%M%S")
34  tarball_tmp_bk=$tarball_tmp$tarball_tmp_$hora
35  echo tarball_tmp=$tarball_tmp exists: move to tarball_tmp_bk=$tarball_tmp_bk #and exit 
36  mkdir $tarball_tmp_bk 
37  mv $tarball_tmp $tarball_tmp_bk/
38  mv $tarball $tarball_tmp_bk/
39  #exit
40  echo old files moved to tarball_tmp_bk=$tarball_tmp_bk 
41  echo
42fi
43
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
61echo ---------------------------------------------------------
62echo ')' create basis dir $tarball_tmp
63mkdir $tarball_tmp
64echo ---------------------------------------------------------
65
66echo
67
68# patnames
69echo ---------------------------------------------------------
70echo ')' copy pathnames
71#cp pathnames_distribution $tarball_tmp/pathnames
72cp pathnames $tarball_tmp/pathnames
73echo ---------------------------------------------------------
74
75echo 
76
77# fortran source files
78echo ---------------------------------------------------------
79echo ')' copy src/
80mkdir $tarball_tmp/src
81cp src/*.f90 $tarball_tmp/src
82cp -r src/gributils $tarball_tmp/src
83# echo '3)' copy makefile
84cp src/makefile $tarball_tmp/src
85#cp src/makefile.gfs $tarball_tmp/src
86echo ---------------------------------------------------------
87
88echo
89
90# options dir
91echo ---------------------------------------------------------
92echo ')' copy options/
93echo ---------------------------------------------------------
94# (for the distribution they work with the defult flex_ecmwf test winds)
95#cp -r options_flex_ecmwf_EA $tarball_tmp/options
96mkdir $tarball_tmp/options
97user_input_files="AGECLASSES     COMMAND        IGBP_int1.dat  OUTGRID        OUTGRID_NEST   RECEPTORS      RELEASES       surfdata.t     surfdepo.t"
98for i in $user_input_files
99do
100  echo $i
101  cp -r options/$i $tarball_tmp/options
102  #echo copy $i to $tarball_tmp/options
103done
104mkdir $tarball_tmp/options/SPECIES
105cp options/SPECIES/SPECIES* $tarball_tmp/options/SPECIES/
106cp options/SPECIES/specoverview.f90 $tarball_tmp/options/SPECIES/
107echo copy options/SPECIES/ to $tarball_tmp/options/SPECIES/
108echo ---------------------------------------------------------
109
110echo
111
112# OH file
113echo ---------------------------------------------------------
114echo ')' copy OH_variables.bin to flexin
115mkdir $tarball_tmp/flexin
116OH_variables=../flexin/OH_FIELDS/OH_variables.bin
117cp $OH_variables $tarball_tmp/flexin/
118echo ---------------------------------------------------------
119
120echo
121
122# AVAILABLE
123echo ---------------------------------------------------------
124echo ')' copy AVAILABLE
125#cp AVAILABLE_flex_ecmwf_EA $tarball_tmp/AVAILABLE
126cp AVAILABLE $tarball_tmp/AVAILABLE
127echo ---------------------------------------------------------
128
129echo 
130
131# output
132echo ---------------------------------------------------------
133echo  ')' create output/ #  mkdir $tarball_tmp/output
134mkdir $tarball_tmp/output
135echo ---------------------------------------------------------
136echo output reference?
137echo ---------------------------------------------------------
138
139echo
140
141# preprocess
142echo ---------------------------------------------------------
143echo ')' preprocess/
144mkdir $tarball_tmp/preprocess
145echo -----------------flex_extract-------------------
146#echo '6)'  mkdir $tarball_tmp/flex_extract [a separate repository]
147#mkdir $tarball_tmp/preprocess
148#mkdir $tarball_tmp/preprocess/flex_ecmwf
149mkdir $tarball_tmp/preprocess/flex_extract
150#echo '7)  add ECMWF retrieve routines (change EA wind files for latest source code)'
151#mkdir $tarball_tmp/preprocess/flex_extract
152#mkdir $tarball_tmp/preprocess/flex_extract/work
153#cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_ecmwf/
154#cp -r flex_ecmwf_src/* $tarball_tmp/preprocess/flex_extract/
155## cp -r flex_extract/work/EA* $tarball_tmp/preprocess/flex_extract/work   
156flex_extract=../flex_extract_v7.0.4/
157echo include flex_extract v7.0.4 b7c1c04a204c91e53759ef590504bf52dfaece64
158echo from $flex_extract [use git modules?] IP 3/2018
159cp $flex_extract/README.md $tarball_tmp/preprocess/flex_extract
160cp -r $flex_extract/docs $tarball_tmp/preprocess/flex_extract
161cp -r $flex_extract/grib_templates $tarball_tmp/preprocess/flex_extract
162cp -r $flex_extract/python $tarball_tmp/preprocess/flex_extract
163cp -r $flex_extract/src $tarball_tmp/preprocess/flex_extract
164echo flex_extract copied
165echo ---------------------------------------------------------
166echo AVAILABLE generation scripts?
167echo ---------------------------------------------------------
168
169#echo '10)' cp example generating scripts [a separate repository]
170#echo moved below
171#mkdir $tarball_tmp/examples
172#cp -r examples/*.sh $tarball_tmp/examples/
173#cp -r examples/Makefile $tarball_tmp/examples/
174
175echo 
176
177# postprocess
178echo ---------------------------------------------------------
179echo ')' postprocess/
180
181postprocess=postprocess
182mkdir $tarball_tmp/$postprocess
183echo -----------------flex_read_fortran-------------------
184flex_read_fortran_src=$postprocess/flex_read_fortran/
185#echo ')'  directory for reading routines
186#echo '12)'  add fortran reading routines [a separate repository]
187mkdir $tarball_tmp/$postprocess/flex_read_fortran
188cp $postprocess/flex_read_fortran/*.f $tarball_tmp/$postprocess/flex_read_fortran
189cp $postprocess/flex_read_fortran/*.f90 $tarball_tmp/$postprocess/flex_read_fortran
190cp $postprocess/flex_read_fortran/makefile $tarball_tmp/$postprocess/flex_read_fortran
191echo flex_read_fortran copied from $flex_read_fortran_src
192
193echo -----------------flex_read_matlab-------------------
194flex_read_matlab_src=../flex_read_matlab/export_basic
195mkdir $tarball_tmp/$postprocess/flex_read_matlab
196cp -r $flex_read_matlab_src/* $tarball_tmp/$postprocess/flex_read_matlab
197echo flex_read_fortran from $flex_read_matlab_src  # NOT copied
198# add matlab reading routines
199#mkdir $tarball_tmp/postprocess/flex_read_matlab
200#cp postprocess/flex_read_matlab/*.m $tarball_tmp/postprocess/flex_read_matlab
201echo ---------------------------------------------------------
202
203echo
204
205echo ---------------------------------------------------------
206echo ')' tests/
207###############################################################
208#echo '13) tests'
209mkdir $tarball_tmp/tests
210#echo -----------------flex_read_fortran-------------------
211#echo 'b) ./tests/flex_read_fortran/'
212#echo fixme
213#mkdir $tarball_tmp/tests/flex_read_fortran
214#cp tests/flex_read_fortran/test_read_default.sh  $tarball_tmp/tests/flex_read_fortran
215
216
217###############################################################
218echo ----------------- examples -------------------
219
220#echo ') ./tests/examples/'
221mkdir $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/
226# echo USAGE: ~/repos/flexpart/tests/examples'$' make run
227cp -r ../flex_tests_examples/examples3/* $tarball_tmp/tests/examples/
228
229echo ----------------- examples_reference -------------------
230cp -r ./tests/examples_reference $tarball_tmp/tests/
231
232
233
234###############################################################
235# echo -----------------postprocess examples-------------------
236echo -----------------read examples-------------------
237
238#echo '13 c) ./tests/read_examples/'
239mkdir $tarball_tmp/tests/read_examples
240
241cp tests/read_examples/declare_examples $tarball_tmp/tests/read_examples/
242cp tests/read_examples/display_examples.sh $tarball_tmp/tests/read_examples/
243cp tests/read_examples/examples_output.txt $tarball_tmp/tests/read_examples/
244cp tests/read_examples/read_examples.sh $tarball_tmp/tests/read_examples/
245cp tests/read_examples/read_grids.sh $tarball_tmp/tests/read_examples/
246cp tests/read_examples/read_parts.sh $tarball_tmp/tests/read_examples/
247cp tests/read_examples/set_examples_all $tarball_tmp/tests/read_examples/
248cp tests/read_examples/set_examples_3.sh $tarball_tmp/tests/read_examples/
249cp tests/read_examples/read_headers.sh $tarball_tmp/tests/read_examples/
250cp tests/read_examples/read_examples_output.txt $tarball_tmp/tests/ #read_examples/
251# echo USAGE ~/repos/flexpart/tests/read_examples'$'./read_grids.sh
252
253###############################################################
254echo ------------compare examples-------------------
255#echo tests/compare_examples.sh
256mkdir $tarball_tmp/tests/compare_examples
257
258
259#mkdir $tarball_tmp/tests/compare_examples
260#cp tests/compare_examples/compare_grids.sh $tarball_tmp/tests/compare_examples
261#cp tests/compare_grids.sh $tarball_tmp/tests/
262cp tests/compare_examples/*.sh $tarball_tmp/tests/compare_examples
263cp tests/compare_examples/compare_grids_output.txt $tarball_tmp/tests/ #compare_examples
264# list of examples with units
265#cp tests/declare_examples $tarball_tmp/tests/
266
267echo 
268
269# ~/repos/flexpart/tests$./compare_grids.sh
270
271#echo mkdir $tarball_tmp/tests/examples2/
272#echo cp tests/examples2/setup.sh $tarball_tmp/tests/examples2/
273# echo --repeat examples-------------------
274# echo FIXME
275
276###############################################################
277#echo -----------------ctbto-------------------
278# mkdir $tarball_tmp/tests/ctbto
279
280# cp -r tests/NILU/test_1 $tarball_tmp/tests/
281# cp -r tests/default_cases $tarball_tmp/tests/
282
283echo ---------------------------------------------------------
284echo create tarball
285#tar cvf $tarball  $tarball_tmp 
286#tar cf $tarball  $tarball_tmp 
287#cd
288
289cd $targetdir
290tar cf $distribution_name.tar $distribution_name 
291
292pwd
293
294
295echo  tarball $tarball complete
296echo exported untarred files in $tarball_tmp 
297
298echo cp -r preprocess/flex_extract/work $tarball_tmp/preprocess/flex_extract/
299echo cd $tarball_tmp/src
300echo $HOME/repos/flexpart/src/make_in_laptop.sh
301echo cd .. ';' ./src/FLEXPART
302echo cd postprocess/flex_read_fortran
303echo make test
304echo  max:  0.115784094     mean:   4.70877676E-05
305#echo cd $tarball_tmp/tests/examples ';'   make run
306echo cd ../../tests/examples ';'   make run
307#echo cd $tarball_tmp/tests/read_examples
308echo cd ../read_examples
309echo ./read_examples.sh
310echo ./read_examples.sh '>' ../read_examples_output.txt
311echo cd ../compare_examples
312echo ./compare_grids.sh
313echo ./compare_grids.sh '>' ../compare_grids_output.txt
314
315echo e.g. tar --append --file=$tarball_tmp/ ../compare_grids_output.txt ../read_examples_output.txt
316 
317 
318
319
320exit
321#return
322###############################################################
323
324# obtain $FLEXHOME (and set)
325#1 cd $FLEXHOME/src
326
327#2 compile
328#
329#[laptop] source /Users/ignacio/repos/flexpart/src/make_in_laptop.sh
330# [njord] make
331# ->created executable (FLEXPART)
332
333#3 execute in src (absolute paths)
334#
335#[laptop] cp  /Users/ignacio/repos/flexpart/src/pathnames .
336#[njord] FIXME
337#
338# mkdir output
339# ./FLEXPART
340# ->created output in output/
341
342#4 read output
343# cd  $FLEXHOME/postprocess/flex_read_fortran/
344# make
345# -> printheader* printgrid* flex_read_compare2*
346#/postprocess/flex_read_fortran$./printheader ../../src/output/
347#/postprocess/flex_read_fortran$./printgrid ../../src/output/ conc
348# -> output in stdout (max:   11122924.0     sum:   90330784.0)
349
350#5 execute in $FLEXHOME
351# cd $FLEXHOME
352# get winds
353#[laptop] cp -r ~/repos/flex_winds/work/ ./preprocess/flex_extract/
354#[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
355
356# src/FLEXPART
357# -> output in $FLEXHOME/output/
358
359#6 read output
360# postprocess/flex_read_fortran/printheader output/
361# postprocess/flex_read_fortran/printgrid output/ conc
362# -> output in stdout ( max:   11578738.0     sum:   104058720.)
363
364#7 gnererate examples
365# cd $FLEXHOME/tests/examples
366
367#make run
368
369#make examples
370#make batch
371#./run_batch_cl.sh
372
373#make (set_default_example.sh)
374#tests/examples$../../src/FLEXPART
375#output
376
377#8 read examples:
378#cd $FLEXHOME/tests/read_examples 
379# ./read_headers.sh
380# ./read_grids.sh
381
382#9 compare examples with reference
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG