Commit d3ae8702 authored by Ignacio Pisso's avatar Ignacio Pisso
Browse files

new shell scripts for generating options pathnames and cases

parent b64735f2
#!/bin/bash
# Ignacio Pisso 2018-03-29
default_gen_options=gen_options_default.sh
gen_options=${1:-$default_gen_options} # $1
echo gen_options=$gen_options
#execute gen options
./$gen_options
options_list="$(ls -d options*)"
# generate pathnames
# generate outputs
for i in ${options_list}
do
echo $i
done
./gen_pathnames.sh
# list available suffixes
pathnames_local=~/repos/flexpart/pathnames
# mkdir output
# cp $pathnames_local pathnames
gen_pathnames_default.sh
#!/bin/bash
# Ignacio Pisso 2018-03-29
options_repo=~/repos/flexpart/options
cp -r $options_repo options
#!/bin/bash
# Ignacio Pisso 2018-03-29
# generate FLEXPART variations on the default for parameter sweep hello world tests
options_template=~/repos/flexpart/options
# group 1 gridded output
#
suffix=_1
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/IOUT=/c\ IOUT=1,' $options_new/COMMAND
suffix=_2
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/IOUT=/c\ IOUT=2,' $options_new/COMMAND
suffix=_3
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/IOUT=/c\ IOUT=3,' $options_new/COMMAND
suffix=_4
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/IOUT=/c\ IOUT=4,' $options_new/COMMAND
suffix=_5
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/IOUT=/c\ IOUT=5,' $options_new/COMMAND
#!/bin/bash
# Ignacio Pisso 2018-03-29
# generate FLEXPART variations on the default for parameter sweep hello world tests
options_template=~/repos/flexpart/options
# group 1 gridded output
#
suffix=_bwd
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/LDIRECT=/c\ LDIRECT= -1,' $options_new/COMMAND
sed -i '/IOUTPUTFOREACHRELEASE=/c\ IOUTPUTFOREACHRELEASE= 1,' $options_new/COMMAND
sed -i '/IOUT=/c\ IOUT= 1,' $options_new/COMMAND #should not be needed
suffix=_bwd5
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/LDIRECT=/c\ LDIRECT= -1,' $options_new/COMMAND
sed -i '/IOUTPUTFOREACHRELEASE=/c\ IOUTPUTFOREACHRELEASE= 1,' $options_new/COMMAND
sed -i '/IOUT=/c\ IOUT= 5,' $options_new/COMMAND
suffix=_bwd_nc
options_new=options$suffix
cp -r $options_template $options_new
sed -i '/LDIRECT=/c\ LDIRECT= -1,' $options_new/COMMAND
sed -i '/IOUTPUTFOREACHRELEASE=/c\ IOUTPUTFOREACHRELEASE= 1,' $options_new/COMMAND
sed -i '/IOUT=/c\ IOUT= 9,' $options_new/COMMAND
#!/bin/bash
pathnames_template=~/repos/flexpart/pathnames
defaultdir=/Users/Shared/Jenkins/Home/jobs/FLEXPART-dev-tests-run2/workspace/
defaultdir=
#echo $defaultdir
OUTPUT="$(ls -d1 ${1:-$defaultdir}options*)"
#OUTPUT="$(ls -d1 ${1:-$defaultdir}options_*)"
#OUTPUT="$(find ${1:-$defaultdir}options_*)"
OUTPUTpwd="$(pwd)"
echo OUTPUT=$OUTPUT
#mkdir output
#cp $pathnames_local pathnames
for i in ${OUTPUT}
do
echo $i
echo expand:
suffix=${i#*options}
echo suffix=$suffix
options_new=$i
output_new=output$suffix
mkdir $output_new
pathnames_new=pathnames$suffix
echo pathnames_new = $pathnames_new
echo pathnames_template = $pathnames_template
# copy template (contains valid AVAILABLE file and winds)
cp $pathnames_template $pathnames_new
# replace options line
sed -i "s/\boptions\b/$options_new/g" $pathnames_new
# replace output line
sed -i "s/\boutput\b/$output_new/g" $pathnames_new
done
pathnames_local=~/repos/flexpart/pathnames
mkdir output
cp $pathnames_local pathnames
#!/bin/bash
#FLEXPART=FLEXPART_8d70e43
# run generate cases
./gen_cases.sh $1
./loop_on_pathnames_laptop.sh
#!/bin/bash
OUTPUTdefault="$(ls -1 pathnames*)"
OUTPUT=${OUTPUTvar:-$OUTPUTdefault}
OUTPUTpwd="$(pwd)"
FLEXPARTdefault=FLEXPART_8d70e43
FLEXPART=${FLEXPARTvar:-$FLEXPARTdefault}
echo $OUTPUT
for i in ${OUTPUT}
do
#FP_slurm_batch_sl=slurm_batch_$i.sl
#FP_slurm_batch_sl=batch_dry_$i.sl
FP_slurm_batch_sl=clrun_full_$i.sl
echo ' ' >> $FP_slurm_batch_sl
#FLEXPART_run_string="$FLEXPART $i -i"
FLEXPART_run_string="$FLEXPART $i"
echo $FLEXPART_run_string >> $FP_slurm_batch_sl
echo $FLEXPART_run_string
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment