Skip to content

Commit 491baa6

Browse files
committed
Added .sh and .pbs files
1 parent 606f55e commit 491baa6

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

prepare_run_eddy_DT10.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
ROOT_DIR="/work/sentinel3/pva_axp/Eddy_Tracking/"
4+
#DATA_DIR="${ROOT_DIR}/data/sla/DT10/"
5+
DATA_DIR="${ROOT_DIR}/data/sla/DT10/test/"
6+
INSTALL_DIR="${ROOT_DIR}/process"
7+
yaml_template="eddy_tracker_configuration_DT10.yaml"
8+
9+
echo "Looking at data file in ${DATA_DIR}"
10+
echo "Template yaml configuration file is: ${yaml_template}"
11+
# Prepare the list of yaml files
12+
i=0
13+
for file in $(ls ${DATA_DIR}); do
14+
i=$(($i+1))
15+
filename=$(basename ${file})
16+
datestr=${file:31:8}
17+
outyaml="${INSTALL_DIR}/production/sh/eddy_tracker_configuration_${datestr}.yaml"
18+
echo "Preparing yaml file for date ${datestr}: ${outyaml}"
19+
sed "s/XXXXXXXX/${datestr}/g" ${yaml_template} > ${outyaml}
20+
outsh="production/sh/eddy_job_${i}.sh"
21+
cmd="python -u ${INSTALL_DIR}/make_eddy_track_AVISO.py ${outyaml}"
22+
echo "#!/bin/bash" > ${outsh}
23+
echo "${cmd}" >> ${outsh}
24+
#echo "echo ${outyaml}" >> ${outsh}
25+
chmod u+x ${outsh}
26+
done
27+
28+
echo "Found ${i} files: preparing array of ${i} jobs"
29+
30+
# Prepare the PBS script
31+
32+
cat > run_eddy.pbs << EOF
33+
34+
#!/bin/bash
35+
#PBS -N pbs_eddy
36+
#PBS -J 1-${i}
37+
#PBS -l select=1:ncpus=1:mem=16000mb
38+
#PBS -l walltime=24:00:00
39+
#PBS -m bea
40+
41+
42+
# repertoire d execution
43+
module load python/2.7.5
44+
cd /work/sentinel3/pva_axp/Eddy_Tracking/process
45+
46+
/work/sentinel3/pva_axp/Eddy_Tracking/process/production/sh/eddy_job_\${PBS_ARRAY_INDEX}.sh
47+
48+
EOF
49+
50+
echo "wrote run_eddy.pbs".
51+
echo "Run command: qsub run_eddy.pbs"
52+
53+
54+
55+
56+
57+
58+
59+

prepare_run_eddy_DT14.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
ROOT_DIR="/work/sentinel3/pva_axp/Eddy_Tracking/"
4+
DATA_DIR="${ROOT_DIR}/data/sla/2006/"
5+
INSTALL_DIR="${ROOT_DIR}/process"
6+
yaml_template="eddy_tracker_configuration.yaml"
7+
8+
echo "Looking at data file in ${DATA_DIR}"
9+
echo "Template yaml configuration file is: ${yaml_template}"
10+
# Prepare the list of yaml files
11+
i=0
12+
for file in $(ls ${DATA_DIR}); do
13+
i=$(($i+1))
14+
filename=$(basename ${file})
15+
datestr=${file:24:8}
16+
outyaml="${INSTALL_DIR}/production/sh/eddy_tracker_configuration_${datestr}.yaml"
17+
echo "Preparing yaml file for date ${datestr}: ${outyaml}"
18+
sed "s/XXXXXXXX/${datestr}/g" ${yaml_template} > ${outyaml}
19+
outsh="production/sh/eddy_job_${i}.sh"
20+
cmd="python -u ${INSTALL_DIR}/make_eddy_track_AVISO.py ${outyaml}"
21+
echo "#!/bin/bash" > ${outsh}
22+
echo "${cmd}" >> ${outsh}
23+
#echo "echo ${outyaml}" >> ${outsh}
24+
chmod u+x ${outsh}
25+
done
26+
27+
echo "Found ${i} files: preparing array of ${i} jobs"
28+
29+
# Prepare the PBS script
30+
31+
cat > run_eddy.pbs << EOF
32+
33+
#!/bin/bash
34+
#PBS -N pbs_eddy
35+
#PBS -J 1-${i}
36+
#PBS -l select=1:ncpus=1:mem=16000mb
37+
#PBS -l walltime=24:00:00
38+
#PBS -m bea
39+
40+
41+
# repertoire d execution
42+
module load python/2.7.5
43+
cd /work/sentinel3/pva_axp/Eddy_Tracking/process
44+
45+
/work/sentinel3/pva_axp/Eddy_Tracking/process/production/sh/eddy_job_\${PBS_ARRAY_INDEX}.sh
46+
47+
EOF
48+
49+
echo "wrote run_eddy.pbs".
50+
echo "Run command: qsub run_eddy.pbs"
51+
52+
53+
54+
55+
56+
57+
58+

run_eddy.pbs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
#!/bin/bash
3+
#PBS -N pbs_eddy
4+
#PBS -J 1-3
5+
#PBS -l select=1:ncpus=1:mem=16000mb
6+
#PBS -l walltime=2:00:00
7+
#PBS -m bea
8+
9+
10+
# repertoire d execution
11+
module load python/2.7.5
12+
cd /work/sentinel3/pva_axp/Eddy_Tracking/process
13+
14+
/work/sentinel3/pva_axp/Eddy_Tracking/process/production/sh/eddy_job_${PBS_ARRAY_INDEX}.sh
15+

0 commit comments

Comments
 (0)