Commit 6ce04005 authored by Sebastian Milinski's avatar Sebastian Milinski
Browse files

Added control run to symlink directory

parent bee0b77b
...@@ -29,9 +29,78 @@ force_historical=false ...@@ -29,9 +29,78 @@ force_historical=false
force_1perc=false force_1perc=false
force_rcp26=false force_rcp26=false
force_rcp45=false force_rcp45=false
force_rcp85=true force_rcp85=false
force_control=true
#####################
# PiControl
if [ "$force_control" = true ]; then
echo creating links for PiControl runs
# path to control run from swiss machine
source_dir=/work/mh1007/mpiesm1/experiments
# directory where links to members will be created. Choose a meaningful name that starts with a letter
target_subdir=${target_dir}/pictrl
# which members should be used from source_dir? Define prefix and counter (counter is expanded to 4-digit number with leading zeros later)
source_prefix=lkm
ens_0=0001 # first ensemble member to include
ens_n=${ens_0} # last ensemble member to include
# source_prefic will be substituted with this
target_prefix=pictrl
# ensemble counter offset, i.e. choose -100 to change lkm0101 to hist0001
counter_offset=0
# Loop through each ensemble member
for rrr in $(seq $ens_0 $ens_n); do #change to 200
source_expid=${source_prefix}$(printf "%04d" $rrr)
target_counter=$(expr $rrr + $counter_offset)
target_expid=${target_prefix}$(printf "%04d" $target_counter)
echo $source_expid - $target_expid
# echo copy directory structure
mkdir -p ${target_subdir}/${target_expid}
find ${source_dir}/${source_expid} -mindepth 1 -depth -type d -printf "%P\n" | while read dir; do mkdir -p "${target_subdir}/${target_expid}/${dir}"; done
# echo linking files
find ${source_dir}/${source_expid} -type f -printf "%P\n" | while read file; do ln -s ${source_dir}/${source_expid}/$file $(echo ${target_subdir}/${target_expid}/$file | sed "s/$source_expid/$target_expid/"); done &
done
wait
fi
# path to control run from mistral
source_dir=/work/mh0469/m214089/mpiesm/experiments
# directory where links to members will be created. Choose a meaningful name that starts with a letter
target_subdir=${target_dir}/pictrl
# which members should be used from source_dir? Define prefix and counter (counter is expanded to 4-digit number with leading zeros later)
source_prefix=lkm
ens_0=0016 # first ensemble member to include
ens_n=${ens_0} # last ensemble member to include
# source_prefic will be substituted with this
target_prefix=pictrl
# ensemble counter offset, i.e. choose -100 to change lkm0101 to hist0001
counter_offset=-14
# Loop through each ensemble member
for rrr in $(seq $ens_0 $ens_n); do #change to 200
source_expid=${source_prefix}$(printf "%04d" $rrr)
target_counter=$(expr $rrr + $counter_offset)
target_expid=${target_prefix}$(printf "%04d" $target_counter)
echo $source_expid - $target_expid
# echo copy directory structure
mkdir -p ${target_subdir}/${target_expid}
find ${source_dir}/${source_expid} -mindepth 1 -depth -type d -printf "%P\n" | while read dir; do mkdir -p "${target_subdir}/${target_expid}/${dir}"; done
# echo linking files
find ${source_dir}/${source_expid} -type f -printf "%P\n" | while read file; do ln -s ${source_dir}/${source_expid}/$file $(echo ${target_subdir}/${target_expid}/$file | sed "s/$source_expid/$target_expid/"); done &
done
wait
fi
##################### #####################
......
Markdown is supported
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