Commit ca350ba4 authored by Espen Sollum's avatar Espen Sollum
Browse files

Add tests from master branch (9.2) to dev (10.0)

parent adf46aef
#WORKSPACE=/xnilu_wrk/flexbuild
#WORKSPACE=/home/ignacio/repos/
FP_exec=$WORKSPACE/src/FP_ecmwf_gfortran
path_flextest=$WORKSPACE/flextest/
declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
#!/bin/bash
#input FP exec
test_dir=$1 # name of dir with pathname and options to be used
FP_exec=$2 # path to executable to be run
base_dir=$3 # base for the output
options_default=$4
echo run test '>' input
echo $1
echo $2
echo $3
echo $4
# echo name= $name
# echo working dir= $path_tests/test_$name
# echo executable= $FP_exec
# echo default options from $options_default
#echo FP_exec=$FP_exec
echo env var FLEXOUT_TMP=$FLEXOUT_TP
#suffix=$(date "+%y-%m-%d_%H%M%S")
test_tmp=${FLEXOUT_TMP}${base_dir}${test_dir}
#_${suffix}
current_dir=$(pwd)
#echo test_tmp=$test_tmp
mkdir $test_tmp
echo run test '>' copy default options to temp dir
echo from $options_default to $test_tmp/options
cp -r $options_default $test_tmp/options
#override default options
echo copy test options files to temp dir
echo ${test_dir}/options/* $test_tmp/options/
cp ${test_dir}/options/* $test_tmp/options/
echo copy test options/SPECIES to temp dir if needed
if [ -d "${test_dir}/options/SPECIES" ]; then
echo from ${test_dir}/options/SPECIES/* to $test_tmp/options/SPECIES/
cp ${test_dir}/options/SPECIES/* $test_tmp/options/SPECIES/
fi
# copy paths form repo source exec tmp dir
echo copy test pathnames to temp dir
cp ${test_dir}/pathnames $test_tmp
echo create output dir ${test_tmp}/output
mkdir ${test_tmp}/output
#cp test_1/run $test_tmp
cd $test_tmp
#echo $(pwd)
#echo $FP_exec
# '&>' o is bash for both out and err
#echo run $FP_exec to out.log #&
#$FP_exec &> out.log #&
echo execute test
$FP_exec > stdout.log 2> stderr.log #&
echo flexpart terminated
#!/bin/bash
#input
# - FP_exec: path to flexpart executable to test
FP_exec=$1
# diplay path
echo FP_exec=$FP_exec
# :
suffix=$(date "+%y-%m-%d_%H%M%S")
#test_tmp=$FLEXOUT_TMP/test_1_$suffix
test_tmp=test_0_$suffix
echo test_tmp=$test_tmp
mkdir $test_tmp
#cp -r test_1/options $test_tmp
cp -r /home/ignacio/repos/flexpart/options $test_tmp
cp test_1/pathnames $test_tmp
cp test_1/run $test_tmp
#echo exit
#exit
cd $test_tmp
./run $FP_exec
#!/bin/bash
#input FP exec
FP_exec=$1
echo FP_exec=$FP_exec
echo $FLEXOUT_TMP
suffix=$(date "+%y-%m-%d_%H%M%S")
test_tmp=${FLEXOUT_TMP}test_1_$suffix
current_dir=$(pwd)
echo test_tmp=$test_tmp
mkdir $test_tmp
cp -r test_1/options $test_tmp
cp test_1/pathnames $test_tmp
cp test_1/run $test_tmp
cd $test_tmp
./run $FP_exec &> $test_tmp.log #&
#!/bin/bash
#input:
# FP_exec : path to flexpart executable
# path_flextest: directory path to output base directory
# test_names (bash array): list of tests to be run
# defaults
#FP_exec=/home/ignacio/repos/flexpart/src/FP_ecmwf_gfortran
#FP_exec=/xnilu_wrk/flexbuild/tests/NILU/FP_ecmwf_gfortran
FP_exec=$WORKSPACE/src/FP_ecmwf_gfortran
#path_flextest=/home/ignacio/repos/flextest/
#path_flextest=/xnilu_wrk/flexbuild/flextest/
path_flextest=$WORKSPACE/flextest/
#options_default=/xnilu_wrk/flexbuild/flexpart/options/
options_default=$WORKSPACE/options/
#declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
#test_names[0]='1'
test_names[0]='HelloWorld'
group_name=tests
source ./$1
suffix=$(date "+%y-%m-%d_%H%M%S")
#tests_dir=tests_${suffix}/
tests_dir=${group_name}_${suffix}/
path_tests=${path_flextest}/$tests_dir
mkdir $path_tests
#declare Bash Array
#declare -a test_names=('1' '2' 'HelloWorld')
#declare -a test_names=('1' '2' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc')
#declare -a test_names=('2' 'Volc')
#declare -a test_names=('1' 'HelloWorld' 'Fwd1' 'Fwd2' 'Bwd1' 'Volc' '2')
#Print the Whole Bash Array
s_test_names=${test_names[@]}
# Length of the Bash Array
n_tests=${#test_names[@]}
#echo n_tests=$n_tests
echo run $s_test_names
echo total $n_tests tests
#test
#tests_dir='tests_15-08-19_113139/'
#path_tests=${path_flextest}/$tests_dir
outlog=stdout.log
i=0
i_end=$n_tests
while [ $i -lt $i_end ] ;
do
let j=i+1
name=${test_names[i]};
echo run test no. $j
# echo name= $name
# echo working dir= $path_tests/test_$name
# echo executable= $FP_exec
# echo default options from $options_default
./run_test test_$name $FP_exec $path_tests $options_default
echo test $name terminated
success="$(cat $path_tests/test_$name/$outlog | grep CONGRATULATIONS | wc -l)"
echo success=$success
let i=i+1;
done
tot_successes="$(cat $path_tests/test_*/$outlog | grep CONGRATULATIONS | wc -l)"
tot_runs="$(ls -1 $path_tests | wc -l)"
echo ' '
echo finished $tot_runs tests of $n_tests
echo $tot_successes seccessful
exit
./run_test test_1 $FP_exec $path_tests
./run_test test_2 $FP_exec $path_tests
# 6 species
./run_test test_Volc $FP_exec $path_tests
./run_test test_HelloWorld $FP_exec $path_tests
./run_test test_Fwd1 $FP_exec $path_tests
./run_test test_Fwd2 $FP_exec $path_tests
./run_test test_Bwd1 $FP_exec $path_tests
To run this test, just execute FLEXPART in the current directory.
Contains the options directory from relese 9.2
The pathfile was modified
To run this test, execute FLEXPART in the current directory after creating an output directory or
./run path-to-flexpart-executable
This should create a temporary output dir and link output to it.
Contains the options directory from releiase 9.2.0.2
The feature tested are the new SPECIES file.
2014-10-16, tested on nordre@nilu (Ubuntu 12.04):
......
./options/
./output/
/
/flex_wrk/WIND_FIELDS/AVAILABLE_ECMWF_OPER_fields_global
/xnilu_wrk/flex_wrk/WIND_FIELDS/AVAILABLE_ECMWF_OPER_fields_global
============================================
#!/bin/bash
suffix=$(date "+%y-%m-%d_%H%M%S")
FP_exec=$1
output_tmp=output_$suffix
mkdir $output_tmp
rm output
ln -s $output_tmp output
echo exec $FP_exec
$FP_exec
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
-1
20140611 0
20140613 0
86400
86400
900
9999999
900 SYNC
-5.0 CTL
4 IFINE
5 IOUT
0 IPOUT
1 LSUBGRID
0 LCONVECTION
1 LAGESPECTRA
0 IPIN
1 IOFR
0 IFLUX
0 MDOMAINFILL
1 IND_SOURCE
2 IND_RECEPTOR
0 MQUASILAG
1 NESTED_OUTPUT
2 LINIT_COND
0 SURF_ONLY
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
+++++++++++++ HEADER +++++++++++++++++
1
26
20140611 180000
20140611 210000
11.530000
78.540001
11.530000
78.540001
1
0
100
4000
1.0000000
ZEP_201406_001_087
20140611 210000
20140612 0
11.530000
78.540001
11.530000
78.540001
1
0
100
4000
1.0000000
ZEP_201406_001_088
****************************************************************************
* *
* Input file for the Lagrangian particle dispersion model FLEXPART *
* Definition file of chemical species/radionuclides *
* *
****************************************************************************
CH4 Tracer name
-999.9 Species half life
-9.9E-09 Wet deposition - A
Wet deposition - B
-9.9E-09 In-cloud scavenging - Ai (cl=Ai*prec**Bi)
-9.9 In-cloud scavenging - Bi (cl=Ai*prec**Bi)
-9.9 In-cloud scavenging - Ci (S_i=Ci/cl)
-9.9 In-cloud scavenging - Di (wetscav=S_i*prec/3.6E6/clouds_h/Di)
-9.9 Dry deposition (gases) - D
Dry deposition (gases) - Henrys const.
Dry deposition (gases) - f0 (reactivity)
-9.9E09 Dry deposition (particles) - rho
Dry deposition (particles) - dquer
Dry deposition (particles) - dsig
-9.99 Alternative: dry deposition velocity
16.000 molweight
2.5E-15 OH Reaction rate at 25 deg, [cm^3/sec]
-9 number of associated specias (neg. none)
-99.99 KOA - organic matter air partitioning
./options/
./output/
/
/xnilu_wrk/flex_wrk/WIND_FIELDS/AVAILABLE_ECMWF_OPER_fields_global
============================================
************************************************
* *
*Lagrangian particle dispersion model FLEXPART *
* Please select your options *
* *
*This file determines the ageclasses to be used*
* *
*Ages are given in seconds. The first class *
*starts at age zero and goes up to the first *
*age specified. The last age gives the maximum *
*time a particle is carried in the simulation. *
* *
************************************************
1 Integer Number of age classes
1728000
********************************************************************************
* *
* Input file for the Lagrangian particle dispersion model FLEXPART *
* Please select your options *
* *
********************************************************************************
1. __ 3X, I2
-1
LDIRECT 1 FOR FORWARD SIMULATION, -1 FOR BACKWARD SIMULATION
2. ________ ______ 3X, I8, 1X, I6
20070121 090000
YYYYMMDD HHMISS BEGINNING DATE OF SIMULATION
3. ________ ______ 3X, I8, 1X, I6
20070122 180000
YYYYMMDD HHMISS ENDING DATE OF SIMULATION
4. _____ 3X, I5
3600
SSSSS OUTPUT EVERY SSSSS SECONDS
5. _____ 3X, I5
3600
SSSSS TIME AVERAGE OF OUTPUT (IN SSSSS SECONDS)
6. _____ 3X, I5
300
SSSSS SAMPLING RATE OF OUTPUT (IN SSSSS SECONDS)
7. _________ 3X, I9
999999999
SSSSSSSSS TIME CONSTANT FOR PARTICLE SPLITTING (IN SECONDS)
8. _____ 3X, I5
300
SSSSS SYNCHRONISATION INTERVAL OF FLEXPART (IN SECONDS)
9. ---.-- 4X, F6.4
3.0
CTL FACTOR, BY WHICH TIME STEP MUST BE SMALLER THAN TL
10. --- 4X, I3
4
IFINE DECREASE OF TIME STEP FOR VERTICAL MOTION BY FACTOR IFINE
11. - 4X, I1
1
IOUT 1 CONCENTRATION (RESIDENCE TIME FOR BACKWARD RUNS) OUTPUT, 2 MIXING RATIO OUTPUT, 3 BOTH,4 PLUME TRAJECT., 5=1+4
12. - 4X, I1
0
IPOUT PARTICLE DUMP: 0 NO, 1 EVERY OUTPUT INTERVAL, 2 ONLY AT END
13. _ 4X, I1
1
LSUBGRID SUBGRID TERRAIN EFFECT PARAMETERIZATION: 1 YES, 0 NO
14. _ 4X, I1
0
LCONVECTION CONVECTION: 1 YES, 0 NO
15. _ 4X, I1
0
LAGESPECTRA AGE SPECTRA: 1 YES, 0 NO
16. _ 4X, I1
0
IPIN CONTINUE SIMULATION WITH DUMPED PARTICLE DATA: 1 YES, 0 NO
17. _
1 4X,I1
IOFR IOUTPUTFOREACHREL CREATE AN OUPUT FILE FOR EACH RELEASE LOCATION: 1 YES, 0 NO
18. _ 4X, I1
0
IFLUX CALCULATE FLUXES: 1 YES, 0 NO
19. _ 4X, I1
0
MDOMAINFILL DOMAIN-FILLING TRAJECTORY OPTION: 1 YES, 0 NO, 2 STRAT. O3 TRACER
20. _ 4X, I1
1
IND_SOURCE 1=MASS UNIT , 2=MASS MIXING RATIO UNIT
21. _ 4X, I1
1
IND_RECEPTOR 1=MASS UNIT , 2=MASS MIXING RATIO UNIT
22. _ 4X, I1
0
MQUASILAG QUASILAGRANGIAN MODE TO TRACK INDIVIDUAL PARTICLES: 1 YES, 0 NO
23. _ 4X, I1
0
NESTED_OUTPUT SHALL NESTED OUTPUT BE USED? 1 YES, 0 NO
24. _ 4X, I1
0
LINIT_COND INITIAL COND. FOR BW RUNS: 0=NO,1=MASS UNIT,2=MASS MIXING RATIO UNIT
25. _ 4X, I1
0
SURF_ONLY IF THIS IS SET TO 1, OUTPUT IS WRITTEN ONLY OUT FOR LOWEST LAYER
1. Simulation direction, 1 for forward, -1 for backward in time
(consult Seibert and Frank, 2004 for backward runs)
2. Beginning date and time of simulation. Must be given in format
YYYYMMDD HHMISS, where YYYY is YEAR, MM is MONTH, DD is DAY, HH is HOUR,
MI is MINUTE and SS is SECOND. Current version utilizes UTC.
3. Ending date and time of simulation. Same format as 3.
4. Average concentrations are calculated every SSSSS seconds.
5. The average concentrations are time averages of SSSSS seconds
duration. If SSSSS is 0, instantaneous concentrations are outputted.
6. The concentrations are sampled every SSSSS seconds to calculate the time
average concentration. This period must be shorter than the averaging time.
7. Time constant for particle splitting. Particles are split into two
after SSSSS seconds, 2xSSSSS seconds, 4xSSSSS seconds, and so on.
8. All processes are synchronized with this time interval (lsynctime).
Therefore, all other time constants must be multiples of this value.
Output interval and time average of output must be at least twice lsynctime.
9. CTL must be >1 for time steps shorter than the Lagrangian time scale
If CTL<0, a purely random walk simulation is done
10.IFINE=Reduction factor for time step used for vertical wind
11.IOUT determines how the output shall be made: concentration
(ng/m3, Bq/m3), mixing ratio (pptv), or both, or plume trajectory mode,
or concentration + plume trajectory mode.
In plume trajectory mode, output is in the form of average trajectories.
12.IPOUT determines whether particle positions are outputted (in addition
to the gridded concentrations or mixing ratios) or not.
0=no output, 1 output every output interval, 2 only at end of the
simulation
13.Switch on/off subgridscale terrain parameterization (increase of
mixing heights due to subgridscale orographic variations)
14.Switch on/off the convection parameterization
15.Switch on/off the calculation of age spectra: if yes, the file AGECLASSES
must be available
16. If IPIN=1, a file "partposit_end" from a previous run must be available in
the output directory. Particle positions are read in and previous simulation
is continued. If IPIN=0, no particles from a previous run are used
17. IF IOUTPUTFOREACHRELEASE is set to 1, one output field for each location
in the RLEASE file is created. For backward calculation this should be
set to 1. For forward calculation both possibilities are applicable.
18. If IFLUX is set to 1, fluxes of each species through each of the output
boxes are calculated. Six fluxes, corresponding to northward, southward,
eastward, westward, upward and downward are calculated for each grid cell of
the output grid. The control surfaces are placed in the middle of each
output grid cell. If IFLUX is set to 0, no fluxes are determined.
19. If MDOMAINFILL is set to 1, the first box specified in file RELEASES is used
as the domain where domain-filling trajectory calculations are to be done.
Particles are initialized uniformly distributed (according to the air mass
distribution) in that domain at the beginning of the simulation, and are
created at the boundaries throughout the simulation period.
20. IND_SOURCE switches between different units for concentrations at the source
NOTE that in backward simulations the release of computational particles
takes place at the "receptor" and the sampling of particles at the "source".
1=mass units (for bwd-runs = concentration)
2=mass mixing ratio units
21. IND_RECEPTOR switches between different units for concentrations at the receptor
1=mass units (concentrations)
2=mass mixing ratio units
22. MQUASILAG indicates whether particles shall be numbered consecutively (1) or
with their release location number (0). The first option allows tracking of
individual particles using the partposit output files
23. NESTED_OUTPUT decides whether model output shall be made also for a nested
output field (normally with higher resolution)
24. LINIT_COND determines whether, for backward runs only, the sensitivity to initial
conditions shall be calculated and written to output files
0=no output, 1 or 2 determines in which units the initial conditions are provided.
25. SURF_ONLY: When set to 1, concentration/emission sensitivity is written out only
for the surface layer; useful for instance when only footprint emission sensitivity is needed
but initial conditions are needed on a full 3-D grid
********************************************************************************
* *
* Input file for the Lagrangian particle dispersion model FLEXPART *
* Please specify your output grid *
* *
********************************************************************************
1. ------.---- 4X,F11.4
-10.0000 GEOGRAFICAL LONGITUDE OF LOWER LEFT CORNER OF OUTPUT GRID
OUTLONLEFT (left boundary of the first grid cell - not its centre)
2. ------.---- 4X,F11.4
35.0000 GEOGRAFICAL LATITUDE OF LOWER LEFT CORNER OF OUTPUT GRID
OUTLATLOWER (lower boundary of the first grid cell - not its centre)
3. ----- 4X,I5
60 NUMBER OF GRID POINTS IN X DIRECTION (= No. of cells + 1)
NUMXGRID
4. ----- 4X,I5
40 NUMBER OF GRID POINTS IN Y DIRECTION (= No. of cells + 1)
NUMYGRID
5. ------.--- 4X,F10.3
0.5 GRID DISTANCE IN X DIRECTION
DXOUTLON
6. ------.--- 4X,F10.3
0.5 GRID DISTANCE IN Y DIRECTION
DYOUTLAT
10. -----.- 4X, F7.1
500.0
LEVEL 4 HEIGHT OF LEVEL (UPPER BOUNDARY)
********************************************************************************
* *
* Input file for the Lagrangian particle dispersion model FLEXPART *
* Please specify your output grid *
* *
********************************************************************************
1. ------.---- 4X,F11.4
1.0000 GEOGRAFICAL LONGITUDE OF LOWER LEFT CORNER OF OUTPUT GRID